jQuery DigitalWrite plugin
This is a jQuery plugin that allows you to create UPPERCASE english alphabets in a 5X5 matrix. Its very easy to use!
-
Include jQuery js library
<script src="<path to jQuery.version.js>"></script>
-
Include this library
<script src="./js/jquery.digitalwrite.js"><script>
OR use the minified version<script src="./js/jquery.digitalwrite.min.js"><script>
-
And tadaa! - for any html dom element call the
digitalwrite
method!
$("#target").digitalwrite({char: 'W'});
-
And then transform to some other charecter using
transformTo
method!
$("#target").transformTo({'M'});
Properties
Properties are passed as parameter, for example:
$("#target").digitalwrite({char: 'W'});
Here
{char: 'W'}
is the charecter property! Other customisable properties include
Property | Description |
---|---|
char |
(REQUIRED) Charecter to print:
|
width |
Width of the charecter block in px
|
height |
Height of the charecter block in px
|
background |
background of the charecter block
|
border |
Border of the charecter block in px
|
animation |
animation you expect for final transition! The categories are: motion , spiral , contract & fade
Note that fade is experimental and buggy!
|
success |
(callback function) called when the alphabet has been created on screen.
|
timeout |
time in ms, for animations 1000, default
|
transformTo()
method
Once you have created some digital alphabet, you can transform it to some other alphabet using thetransformTo()
method.
For example call$('#transform_MK').transformTo('N');
You can make a whole storyline using the success
callback
$('#transform_MK').digitalwrite({
char: 'M',
background: 'rgba(0,0,0,.1)',
animation: 'default',
success: function() {
setTimeout(function() {
$('#transform_MK').transformTo('N');
}, 1000);
}
});
transformTo()
method format
$(identifier).transformTo(char, callback);
char
- (charecter) the charecter to transform to.
callback
- (function, optional) callback called on completion of transformation.
Customisations
Size
Code used for them respectively are:
$("#m20").digitalwrite({char: 'M', height: 20, width: 20, animation: 'none'});
$("#m40").digitalwrite({char: 'M', height: 40, width: 40, animation: 'none'});
$("#m60").digitalwrite({char: 'M', height: 60, width: 60, animation: 'none'});
$("#m80").digitalwrite({char: 'M', height: 80, width: 80, animation: 'none'});
$("#m100").digitalwrite({char: 'M', height: 100, width: 100, animation: 'none'});
$("#m120").digitalwrite({char: 'M', height: 120, width: 120, animation: 'none'});
Colors
Code used for them respectively are:
$("#c1").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)'})
$("#c2").digitalwrite({char: 'I', background: 'rgba(255, 0, 0, .1)', border: '1px dotted red'});
$("#c3").digitalwrite({char: 'N', background: 'yellow', border: '1px solid red'});
$("#c4").digitalwrite({char: 'H', background: 'yellowGreen', border: '1px solid green'});
$("#c5").digitalwrite({char: 'A'});
$("#c6").digitalwrite({char: 'Z', background: 'red', border: '1px solid red'});
Animations
motion
spiral (experimental)
contract
fade (experimental)
Code used for them respectively are:
$("#m1").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)'});
$("#m3").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)', animation: 'contract'});
$("#m4").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)', animation: 'fade'});
$("#m20").digitalwrite({char: 'M', height: 20, width: 20, animation: 'none'});
$("#m40").digitalwrite({char: 'M', height: 40, width: 40, animation: 'none'});
$("#m60").digitalwrite({char: 'M', height: 60, width: 60, animation: 'none'});
$("#m80").digitalwrite({char: 'M', height: 80, width: 80, animation: 'none'});
$("#m100").digitalwrite({char: 'M', height: 100, width: 100, animation: 'none'});
$("#m120").digitalwrite({char: 'M', height: 120, width: 120, animation: 'none'});
Code used for them respectively are:
$("#c1").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)'})
$("#c2").digitalwrite({char: 'I', background: 'rgba(255, 0, 0, .1)', border: '1px dotted red'});
$("#c3").digitalwrite({char: 'N', background: 'yellow', border: '1px solid red'});
$("#c4").digitalwrite({char: 'H', background: 'yellowGreen', border: '1px solid green'});
$("#c5").digitalwrite({char: 'A'});
$("#c6").digitalwrite({char: 'Z', background: 'red', border: '1px solid red'});
Animations
motion
spiral (experimental)
contract
fade (experimental)
Code used for them respectively are:
$("#m1").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)'});
$("#m3").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)', animation: 'contract'});
$("#m4").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)', animation: 'fade'});
motion
spiral (experimental)
contract
fade (experimental)
$("#m1").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)'});
$("#m3").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)', animation: 'contract'});
$("#m4").digitalwrite({char: 'M', background: 'rgba(0, 0, 0, .1)', animation: 'fade'});