Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a typing cat #573

Merged
merged 1 commit into from Apr 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions cat_typing/index.html
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>THE CAT KNOWS WHAT HE IS DOING DAMNIT</title>

<style>

.gif { display: block; margin: 0 auto; border: 1px solid #383838; padding: 5px; }
.typing { width: 485px; margin: 0 auto; font-family: monospace; word-wrap: break-word; }

</style>

</head>
<body>

<img class="gif" src="http://img.izifunny.com/pics/2013/20130429/original/izifunny-gifdump-april-29-2013-25-gifs_2.gif" alt="What, you don't want to see the funny cat gif?">

<div class="typing" id="cursor"></div>

<script>

var cursor = document.getElementById('cursor');

var catTyping = function() {
var r = Math.random();
var char = (r < 0.1 ? Math.floor(r*100) : String.fromCharCode(Math.floor(r * 26) + (r > 0.5 ? 97 : 65)));
cursor.innerHTML += char;
window.setTimeout(catTyping, 85);
};

catTyping();

</script>

</body>
</html>