-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·140 lines (121 loc) · 3.99 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript">
$(function(){
var steps = ["\\o\\","lol","\/o\/","\\ol","\_o\_","lo\/"];
var random_array = [];
var item = steps[Math.floor(Math.random()*steps.length)];
$('.steproll').html(item);
var score = 0;
$('.totscore').html(score);
var totalw = $('.footer').width();
var i = 0;
/*while(i<totalw){
i += 20;
setTimeout(function(){
$('.steproll').animate({right: i}, 250);
},500);
}*/
function myLoop () {
setTimeout(function () {
i += 50;
$('.steproll').animate({right: i}, 250);
console.log(i);
if (i < totalw) {
myLoop();
}else {
console.log('Test');
$('#gameover').show();
//$('.steproll').html('Your life now has meaning!');
}
}, 500)
}
myLoop();
function randomize(steps){
item = steps[Math.floor(Math.random()*steps.length)];
//console.log('new item: '+item);
score += 10;
$('.totscore').html(score);
$('.steproll').html(item);
}
function match(s1,s2){
if(s1 == s2){
randomize(steps);
//return '1';
}
else
return '0';
}
/*setInterval(function(){
var item = steps[Math.floor(Math.random()*steps.length)];
random_array.push(item);
console.log(random_array);
},1000);*/
$('.topleft').hover(function(){
var loltype = '\\o\\';
match(item,loltype);
$('.lol').html(loltype);
});
$('.top').hover(function(){
var loltype = 'lol';
match(item,loltype);
$('.lol').html(loltype);
});
$('.topright').hover(function(){
var loltype = '\/o\/';
match(item,loltype);
$('.lol').html(loltype);
});
$('.bottomleft').hover(function(){
var loltype = '\\ol';
match(item,loltype);
$('.lol').html(loltype);
});
$('.bottom').hover(function(){
var loltype = '\_o\_';
match(item,loltype);
$('.lol').html(loltype);
});
$('.bottomright').hover(function(){
var loltype = 'lo\/';
match(item,loltype);
$('.lol').html(loltype);
});
});
</script>
<style type="text/css">
* {margin: 0; padding: 0;}
html, body {position: fixed; width: 100%; height: 100%; font-family: helvetica;}
#gameover {display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #eeeeee; text-align: center; z-index: 10;}
#gameover p{position: relative; top: 45%; color: #333333; font-size: 20px;}
.topleft {position: absolute; top: 0; left: 0; width: 45%; height: 50%;}
.top {position: absolute; top: 0; left: 45%; width: 10%; height: 50%;}
.topright {position: absolute; top: 0; left: 55%; width: 45%; height: 50%;}
.scorecard {position: absolute; top: 0; right: 0; font-size: 16px; color: #555555;}
.totscore {display: block; right: 0;}
.bottomleft {position: absolute; top: 50%; left: 0; width: 45%; height: 50%;}
.bottom {position: absolute; top: 50%; left: 45%; width: 10%; height: 50%;}
.bottomright {position: absolute; top: 50%; left: 55%; width: 45%; height: 50%;}
.lol {position: absolute; bottom: -30px; font-size: 60px; width: 100%; text-align: center; color: #444444; z-index: 2;}
.footer {position: fixed; bottom: 0; width: 100%; height: 50px; z-index: 5; background-color: #333333; color: #ffffff;}
.steproll {position: absolute; right: 10px; font-size: 20px; padding: 15px 0px;}
</style>
</head>
<body>
<div id="gameover"><p>Your life now has meaning!</p></div>
<div class="topleft"></div>
<div class="top"><div class="lol">lol</div></div>
<div class="topright">
<div class="scorecard">SCORE <div class="totscore"></div></div>
</div>
<div class="bottomleft"></div>
<div class="bottom"></div>
<div class="bottomright"></div>
<div class="footer">
<div class="steproll"></div>
</div>
</body>
</html>