CVI
reflex.js 1.5 allows you to add a Cover Flow effect (including reflection) to images on your webpages. *Cover Flow is a trademark of Apple Inc.

It works in all the major browsers - Mozilla Firefox 1.5+, Opera 9+, Safari and IE6+. On older browsers, it'll degrade and your visitors won't notice a thing.
CVI-lab: Get a fast impression of the effects and their illustration qualities.

Demonstration

Shows some of the things reflex.js does.

First 3 images with class "reflex" only, last 3 with "idistance?? iheight?? iopacity?? iborder? icolor??????" ...


"reflex iopacity50"

"reflex iopacity75"

"reflex iopacity25"

Images used are copyrighted and are used for demonstration only.

Setting Up

Download reflex.js and include it into your webpage.

<script type="text/javascript" src="reflex.js"></script>

Using It

To get the effect just add a class="reflex" to the image (minimum dimension: 32x32).
The needed vertical space of the canvas element will grow by the height of the reflection, plus the height of the distance.

Classes

Scripting lib

If you want flexibility, use "cvi_reflex_lib.js" instead of "reflex.js". You can make your images respond to user actions (e.g. changing one or more options when the image is hovered over).

Set defaults using Javascript
cvi_reflex.defaultTilt = 'none'; //STR 'n|l|r'-'none|left|right'
cvi_reflex.defaultHeight = 33; //INT 10-100 (%)
cvi_reflex.defaultDistance = 0; //INT 0-100 (px)
cvi_reflex.defaultTransparency = 50; //INT 1-100 (%)
cvi_reflex.defaultBorder = 0; //INT 0-20 (px)
cvi_reflex.defaultColor = '#ffffff'; //STR '#000000'-'#ffffff'
cvi_reflex.defaultBoxmode = false; //BOOLEAN
If cvi_filter_lib.js is loaded also...
cvi_reflex.defaultFilter = null; //OBJ [{f='grayscale'},{f='emboss', s:1}...]

Add images using Javascript
cvi_reflex.add(image, options);
image should be an image element: document.getElementById("myimg")
options can contain one or more values: {tilt: value, height: value, distance: value, transparency: value, border: value, color: value, boxmode: value, filter: value}
Examples:
cvi_reflex.add(document.getElementById("myimg"), { height: 25, distance: 10 });
<img onLoad="cvi_reflex.add(this, { height: 25, distance: 10 });" ...>

Modify images using Javascript
cvi_reflex.modify(image, options);
If the image has already an effect but a option value has changed, the effect will be changed accordingly.
Example:
cvi_reflex.modify(document.getElementById("myimg"), { tilt: "left" });

Remove effect from an image using Javascript
cvi_reflex.remove(image);

Support libs

If you are using the more flexible "cvi_reflex_lib.js" instead of "reflex.js", you'll get access to additional features by the following support libraries (part of distribution):

Why use Javascript Reflex Image?

In older browsers, the script degrades and your visitors won't notice a thing.

Download

Please read the license before you download reflex.js 1.5

F.A.Q.

Please read the Frequently Asked Questions before you contact the author.

History

Version 1.5

Version 1.4 Version 1.3 Version 1.21 Version 1.2 Version 1.1 Version 1.0

Credits

The inspiration for the script came from apples Cover Flow.

Contact

Please leave any comments at this contact formular.

License

reflex.js and cvi_reflex_lib.js are distributed under the Netzgestade Non-commercial Software License Agreement.
License permits free of charge use on non-commercial and private web sites only under special conditions (as described in the license). This license equals neither "open source" nor "public domain". There are also Commercial Software Licenses available.

YOU AGREE TO ALL CONDITIONS OF THIS LICENCE AGREEMENT CONCERNING THE USE OF THE SOFTWARE BY ACCEPTING THIS LICENCE.
IF YOU DO NOT AGREE TO ALL CONDITIONS OF THIS AGREEMENT, YOU SHALL NOT INSTALL THE SOFTWARE, OR USE IT IN OTHER WAYS.

Other Projects

reflex.netzgesta.de © 2024 by Christian Effenberger :: Imprint feed   twitter   facebook   myspace   delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   blinklist   mister-wong