feat: fix skeleton to skeleton3 only, remove switcher
This commit is contained in:
parent
6e178837d2
commit
93d0cb87e7
1 changed files with 2 additions and 21 deletions
|
|
@ -771,7 +771,7 @@ html, body {
|
|||
<!-- ===================== ROBOT ===================== -->
|
||||
<div class="robot-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>
|
||||
</div><!-- .robot-wrap -->
|
||||
|
|
@ -1134,26 +1134,7 @@ function nextDanceStyle() {
|
|||
document.body.setAttribute('data-dance', 'bounce');
|
||||
setInterval(nextDanceStyle, 8000);
|
||||
|
||||
/* ============================================================
|
||||
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];
|
||||
}
|
||||
function pickSkeleton() {}
|
||||
|
||||
|
||||
/* ============================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue