GithubHelp home page GithubHelp logo

revealer's Introduction

#Revealer

revealer

Angular directive that allows two images to be layered on top of each other and compared using a slider, demo or scroll demo.

#Documentation

Include revelaer module source file in html

 <script src="path/to/revealer.js"></script>

Mark the revealer module as a dependecy of your angular app

angular.module('myApp', ['revealer']);

Then declare the revealer directive in your html.

<revealer top-image="top.png" top-label="Top Image" bottom-image="bottom.png" bottom-label="Bottom Label"></revealer>

Options

####top-image Path of image to appear on the top layer. This is the image that is revealed

top-image="top.png"

####bottom-image Path of image to appear on the bottom layer

bottom-image="bottom.png"

####top-label (optional) Label to appear on the top image

top-label="Top Image"

####bottom-label (optional) Label to appear on the bottom image

bottom-label="Bottom Label"

####start-position (optional) set the start position of the revealer in percentage (default : 50)

start-position="60"

####on-complete (optional) if set on the scope, this function will be invoked when the drag action has complete

on-complete="vm.onComplete('called from the controller')"

####scroll (optional)

Set postion of the revealer on scroll, the revealer will only happen when the element is in the windows viewport.

note when set the start-postion will be 0

scroll="true"

####scroll-offset (optional)

change the trigger location of the scroll functionality

scroll-offset="500"

Change log

1.0.0

  • throttle function #8
  • page-scroll functionality #10
  • updated documentation

breaking changes

  • removed topimage, bottomimage, toplabel, bottomlabel

0.1.4

  • support UMD #7

0.1.3

  • updated revealer tests
  • onComplete function fature added #9
  • updated documentation

0.1.2

  • fix release listener issue #11

0.1.1

  • fix offset issue #6
  • updated gulp task to output to a single destination

0.0.1

  • intital release

License

MIT

revealer's People

Contributors

antoineguillaume avatar httpete-ire avatar princemaple avatar seyz 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

Watchers

 avatar  avatar  avatar  avatar

revealer's Issues

offset when window resized

when the window is resized the offset of the top image is not correct, the drag "handle" follows the mouse but the image overlay is way off.

release listeners are not being removed

the release listeners are not be removed when the release event triggers, the release listener is also getting duplicated every time the handler is clicked.

$document.on(eventConfig.release, removeListeners.bind(null, eventConfig));

I think the reason for this is that the .bind method returns a new function which does not match the listener function.

highlighting of images

tested on on safari 9 on 10.11, but when dragging the slider the images select. you should add a no select css property to every element under your slider.

touch events

at the moment the revealer will work responsively but 'touch' events are not handled so it is useless on a touch device

Mouse offset on drag

When you drag the 'slider', it doesn't keep the mouse offset from where it was pressed. The cursor jumps to the middle of the 'slider'. I don't know if I would call it a bug, maybe an oversight or could even be intended behavior I guess.

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.