Skip to content

Instantly share code, notes, and snippets.

@nothingrealhappen
Created April 20, 2016 13:02
Show Gist options
  • Save nothingrealhappen/67fdd05c7d4448c9a5fb29a13f44a18a to your computer and use it in GitHub Desktop.
Save nothingrealhappen/67fdd05c7d4448c9a5fb29a13f44a18a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta content="initial-scale=1.0, width=device-width" name="viewport">
</head>
<body>
<pre id="lines" data-lining>
print("Hello, WWDC!")
Hello love at first swipe.
Hello other side of the road.
Hello yogi on my wrist.
Hello driver, fast as you can.
Hello workout in my living room.
Hello every pitch, every highlight.
Hello self-combusting selfies.
Hello double tap heart.
Hello rain in five minutes.
Hello 6 seconds of fame.
Hello big idea.
</pre>
<script src="//cdn.jsdelivr.net/lining.js/0.3.2/lining.min.js"></script>
<script>
var colors = ['#00AbA4', '#8884C5', '#CD8B5c', '#DC3B3B', '#B33896'];
var randomColor = function() {
return colors[Math.floor(Math.random()*colors.length)];
}
window.onload = function() {
var lines = document.querySelectorAll('#lines .line');
[].forEach.call(lines, function(x) {
x.style.color = randomColor();
});
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment