Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,30 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="styles.css">
<title></title>
</head>

<body>
<h1>Meme Kingdom</h1>
<div id="meme-kingdom"></div>
<button onclick="memeShuffle()">Shuffle Memes</button>
</body>
<script>

var colors= ['#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6',
'#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D',
'#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A',
'#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC',
'#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC',
'#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399',
'#E666B3', '#33991A', '#CC9999', '#B3B31A', '#00E680',
'#4D8066', '#809980', '#E6FF80', '#1AFF33', '#999933',
'#FF3380', '#CCCC00', '#66E64D', '#4D80CC', '#9900B3',
'#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF'];
var random_color = colors[Math.floor(Math.random() * colors.length)];
document.body.style.backgroundColor = random_color

var memes = [
"memes/gopher-this-is-fine.jpg",
"memes/cny-pocket.jpg",
Expand All @@ -27,14 +43,19 @@ <h1>Meme Kingdom</h1>
return document.getElementById(id)
}


// spin the meme
function spin(id) {
meme = gid(id)

function memeShuffle() {
var j, x, i;
for (i = memes.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = memes[i];
memes[i] = memes[j];
memes[j] = x;
}
loadmemes();
}

var kingdom = gid("meme-kingdom")

function loadmemes() {
while (kingdom.firstChild) {
kingdom.removeChild(kingdom.firstChild);
Expand Down
18 changes: 18 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p {
color: red;
}
img {
border-radius: 50%;
-webkit-transition: -webkit-transform .8s ease-in-out;
transition: transform .8s ease-in-out;
}
img:hover {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}