Recommend this page to a friend! |
Classes of Joseluis Laso | CoolLedMatrix | README.md | Download |
|
|
Downloadjs-cool-matrix-ledA cool led matrix with javascript and CSS (jquery needed) This is based on the work of http://codepen.io/motorlatitude/pen/fmzkd InstallationCopy the files cool-led-matrix.css and cool-led-matrix.js to your project, to the folder you want. invoke it in your html file like this:
Create a container with enough room to the matrix:
Apply to this container the styles you want, but you have to have position: absolute; yes or yes.
And, on your code create as many led-matrix blocks as you need:
If you need more symbols is pretty easy to create new ones.
To draw this new symbol just call the draw method of the object:
Remember that for the colorClass parameter you need to create also the correspondent class:
You have 4 basic models ready to use: Use more than one colorIn order to allow you to have a pretty led matrix like this one: I have created a palette object: The idea is pretty simple, you have to pass an array of 10 items or less with a css valid color:
The only thing you have to do is use the color index in the definition of the symbol:
The result is like the previous picture. AnimationI am pretty sure you want to use that cool class immediately, in order to notice your users about some of your services. But, what if this cool led matrix was animated ...? Much cool, right ? Let's see how to do that .. First of all we have to create an array with all the sequences that we will need to animate it:
I know that is a lot of work, I am thinking in how to animate programatically, ideas are welcome. And invoke the animate like that:
This was a simple animation, stepping each frame ... But, what about combining colors ...
As you can see the animation is defined by the callback, in this case the color is shifted. But you can create the animation you want. Try your own animation. |