-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
133 lines (111 loc) · 4.06 KB
/
script.js
File metadata and controls
133 lines (111 loc) · 4.06 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
window.addEventListener("load", () => {
const loader = document.getElementById("loader");
setTimeout(() => {
loader.style.display = "none";
document.body.style.overflow = "auto";
}, 3000);
});
const usuarioEmail = localStorage.getItem("usuarioEmail");
const emailTexto = document.getElementById("email-text");
const notificacao = document.getElementById("notification");
if (usuarioEmail) {
emailTexto.innerText = usuarioEmail;
if (!localStorage.getItem("notificacaoExibida")) {
notificacao.style.display = "block";
localStorage.setItem("notificacaoExibida", "true");
} else {
notificacao.style.display = "none";
}
} else {
emailTexto.innerText = "";
}
function logout() {
localStorage.removeItem("usuarioEmail");
localStorage.removeItem("notificacaoExibida");
window.location.href = "../login/index.html";
}
function closeNotification() {
notificacao.style.display = "none";
}
const elementoTexto = document.getElementById("textoDigitando");
const textos = [
"TableFlix",
"OS MELHORES FILMES E SÉRIES SÃO AQUI!!"
];
let textoIndex = 0;
let letraIndex = 0;
let apagando = false;
function digitar() {
const textoAtual = textos[textoIndex];
if (!apagando) {
if (letraIndex <= textoAtual.length) {
let textoParcial = textoAtual.substring(0, letraIndex);
if (textoIndex === 0) {
const table = textoParcial.substring(0, 5);
const flix = textoParcial.substring(5);
elementoTexto.innerHTML = `${table}<span class="flix">${flix}</span>`;
} else {
elementoTexto.textContent = textoParcial;
}
letraIndex++;
setTimeout(digitar, 80);
} else {
setTimeout(() => {
apagando = true;
digitar();
}, 1500);
}
} else {
if (letraIndex >= 0) {
let textoParcial = textoAtual.substring(0, letraIndex);
if (textoIndex === 0) {
const table = textoParcial.substring(0, 5);
const flix = textoParcial.substring(5);
elementoTexto.innerHTML = `${table}<span class="flix">${flix}</span>`;
} else {
elementoTexto.textContent = textoParcial;
}
letraIndex--;
setTimeout(digitar, 50);
} else {
apagando = false;
textoIndex = (textoIndex + 1) % textos.length;
setTimeout(digitar, 500);
}
}
}
document.addEventListener("DOMContentLoaded", () => {
digitar();
});
const modalFilme = document.getElementById("modalFilme");
const modalImagem = document.getElementById("modalImagem");
const modalTitulo = document.getElementById("modalTitulo");
const modalDescricao = document.getElementById("modalDescricao");
const modalLink = document.getElementById("modalLink");
const imagensFilmes = document.querySelectorAll(".filmesDestaque img, .filmes img, .series img");
imagensFilmes.forEach((img) => {
img.addEventListener("click", () => {
modalImagem.src = img.src;
modalImagem.alt = img.dataset.titulo || img.alt;
modalTitulo.textContent = img.dataset.titulo || img.alt || "Título do Filme";
modalDescricao.textContent = img.dataset.descricao || "Descrição não disponível.";
modalLink.href = img.dataset.link || "#";
modalLink.title = `Baixar ${modalTitulo.textContent}`;
modalFilme.style.display = "flex";
document.body.style.overflow = "hidden";
});
});
function fecharModal() {
modalFilme.style.display = "none";
document.body.style.overflow = "auto";
}
modalFilme.addEventListener("click", (e) => {
if (e.target === modalFilme) {
fecharModal();
}
});
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && modalFilme.style.display === "flex") {
fecharModal();
}
});