-
Notifications
You must be signed in to change notification settings - Fork 0
/
mombday.html
125 lines (104 loc) · 2.68 KB
/
mombday.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html id = "yay">
<head>
<title></title>
<style type="text/css">
html {
background-color: #00FFFF;
}
#happy {
font-family: "Courier New";
font-size: 70px;
text-align: center;
}
.animated {
display: inline-block;
-webkit-animation-name: bounceIn;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 100;
/* -webkit-animation-timing-function: ease-out;
*/
-webkit-animation-fill-mode: forwards;
animation-name: bounceIn;
animation-duration: 1s;
animation-iteration-count: 1000;
animation-timing-function: ease-out;
animation-fill-mode: forwards;
}
/*
* Animation for webkit
*/
@-webkit-keyframes bounce {
0%,
20%,
50%,
80%,
100% {
-webkit-transform: translateY(0);
}
40% {
-webkit-transform: translateY(-30px);
}
60% {
-webkit-transform: translateY(-15px);
}
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translateY(0);
}
40% {
transform: translateY(-30px);
}
60% {
transform: translateY(-15px);
}
}
/*
* Adding the animation to our element
*/
.bounce {
-webkit-animation-name: bounce;
animation-name: bounce;
}
</style>
</head>
<body>
<h1 id="happy"> HAPPY BIRTHDAY MOMMY!!!<h1>
<audio id="audio" src="https://s3-us-west-2.amazonaws.com/codesketches/Paradise+By+The+Dashboard+Lights.mp3"></audio>
<script type="text/javascript">
window.onload = function() {
function mommy() {
var mom = document.createElement('div');
document.body.appendChild(mom);
mom.style.height = "400px";
mom.style.width = "300px";
mom.style.backgroundImage = "url(https://s3-us-west-2.amazonaws.com/codesketches/mom1.png)";
mom.style.backgroundSize = "cover";
mom.style.position = "relative";
mom.classList.add("animated");
mom.classList.add("bounce");
}
for (i = 1; i < 30; i = i + 1) {
mommy()
};
function play() {
var audio = document.getElementById("audio")
audio.play()
};
play();
document.getElementById('yay');
function color () { yay.style.backgroundColor=
"rgb(" + Math.floor(Math.random() *255) + "," +
Math.floor(Math.random() *255) + "," +
Math.floor(Math.random() *255) + ")"
}
setInterval(color, 1000)
}
</script>
</body>
</html>