Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexatunes authored May 22, 2024
1 parent 14720fe commit 659cb50
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
43 changes: 43 additions & 0 deletions scripts/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
function actuallySwitchTeambuilder(){
location.href = "/teambuilder.html";
}

function intoFinished(){
document.getElementById("padTrans").style.display = "none";
}

function switchTeambuilder(){
document.getElementById("padTrans").style.display = "block";
document.getElementById("padTrans").style.animation = "fadeIn 1s";
setTimeout(actuallySwitchTeambuilder, 1000)
}

const songs = ["Harrisville.mp3", "Springdale.mp3", "Blossom.mp3"]

function startGame(){
document.getElementById("startMenu").style.display = "none";
const randomSong = Math.floor(Math.random() * songs.length);
const path = "/audios/music/" + songs[randomSong];
document.getElementById("bgm").src = path;
document.getElementById("bgm").play()
document.getElementById("bgm").volume = 0.5
}

var musicPlaying = true;

function toggleMusic(){
if(musicPlaying){
document.getElementById("toggleMusic").src = "/images/musicOFF.png";
document.getElementById("bgm").volume = 0.0;
musicPlaying = false;
}else{
document.getElementById("toggleMusic").src = "/images/musicON.png";
document.getElementById("bgm").volume = 0.5;
musicPlaying = true;
}
}

function hidePad(){
document.getElementById("padTrans").style.animation = "fadeOut 1s";
setTimeout(intoFinished, 1000)
}
26 changes: 26 additions & 0 deletions scripts/teambuilder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function actuallySwitchHome(){
location.href = "/";
}

function intoFinished(){
document.getElementById("padTrans").style.display = "none";
}

function switchHome(){
document.getElementById("padTrans").style.display = "block";
document.getElementById("padTrans").style.animation = "fadeIn 1s";
setTimeout(actuallySwitchHome, 1000)
}

const songs = ["Harrisville.mp3", "Springdale.mp3", "Blossom.mp3"]

function setUp(){
const randomSong = Math.floor(Math.random() * songs.length);
const path = "/audios/music/" + songs[randomSong];
document.getElementById("bgm").src = path;
document.getElementById("bgm").play()
document.getElementById("bgm").volume = 0.5

document.getElementById("padTrans").style.animation = "fadeOut 1s";
setTimeout(intoFinished, 1000)
}

0 comments on commit 659cb50

Please sign in to comment.