-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangerGames.html
278 lines (250 loc) · 7.82 KB
/
angerGames.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!DOCTYPE html>
<html>
<head>
<title>Anger Games & Exercises</title>
<script src="jquery.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Pics/bigIcon.png" />
<style>
.icon {
background-image: url("Pics/borderlessIcon.svg");
background-size: 100% 100%;
width: 48px;
height: 48px;
border: rgb(142, 189, 189) outset;
float: left;
position: fixed;
margin-top: -3px;
border-radius: 5px;
z-index: 3;
}
.icon:hover {
border: rgb(142, 189, 189) inset;
}
#banner {
background-color: rgb(142, 189, 189);
height: 7%;
width: 100%;
position: fixed;
z-index: 2;
margin-top: -9px;
margin-left: -12px;
border: rgb(142, 189, 189) solid;
}
body {
background-image: url("Pics/balloon_sky.jpg");
}
@font-face {
font-family: cuteFont;
src: url('HappyMonkey-Regular.ttf');
}
p {
margin: 50px 50px;
text-align: center;
text-decoration: none;
}
a {
text-decoration: none;
}
.account {
margin-top: .6%;
padding: 5px 5px 5px 5px;
border-radius: 5px;
background-color: rgb(182, 229, 229);
border: white outset;
font-family: cuteFont;
position: fixed;
margin-left: 93%;
z-index: 3;
}
.account:hover {
border: white inset;
}
#login {
margin-left: 89%;
}
#bannerText {
font-family: cuteFont;
font-size: 160%;
color: rgb(182, 229, 229);
z-index: 4;
position: fixed;
transform: translate(-50%, -50%);
horizontal-align: middle;
text-align: center;
float: center;
top: -2%;
left: 47%;
margin-right: -50%;
}
.balloon {
width : 15%;
position: fixed;
}
.face {
display: none;
width : 10%;
position: relative;
margin-left: 40px;
margin-top: 30px;
border-radius: 30px;
-webkit-border-radius: 150px;
-moz-border-radius: 150px;
}
.popped {
width: 15%;
position: fixed;
display: none;
}
#instructions {
position: absolute;
z-index: 3;
font-family: cuteFont;
color: rgb(142, 189, 189);
font-size: 150%;
background-color: rgb(182, 229, 229);
border: rgb(142, 189, 189) solid;
border-radius: 5px;
width: 50%;
height: auto;
transform: translate(-50%, -50%);
horizontal-align: middle;
text-align: center;
float: center;
top: 10%;
left: 50%;
margin-right: -50%;
}
#uploadedFace {
border-radius: 5px;
background-color: rgb(182, 229, 229);
border: rgb(142, 189, 189) solid;
font-family: cuteFont;
padding: 5px 5px 5px 5px;
position: absolute;
z-index: 4;
width: auto;
height: auto;
transform: translate(-50%, -50%);
horizontal-align: middle;
text-align: center;
float: center;
top: 8.8%;
left: 81.7%;
margin-right: -50%;
}
.upload {
margin-top: 2%;
}
</style>
<script>
var uploaded = false;
$(document).ready(function() {
//$(".popped").hide();
click("blueObject");
click("magentaObject");
click("purpleObject");
click("brightgreenObject");
click("orangeObject");
click("yellowObject");
click("redObject");
click("mintObject");
balloon("blueObject");
$(".magentaObject").delay(1000);
balloon("magentaObject");
$(".purpleObject").delay(1000);
balloon("purpleObject");
balloon("brightgreenObject");
$("#orangeObject").delay(1000);
balloon("orangeObject");
balloon("yellowObject");
balloon("redObject");
balloon("mintObject");
});
var width = $(window).width();
var height = $(window).height();
var color = classValue.split("Object")[0];
function balloon(classValue) {
var color = classValue.split("Object")[0];
var x = Math.floor(Math.random() * (width-130) + 10);
$("." + classValue).css({position: 'fixed', left: x + 'px', top: height});
$("." + classValue).delay(1000);
var other = height + 320;
if (uploaded) {
$("." + classValue).show();
}
else {
$("#" + color + "Balloon").show();
}
$("." + classValue).animate({top: '-=' + other + 'px'}, 3600, function() {
balloon(classValue);
});
}
function click(classValue) {
var color = classValue.split("Object")[0];
$("#" + color + "balloonPopped").hide();
$("." + classValue).mousedown(function() {
$('body').append('<embed src="Music/pop.mp3" autostart="true" hidden="true" loop="false">');
$("." + classValue).stop();
var p = $("." + classValue);
var position = p.position();
$("#" + color + "balloonPopped").css({position: 'fixed', left: position.left + 'px', top: position.top + 'px'});
$("#" + color + "balloonPopped").show();
$("." + classValue).hide();
$("#" + color + "balloonPopped").hide(1000);
balloon(classValue);
});
}
function changePic(){
var source = document.getElementById("uploadedFace").value;
//var splitSource = source.split("\\");
//var imageSource = splitSource[splitSource.length - 1];
//$(".face").attr("src", imageSource);
$(".face").attr("src", source);
$(".face").css("display", "inline");
uploaded = true;
}
</script>
</head>
<body>
<a href="index.html">
<div class="icon"></div>
</a>
<p id="bannerText">Balloon Popping Game</p>
<div id="banner">
</div>
<button class = "account">Sign Up</button>
<button id="login" class = "account">Login</button>
<canvas id="mycanvas">
</canvas>
<h2 id= "instructions">
Enter a link of a picture of someone or something that makes you angry,
then have fun popping his/her/its face off!
</h2>
<input type = "text" id = "uploadedFace" name = "face"/>
<button class="upload" id="uploadedFace" onclick="changePic()">Upload</button>
<img class = "balloon blueObject" id = "blueBalloon" src = "Pics/blueballoonCleaned.png" />
<img class = "balloon orangeObject" id = "orangeBalloon" src = "Pics/orangeballoonCleaned.png" />
<img class = "balloon magentaObject" id = "magentaBalloon" src = "Pics/magentaballoonCleaned.png" />
<img class = "balloon purpleObject" id = "purpleBalloon" src = "Pics/purpleballoonCleaned.png" />
<img class = "balloon brightgreenObject" id = "brightgreenBalloon" src = "Pics/brightgreenballoonCleaned.png" />
<img class = "balloon yellowObject" id = "yellowBalloon" src = "Pics/yellowballoonCleaned.png" />
<img class = "balloon redObject" id = "redBalloon" src = "Pics/redballoonCleaned.png" />
<img class = "balloon mintObject" id = "mintBalloon" src = "Pics/mintballoonCleaned.png" />
<img class = "face blueObject" src = "Pics/bigIcon.png" />
<img class = "face orangeObject"src = "Pics/bigIcon.png" />
<img class = "face magentaObject" src = "Pics/bigIcon.png" />
<img class = "face purpleObject" src = "Pics/bigIcon.png" />
<img class = "face brightgreenObject" src = "Pics/bigIcon.png" />
<img class = "face yellowObject" src = "Pics/bigIcon.png" />
<img class = "face redObject" src = "Pics/bigIcon.png" />
<img class = "face mintObject" src = "Pics/bigIcon.png" />
<img class = "balloon" id = "blueballoonPopped" src = "Pics/blueballoonPopped.png" />
<img class = "balloon" id = "orangeballoonPopped" src = "Pics/orangeballoonPopped.png" />
<img class = "balloon" id = "magentaballoonPopped" src = "Pics/magentaballoonPopped.png" />
<img class = "balloon" id = "purpleballoonPopped" src = "Pics/purpleballoonPopped.png" />
<img class = "balloon" id = "brightgreenballoonPopped" src = "Pics/brightgreenballoonPopped.png" />
<img class = "balloon" id = "yellowballoonPopped" src = "Pics/yellowballoonPopped.png" />
<img class = "balloon" id = "redballoonPopped" src = "Pics/redballoonPopped.png" />
<img class = "balloon" id = "mintballoonPopped" src = "Pics/mintballoonPopped.png" />
</body>
</html>