-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
178 lines (146 loc) · 5.44 KB
/
script.js
File metadata and controls
178 lines (146 loc) · 5.44 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
var sdireito = document.getElementById("s-direito");
var largura = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
function menuShow() {
let menuMobile = document.querySelector('.mobile-menu');
if (menuMobile.classList.contains('open')) {
menuMobile.classList.remove('open');
document.querySelector('.icon').src = "img/menu_white_36dp.svg";
} else {
menuMobile.classList.add('open');
document.querySelector('.icon').src = "img/close_white_36dp.svg";
}
}
function cad() {
var key = Math.floor(Math.random() * 1000 + 1);
var nome = document.getElementById("nome").value;
var tel = document.getElementById("tel").value;
var end = document.getElementById("endereco").value;
var cpf = document.getElementById("cpf").value;
var mail = document.getElementById("mail").value;
var senha = document.getElementById("senha").value;
var senha_ver = document.getElementById("verifica-senha").value;
if (senha != senha_ver) {
document.getElementById("invalido").innerHTML = " As senhas devem ser iguais. ";
return false;
} else {
var usuario = { nome_: nome, tel_: tel, end_: end, cpf_: cpf, mail_: mail, senha_: senha };
localStorage.setItem(key, JSON.stringify(usuario));
alert("Usuário(a) cadastrado(a) com sucesso!")
window.location.href = "login.html";
}
return false;
}
function verificar() {
var v_senha = document.getElementById("senha").value;
var v_mail = document.getElementById("mail").value;
for (let i = 0; i < localStorage.length; i++) {
let id = localStorage.key(i);
let dados = localStorage.getItem(id);
var users = JSON.parse(dados);
if (users.senha_ === v_senha && users.mail_ === v_mail) {
var key = "userlog";
localStorage.setItem(key,id);
window.location.href = "pagina-curso.html";
break;
} else {
document.getElementById("invalido").innerHTML = " Usuário e/ou Senha Inválido(s)";
}
}
return false;
}
function reset() {
sdireito.style.backgroundImage = "";
sdireito.innerHTML = ``;
}
function Inicio(obj) {
reset()
obj.style.backgroundColor = 'green';
if (largura > 1000) {
sdireito.style.backgroundImage = "url('img/Slide1.PNG')";
} else {
sdireito.style.backgroundImage = "url('img/Slide1p.png')";
}
}
function Aula1(obj) {
reset()
obj.style.backgroundColor = 'green';
sdireito.innerHTML = `<iframe class="video-aula" src="https://www.youtube.com/embed/udFYDWN02r8?start=40" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
}
function Aula2(obj) {
reset()
obj.style.backgroundColor = 'green';
if (largura > 1000) {
sdireito.style.backgroundImage = "url('img/Slide2.PNG')";
} else {
sdireito.style.backgroundImage = "url('img/Slide2p.png')";
}
}
function Aula3(obj) {
reset()
obj.style.backgroundColor = 'green';
if (largura > 1000) {
sdireito.style.backgroundImage = "url('img/Slide3.PNG')";
} else {
sdireito.style.backgroundImage = "url('img/Slide3p.png')";
}
}
function Aula4(obj) {
reset()
obj.style.backgroundColor = 'green';
if (largura > 1000) {
sdireito.style.backgroundImage = "url('img/Slide4.PNG')";
} else {
sdireito.style.backgroundImage = "url('img/Slide4p.png')";
}
}
function Aula5(obj) {
reset()
obj.style.backgroundColor = 'green';
if (largura > 1000) {
sdireito.style.backgroundImage = "url('img/Slide5.PNG')";
} else {
sdireito.style.backgroundImage = "url('img/Slide5p.png')";
}
}
function Aula6(obj) {
reset()
obj.style.backgroundColor = 'green';
document.getElementById("botao").style.display = "block";
if (largura > 1000) {
sdireito.style.backgroundImage = "url('img/Slide6.PNG')";
} else {
sdireito.style.backgroundImage = "url('img/Slide6p.png')";
}
}
var contador = 0;
var contChances = 0;
function check() {
contChances++;
for (let i = 1; i <= 12; i++) {
if (document.getElementById("certa"+i).checked) {
contador++;
}
}
document.getElementById("titulo").textContent = "Tentativa "+contChances;
if(contador >= 9){
document.getElementById("btn2").style.display = "block";
document.getElementById("btn").style.display = "none";
document.getElementById("titulo").textContent = "PARABÉNS, VOCÊ FOI APROVADO!!";
document.getElementById("titulo").style.color = "#fdac00";
}
alert("Você acertou "+contador+" questões");
contador = 0;
if(contChances == 3){
alert("Você excedeu o limite de tentativas");
var button = document.getElementById("btn");
button.setAttribute("disabled", "disabled");
}
}
window.onload = function certificado(){
let id = "userlog";
let id1 = localStorage.getItem(id);
let id2 = localStorage.getItem(id1);
var dados = JSON.parse(id2);
document.getElementById("nome").innerHTML = dados.nome_;
document.getElementById("cpf").innerHTML = dados.cpf_;
}