Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (70 loc) · 3.38 KB
/
Copy pathindex.html
File metadata and controls
72 lines (70 loc) · 3.38 KB
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
<!DOCTYPE html>
<html lang="en">
<!-- Your website is in another castle! -->
<head>
<meta charset="utf-8" />
<title>Bowserstack</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="shortcut icon" href="icons/favicon.ico">
<link rel="apple-touch-icon" href="icons/apple-touch-icon.png">
<style>
*::-webkit-scrollbar { display: none; }
html, body { -ms-overflow-style: none; scrollbar-width: none; margin: 0; overflow-x: hidden; }
body { display: flex; flex-direction: column; align-items: center; }
#counter { position: fixed; bottom: 20px; right: 20px; background: rgba(0,0,0,.76); color: #fff; padding: 12px 20px; border-radius: 12px; font-family: system-ui, -apple-system, sans-serif; display: flex; flex-direction: column; align-items: flex-end; opacity: 0; transition: opacity .3s, transform .3s; z-index: 1000; pointer-events: none; box-shadow: 0 4px 15px rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.1); }
#counter.visible { opacity: 1; }
@keyframes glow { 0%, 100% { box-shadow: 0 4px 15px rgba(0,0,0,.3); transform: scale(1); border-color: rgba(255,255,255,.1); } 50% { box-shadow: 0 0 30px #FFBE21cc; transform: scale(1.15); border-color: #FFBE21cc; } }
.glow { animation: glow .8s cubic-bezier(.16, 1, 0.3, 1); }
.label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; margin-bottom: 2px; font-weight: 600; }
.value { font-size: 28px; font-weight: 800; line-height: 1; }
#stack img { width: 100%; max-width: 600px; height: auto; display: block; margin: 0 auto; }
</style>
</head>
<body>
<div id="stack"></div>
<div id="counter"><div class="label">Current Stack</div><div id="count" class="value">0</div></div>
<script>
const stack = document.getElementById('stack'), counter = document.getElementById('counter'), countDisplay = document.getElementById('count'), imgSrc = 'bowserstack.png';
let bowserHeight = 0, lastMilestone = 0;
const addImages = (n) => {
for (let i = 0; i < n; i++) {
const img = new Image();
img.src = imgSrc;
stack.appendChild(img);
if (i === 0 && !bowserHeight) img.onload = () => { bowserHeight = img.offsetHeight / 5; update(); };
}
};
const update = () => {
if (!bowserHeight) return;
const count = Math.floor(window.scrollY / bowserHeight);
if (count > 51) {
countDisplay.innerText = count.toLocaleString();
counter.classList.add('visible');
const milestone = Math.floor(count / 100);
if (milestone > lastMilestone) {
counter.classList.remove('glow');
void counter.offsetWidth;
counter.classList.add('glow');
lastMilestone = milestone;
}
} else {
counter.classList.remove('visible');
lastMilestone = 0;
}
};
addImages(20);
window.onscroll = () => {
update();
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - 2000) addImages(10);
};
window.onresize = () => {
const first = stack.querySelector('img');
if (first?.complete) bowserHeight = first.offsetHeight / 5;
update();
};
</script>
</body>
</html>