feat: fix skeleton to skeleton3 only, remove switcher

This commit is contained in:
ltadeu6 2026-06-07 12:20:44 -03:00
parent 6e178837d2
commit 93d0cb87e7
No known key found for this signature in database
GPG key ID: FB9FDAB6B6F3418D

View file

@ -771,7 +771,7 @@ html, body {
<!-- ===================== ROBOT ===================== --> <!-- ===================== ROBOT ===================== -->
<div class="robot-wrap"> <div class="robot-wrap">
<div class="beat-wrap"> <div class="beat-wrap">
<img src="skeleton4.apng" class="skeleton-gif" alt="skeleton"> <img src="skeleton3.apng" class="skeleton-gif" alt="skeleton">
<div class="robot-shadow"></div> <div class="robot-shadow"></div>
</div> </div>
</div><!-- .robot-wrap --> </div><!-- .robot-wrap -->
@ -1134,26 +1134,7 @@ function nextDanceStyle() {
document.body.setAttribute('data-dance', 'bounce'); document.body.setAttribute('data-dance', 'bounce');
setInterval(nextDanceStyle, 8000); setInterval(nextDanceStyle, 8000);
/* ============================================================ function pickSkeleton() {}
SKELETON SWITCHER
Add new files to SKELETONS to include them in the rotation.
Switches on music change and randomly every 16 beats (8s).
============================================================ */
const SKELETONS = ['skeleton2.apng', 'skeleton3.apng', 'skeleton4.apng', 'skeleton5.apng', 'skeleton6.apng'];
const skeletonImg = document.querySelector('.skeleton-gif');
let currentSkel = 2;
// Preload all skeletons so switches are instant
const _preloaded = SKELETONS.map(src => { const i = new Image(); i.src = src; return i; });
function pickSkeleton() {
if (SKELETONS.length < 2) return;
let next;
do { next = Math.floor(Math.random() * SKELETONS.length); }
while (next === currentSkel);
currentSkel = next;
skeletonImg.src = SKELETONS[currentSkel];
}
/* ============================================================ /* ============================================================