https://developer.chrome.com/blog/autoplay also added charset to meta tag Signed-off-by: ovosimpatico <code.deleo@simplelogin.com>
134 lines
4.0 KiB
HTML
134 lines
4.0 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" />
|
|
<meta charset="utf-8" />
|
|
<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;
|
|
}
|
|
|
|
details {
|
|
color: white;
|
|
font-size: 1.5vw;
|
|
}
|
|
|
|
button {
|
|
font-size: 1.5vw;
|
|
/* grey */
|
|
background-color: #808080;
|
|
}
|
|
|
|
@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 />
|
|
|
|
|
|
<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> |