-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathindex.html
691 lines (656 loc) · 29.5 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
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="utf-8" />
<title>De beste website ter wereld</title>
<meta
name="description"
content="Deze website wordt gebruikt voor een opdracht over GitHub in het lesmateriaal van CodeCrashers."
/>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="De beste website" />
<meta property="og:title" content="De beste website" />
<meta
property="og:description"
content="Deze website wordt gebruikt voor een opdracht over GitHub in het lesmateriaal van CodeCrashers."
/>
<meta
property="og:url"
content="https://codecrashersnl.github.io/beste-website/"
/>
<meta
property="og:image"
content="https://codecrashersnl.github.io/beste-website/images/favicon.png"
/>
<meta name="twitter:card" content="summary" />
<link rel="icon" type="image/png" href="images/favicon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cairo&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles/stylesheet.css" />
</head>
<body>
<div class="background"></div>
<div class="container">
<header>
<h1>🦄 De beste website ter wereld</h1>
<p>
Aan deze pagina mag iedereen zijn of haar content toevoegen.
</p>
<p>De spelregels:</p>
<ul>
<li>
Nieuwe content wordt altijd toegevoegd via goedgekeurde
pull requests.
<ul>
<li>
Lees de theorie in het lesmateriaal om te lezen
hoe dat werkt.
</li>
</ul>
</li>
<li>
Nieuwe stukken HTML code voeg je toe in een eigen
section-element.
<ul>
<li>
Op dezelfde wijze als de al bestaande
section(s).
</li>
</ul>
</li>
<li>
De code hoeft niet volgens de alom geldende goede smaak
of "best practices" te zijn.
<ul>
<li>
Zolang je code maar functioneert en de rest van
de pagina niet breekt.
</li>
</ul>
</li>
<li>
Je mag eerdere stukken code van andere developers niet
verwijderen.
<ul>
<li>
Je eigen content mag je natuurlijk wel aanpassen
achteraf, via een nieuwe pull request.
</li>
</ul>
</li>
<li>
Je toegevoegde content hoeft niet per se (alleen) uit
tekst te bestaan.
<ul>
<li>
Afbeeldingen, animaties, hyperlinks en video's
zijn ook prima.
</li>
</ul>
</li>
<li>
Discriminerende, beledigende of NSFW content is niet
toegestaan.
<ul>
<li>
Pull requests die dergelijke inhoud bevatten
worden per definitie geweigerd.
</li>
</ul>
</li>
<li>
Als je weet wat je doet mag je ook CSS gebruiken
toevoegen.
<ul>
<li>
Zorg er in dat geval wel voor dat je alleen je
eigen section aanspreekt middels een id.
</li>
</ul>
</li>
</ul>
</header>
<section id="animals" class="ferret">
<p>
<marquee>
🐀 🐁 🐂 🐃 🐄 🐅 🐆 🐇 🐈 🐉 🐊 🐋 🐌 🐍 🐎 🐏 🐐 🐑 🐒
🐕 🐖 🐘 🐙 🐚 🐛 🐜 🐝 🐞 🐟 🐠 🐡 🐢 🐤 🐦 🐧 🐩 🐪 🐫
🐬 🦀 🦂 🦃 🦅 🦆 🦇 🦈 🦉 🦋 🦌 🦍 🦎 🦏 🦐 🦑 🦔 🦕 🦖
🦗
</marquee>
</p>
</section>
<section>
<p>
wie houdt er nou niet van bananen!
</p>
</section>
<section>
<h1>leuke opdracht, veel plezier iedereen.</h1>
<h2>mvg koen😆</h2>
</section>
<section>
<p><strong>Suikoden II</strong> is de beste RPG voor de PS1!</p>
<img
src="images/Suikoden-II-HD-Remaster.jpg"
alt="Suikoden II HD Remaster"
width="960"
height="540"
/>
</section>
<section id="ferret" class="ferret">
<img src="images/ferret.jpg" alt="ferret" title="ferret" />
</section>
<section>
<h1>Leuke opdracht, good luck students!</h1>
<h2 class="animateDylan">Groetjes Dylan</h2>
</section>
<section id="cool-gifs">
<div class="row">
<div class="column">
<img
src="images/conway.gif"
title="Conway's Game of Life glider gun"
width="310"
/>
</div>
<div class="column">
<img
src="images/boids.gif"
title="Boids flocking behavior"
/>
</div>
</div>
</section>
<section>
<h2>This is a fun assignment!</h2>
<h3>Dit zijn mijn favoriete games:</h3>
<ol>
<li>
<a href="https://www.youtube.com/watch?v=gOE2BVRCUkM"
>God of War 4</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=c0i88t0Kacs"
>Witcher 3</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=cUuKIpCM2o0"
>Assassins Creed Origins</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=6eMhs6VFG0o"
>Doom eternal</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=Woe0PYZPxRw"
>Darksouls</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=LwZLBDUqxhg"
>Old school runescape</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=kB9uftJxxx4"
>Rocketleague</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=XeMc43i3YPA"
>SSX 3</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=mDYqT0_9VR4"
>League of legends</a
>
</li>
<li>
<a href="https://www.youtube.com/watch?v=FcFs9QEnvRo"
>Yu-Gi-Oh</a
>
</li>
</ol>
<h3>Greetings Jack :D</h3>
</section>
<section class="ferret">
<img src="images/ferret.jpg" width="960" height="540" />
</section>
<section class="ferret">
<img
src="images/ferret-sleepy-yawn.gif"
width="600"
height="500"
/>
</section>
<section>
<p>Dit is een testregel om te zien of alles klopt. test</p>
</section>
<section>
<h1>Dit is een test</h1>
<p>Dit is een paragraaf</p>
<img
src="images/ditiseenafbeelding.png"
alt="Dit is een afbeelding"
/>
</section>
<section>
<img src="images/goober.gif" width="600" height="500" />
</section>
<section>
<p><strong>Ratatouille</strong> film over ratten die koken</p>
<img
src="images/ratbeeld[23539].v3-VOANEWSDETAIL_62.jpg"
alt="Ratatouille"
width="960"
height="540"
/>
</section>
<section>
<img
src="https://upload.wikimedia.org/wikipedia/en/thumb/0/05/PSV_Eindhoven.svg/1200px-PSV_Eindhoven.svg.png"
alt="PSV"
/>
</section>
<section>
<p>Marijn is de beste</p>
</section>
<section>
<p>Dit is een ode aan Jos.</p>
<img
src="https://waarnemingen.be/media/photo/1147658.jpg"
alt="Geoorde fuut"
/>
</section>
<section>
<h1>20 Years of ME!!!</h1>
<p>
Today - as in, the day and date I'm writing (and uploading)
this - is my 20th birthday!
</p>
<p>
As a little means to celebrate with y'all, here's
<a
href="https://open.spotify.com/playlist/7HExOpdLUd04D7UeqC13oF?si=_4plPpbTwi0k3Spul-HSw"
>one of my more elaborate Spotify playlists</a
>. Enjoy!
</p>
<p>
Signed,<img
src="images/BorgzTDC_emblem.png"
title="My personal emblem!"
alt="Emblem of the author of this section."
style="
width: 150px;
float: right;
position: relative;
bottom: 20px;
"
/><br />Rens Tamerus.
</p>
</section>
<section>
<img
src="images/noot.gif"
alt="noot noot!"
width="600"
height="500"
/>
</section>
<section>
<h1>hoo hoo haa ha hoo "rips out your organs"</h1>
<img src="images/monke.jpg" alt="hee hee hoo hoo" />
</section>
<section>
<p class="ferret">
<strong>Vukovi</strong> is de een hele goede alt rock band.
luister er naar!
</p>
<img
src="images/vukovi.jpg"
alt="Vukovi"
class="ferret"
width="960"
height="540"
/>
</section>
<section>
<p>
Humans have asked us to play by their rules, well the rules
have just changed
</p>
<img src="images/Optimus-Prime.jpg" alt="Optimus Prime" />
</section>
<section>
<img src="images/polite-cat.jpg" alt="Een hele beleefde kat" />
</section>
<section>
<img src="images/mochi-cat.jpg" alt="Kitty met boba tea" />
</section>
<section>
<img
src="images/funny-adhdinos-comics-30-608x608.jpg"
alt="adhd comic"
/>
</section>
<section>
<img src="images/poes.jpg" alt="Sleepy Kitty">
</section>
<section>
<p><strong>buh</strong></p>
<img
src="images/TQqwfCxg.png"
alt="buh"
width="960"
height="540"
/>
</section>
<section>
<p>Je moet vast moe zijn van al dat scrollen. Hier, neem een perenijsje!</p>
<img src="images/perenijsje.jpeg" alt="perenijsje" width="50%" height="50%"/>
</section>
<section>
<h3>Dit zijn mijn favoriete games</h3>
<ol>
<li><a href="https://nl.wikipedia.org/wiki/The_Legend_of_Zelda:_Tears_of_the_Kingdom">The Legend of Zelda: Tears of the Kingdom</a></li>
<li><a href="https://nl.wikipedia.org/wiki/Hogwarts_Legacy">Hogwarts Legacy</a></li>
<li><a href="https://nl.wikipedia.org/wiki/The_Legend_of_Zelda:_Breath_of_the_Wild">The Legend of Zelda: Breath of the Wild</a></li>
<li><a href="https://nl.wikipedia.org/wiki/The_Legend_of_Zelda:_Twilight_Princess">The Legend of Zelda: Twilight Princess</a></li>
<li><a href="https://nl.wikipedia.org/wiki/Super_Mario_Odyssey">Super Mario Odyssey</a></li>
</ol>
<h3>Ik speel op dit moment</h3>
<a href="https://nl.wikipedia.org/wiki/Horizon_Zero_Dawn">
<img src="images/hzd.webp" alt="Horizon Zero Dawn" height="50%" width="50%" />
</a>
</section>
<section>
<p>h</p>
</section>
<section>
<iframe width="1232" height="693" src="https://www.youtube.com/embed/PE2YZhcC4NY?si=bwE1-ufDS44Aq3s_" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<div style="text-align: center;">
<img
src="images/mc_icon.png"
alt="huh"
width="420"
height="420"
/>
<img
src="images/huh.png"
alt="huh"
width="420"
height="420"
/>
</div>
</section>
<section>
<img src="images/fatasscat.jpg" width="500" height="500"/>
</section>
<section>
<img
src="images/solid-snake-solid.gif"
alt="no that is not solid snake gif from metal gear solid 2"
class="center"
>
</section>
<section style = background-color:black;>
<h1 style = color:white;> Chew on this </h1>
<img src="images/Chewy.jpg">
</section>
<section>
<h3>what a cool website</h3>
</section>
<section>
<h3 class="codingwithcat">coding with cattitude</h3>
<img src="images/javascratch.gif"
alt="kat die op laptop typt"
class="javascratch"
>
</section
>
<section id="Write-A-Storry">
<div id="Write-A-Storry_form">
<dialog open="true" id="Write-A-Storry_form_dialog">
<h2>schrijf je eigen verhaal</h2>
<p>beantwoord de vragen hieronder om je eigen verhaal te schrijven. gemaakt met aleen css en html.</p>
<form method="dialog">
<label for="name" >je eigen naam of een random naam.</label><br>
<input type="text" name="name" placeholder="jantje" oninput="document.getElementById('Write-A-Storry_story_name').innerText = this.value" id="Write-A-Storry_form_name">
<br>
<label for="place" >een plaats.</label><br>
<input type="text" name="place" placeholder="amsterdam" oninput="document.getElementById('Write-A-Storry_story_place').innerText = this.value" id="Write-A-Storry_form_name">
<br>
<label for="store" >naam van een winkel.</label><br>
<input type="text" name="store" placeholder="dirk" oninput="document.getElementById('Write-A-Storry_story_store').innerText = this.value" id="Write-A-Storry_form_store">
<br>
<label for="product" >naam van een product.</label><br>
<input type="text" name="product" placeholder="chips" oninput="document.getElementById('Write-A-Storry_story_product').innerText = this.value" id="Write-A-Storry_form_product">
<br>
<label for="products" >type een paar producten.</label><br>
<textarea name="products" placeholder="aardapels, bannaanen en peren" oninput="document.getElementById('Write-A-Storry_story_products').innerText = this.value" id="Write-A-Storry_form_products"></textarea>
<br>
<label for="product" >naam van een beroep.</label><br>
<input type="text" name="product" placeholder="leerraar" oninput="document.getElementById('Write-A-Storry_story_job').innerText = this.value" id="Write-A-Storry_form_job">
<br>
<label for="end" >antwoord met wel of niet: ben je blij vandaag?</label><br>
<input type="text" name="end" placeholder="wel" oninput="document.getElementById('Write-A-Storry_story_end').innerText = this.value" id="Write-A-Storry_form_end">
<br>
<input type="submit" value="start" id="Write-A-Storry_form_submit">
</form>
</dialog>
</div>
<div id="Write-A-Storry_story">
<p>een man genaamd <span id="Write-A-Storry_story_name">jantje</span> liep in <span id="Write-A-Storry_story_place">amsterdam</span>.
toen kwam hij bij de <span id="Write-A-Storry_story_store">dirk</span>.
hij liep naar binnen en zag <span id="Write-A-Storry_story_product">chips</span>. hij deed dat in zijn zak. hij haalde ook nog <span id="Write-A-Storry_story_products">aardapels, bannaanen en peren</span>.
hij deed deze producten in een mandje en ging naar de kassa hij rekende alle producten af. maar niet wat in zijn zak zit. toen rende hij naar buiten. maar hij werd achtervolgt door een <span id="Write-A-Storry_story_job">leeraar</span>.
na uren rennen wist hij uitijndelijk <span id="Write-A-Storry_story_end">niet</span> te ontkomen.
</p>
</div>
<br>
</section>
<section>
<style>
/* Container for grid */
.grid-container {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(3, 100px);
gap: 5px;
justify-content: center;
align-items: center;
color: aliceblue;
}
/* Each individual cube */
.cube {
width: 100px;
height: 100px;
background-color: #3ab3ff;
display: flex;
justify-content: center;
align-items: center;
border: 2px solid rgb(62, 146, 215);
cursor: pointer;
transition: background-color 0.3s;
box-shadow: 0px 0px 5px rgb(85, 85, 85);
border-radius: 5px;
}
/* Hover effect */
.cube:hover {
background-color: rgb(178, 233, 255);
}
.cube:active {
background-color: #3ab3ff;
}
.cubeClickAnimation {
animation: bounce 0.25s both;
}
/* Flash effect */
.flash {
background-color: rgb(0, 123, 255) !important;
}
/* Disabled state when user cannot click during sequence */
.disabled {
pointer-events: none;
}
.fancyText {
font-size: large;
font-weight: bold;
}
@keyframes bounce {
0% {
transform: scale(100%);
}
50% {
transform: scale(90%);
}
100% {
transform: scale(100%);
}
}
</style>
<div style="text-align: center;">
<h1>Memory Game</h1>
<div class="grid-container" id="grid-container">
<!-- Cube here -->
</div>
<button id="startBtn" class="fancyText">Start Game</button>
<p id="status" class="fancyText">Click "Start Game" to begin!</p>
</div>
<script> // Script area
const gridContainer = document.getElementById('grid-container');
const startBtn = document.getElementById('startBtn');
const status = document.getElementById('status');
// Function to generate the grid
function generateGrid(rows, cols) {
gridContainer.innerHTML = ''; // Clear existing cubes
for (let i = 1; i <= rows * cols; i++) {
const cube = document.createElement('div');
cube.classList.add('cube');
cube.setAttribute('data-id', i);
cube.textContent = `◯`;
cube.style.fontWeight = 'Bold';
// Add click event to each cube
cube.addEventListener('click', () => {
handleUserClick(cube);
cube.classList.add("cubeClickAnimation");
setTimeout(() => {
cube.classList.remove("cubeClickAnimation");
}, 250);
});
gridContainer.appendChild(cube);
}
}
// SetTimeout delays
let delay = 750;
let flashTime = 500;
// Game variables
let userSequence = [];
let gameSequence = [];
let gameActive = false
let round = 1;
// Handle user click during game sequence
function handleUserClick(cube) {
const cubeId = parseInt(cube.getAttribute('data-id'));
userSequence.push(cubeId);
if (userSequence[userSequence.length - 1] !== gameSequence[userSequence.length - 1]) {
// incorrect click
status.innerHTML = 'Wrong sequence, game over!<br>Click "Start Game" to play again!';
resetGame();
return;
}
if (userSequence.length === gameSequence.length) {
if (userSequence.length === 5) {
status.innerHTML = 'You won the game, congratulations!<br>Click "Start Game" to play again!';
// Ah feck it, why even optimize code anyways? Don't fix what ain't broken
flashAllCubes();
setTimeout(flashAllCubes,450)
setTimeout(resetGame,600)
} else {
// Move to next round
disableUserInput();
round++;
status.textContent = `Round ${round}`;
userSequence = [];
setTimeout(startRound, delay); // Start next round after delay
}
}
}
// Start new round by adding a new cube to the sequence
function startRound() {
gameSequence.push(Math.floor(Math.random() * 9) + 1); // Random cube ID between 1 and 9
showSequence(gameSequence);
}
// Flash cubes in the sequence
function showSequence(sequence) {
let i = 0;
const interval = setInterval(() => {
flashCube(sequence[i]);
i++;
if (i >= sequence.length) {
clearInterval(interval);
setTimeout(enableUserInput,flashTime);
}
}, delay);
}
// Flash a cube
function flashCube(id) {
const cube = document.querySelector(`.cube[data-id="${id}"]`);
cube.classList.add('flash');
setTimeout(() => {
cube.classList.remove('flash');
}, flashTime);
}
// Flash all cubes when round has been won
function flashAllCubes() {
for (let i = 1; i <= 9; i++) {
const cube = document.querySelector(`.cube[data-id="${i}"]`);
cube.classList.add('flash');
setTimeout(() => {
cube.classList.remove('flash');
}, 200);
}
}
// Enable clicking after sequence finishes
function enableUserInput() {
userSequence = [];
gridContainer.classList.remove('disabled');
}
// Disable clicking while sequence is flashing
function disableUserInput() {
gridContainer.classList.add('disabled');
}
// Reset game
function resetGame() {
gameActive = false
gameSequence = [];
round = 1;
disableUserInput();
}
// Start button
startBtn.addEventListener('click', () => {
if (gameActive == false) {
gameActive = true
gameSequence = [];
round = 1;
status.textContent = `Round ${round}`;
generateGrid(3, 3);
setTimeout(startRound, delay); // Start first round after delay
disableUserInput(); // Disable user input until first round starts
}
});
</script>
</section>
</div>
</body>
</html>