CVI
instant.js 2.4 allows you to add an instant picture effect (including tilt) to images on your webpages (alternatively: slided.js or filmed.js).

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 instant.js does.

First image with class = "instant itiltleft icolorFFFCE9 ishadow40 historical", next image with class = "instant nocorner itxtalt" and next two images with class = "instant itxtalt". All other images with class = "instant" only...

A beautiful girl
A beautiful girl
A beautiful girl

 

   

Images used are copyrighted and are used for demonstration only.

Setting Up

Download instant.js and include it into your webpage.

// only if you want to use the annotation feature...
<script type="text/javascript" src="cvi_text_lib.js"></script>
// ...else this one only...
<script type="text/javascript" src="instant.js"></script>

Using It

To get the instant picture effect just add a class="instant" to the image (minimum dimension: 64x64).

Classes

Scripting lib

If you want flexibility, use "cvi_instant_lib.js" instead of "instant.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_instant.defaultTilt = 'none'; //STR 'n|l|r'-'none|left|right'
cvi_instant.defaultShade = 33; //INT 0-100 (% opacity)
cvi_instant.defaultShadow = 33; //INT 0-100 (% opacity)
cvi_instant.defaultColor = '#f0f4ff'; //STR '#000000'-'#ffffff'
cvi_instant.defaultNoshade = false; //BOOLEAN
cvi_instant.defaultNocorner = false; //BOOLEAN
cvi_instant.defaultHistorical = false; //BOOLEAN
cvi_instant.defaultPreserve = false; //BOOLEAN
If cvi_text_lib.js is loaded also...
cvi_instant.defaultText = ''; //STR
cvi_instant.defaultTextcolor = '#000000'; //STR '#000000'-'#ffffff'
cvi_instant.defaultFontattr = [100,100,100]; //OBJ [1-200==weight, 10-400==width, 10-1000==space]
If cvi_filter_lib.js is loaded also...
cvi_instant.defaultFilter = null; //OBJ [{f='grayscale'},{f='emboss', s:1}...]

Add images using Javascript
cvi_instant.add(image, options);
image should be an image element: document.getElementById("myimg")
options can contain one or more values: {tilt: value, shadow: value, shade: value, color: value, noshade: value, nocorner: value, historical: value, preserve: value, text: value, textcolor: value, fontattr: [value,value,value], filter: value }
Examples:
cvi_instant.add(document.getElementById("myimg"), { shadow: 75, shade: 10 });
<img onLoad="cvi_instant.add(this, { shadow: 75, shade: 10 });" ...>

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

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

Support libs

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

Why use Javascript Instant Image?

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

Download

Please read the license before you download instant.js 2.4

F.A.Q.

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

History

Version 2.4

Version 2.3 Version 2.21 Version 2.2 Version 2.1 Version 2.0 Version 1.7 Version 1.6 Version 1.5 Version 1.4 Version 1.3 Version 1.2 Version 1.12 Version 1.11 Version 1.1 Version 1.0

Credits

The inspiration for the script came from polaroid.rb.

Contact

Please leave any comments at this contact formular.

License

instant.js and cvi_instant_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

instant.netzgesta.de © 2014 by Christian Effenberger feed   twitter   facebook   myspace   delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   blinklist   mister-wong