WIP: The MuSiCaL Update #1
BIN
Music/vault1.mid
Normal file
BIN
Music/vault1.mid
Normal file
Binary file not shown.
BIN
Music/vault2.mid
Normal file
BIN
Music/vault2.mid
Normal file
Binary file not shown.
BIN
Music/vault3.mid
Normal file
BIN
Music/vault3.mid
Normal file
Binary file not shown.
@@ -90,4 +90,51 @@
|
||||
<p class=quote>run by your cat overlords here at neocities.</p>
|
||||
<a href=/CAT.html> <img src="/cat overlord.png"> </a>
|
||||
</body>
|
||||
<script>
|
||||
function randinte() {
|
||||
//this is actually code from minima and its absolutely NOT made for this BUT WHO CARES????
|
||||
//@ts-check
|
||||
console.log("yo whatap")
|
||||
console.log("picking a song...")
|
||||
let min = 0
|
||||
let max = 3
|
||||
let scarynumber = Math.random() * (max - min + 1) + min;
|
||||
let randint = Math.round(scarynumber)
|
||||
if (randint > max) {
|
||||
console.warn("number is bigger than ", max)
|
||||
console.warn("running it back")
|
||||
randinte()
|
||||
}
|
||||
let song = "Music/vault" + randint + ".mid"
|
||||
}
|
||||
//randomize the songmabobers
|
||||
//just in case the user has autoplay disabled because they probably do
|
||||
MIDIjs.play(song, true);
|
||||
//idk if it's playing
|
||||
isplaying = "idk"
|
||||
//random ahh google code
|
||||
MIDIjs.player_callback = function(event) {
|
||||
// Check if event object contains time (indicating playback)
|
||||
if (event && event.time !== undefined) {
|
||||
isplaying = "true";
|
||||
} else {
|
||||
isplaying = "false";
|
||||
}
|
||||
};
|
||||
var apbox = document.getElementById("autoplay");
|
||||
console.log("waiting a bit for midijs")
|
||||
setTimeout(function(){
|
||||
checkAudio()
|
||||
}, 5000)
|
||||
function checkAudio() {
|
||||
if (isplaying == "false") {
|
||||
console.log("music isn't playing. i blame chrome")
|
||||
document.getElementById("autoplay").innerHTML = "<p>Music is playing, but your autoplay is turned off.</p><noscript>JS is off, MIDIjs won't be able to play audio anyways.</noscript> <button onclick=MIDIjs.play(song, true)>Play Music</button>"
|
||||
} else if (isplaying == "true"){
|
||||
console.log("music do be the playing")
|
||||
} else if (isplaying == "idk") {
|
||||
console.warn("idk if there be music")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user