diff --git a/source/js/thematrix.js b/source/js/thematrix.js index 6146c88..ee9512e 100644 --- a/source/js/thematrix.js +++ b/source/js/thematrix.js @@ -40,13 +40,24 @@ var killWhenDone = (elem, length) => { }, length * 200 + 2000); }; +var getNormalizedLeft = (text) => { + var i = parseInt(text.substring(0, 2), 16); + + i = i || 0; + i = i * width/256; + i += Math.random() * 30; + i = Math.floor(i); + + return i; +}; + var createCol = (text) => { var col = $('
').addClass('col'); text.split('').forEach(c => col.append(createChar(c))); col.css({ - left: Math.floor(Math.random() * width), + left: getNormalizedLeft(text), top: Math.floor(Math.random() * height * 0.66) });