New Spin Music

This commit is contained in:
bingus_violet 2024-06-03 01:01:48 -05:00
parent cbc8fd427a
commit 0a1089a4f6
3 changed files with 11 additions and 11 deletions

Binary file not shown.

View file

@ -19,10 +19,10 @@ const discStatuses = {
var pfp var pfp
var catsOnMars = new Audio("/snds/cats on mars.mp3") var music = new Audio("/snds/Lotus Waters.ogg")
var whipLash = new Audio("/snds/johnny-test-whip-crack.mp3") var whipLash = new Audio("/snds/johnny-test-whip-crack.mp3")
catsOnMars.loop = true music.loop = true
catsOnMars.volume = 0.25 music.volume = 0.45
whipLash.volume = 0.25 whipLash.volume = 0.25
var sock var sock
@ -42,20 +42,20 @@ function spinLoop() {
spinWaiting = true spinWaiting = true
setTimeout(() => { setTimeout(() => {
spinWaiting = false spinWaiting = false
if (!catsOnMars.paused) { if (!music.paused) {
if (spins > 1) { if (spins > 1) {
document.querySelector(".spinnyCount").style.display = "block" document.querySelector(".spinnyCount").style.display = "block"
document.querySelector(".localSpins").innerHTML = Math.ceil(spins - 1); document.querySelector(".localSpins").innerHTML = Math.ceil(spins - 1);
} }
spins += 0.5 spins += 0.5
if (Math.round(spins) == spins && sock && sock.OPEN) { if (Math.round(spins) == spins && sock && sock.OPEN) {
resetPFP() // resetPFP()
sock.send(`{"op": 4}`) sock.send(`{"op": 4}`)
console.log("Spin Sent!") console.log("Spin Sent!")
} }
spinLoop() spinLoop()
} }
}, 1000); }, 1500);
} }
window.onbeforeunload = function () { window.onbeforeunload = function () {
@ -71,7 +71,7 @@ window.onload = function () {
if (!spinWaiting) { if (!spinWaiting) {
spinLoop(); spinLoop();
} }
catsOnMars.play() music.play()
pfp.style.animationName = "spinny" pfp.style.animationName = "spinny"
@ -79,9 +79,9 @@ window.onload = function () {
}) })
document.body.onmouseup = () => { document.body.onmouseup = () => {
if (catsOnMars.currentTime != 0) { if (music.currentTime != 0) {
catsOnMars.currentTime = 0 music.currentTime = 0
catsOnMars.pause() music.pause()
whipLash.currentTime = 0 whipLash.currentTime = 0
whipLash.play() whipLash.play()

View file

@ -56,7 +56,7 @@
rotate: 0deg; rotate: 0deg;
user-select: none; user-select: none;
animation-duration: 2s; animation-duration: 3s;
animation-timing-function: linear; animation-timing-function: linear;
animation-iteration-count: infinite; animation-iteration-count: infinite;
} }