Real Shadow — Module that casts photorealistic shadows of any shape
Perfect for eye-catching demos and landing pages.
Works in any browser supporting CSS box-shadow property.
Real Shadow registers itself as CommonJS module, AMD module or jQuery plugin (it depends on your environment).
If there is no CommonJS, AMD or jQuery, Real Shadow registers itself in the global namespace.
What's new
- constant angle
- flat shadows
- text shadows
- shadows can be of any shape
- per-element settings (instead of global settings)
Basic Usage with jQuery
; // options are optional ;
Basic Usage without jQuery
; // options are optional ; // options example listed above
To specify different colors for each element, you can use "data-shadow-color" attribute:
<!-- values in range 0..255 --> redgreenblueyellowcyanvioletgrey
;
Inset Shadows
;
Inverse Shadows
;
Custom Shadow Shape
;
Text Shadow
;
Constant Angle
If you would like the shadows angle to be constant, specify the 'angle' option, in radians.
;
Update shadows during/after jQuery animations
// before: apply Real Shadow to elements:; // update shadows during jQuery animation, i.e. each animation step:; // update shadows after jQuery animation is over:;
If you update shadows during jQuery animation, you don't need to update shadows after jQuery animation is over.
Custom shadows length
;
CommonJS usage
var realshadow = ; ;;
RequireJS / AMD usage
;
Reset Real Shadow
Real Shadow will release all added elements and remove all its event listeners
// if you have Real Shadow in the current scope:realshadow; // if you use jQuery:$fnrealshadow;
Getting Real Shadow
Real Shadow is available in GitHub And you can get it using Bower:
bower install real-shadow
If you suppose that the usage of Real Shadow is unclear or have something to say, feel free to contact me.