-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex2.html
More file actions
446 lines (391 loc) · 12.4 KB
/
index2.html
File metadata and controls
446 lines (391 loc) · 12.4 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
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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
/*Background color*/
#grad1 {
background-color: #0e8aa0;
background-image: linear-gradient(120deg, #1a4297, #81D4FA);
}
/*form styles*/
#msform {
text-align: center;
position: relative;
margin-top: 20px;
}
#msform fieldset .form-card {
background: white;
border: 0 none;
border-radius: 0px;
box-shadow: 0 2px 2px 2px rgba(0, 0, 0, 0.2);
padding: 20px 40px 30px 40px;
box-sizing: border-box;
width: 94%;
margin: 0 3% 20px 3%;
/*stacking fieldsets above each other*/
position: relative;
}
#msform fieldset {
background: white;
border: 0 none;
border-radius: 0.5rem;
box-sizing: border-box;
width: 100%;
margin: 0;
padding-bottom: 20px;
/*stacking fieldsets above each other*/
position: relative;
}
/*Hide all except first fieldset*/
#msform fieldset:not(:first-of-type) {
display: none;
}
#msform fieldset .form-card {
text-align: left;
color: #9E9E9E;
}
#msform input,
#msform textarea {
padding: 0px 8px 4px 8px;
border: none;
border-bottom: 1px solid #ccc;
border-radius: 0px;
margin-bottom: 25px;
margin-top: 2px;
width: 100%;
box-sizing: border-box;
font-family: montserrat;
color: #2C3E50;
font-size: 16px;
letter-spacing: 1px;
}
#msform input:focus,
#msform textarea:focus {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
border: none;
font-weight: bold;
border-bottom: 2px solid skyblue;
outline-width: 0;
}
/*Blue Buttons*/
#msform .action-button {
width: 100px;
background: skyblue;
font-weight: bold;
color: white;
border: 0 none;
border-radius: 0px;
cursor: pointer;
padding: 10px 5px;
margin: 10px 5px;
}
#msform .action-button:hover,
#msform .action-button:focus {
box-shadow: 0 0 0 2px white, 0 0 0 3px skyblue;
}
/*Previous Buttons*/
#msform .action-button-previous {
width: 100px;
background: #616161;
font-weight: bold;
color: white;
border: 0 none;
border-radius: 0px;
cursor: pointer;
padding: 10px 5px;
margin: 10px 5px;
}
#msform .action-button-previous:hover,
#msform .action-button-previous:focus {
box-shadow: 0 0 0 2px white, 0 0 0 3px #616161;
}
/*Home Buttons*/
#msform .action-button-home {
width: 100px;
background: #616161;
font-weight: bold;
color: white;
border: 0 none;
border-radius: 0px;
cursor: pointer;
padding: 10px 5px;
margin: 10px 5px;
}
#msform .action-button-home:hover,
#msform .action-button-home:focus {
box-shadow: 0 0 0 2px white, 0 0 0 3px #616161;
}
/*Compartilhar Buttons*/
#msform .action-button-compartilhar {
width: 100px;
background: #616161;
font-weight: bold;
color: white;
border: 0 none;
border-radius: 0px;
cursor: pointer;
padding: 10px 5px;
margin: 10px 5px;
}
#msform .action-button-compartilhar:hover,
#msform .action-button-compartilhar:focus {
box-shadow: 0 0 0 2px white, 0 0 0 3px #616161;
}
/*Dropdown List Exp Date*/
select.list-dt {
border: none;
outline: 0;
border-bottom: 1px solid #ccc;
padding: 2px 5px 3px 5px;
margin: 2px;
}
select.list-dt:focus {
border-bottom: 2px solid skyblue;
}
/*The background card*/
.card {
z-index: 0;
border: none;
border-radius: 0.5rem;
position: relative;
}
/*FieldSet headings*/
.fs-title {
font-size: 25px;
color: #2C3E50;
margin-bottom: 10px;
font-weight: bold;
text-align: left;
}
/*progressbar*/
#progressbar {
margin-bottom: 30px;
overflow: hidden;
color: lightgrey;
}
#progressbar .active {
color: #000000;
}
#progressbar li {
list-style-type: none;
font-size: 12px;
width: 33.33333%;
float: left;
position: relative;
}
/*Icons in the ProgressBar*/
#progressbar #account:before {
font-family: FontAwesome;
content: "\f007";
}
#progressbar #ingredientes:before {
font-family: FontAwesome;
content: "\f013";
}
#progressbar #payment:before {
font-family: FontAwesome;
content: "\f013";
}
#progressbar #confirm:before {
font-family: FontAwesome;
content: "\f00c";
}
/*ProgressBar before any progress*/
#progressbar li:before {
width: 50px;
height: 50px;
line-height: 45px;
display: block;
font-size: 18px;
color: #ffffff;
background: lightgray;
border-radius: 50%;
margin: 0 auto 10px auto;
padding: 2px;
}
/*ProgressBar connectors*/
#progressbar li:after {
content: '';
width: 100%;
height: 2px;
background: lightgray;
position: absolute;
left: 0;
top: 25px;
z-index: -1;
}
/*Color number of the step and the connector before it*/
#progressbar li.active:before,
#progressbar li.active:after {
background: skyblue;
}
/*Imaged Radio Buttons*/
.radio-group {
position: relative;
margin-bottom: 25px;
}
.radio {
display: inline-block;
width: 204;
height: 104;
border-radius: 0;
background: lightblue;
box-shadow: 0 2px 2px 2px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
cursor: pointer;
margin: 8px 2px;
}
.radio:hover {
box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.3);
}
.radio.selected {
box-shadow: 1px 1px 2px 2px rgba(0, 0, 0, 0.1);
}
/*Fit image in bootstrap div*/
.fit-image {
width: 100%;
object-fit: cover;
}
</style>
</head>
<body>
<!-- Fieldset 1: Informações Pessoais -->
<fieldset>
<legend>Informações Pessoais</legend>
<label for="nome">Nome:</label>
<input type="text" id="nome" placeholder="Digite seu nome">
<label for="tipoRefeicao">Tipo de Refeição:</label>
<select id="tipoRefeicao">
<option value="">Selecione...</option>
</select>
</fieldset>
<!-- Fieldset 2: Itens do Grupo Alimentar -->
<fieldset>
<legend>Itens do Grupo Alimentar</legend>
<div id="grupoAlimentarInputs">
<!-- Itens do grupo alimentar serão gerados dinamicamente aqui -->
</div>
<button onclick="gerarRefeicao()">Gerar Refeição</button>
</fieldset>
<!-- Fieldset 3: Exibição dos Resultados -->
<fieldset>
<div class="form-card">
<h2 class="fs-title text-center" id="finalname">Olá</h2>
<div class="row justify-content-center">
<div class="col-7 text-center">
<h5>Você configurou corretamente sua refeição! seguem os dados:</h5>
</div>
</div>
<div class="row justify-content-center">
<table class="table" id="tabelaProdutos">
<thead>
<tr>
<th>Item</th>
<th>Quantas porções</th>
<th>Porção</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="row justify-content-center">
<div class="col-12 text-left fs-title">
<h3>Lembre-se:</h3>
<h6>1. Não existe "dia do lixo" ... o cardápio tem que ser seguido à risca de segunda a segunda-feira</h6>
<h6>2. Observar sempre as quantidades especificadas em cada porção de alimento...</h6>
<h6>3. Atividade física é essencial para promover a perda de gordura e a manutenção da massa muscular!!!</h6>
</div>
</div>
<input type="button" name="home" class="home action-button-home" value="Home" />
<input type="button" name="compartilhar" class="compartilhar action-button-compartilhar" value="Enviar" />
</div>
</fieldset>
<script>
// Dados de exemplo (substitua pelo conteúdo dos arquivos JSON)
const planosAlimentares = [
{
"nome": "VA",
"refeicoes": {
"cafeDaManha": {
"laticinios": 1,
"carboidratos": 1,
"carnes": 1,
"gorduras": 1
}
}
},
{
"nome": "CB",
"refeicoes": {
"almoco": {
"carboidratos": 2,
"frutas": 2,
"carnes": 4
}
}
}
];
const grupoAlimentar = {
"laticinios": "200ml de leite",
"carboidratos": "1 fatia de pão",
"carnes": "100g de carne",
"gorduras": "1 colher de óleo"
};
// Carrega tipos de refeição
function carregarTiposRefeicao() {
const tipoRefeicaoSelect = document.getElementById("tipoRefeicao");
planosAlimentares.forEach(plano => {
const option = document.createElement("option");
option.value = plano.nome;
option.textContent = plano.nome;
tipoRefeicaoSelect.appendChild(option);
});
}
// Carrega inputs dos grupos alimentares
function carregarGrupoAlimentar() {
const container = document.getElementById("grupoAlimentarInputs");
for (const grupo in grupoAlimentar) {
const div = document.createElement("div");
div.className = "form-group";
div.innerHTML = `<label>${grupo}:</label>
<input type="number" id="${grupo}" class="form-control" placeholder="Quantidade">`;
container.appendChild(div);
}
}
// Gera e exibe a refeição
function gerarRefeicao() {
const tipoRefeicao = document.getElementById("tipoRefeicao").value;
const nome = document.getElementById("nome").value;
const planoSelecionado = planosAlimentares.find(plano => plano.nome === tipoRefeicao);
// Atualiza saudação
document.getElementById("finalname").textContent = `Olá, ${nome}!`;
// Limpa a tabela
const tbody = document.getElementById("tabelaProdutos").querySelector("tbody");
tbody.innerHTML = "";
// Preenche a tabela com a refeição configurada
for (const [item, quantidade] of Object.entries(planoSelecionado.refeicoes.cafeDaManha)) {
const tr = document.createElement("tr");
const porcao = grupoAlimentar[item] || "N/A";
tr.innerHTML = `<td>${item}</td><td>${quantidade}</td><td>${porcao}</td>`;
tbody.appendChild(tr);
}
}
// Inicializa o formulário
carregarTiposRefeicao();
carregarGrupoAlimentar();
</script>
</body>
</html>