-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
108 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-image: url("background2.jpg"); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
color:white; | ||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); | ||
|
||
font-family: Arial, sans-serif; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-image: url("background2.jpg"); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
color: white; | ||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.menu { | ||
text-align: center; | ||
text-align: center; | ||
} | ||
|
||
h1 { | ||
font-size: 36px; | ||
margin-bottom: 20px; | ||
font-size: 36px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
button { | ||
padding: 10px 20px; | ||
font-size: 18px; | ||
background-color: #3498db; | ||
color: #fff; | ||
border: solid; | ||
cursor: pointer; | ||
border-radius: 1em; | ||
} | ||
padding: 10px 20px; | ||
font-size: 18px; | ||
background-color: #3498db; | ||
color: #fff; | ||
border: solid; | ||
cursor: pointer; | ||
border-radius: 1em; | ||
} | ||
|
||
button:hover { | ||
background-color: #2980b9; | ||
background-color: #2980b9; | ||
} | ||
|
||
main { | ||
padding: 2em; | ||
background-color: rgba(0,0,0,0.4); | ||
} | ||
padding: 2em; | ||
background-color: rgba(0, 0, 0, 0.4); | ||
} | ||
|
||
img { | ||
height: 5em; | ||
width: 5em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
var musicState = localStorage.getItem("musicState"); | ||
var mute = document.getElementById("mute"); | ||
var muteText = '<img src="./mute.jpg" alt="Mute/Unmute">'; | ||
var playingText = '<img src="./volume.jpg" alt="Mute/Unmute">' | ||
|
||
var backgroundMusic = document.getElementById("backgroundMusic"); | ||
volumeControl.addEventListener('input', function() { | ||
backgroundMusic.volume = volumeControl.value; | ||
}); | ||
|
||
// Pausar la música | ||
function pauseMusic() { | ||
backgroundMusic.pause(); | ||
localStorage.setItem("musicState", "paused"); | ||
mute.innerHTML = muteText; | ||
} | ||
|
||
// Detener la música | ||
function stopMusic() { | ||
backgroundMusic.pause(); | ||
backgroundMusic.currentTime = 0; | ||
localStorage.setItem("musicState", "paused"); | ||
mute.innerHTML = "Stopped"; | ||
} | ||
|
||
// Reproducir la música | ||
function playMusic() { | ||
backgroundMusic.play(); | ||
localStorage.setItem("musicState", "playing"); | ||
mute.innerHTML = playingText; | ||
} | ||
|
||
// Restaura el estado de la música | ||
if (musicState === "playing") { | ||
playMusic(); | ||
} else if (musicState === "paused") { | ||
pauseMusic(); | ||
} | ||
|
||
window.addEventListener('load', function () { | ||
if(musicState === "playing"){ | ||
playMusic(); | ||
mute.innerHTML = playingText; | ||
} | ||
}); | ||
|
||
function music(){ | ||
if (backgroundMusic.paused) { | ||
playMusic(); | ||
} else { | ||
pauseMusic(); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,9 @@ body { | |
display:grid; | ||
grid-row-gap:1em; | ||
text-align: center; | ||
} | ||
|
||
img{ | ||
height: 5em; | ||
width: 5em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.