GithubHelp home page GithubHelp logo

anta199 / okshadow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okfocus/okshadow

0.0 0.0 0.0 4.35 MB

Cursor as light source.

Home Page: okfoc.us/okshadow

License: MIT License

Ruby 12.95% CSS 0.43% JavaScript 85.38% Shell 1.23%

okshadow's Introduction

okshadow

OKShadow by OKFocus

OKShadow is a jQuery plugin that produces drop shadows that track the mouse cursor. Many effects are possible, including depth-of-field simulation and focus effects. See examples here.

Usage

OKShadow can bind to any DOM element that recognizes the CSS3 box-shadow or text-shadow property.

Options

option description default
color sets shadow color #888
textShadow applies the shadow to the text; otherwise, the shadow affects the container (“box-shadow”) false
transparent sets text color to transparent for ghost text effect false
downwards on mobile browsers, shadows will only move downwards true
xMax horizontal movement constraint, in pixels null
yxOffset horizontal offset, in pixels 0
xFactor affects blur position based on mouse distance 30
yMax vertical movement constraint, in pixels null
yOffset vertical offset, in pixels 0
yFactor affects blur position based on mouse distance 30
fuzzMin minimum blur radius in pixels null
fuzzMax maximum blur radius in pixels null
fuzzFactor affects blur radius based on mouse distance 40

Methods

OKShadow offers the method setoption so parameters can be changed after instantiation. It takes either a hash of parameters or a single key and value. For example:


$('#ok').okshadow();
$('#ok').data("okshadow").setoption({
  "color": "red",
  "fuzzMin": 10,
});

For use in dynamic web apps, use the pause and unpause methods to turn the effect on and off.

Run Tests

OKFocus tests JavaScript with Jasmine. Run tests:


$ bundle install
$ jasmine init
$ rake jasmine

okshadow's People

Contributors

jgv 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.