Files
RPG_Renan/index.html
ovosimpatico e592789f8a RPG v2
- Added a new song and image, which are triggered on countdown finish.
- Improved adaptive design.
- Disable control buttons as requested by client.
Signed-off-by: ovosimpatico <code.deleo@simplelogin.com>
2024-01-06 14:45:37 -03:00

122 lines
3.9 KiB
HTML

<!-- Feito por ovosimpatico -->
<!-- Made by ovosimpatico -->
<!-- Esse software é licenciado sob a licença AGPLv3. Para mais informações, leia o arquivo LICENSE ou acesse https://www.gnu.org/licenses/agpl-3.0.html -->
<!-- This software is licensed under AGPLv3 license. For more information, read LICENSE file or visit https://www.gnu.org/licenses/agpl-3.0.html -->
<!-- O código fonte desse site está disponível em: -->
<!-- The source code of this site is available at: -->
<!-- https://git.ovosimpatico.com/ovosimpatico/RPG_Renan -->
<!DOCTYPE html>
<html>
<head>
<title>RPG</title>
<link rel="icon" type="image/x-icon" href="image.png" />
<style>
body {
background-color: black;
text-align: center;
color: white;
font-family: monospace;
}
img {
max-width: 45%;
height: auto;
margin: 0 auto;
display: block;
}
#contador {
color: white;
font-size: 3vw;
}
@media (min-width: 500px) {
#contador {
font-size: 2vw;
}
}
</style>
</head>
<body>
<img src="image.png" />
<div id="contador">07:00:00</div>
<audio id="musica" src="song.mp3" loop></audio>
<br />
<!-- Desabilitado por pedido do cliente -->
<!-- <details>
<summary>Controles</summary>
<div id="controles">
<div>Playback</div>
<button onclick="document.getElementById('musica').play()">Play</button>
<button onclick="document.getElementById('musica').pause()">
Pause
</button>
<div>Volume</div>
<button onclick="diminuirVolume()">- Volume</button>
<button onclick="aumentarVolume()">+ Volume</button>
<br />
<div>Contador</div>
<button onclick="resetContador()">Resetar Contador</button>
<button onclick="pausarContador()">Pausar Contador</button>
</div>
</details> -->
<script>
console.log("Made by ovosimpatico");
console.log("This software is licensed under AGPLv3 license. For more information, read LICENSE file or visit https://www.gnu.org/licenses/agpl-3.0.html");
console.log("The source code of this site is available at: https://git.ovosimpatico.com/ovosimpatico/RPG_Renan");
let tempo = 25199;
let contadorPausado = false;
document.getElementById('musica').play()
function diminuirVolume() {
document.getElementById("musica").volume -= 0.1;
}
function aumentarVolume() {
document.getElementById("musica").volume += 0.1;
}
function resetContador() {
tempo = 25199;
}
function pausarContador() {
contadorPausado = !contadorPausado;
}
setInterval(() => {
if (!contadorPausado) {
let horas = String(Math.floor(tempo / 3600)).padStart(2, "0");
let minutos = String(Math.floor((tempo % 3600) / 60)).padStart(2, "0");
let segundos = String(tempo % 60).padStart(2, "0");
if (tempo === 0) {
// Pausar contador
contadorPausado = !contadorPausado;
// Trocar imagem
document.querySelector('img').src = 'image_final.png';
// Trocar música
musica.pause();
musica.currentTime = 0;
document.getElementById('musica').src = 'song_final.mp3';
musica.play();
}
document.getElementById("contador").innerHTML =
horas + ":" + minutos + ":" + segundos;
tempo--;
}
}, 1000);
</script>
</body>
</html>