-
Notifications
You must be signed in to change notification settings - Fork 0
/
sharks.html
270 lines (220 loc) · 7.18 KB
/
sharks.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tsundere Sharks!</title>
<meta name="author" content="Anaconda">
<meta name="description" content="Tsundere Shark wants to help you sort.">
<meta name="keywords" content="Shark, Tsundere, Yandere">
</head>
<style>
span {
display: none;
}
</style>
<body style="background-color:midnightblue">
<span index="nosupport">
Hi Senpai~ <br />
I'm going to hide until you update to a new browser.
</span>
<span index="1">
<img src="https://cosplaycalamity.files.wordpress.com/2014/12/ckjhmq9.jpg"/>
<span style="display:inline; position:absolute; top:30%; left:50%; color:white;" >
Hello Senpai~ <br />
So you want your file sorted?
</span>
<br />
<input type="file" id="files" name="files[]" multiple style="
position: absolute;
top: 40%;
left: 50%;
color: white;"/>
</span>
<span index="2">
<img src="https://cosplaycalamity.files.wordpress.com/2014/12/ckjhmq9.jpg"/>
<span style="display:inline; position:absolute; top:30%; left:50%; color:white;" >
I'll do it for you... But don't think it's because I like you! <br />
I want you to do some things for me first ;)
</span>
</span>
<span index="3">
< insert third, fourth, fifth picture >
<img src="https://cosplaycalamity.files.wordpress.com/2014/12/ckjhmq9.jpg"/>
<span style="display:inline; position:absolute; top:30%; left:50%; color:white;" >
Who's the cutest kouhai here?
</span>
<a onclick="advance()"><img src="http://i.imgur.com/WTrtBqE.jpg" height="200" width="200"></a>
<a onclick="toBadEnd()"><img src="http://i.imgur.com/5dGthfi.jpg" height="200" width="200"></a>
<a href="https://www.youtube.com/watch?v=_JAa3NvP6f4"><img src="https://s-media-cache-ak0.pinimg.com/originals/02/62/b2/0262b25a39e1b5b7a392166b0c76ccd7.jpg" height="200" width="200"></a>
</span>
<span index="4">
<img class="meat" height="75" src="http://www.nationalgrocers.org/images/default-source/default-album/shutterstock_118987798.jpg?sfvrsn=0" />
<span class="feedme" style="display:inline; position:absolute; top:30%; right:40%; color:red; font-size:100px ">
FEED ME
</span>
<span class="countclock" style="display:inline; position:absolute; top:0%; left:0%; color:red; font-size:100px ">
30
</span>
</span>
<span index="5">
What's the third test?
</span>
<span index="badend">
<span style="display:inline; position:absolute; top:30%; left:80%; color:white;" >
I'm not very happy with you. Hmph
</span>
<img onmouseover=playSong() src="http://www.pageresource.com/wallpapers/wallpaper/great-white-shark-cartelthemes_92092.jpg" height="1000" width="1800">
</span>
<span index="goodend">
Surprise! I've been working on it all the time!
But I don't think I'm very good at it...
<a onclick="bogosort()"><img src = "https://pbs.twimg.com/profile_images/580997733797863424/Drgj3NJz.jpg" height = "900px"/></a>
<span style = "display:inline; position:absolute; top:30%; left:50%; color:white; font-size: 20px">
Surprise! I've been working on it all the time!
But I don't think I'm very good at it...
</span>
</span>
<span class="console" style="display:block">
</span>
</span>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.5.3/modernizr.min.js" type="text/javascript"></script>
<script type="text/javascript">
var current_index = 1;
// page startup
function checkSupport()
{
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
return true;
} else {
return false;
}
}
function autorun()
{
if (checkSupport())
$('span[index="1"]').show();
else
$('span[index="nosupport"').show();
}
$(autorun);
function advance()
{
$('span[index="'+current_index+'"]').hide();
current_index++;
$('span[index="'+current_index+'"]').show();
if (current_index === 4)
{
initializePart4();
}
}
// code for part 1
var sortFile; // this is the variable where text will be loaded into
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
// files is a FileList of File objects. List some properties.
var output = [];
f = files[0];
var reader = new FileReader();
reader.onloadend = function(evt) {
if (evt.target.readyState == FileReader.DONE) { // DONE == 2
sortFile = evt.target.result;
advance();
setTimeout(advance, 5000); //advance to part 3
}
};
reader.readAsText(f);
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
// code for part 2
// This is a text only section, advancing is done by a timeout in part 1
// code for part 3
function toBadEnd() {
$('span[index="'+current_index+'"]').hide();
$('span[index="badend"]').show();
}
// code for part 4
var points=0;
var timervar;
function initializePart4()
{
$('.feedme').fadeOut(3000);
initializeMeat();
// create the count down clock
timervar = setInterval(function()
{
var count = parseInt($('.countclock').text());
count--;
$('.countclock').text(count);
if (count === 0)
toBadEnd();
},
1000)
}
function initializeMeat()
{
// create the meat
meat = $('.meat');
meat.click(function () {
$(this).remove()
points ++;
if ($('.meat').size() === 0)
{
clearInterval(timervar);
advance();
toGoodEnd();
}
})
for (var i =0; i < 25; i++)
meat.after(meat.clone(true, true));
$('.meat').each(function() {
$(this).css({ position: "absolute", top: ((Math.random() * 70) + 15) + "%", left: ((Math.random() * 70) + 15) + "%" });
}
)
}
// code for bad end
function playSong() {
var song = new Audio("jaws.mp3");
song.play();
}
// code for good end
//Processes the file (now in a string) in preperation for shitty sort
function toGoodEnd() {
$('span[index="'+current_index+'"]').hide();
$('span[index="goodend"]').show();
}
//Processes the file (now in a string) in preperation for shitty sort
function stringProcessor (sortFile)
{
//replace all non-alphanumeric char with a space
sortFile.replace(/\W+/g," ");
//splits the string in an array of words
var sortFileArray = sortFile.split(" ");
return sortFileArray
}
//Random shuffling of the file
function shuffle (sortFile)
{
//variables for the shuffling
var i = sortFile.length;
var j = Math.Floor(Math.random() * i);
//shuffling for loop
for(k = 0; k < sortFile.length; k++)
{
x = sortFile[--i];
v[i] = v[j];
v[j] = x;
}
return sortFile;
};
//Bogo sorts the file
function bogosort (){
var sortFileArray = stringProcessor(sortFile);
sortFileArray = shuffle(sortFileArray);
return sortFileArray;
}
</script>
</body>
</html>