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>
This commit is contained in:
BIN
image_final.png
Normal file
BIN
image_final.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
49
index.html
49
index.html
@@ -18,14 +18,25 @@
|
||||
background-color: black;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 400px;
|
||||
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>
|
||||
@@ -33,11 +44,13 @@
|
||||
<body>
|
||||
<img src="image.png" />
|
||||
|
||||
<div id="contador">02:00:00</div>
|
||||
<div id="contador">07:00:00</div>
|
||||
|
||||
<audio id="musica" src="song.mp3" loop></audio>
|
||||
<br />
|
||||
<details>
|
||||
|
||||
<!-- Desabilitado por pedido do cliente -->
|
||||
<!-- <details>
|
||||
<summary>Controles</summary>
|
||||
<div id="controles">
|
||||
<div>Playback</div>
|
||||
@@ -53,10 +66,16 @@
|
||||
<button onclick="resetContador()">Resetar Contador</button>
|
||||
<button onclick="pausarContador()">Pausar Contador</button>
|
||||
</div>
|
||||
</details>
|
||||
</details> -->
|
||||
|
||||
<script>
|
||||
let tempo = 7200;
|
||||
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;
|
||||
@@ -67,7 +86,7 @@
|
||||
}
|
||||
|
||||
function resetContador() {
|
||||
tempo = 7200;
|
||||
tempo = 25199;
|
||||
}
|
||||
|
||||
function pausarContador() {
|
||||
@@ -76,9 +95,21 @@
|
||||
|
||||
setInterval(() => {
|
||||
if (!contadorPausado) {
|
||||
let horas = Math.floor(tempo / 3600);
|
||||
let minutos = Math.floor((tempo % 3600) / 60);
|
||||
let segundos = tempo % 60;
|
||||
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;
|
||||
|
||||
BIN
song_final.mp3
Normal file
BIN
song_final.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user