forked from brunohasouza/vitrine-literaria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
anuncio.html
429 lines (420 loc) · 26.6 KB
/
anuncio.html
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vitrine Literária</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/anuncio.css">
</head>
<body>
<main>
<header>
<div class="container">
<div class="header__container">
<div class="header__logo">
<h1>Vitrine <spam class="branco">Literaria</spam></h1>
</div>
<div class="header__pesquisa">
<form action="" id="pesquisarForm">
<div class="form-group">
<select class="form-control" id="exampleFormControlSelect1">
<option value="1" selected>Autor e Título</option>
<option value="2" >Autor</option>
<option value="3" >Título</option>
</select>
</div>
<div class="input-group">
<input required type="text" id="pesquisarInputKeyword" class="form-control" placeholder="Pesquisar" aria-describedby="button-addon2">
<div class="input-group-append">
<button class="btn btn-secondary" type="submit" id="button-addon2">
<i class="material-icons">search</i>
</button>
</div>
</div>
</form>
</div>
<div class="header__usuario">
<div class="dropdown dropdown_deslogado">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="material-icons">account_circle</i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<button class="dropdown-item" data-toggle="modal" data-target="#loginModal">Login</button>
<button class="dropdown-item" data-toggle="modal" data-target="#cadastroModal">Cadastro</button>
<button class="dropdown-item" data-toggle="modal" data-target="#recuperarSenhaModal">Recuperar Senha</button>
</div>
</div>
</div>
<div class="header__usuarioLogado">
<div class="dropdown dropdown_logado">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Olá, Bruno!
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Meu Perfil</a>
<button class="dropdown-item" id="botaoLogout">Sair</button>
</div>
</div>
<a href="carrinho.html" class="btn btn-secondary">
<i class="material-icons">shopping_cart</i>
</a>
</div>
</div>
</div>
</div>
</header>
<section>
<div class="container">
<div class="row">
<div class="col-12">
<div class="section__titulo anuncio">
<h1>O Pequeno Príncipe</h1>
<p class="text-muted">Antoine de Saint-Exupéry</p>
</div>
</div>
<div class="col-2">
<div class="card">
<img src="./imagens/capa1.jpg" class="card-img-top" alt="" srcset="">
</div>
</div>
<div class="col-6">
<div class="card anuncio__infos">
<div class="card-body">
<div class="card-text">
<span>Editora: </span>
<span>Globo</span>
</div>
<div class="card-text">
<span>Páginas: </span>
<span>326</span>
</div>
<div class="card-text">
<span>Idioma: </span>
<span>Português</span>
</div>
<div class="card-text">
<span>Condição: </span>
<span>Usado</span>
</div>
<div class="card-text">
<span>Ano: </span>
<span>2018</span>
</div>
<div class="card-text">
<span>Localização: </span>
<span>PE - Recife</span>
</div>
<div class="card-text">
<span>Cadastrado em: </span>
<span>28/05/2019</span>
</div>
<div class="card-text">
<span>Sinopse: </span>
<span>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore, explicabo. Consectetur quibusdam magnam tempore. At voluptate ratione exercitationem vel atque repellat, quisquam est tempora incidunt odio. Vel amet perspiciatis fuga voluptatibus maiores doloribus perferendis ea minus autem ratione vero asperiores neque labore, quisquam similique iusto quod beatae itaque exercitationem! Asperiores a harum illum sequi pariatur rem modi, recusandae accusamus perferendis?</span>
</div>
<div class="card-text">
<span>Descrição: </span>
<span>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nulla officia fuga possimus distinctio maiores cumque id, quisquam quo accusamus non? Ducimus reiciendis quos harum accusantium consequuntur vero eveniet, voluptatum molestiae.m20</span>
</div>
</div>
<div class="card-body">
<a href="pesquisa.html" class="btn btn-light">Pesquisar por mais livros de <span>Antoine de Saint-Exupéry</span></a>
<a href="pesquisa.html" class="btn btn-light">Pesquisar por outro anúncios com o título <span>O Pequeno Príncipe</span></a>
</div>
</div>
</div>
<div class="col-4">
<div class="card anuncio__comprar">
<div class="card-body">
<div class="anuncio__preco">
<span>R$</span>
<span>30,00</span>
<p>em até 12x de 2,50</p>
</div>
<div class="anuncio__botao" id="btnComprar">
<button class="btn btn-info btn-lg">ADICIONAR AO CARRINHO</button>
</div>
<div class="anuncio__frete">
<form action="" id="freteForm">
<p>Calcule o frete:</p>
<input type="text" placeholder="CEP" class="form-control">
<button type="submit" class="btn btn-secondary">OK</button>
</form>
<div class="anuncio__frete--valor">
<div class="frete-prazo">
<span>Prazo:</span>
<span id="fretePrazo"></span>
</div>
<div class="frete-valor">
<span>Valor:</span>
<span id="freteValor"></span>
</div>
</div>
</div>
</div>
</div>
<div class="card anuncio__vendedor">
<div class="card-body">
<p class="text-muted">Sobre o Vendedor</p>
<h5 class="card-title">Bruno Henrique</h5>
<p class="card-text">PE - Recife</p>
<div class="anuncio__rating">
<div class="anuncio__nota">
<i class="material-icons">star</i>
<i class="material-icons">star</i>
<i class="material-icons">star</i>
<i class="material-icons">star_half</i>
<i class="material-icons">star_border</i>
</div>
<div class="anuncio__avaliacoes">
<span>764 comentários</span>
</div>
</div>
<div class="anuncio__botao">
<a href="" class="btn btn-light">Ver perfil completo</a>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="card anuncio__perguntas">
<div class="card-body">
<h5 class="card-title">Perguntas:</h5>
<div class="anuncio__perguntaForm">
<form action="" id="formPergunta">
<textarea class="form-control" placeholder="Faça uma pergunta ao vendedor"></textarea>
<button class="btn btn-secondary">Enviar</button>
</form>
</div>
<div>
<div class="anuncio__pergunta">
<div class="anuncio__perguntaUsuario">
<div class="anuncio__imagemPerfil">
<i class="material-icons">account_circle</i>
</div>
<div class="anuncio__perguntaTexto">
<span>Nome do Usuário</span>
<span class="text-muted">28/05/2019</span>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore quisquam quod fugiat. Suscipit, sint. At velit ratione perferendis asperiores aliquam.</p>
</div>
</div>
<div class="anuncio__perguntaResposta">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Debitis, nisi similique, dignissimos ipsa in, modi consequatur corporis maiores incidunt at recusandae tempore a corrupti assumenda ab placeat culpa sed et.</p>
<span>Resposta enviada dia 28/05/2019</span>
</div>
</div>
<div class="anuncio__pergunta">
<div class="anuncio__perguntaUsuario">
<div class="anuncio__imagemPerfil">
<i class="material-icons">account_circle</i>
</div>
<div class="anuncio__perguntaTexto">
<span>Nome do Usuário</span>
<span class="text-muted">28/05/2019</span>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore quisquam quod fugiat. Suscipit, sint. At velit ratione perferendis asperiores aliquam.</p>
</div>
</div>
<div class="anuncio__perguntaResposta">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Debitis, nisi similique, dignissimos ipsa in, modi consequatur corporis maiores incidunt at recusandae tempore a corrupti assumenda ab placeat culpa sed et.</p>
<span>Resposta enviada dia 28/05/2019</span>
</div>
</div>
<div class="anuncio__pergunta">
<div class="anuncio__perguntaUsuario">
<div class="anuncio__imagemPerfil">
<i class="material-icons">account_circle</i>
</div>
<div class="anuncio__perguntaTexto">
<span>Nome do Usuário</span>
<span class="text-muted">28/05/2019</span>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore quisquam quod fugiat. Suscipit, sint. At velit ratione perferendis asperiores aliquam.</p>
</div>
</div>
<div class="anuncio__perguntaResposta">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Debitis, nisi similique, dignissimos ipsa in, modi consequatur corporis maiores incidunt at recusandae tempore a corrupti assumenda ab placeat culpa sed et.</p>
<span>Resposta enviada dia 28/05/2019</span>
</div>
</div>
</div>
<div class="anuncio__perguntaCarregarMais text-center">
<button class="btn btn-secondary">
Carregar Mais Perguntas
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="footer__container">
<img src="./imagens/leoa.png" alt="">
<address>Todos os direitos reservados</address>
</div>
</div>
</footer>
</main>
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Login</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="loginForm">
<div class="form-group">
<label for="loginInputEmail">E-mail</label>
<input required type="email" class="form-control" id="loginInputEmail" aria-describedby="emailHelp" placeholder="[email protected]">
</div>
<div class="form-group">
<label for="loginInputSenha">Senha</label>
<input required type="password" class="form-control" id="loginInputSenha" placeholder="●●●●●●●●●●">
</div>
<div class="login-submit">
<button type="submit" class="btn btn-lg btn-secondary">Entrar</button>
</div>
</form>
<div class="alert alert-danger" role="alert">Todos os campos são obrigatórios</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="recuperarSenhaModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Recuperar Senha</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="recuperarSenhaForm">
<div class="form-group">
<label for="recuperarSenhaEmail">E-mail</label>
<input required type="email" class="form-control" id="recuperarSenhaEmail" aria-describedby="emailHelp" placeholder="[email protected]">
</div>
<div class="login-submit">
<button type="submit" class="btn btn-lg btn-secondary">Enviar Solicitação</button>
</div>
</form>
<div class="alert alert-danger" role="alert">Todos os campos são obrigatórios</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="cadastroModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Cadastre-se</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="cadastroForm">
<div class="form-group">
<label for="cadastroInputNome">Nome</label>
<input required type="text" class="form-control" id="cadastroInputNome" placeholder="João da Silva">
</div>
<div class="form-group">
<label for="cadastroInputEmail">E-mail</label>
<input required type="email" class="form-control" id="cadastroInputEmail" aria-describedby="emailHelp" placeholder="[email protected]">
</div>
<div class="form-group">
<label for="cadastroInputSenha">Senha</label>
<input required type="password" class="form-control" id="cadastroInputSenha" placeholder="●●●●●●●●●●">
</div>
<div class="form-group">
<label for="cadastroInputRepetirSenha">Repetir Senha</label>
<input required type="password" class="form-control" id="cadastroInputRepetirSenha" placeholder="●●●●●●●●●●">
</div>
<div class="form-group">
<label for="cadastroInputCEP">CEP</label>
<input required type="text" class="form-control" id="cadastroInputCEP" placeholder="53130-110">
</div>
<div class="form-group">
<label for="cadastroInputLogradouro">Logradouro</label>
<input required type="text" class="form-control" id="cadastroInputLogradouro" placeholder="Rua do Giriquiti">
</div>
<div class="form-group">
<label for="cadastroInputBairro">Bairro</label>
<input required type="text" class="form-control" id="cadastroInputBairro" placeholder="Boa Vista">
</div>
<div class="form-group">
<label for="cadastroInputCidade">Cidade</label>
<input required type="text" class="form-control" id="cadastroInputCidade" placeholder="Recife">
</div>
<div class="form-group">
<label for="cadastroInputCidade">Estado</label>
<input required type="text" class="form-control" id="cadastroInputCidade" placeholder="Pernambuco">
</div>
<div class="form-group">
<label for="cadastroInputNumero">Número</label>
<input required type="text" class="form-control" id="cadastroInputNumero" placeholder="172">
</div>
<div class="form-group">
<label for="cadastroInputComplemento">Complemento</label>
<input required type="text" class="form-control" id="cadastroInputComplemento" placeholder="Bloco A">
</div>
<div class="form-group">
<label for="cadastroInputReferência">Ponto de Referência</label>
<input required type="text" class="form-control" id="cadastroInputReferência" placeholder="Por trás do Shopping Boa Vista">
</div>
<div class="form-group">
<label for="cadastroInputTelefone">Telefone</label>
<input required type="text" class="form-control" id="cadastroInputTelefone" placeholder="(81) 98765-4321">
</div>
<div class="login-submit">
<button type="submit" class="btn btn-lg btn-secondary">Enviar Solicitação</button>
</div>
</form>
<div class="alert alert-danger" role="alert">Todos os campos são obrigatórios</div>
</div>
</div>
</div>
</div>
<script src="./js/jquery.min.js"></script>
<script src="./js/popper.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/header.js"></script>
<script>
const logado = window.localStorage.getItem('vitrine')
const formPergunta = document.querySelector('#formPergunta')
const btnComprar = document.querySelector('#btnComprar')
const freteForm = document.querySelector('#freteForm')
if (logado === 'logado') {
formPergunta.innerHTML = `
<form action="">
<textarea class="form-control" placeholder="Faça uma pergunta ao vendedor"></textarea>
<button class="btn btn-secondary">Enviar</button>
</form>
`
btnComprar.innerHTML = `<button onclick="alert('Livro adicionado ao carrinho de compras')" class="btn btn-info btn-lg">ADICIONAR AO CARRINHO</button>`
} else {
formPergunta.innerHTML = `
<form action="">
<textarea class="form-control" placeholder="Faça login para falar com o vendedor" readonly></textarea>
</form>
`
btnComprar.innerHTML = `<button data-toggle="modal" data-target="#loginModal" class="btn btn-warning btn-lg">FAÇA LOGIN PARA COMPRAR</button>`
}
freteForm.addEventListener('submit', function(ev){
ev.preventDefault()
if(this.querySelector('input[type=text]').value) {
document.querySelector('#fretePrazo').innerHTML = '15 dias'
document.querySelector('#freteValor').innerHTML = 'R$14,63'
}
})
</script>
</body>
</html>