-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexlanding.js
More file actions
121 lines (82 loc) · 3.42 KB
/
Copy pathexlanding.js
File metadata and controls
121 lines (82 loc) · 3.42 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
var icone = document.querySelectorAll('.icone');
icone.forEach(function(icone) {
icone.addEventListener("click", function() {
var aviso = document.querySelector(".aviso");
aviso.style.display = 'block';
});
});
var aviso = document.querySelector('.aviso');
aviso.addEventListener("click", function(){
var aviso = document.querySelector('.aviso');
aviso.style.display = 'none';
});
var menulateral = document.querySelector('#menulateral');
menulateral.addEventListener("click", function(event) {
event.stopPropagation();
var menu =document.querySelector('#menu');
var fecharbotao = document.querySelector('#fecharbotao');
var fechar = document.querySelector('#menulateral')
menu.style.display = 'block'
fecharbotao.style.display = 'block'
fechar.style.display = 'none'
});
document.addEventListener("click", function() {
setTimeout( function() {
var menu =document.querySelector('#menu');
var fecharbotao = document.querySelector('#fecharbotao');
var fechar = document.querySelector('#menulateral')
if (menu.style.display ==='block' && fechar.style.display === 'none') {
menu.style.display = 'none'
fecharbotao.style.display = 'none'
fechar.style.display = 'block'
}
},0);
});
var fecharbotao = document.querySelector('#fecharbotao');
fecharbotao.addEventListener("click", function() {
var menu =document.querySelector('#menu');
var fecharbotao = document.querySelector('#fecharbotao');
var fechar = document.querySelector('#menulateral')
menu.style.display = 'none'
fecharbotao.style.display = 'none'
fechar.style.display = 'block'
});
var zap = document.querySelector('.iconezap');
zap.addEventListener("click", function() {
var avisozap = document.querySelector('.avisozap');
avisozap.style.display = 'block'
});
var avisozap = document.querySelector('.avisozap');
avisozap.addEventListener("click", function(){
var aviso = document.querySelector('.avisozap');
aviso.style.display = 'none';
});
var pedido = document.querySelector('.pedido');
// Adiciona o listener de evento para o clique no botão
pedido.addEventListener("click", function(event) {
// Impede que o clique no botão propague para o documento
var form = document.querySelector('.form-conteiner');
event.stopPropagation();
// Altera a cor de fundo e a cor do texto do botão
this.style.backgroundColor = '#ffffff';
this.style.color = 'green';
form.style.display = 'block';
});
// Adiciona o listener de evento para o clique no documento
document.addEventListener("click", function() {
// Adiciona um atraso para garantir que o clique no botão seja registrado primeiro
setTimeout(function() {
// Verifica se a cor de fundo do botão é branca (em formato RGB)
if (pedido.style.backgroundColor === 'rgb(255, 255, 255)' && form.style.display === 'block' ) {
// Reseta a cor de fundo do botão para uma nova cor
pedido.style.backgroundColor = ''; // Cor original ou a cor desejada
pedido.style.color = ''; // Opcional: resetar a cor do texto se necessário
}
}, 10);
});
var submit = document.querySelector('#enviar');
submit.addEventListener("click", function() {
var pedido = document.querySelector('.pedido')
pedido.style.backgroundColor = '';
pedido.style.color = '';
});