Mango.js
A small medium like javascript library to zoom your images.
Install
# Using npmnpm install mango-js# Using yarnyarn add mango-js
Now include mango and you should be good to go.
// es6// commonjsconst mango = ;
Alternatively you can include a minified version of mango (or the source code, up to you) via direct file or using our CDN link.
Usage
Add data-mango
to your images as it follows below.
...
Add mango css
to your document.
Call mango anywhere in your code:
// Call me;
Additionally add a high-res image as a data-src
attribute, like the example below:
...
Configuring
Pass options to mango like the example below:
// Custom options;
Supported parameters
-
selector
typestring
default[data-mango]
. -
background
typestring
defaultwhite
. -
margin
typeinteger
default50
. -
interruptKeys
typearray
default[27, 37, 39]
.
Running Tasks
You can run tasks with yarn
or npm
using the following commands:
# Build task$ yarn build# etc.$ ...
Roadmap
Todo List
- Make a better example page.
-
Add data-src image option. - Make selected images only support an image tag.
- Refactor zoom().
- Refactor event listeners.
- Refactor handlers
- Fix isAnimating.
- Refactor animate().
- Reduce to 150 lines or less (without comments).
- Refactor to arrow functions.
- Write tests.
Legend: Checked boxes mean partial completion, checked and crossed items mean they're fully working.
Contributing
If you feel like smoothie is missed something please do send a message or, alternatively make a pull request or even open an issue using an appropriate label and we will go from there.
License
Code released under the MIT license.