npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

imago-js

v2.1.0

Published

> It's a wonderful image library! With the purpose to facilitate the manipulation of images, imago.js enables you to perform trimming and resizing. [Example page](http://evandroeisinger.github.io/imago.js/example)

Downloads

2

Readme

imago.js Build Status npm version Bower version

It's a wonderful image library! With the purpose to facilitate the manipulation of images, imago.js enables you to perform trimming and resizing. Example page

install

Available on npm and bower: npm install imago-js, bower install imago.js or directly download

basic usage

// create a new imago instance
var imago = new Imago(document.getElementsByTagName('image')[0]);

// to start a edition
imago.edit();

// to save edited image
imago.save();

// to cancel current edition
imago.cancel();

// to reset image edition
imago.reset();

if the image element already has editing attributes and/or editing elements it will be rendered according to them.

<!-- image with editing attributes -->
<img src="example.jpg" data-original-width="640" data-original-height="424" data-width="640" data-height="424" data-top="0" data-left="0">

<!-- image with initial editing elements -->
<figure>
  <img src="example.jpg" data-original-width="640" data-original-height="424" data-width="640" data-height="424" data-top="0" data-left="0">
</figure>

<!-- image with all editing elements -->
<figure>
  <img src="example.jpg" data-original-width="640" data-original-height="424" data-width="640" data-height="424" data-top="0" data-left="0">
  <div class="crop__mask"></div>
  <div class="crop__wrapper">
    <img src="example.jpg">
  </div>
  <div class="crop__handlers">
    <div class="crop__move-handler"></div>
    <span class="crop__top-left-handler"></span>
    <span class="crop__top-right-handler"></span>
    <span class="crop__bottom-left-handler"></span>
    <span class="crop__bottom-right-handler"></span>
  </div>
</figure>

constructor

new Imago(imageElement);

parameters

  • imageElement: image element used by the imago constructor.

editing attributes

  • data-original-width;
  • data-original-height;
  • data-width;
  • data-height;
  • data-top;
  • data-left;

editing elements

figure
├  image
├  .crop__mask
├  .crop__wrapper
├  └  .crop__shadow
└  .crop__handler
   ├  .crop__move-handler
   ├  .crop__top-left-handler
   └  .crop__bottom-right-handler

methods

  • imago.edit();
  • imago.save();
  • imago.cancel();
  • imago.reset();

support

  • chrome: latest;
  • firefox: latest;
  • safari: latest;
  • internet explore: 9+;

contribute

Everyone can contribute! Finding bugs, creating issues, improving documentation, improving editor it self or creating components. Every contribution will be welcomed! :santa:

Fork it -> Branch it -> Test it -> Push it -> Pull Request it :gem: