Skip to content

Instantly share code, notes, and snippets.

@radiodario
Forked from anonymous/jsbin.iZAYIKI.css
Last active December 27, 2015 08:59
Show Gist options
  • Save radiodario/7300723 to your computer and use it in GitHub Desktop.
Save radiodario/7300723 to your computer and use it in GitHub Desktop.
body {
text-align: center;
}
.yay {
font-size: 70px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Awesome</title>
</head>
<body>
<pre class="yay"></pre>
</body>
</html>
var things = [
"✌('ω')✌",
"✌('ω'✌)",
"(ω' ✌)",
"(' ✌ )",
"(✌ )✌",
"✌( )✌",
"✌( ✌)",
"( ✌ ')",
"(✌ 'ω)",
"(✌'ω')✌",
"✌('ω')✌"
];
var currentPos = 0;
var yayDiv = document.querySelector('.yay');
var dt = 0;
var start = 0;
function render(time) {
dt = time - start;
//console.log("Hey", time, start, dt);
if (dt >= (300)) {
currentPos = (currentPos+1) % things.length;
yayDiv.innerText = things[currentPos];
start = time;
dt = 0;
}
}
function animate(time) {
requestAnimationFrame(animate);
render(time);
}
animate(start);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment