diff options
-rw-r--r-- | index.html | 18 | ||||
-rw-r--r-- | static/aseem.jpg | bin | 0 -> 176034 bytes | |||
-rw-r--r-- | static/aseem.js | 62 | ||||
-rw-r--r-- | static/aseem.mp3 | bin | 0 -> 875962 bytes | |||
-rw-r--r-- | static/aseem.ogg | bin | 0 -> 1452981 bytes | |||
-rw-r--r-- | static/styles.css | 0 |
6 files changed, 80 insertions, 0 deletions
diff --git a/index.html b/index.html new file mode 100644 index 0000000..3edf7c8 --- /dev/null +++ b/index.html @@ -0,0 +1,18 @@ +<!DOCTYPE HTML> +<html> + <head> + <meta charset="utf-8"> + <title>aseem's legit</title> + <meta id="viewport" name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> + </head> + <body> + <a href="/tears.html"> + <img id="aseem" src="/static/aseem.jpg" height="320" style="position:absolute;"></img> + </a> + <audio autoplay loop> + <source src="/static/aseem.ogg"> + <source src="/static/aseem.mp3"> + </audio> + <script src="/static/aseem.js"></script> + </body> +</html> diff --git a/static/aseem.jpg b/static/aseem.jpg Binary files differnew file mode 100644 index 0000000..fce2be3 --- /dev/null +++ b/static/aseem.jpg diff --git a/static/aseem.js b/static/aseem.js new file mode 100644 index 0000000..f8d7b52 --- /dev/null +++ b/static/aseem.js @@ -0,0 +1,62 @@ +'use strict'; + +function randomInteger(min, max) { + /* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random */ + return Math.floor(Math.random() * (max - min)) + min; +} + +function setColor(color) { + document.body.style.backgroundColor = color; +} + +var hexCharacters = '0123456789abcdef'.split(''); +function randomColor() { + var color = '#'; + for (var i = 0; i < 6; i++) { + color += hexCharacters[randomInteger(0, hexCharacters.length)]; + } + return color; +} + +function randomlySetColor() { + setColor(randomColor()); +} + +function move(id, left, top) { + var element = document.getElementById(id); + element.style.left = left + "px"; + element.style.top = top + "px"; +} + +function randomValidPosition(id) { + var width = window.innerWidth; + var height = window.innerHeight; + var element = document.getElementById(id); + return { + left: randomInteger(0, width - element.width), + top: randomInteger(0, height - element.height) + }; +} + +function randomlyMoveElement(id) { + var position = randomValidPosition(id); + move(id, position.left, position.top); +} + +function rotate(text) { + // Adapted from Robert Quitt + return text.substring(1) + text[0]; +} + +var titleText = document.title + ' ' // buffer +setInterval(function() { + randomlySetColor(); + randomlyMoveElement('aseem'); + + // document.title strips out spaces, so helper variable + titleText = rotate(titleText) + document.title = titleText +}, 220); + + +} diff --git a/static/aseem.mp3 b/static/aseem.mp3 Binary files differnew file mode 100644 index 0000000..9e4ecf5 --- /dev/null +++ b/static/aseem.mp3 diff --git a/static/aseem.ogg b/static/aseem.ogg Binary files differnew file mode 100644 index 0000000..ac4fe68 --- /dev/null +++ b/static/aseem.ogg diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/static/styles.css |