Coder Social home page Coder Social logo

maxulyanov / imagecomparison Goto Github PK

View Code? Open in Web Editor NEW
58.0 5.0 8.0 4.11 MB

Slider to quickly compare two images

Home Page: https://m-ulyanov.github.io/image-comparison/

License: MIT License

HTML 22.78% CSS 16.39% JavaScript 60.83%
slider compare compare-images vanilla-js es6 dom javascript slide imagecomparison css

imagecomparison's Introduction

Hi there ๐Ÿ‘‹

GitHub Streak

imagecomparison's People

Contributors

maxulyanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

imagecomparison's Issues

Transpiling to ES5 causes Uncaught TypeError

Dear Ulyanov,

I want to thank you for creating this module, i do like it very much because of its lightweight size and simplicity. I recently used it for the first time and unfortunately encountered an js error when running under production mode.

I am using a gulp js minifier module which only accepts ES5, thats why i recognized your plugin been shiped as ES6 source. I did point my babel to transpile it to ES5 which worked without any error inside my dev setup. But then in the console i got the following error on this line:

if (typeof define === 'function' && define.amd) {
    define('ImageComparison', [], function() {
        return ImageComparison;
    });
} else {
    root.ImageComparison = ImageComparison;
    ^ Uncaught TypeError: Cannot set property 'ImageComparison' of undefined
}

I did double check my setup for causes, without success. Also i use two other npm modules shipped in ES5 which work perfectly. Removing the causing js block from your plugin does fix the error but corebreaks your module.

While searching your github, npm and examples page, i recognized that your example pages source js differs to the one in your github repo.

I hope to hear soon from you, i am out of ideas...

Best regards

mouse drag and move around

Hi,
not sure if I'm missing something, but looks like the mouse action to drag the bar left and right is not working and you are left to click left or right.

UMD wrapper? CommonJS Support

Excellent module! I'm excited to find a solution that doesn't require jQuery.

I'm using browserify to manage and bundle javascript. I see you're attaching ImageComparison to the window as a global. It would be great if you could use a UMD wrapper to support CommonJS and RequireJS.

var ImageComparison = require('image-comparison'); results in an error (module 'image comparison' not found). package.json's main field is pointing towards a file that doesn't exist (index.js). The main field should be src/js/ImageComparison.js at a minimum so the file can be required even if it's just attached to the window.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.