Last active
January 1, 2016 20:29
-
-
Save Tsa6/8196971 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<!--Made by Tsa6--> | |
<head> | |
<title>Santa's List</title> | |
<style> | |
body { | |
background-color: lightyellow; | |
background-image: url('http://freeseamlesstextures.com/images/40-dirty-paper-background-sml.jpg'); | |
} | |
@font-face { | |
font-family: handwriting; | |
src: url(http://themes.googleusercontent.com/static/fonts/thegirlnextdoor/v4/cWRA4JVGeEcHGcPl5hmX7p-yoK3Kl6E6RmvAncM23y8.woff); | |
} | |
p { | |
font-family: handwriting; | |
font-size: 200%; | |
line-height: 1; | |
} | |
</style> | |
</head> | |
<body> | |
<script> | |
var unchecked = '□ ' | |
var rawDate = new Date(); | |
if(rawDate.getDate() !== 24 || rawdate.getMonth() !== 11){ | |
alert('It\'s not christmas eve silly! Santa\'s still making his list! Well, here\'s his old one at least.'); | |
unchecked = '☑ '; | |
} | |
var randomSelect = function() { | |
randomNum = Math.round(Math.random() * (arguments.length - 1)); | |
return arguments[randomNum]; | |
}; | |
function showAll() { | |
var list = ''; | |
for (var i = 0; i < 100; i++) { | |
list += randomSelect('☑ ',unchecked); | |
list += randomSelect('Emma', 'Emily', 'Madison', 'Kaitlyn', 'Sophia', 'Isabella', 'Olivia', 'Hannah', 'Makayla', 'Ava', 'Abigail', 'Sarah', 'Hailey', 'Kaylee', 'Madeline', 'Ella', 'Grace', 'Mia', 'Riley', 'Samantha', 'Aidan', 'Jacob', 'Ethan', 'Nicholas', 'Matthew', 'Ryan', 'Tyler', 'Jack', 'Joshua', 'Andrew', 'Dylan', 'Michael', 'Connor', 'Caden', 'Jayden', 'Noah', 'Zachary', 'Alexander', 'Logan', 'Caleb'); | |
list += '</br>'; | |
} | |
list += unchecked + 'Gwen</br>' + unchecked + 'Laura</br>' + unchecked + 'Taizo</br>' + unchecked + 'Joon</br>'; | |
document.getElementById('list').innerHTML = list; | |
} | |
function search() { | |
var results = ''; | |
var name = prompt('Who do you want to search Santa\'s list', ''); | |
for (var i = 0; i < Math.abs(13 - name.length); i++) { | |
results += randomSelect('☑ ', unchecked); | |
results += name; | |
results += '</br>'; | |
} | |
results += unchecked + name; | |
document.getElementById('list').innerHTML = results; | |
} | |
</script> | |
<h1>Santa's List</h1> | |
<button onclick='showAll()'>All</button> | |
<button onclick='search()'>Search</button> | |
<p id='list'>Choose A Mode</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment