Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
Tweaked vars for best visual effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ahultgren committed Apr 15, 2015
1 parent 90c1a30 commit 8c2436c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions source/js/thematrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,25 @@ var killWhenDone = (elem, length) => {
var getNormalizedLeft = (text) => {
var i = parseInt(text.substring(0, 2), 16);

i = i || 0;
i = i || Math.floor(Math.random() * 16);
i = i * width/256;
i += Math.random() * 30;
i += Math.random() * 40;
i = Math.floor(i);

return i;
};

var createCol = (text) => {
var col = $('<div/>').addClass('col');
var z = Math.floor(Math.random() * 4);

text.split('').forEach(c => col.append(createChar(c)));

col.css({
left: getNormalizedLeft(text),
top: Math.floor(Math.random() * height * 0.66)
top: Math.floor(Math.random() * height * 0.66),
'z-index': z,
transform: `scale(${1/4*3 + z/4})`
});

killWhenDone(col, text.length);
Expand Down
2 changes: 1 addition & 1 deletion source/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body {
}

@interval: 40ms;
@visible-for: 2000ms;
@visible-for: 3000ms;

.animate-char (@n) when (@n > -1) {
.animate-char(@n - 1);
Expand Down

0 comments on commit 8c2436c

Please sign in to comment.