Giter VIP home page Giter VIP logo

oddball-magnifier's Introduction

Oddball Magnifier

A touch-friendly, light-weight image magnifier. Can be used on multiple images on a page, and is highly customisable. View demo

Screenshot of working Oddball Magnifier

How to use the Oddball Magnifier

To use the Oddball Magnifier, simply include any class-name on an image and call the script like so:

<img src="./example.jpg" class="your-class-name" />

...

<script src='./oddballMagnifier.min.js'></script>
<script>
$(document).ready(function() {
	$('.your-class-name').oddballMagnifier();
});
</script>

You can also designate a different magnified image from the main image (for example, a high-definition version of the image) like so:

<img src="./example.jpg" data-hdsrc="./example-hd.jpg" class="your-class-name" />

For more customisability, you can change the lens layout:

$('.your-class-name').oddballMagnifier({
	lens: 340,
	curve: 340,
	shadow: 0.1,
	spread: 30,
	zoom: 1920,
	border: 8,
	inset: false,
	borderColor: '255,255,255',
	shadowColor: '0,0,0'
});

Documentation

  • lens - size of the magnifier (pixels)
  • curve - border-radius of the lends (pixels)
  • shadow - opacity of the drop-shadow of the magnifier (set from 0-1)
  • spread - size/spread of the drop-shadow (pixels)
  • zoom - size of the magnifier image (pixels)
  • border - border-width of the magnifier
  • inset - shadow/glow as inset (true or false)
  • borderColor - border color (rgb only - i.e. '255,255,255')
  • shadowColor - shadow color (rgb only - i.e. '0,0,0')

To do

  • Add more customisable shapes to the magnifier
  • Possible pre-loading of HD images
  • Transitions on lens to fade in and out
  • Anything anyone else can think of/cares to add

Dependencies

  • jQuery

oddball-magnifier's People

Contributors

ohepworthbell avatar

Stargazers

Jack Saunders avatar

Watchers

James Cloos avatar  avatar

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.