Skip to content

Commit bd24c6c

Browse files
authored
Add files via upload
1 parent 14cbecf commit bd24c6c

1 file changed

Lines changed: 36 additions & 39 deletions

File tree

void-star/index.html

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
<meta charset="UTF-8">
55
<title>Mercwar Void Star</title>
66

7-
<script>
8-
// Generates "YYYY-MM-DD"
9-
const d = new Date();
10-
const v = d.toISOString().split('T')[0];
11-
12-
document.write(`<link rel="stylesheet" href="index.css?v=${v}">`);
13-
document.write(`<link rel="stylesheet" href="ui.css?v=${v}">`);
14-
document.write(`<link rel="stylesheet" href="fire-gem-orb.css?v=${v}">`);
15-
</script>
7+
<link rel="stylesheet" href="index.css?v=124">
8+
<link rel="stylesheet" href="ui.css?v=123">
9+
<link rel="stylesheet" href="fire-gem-orb.css?123">
1610

1711
<!-- ===== AVIS / CONSTELLATION META CORE ===== -->
1812
<meta name="meta" content="AVIS-CONSTELLATION">
@@ -135,40 +129,43 @@ <h1>Void Star</h1>
135129
<script src="index.js?v=10"></script>
136130

137131
<script>
138-
(function () {
139-
const OFFSET = 170;
140-
const TARGET_ID = "topDivider";
141-
142-
window.addEventListener("load", () => {
143-
144-
// Don't auto-scroll inside an iframe.
145-
if (window.self !== window.top) {
146-
return;
147-
}
148-
149-
// Wait until layout settles.
150-
requestAnimationFrame(() => {
151-
requestAnimationFrame(() => {
152-
153-
const target = document.getElementById(TARGET_ID);
154-
if (!target) return;
155-
156-
const y = target.getBoundingClientRect().top +
157-
window.pageYOffset +
158-
OFFSET;
159-
160-
window.scrollTo({
161-
top: y,
132+
window.addEventListener("load", () => {
133+
const anchor = document.getElementById("jump_scroll");
134+
if (!anchor) return;
135+
136+
// First scroll into view
137+
anchor.scrollIntoView({
138+
behavior: "smooth",
139+
block: "start"
140+
});
141+
142+
let lastPos = -1;
143+
let stableCount = 0;
144+
145+
function validateScroll() {
146+
const currentPos = window.scrollY;
147+
148+
if (currentPos === lastPos) {
149+
stableCount++;
150+
// Require stability for ~20 frames (~300ms at 60fps)
151+
if (stableCount >= 20) {
152+
// Apply final offset once validated
153+
window.scrollBy({
154+
top: 136,
162155
behavior: "smooth"
163156
});
157+
return; // stop loop after final scroll
158+
}
159+
} else {
160+
stableCount = 0; // reset if movement detected
161+
}
164162

165-
});
166-
});
163+
lastPos = currentPos;
164+
requestAnimationFrame(validateScroll);
165+
}
167166

168-
}, { once: true });
169-
})();
167+
requestAnimationFrame(validateScroll);
168+
});
170169
</script>
171-
172-
173170
</body>
174171
</html>

0 commit comments

Comments
 (0)