-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanim.js
More file actions
32 lines (26 loc) · 1003 Bytes
/
Copy pathanim.js
File metadata and controls
32 lines (26 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Animar las letras
function updateLyrics() {
var time = Math.floor(audio.currentTime);
var currentLine = lyricsData.find(
(line) => time >= line.time && time < line.time + 6
);
if (currentLine) {
// Calcula la opacidad basada en el tiempo en la línea actual
var fadeInDuration = 0.1; // Duración del efecto de aparición en segundos
var opacity = Math.min(1, (time - currentLine.time) / fadeInDuration);
} else {
// Restablece la opacidad y el contenido si no hay una línea actual
lyrics.style.opacity = 0;
lyrics.innerHTML = "";
}
}
//funcion titulo
// Función para ocultar el título después de 216 segundos
function ocultarTitulo() {
var titulo = document.querySelector(".titulo");
titulo.style.animation =
"fadeOut 3s ease-in-out forwards"; /* Duración y función de temporización de la desaparición */
setTimeout(function () {
titulo.style.display = "none";
}, 3000); // Espera 3 segundos antes de ocultar completamente
}