Update templates/index.html
Browse files- templates/index.html +112 -385
templates/index.html
CHANGED
|
@@ -1,445 +1,172 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="pt-BR"
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
-
<title>Simulador de Investimentos
|
| 7 |
<style>
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
/* Reset & base */
|
| 11 |
* {
|
| 12 |
box-sizing: border-box;
|
| 13 |
-
margin: 0;
|
|
|
|
| 14 |
}
|
|
|
|
| 15 |
body {
|
| 16 |
-
font-family: '
|
| 17 |
-
background: linear-gradient(135deg, #
|
| 18 |
-
color: #fff;
|
| 19 |
min-height: 100vh;
|
| 20 |
display: flex;
|
| 21 |
-
|
| 22 |
-
align-items:
|
| 23 |
-
padding:
|
| 24 |
-
|
| 25 |
-
-moz-osx-font-smoothing: grayscale;
|
| 26 |
}
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
margin-bottom: 1rem;
|
| 31 |
-
letter-spacing: 0.06em;
|
| 32 |
-
text-align: center;
|
| 33 |
-
text-transform: uppercase;
|
| 34 |
-
text-shadow: 0 2px 8px rgba(255,255,255,0.2);
|
| 35 |
-
}
|
| 36 |
-
form {
|
| 37 |
-
background: rgba(255, 255, 255, 0.1);
|
| 38 |
-
backdrop-filter: blur(8px);
|
| 39 |
border-radius: 12px;
|
| 40 |
-
padding:
|
| 41 |
-
max-width:
|
| 42 |
width: 100%;
|
| 43 |
-
box-shadow: 0 8px
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 46 |
}
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
}
|
|
|
|
| 50 |
label {
|
| 51 |
-
display: block;
|
| 52 |
font-weight: 600;
|
| 53 |
-
font-size: 0.
|
| 54 |
-
margin-bottom:
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
letter-spacing: 0.04em;
|
| 58 |
-
user-select: none;
|
| 59 |
}
|
|
|
|
| 60 |
input[type="number"] {
|
| 61 |
width: 100%;
|
| 62 |
-
padding:
|
|
|
|
| 63 |
border-radius: 8px;
|
| 64 |
-
border: none;
|
| 65 |
font-size: 1rem;
|
| 66 |
-
|
| 67 |
-
color: #0f2027;
|
| 68 |
-
background: #e0f7fa;
|
| 69 |
-
box-shadow: inset 1px 1px 6px rgba(0,0,0,0.1);
|
| 70 |
-
transition: background-color 0.25s ease;
|
| 71 |
-
margin-bottom: 1.2rem;
|
| 72 |
-
outline-offset: 2px;
|
| 73 |
}
|
| 74 |
input[type="number"]:focus {
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
button {
|
| 79 |
-
width: 100%;
|
| 80 |
-
padding: 0.75rem;
|
| 81 |
-
background: #00c6ff;
|
| 82 |
-
background: linear-gradient(45deg, #00c6ff, #0072ff);
|
| 83 |
-
border: none;
|
| 84 |
-
border-radius: 10px;
|
| 85 |
-
color: white;
|
| 86 |
-
font-weight: 700;
|
| 87 |
-
font-size: 1.1rem;
|
| 88 |
-
cursor: pointer;
|
| 89 |
-
letter-spacing: 0.05em;
|
| 90 |
-
box-shadow: 0 6px 20px rgba(0, 198, 255, 0.5);
|
| 91 |
-
transition: background 0.3s ease, box-shadow 0.3s ease;
|
| 92 |
-
user-select: none;
|
| 93 |
-
}
|
| 94 |
-
button:hover {
|
| 95 |
-
background: linear-gradient(45deg, #0072ff, #00c6ff);
|
| 96 |
-
box-shadow: 0 8px 30px rgba(0, 114, 255, 0.7);
|
| 97 |
-
}
|
| 98 |
-
button:active {
|
| 99 |
-
transform: scale(0.98);
|
| 100 |
}
|
| 101 |
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
background: rgba(255, 255, 255, 0.12);
|
| 107 |
-
padding: 1.8rem 2rem;
|
| 108 |
-
border-radius: 14px;
|
| 109 |
-
box-shadow: 0 12px 40px rgba(0,0,0,0.4);
|
| 110 |
-
font-size: 1rem;
|
| 111 |
-
line-height: 1.5;
|
| 112 |
-
color: #dcefff;
|
| 113 |
-
font-weight: 400;
|
| 114 |
-
display: none;
|
| 115 |
-
user-select: text;
|
| 116 |
}
|
| 117 |
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
text-align: center;
|
| 124 |
-
text-shadow: 0 2px 6px rgba(0, 209, 255, 0.7);
|
| 125 |
}
|
| 126 |
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
border-radius: 10px;
|
| 136 |
-
|
| 137 |
-
box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
|
| 138 |
-
}
|
| 139 |
-
th, td {
|
| 140 |
-
padding: 0.8rem 1.1rem;
|
| 141 |
-
text-align: right;
|
| 142 |
-
font-weight: 500;
|
| 143 |
-
color: #d0e8ff;
|
| 144 |
-
}
|
| 145 |
-
th:first-child, td:first-child {
|
| 146 |
-
text-align: left;
|
| 147 |
-
font-weight: 600;
|
| 148 |
-
color: #a0d8ef;
|
| 149 |
-
}
|
| 150 |
-
th {
|
| 151 |
-
background: linear-gradient(90deg, #0077c2, #00c6ff);
|
| 152 |
-
font-size: 1rem;
|
| 153 |
-
letter-spacing: 0.04em;
|
| 154 |
-
}
|
| 155 |
-
tbody tr:hover {
|
| 156 |
-
background: rgba(0, 198, 255, 0.12);
|
| 157 |
-
color: #00d1ff;
|
| 158 |
transition: background-color 0.25s ease;
|
|
|
|
| 159 |
}
|
| 160 |
-
|
| 161 |
-
color: #
|
| 162 |
-
font-weight: 700;
|
| 163 |
-
text-shadow: 0 0 6px #00ff99;
|
| 164 |
}
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
white-space: pre-wrap;
|
| 169 |
-
background: rgba(0, 0, 0, 0.2);
|
| 170 |
-
padding: 1rem 1.2rem;
|
| 171 |
-
border-radius: 12px;
|
| 172 |
-
font-size: 1rem;
|
| 173 |
-
color: #b9f2ff;
|
| 174 |
-
font-weight: 400;
|
| 175 |
-
max-height: 300px;
|
| 176 |
-
overflow-y: auto;
|
| 177 |
-
box-shadow: inset 0 0 15px rgba(0,209,255,0.3);
|
| 178 |
-
user-select: text;
|
| 179 |
}
|
| 180 |
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
box-shadow: 0 0 25px rgba(0, 198, 255, 0.5);
|
| 186 |
-
max-width: 100%;
|
| 187 |
-
display: block;
|
| 188 |
-
margin-left: auto;
|
| 189 |
-
margin-right: auto;
|
| 190 |
-
user-select: none;
|
| 191 |
}
|
| 192 |
|
| 193 |
/* Responsividade */
|
| 194 |
@media (max-width: 480px) {
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
button {
|
| 202 |
-
font-size: 1rem;
|
| 203 |
-
}
|
| 204 |
-
#resultado {
|
| 205 |
-
padding: 1.2rem 1rem;
|
| 206 |
-
font-size: 0.9rem;
|
| 207 |
-
}
|
| 208 |
-
#analise {
|
| 209 |
-
max-height: 200px;
|
| 210 |
-
font-size: 0.9rem;
|
| 211 |
-
}
|
| 212 |
-
table, th, td {
|
| 213 |
-
font-size: 0.85rem;
|
| 214 |
}
|
| 215 |
}
|
| 216 |
</style>
|
| 217 |
</head>
|
| 218 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
<form id="formInvest" autocomplete="off" spellcheck="false">
|
| 223 |
-
<label for="capital">Capital Inicial (R$)</label>
|
| 224 |
-
<input type="number" step="0.01" id="capital" name="capital" placeholder="Ex: 100000" required min="0" />
|
| 225 |
|
| 226 |
-
|
| 227 |
-
|
| 228 |
|
| 229 |
-
|
| 230 |
-
|
| 231 |
|
| 232 |
-
|
| 233 |
-
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
| 237 |
|
| 238 |
-
|
| 239 |
-
|
| 240 |
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
<h2>Resultado da Simulação</h2>
|
| 249 |
-
<div id="tabela"></div>
|
| 250 |
-
<div id="analise"></div>
|
| 251 |
-
<img id="grafico" src="" alt="Gráfico dos investimentos ao longo do tempo" />
|
| 252 |
-
</section>
|
| 253 |
|
| 254 |
<script>
|
| 255 |
-
const
|
| 256 |
-
const
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
e.preventDefault();
|
| 268 |
-
|
| 269 |
-
// Pega valores
|
| 270 |
-
const capital = parseFloat(form.capital.value);
|
| 271 |
-
const studio_ret = parseFloat(form.studio_ret.value);
|
| 272 |
-
const valorizacao = parseFloat(form.valorizacao.value);
|
| 273 |
-
const franquia_ret = parseFloat(form.franquia_ret.value);
|
| 274 |
-
const acoes_ret = parseFloat(form.acoes_ret.value);
|
| 275 |
-
const renda_fixa = parseFloat(form.renda_fixa.value);
|
| 276 |
-
const inflacao = parseFloat(form.inflacao.value);
|
| 277 |
-
|
| 278 |
-
if ([capital, studio_ret, valorizacao, franquia_ret, acoes_ret, renda_fixa, inflacao].some(isNaN)) {
|
| 279 |
-
alert('Por favor preencha todos os campos corretamente.');
|
| 280 |
-
return;
|
| 281 |
-
}
|
| 282 |
-
|
| 283 |
-
// Simulação (local para demo, ideal é chamar API backend)
|
| 284 |
-
const anos = [1,2,3,4,5];
|
| 285 |
-
|
| 286 |
-
const patrimonio_studio = anos.map(ano => capital * Math.pow(1 + valorizacao/100, ano));
|
| 287 |
-
const renda_acumulada_studio = anos.map(ano => capital * (Math.pow(1 + studio_ret/100, 12*ano) - 1));
|
| 288 |
-
const studio_total = anos.map((_,i) => patrimonio_studio[i] + renda_acumulada_studio[i]);
|
| 289 |
-
const franquia = anos.map(ano => capital + franquia_ret * ano);
|
| 290 |
-
const acoes = anos.map(ano => capital * Math.pow(1 + acoes_ret/100, ano));
|
| 291 |
-
const renda_fixa_valores = anos.map(ano => capital * Math.pow(1 + renda_fixa/100, ano));
|
| 292 |
-
|
| 293 |
-
// Monta tabela HTML
|
| 294 |
-
let tabelaHTML = `<table aria-label="Comparativo dos investimentos">
|
| 295 |
-
<thead>
|
| 296 |
-
<tr>
|
| 297 |
-
<th>Ano</th>
|
| 298 |
-
<th>Studio (Patrimônio + Renda)</th>
|
| 299 |
-
<th>Franquia</th>
|
| 300 |
-
<th>Ações</th>
|
| 301 |
-
<th>Renda Fixa</th>
|
| 302 |
-
</tr>
|
| 303 |
-
</thead>
|
| 304 |
-
<tbody>`;
|
| 305 |
-
|
| 306 |
-
// Identificar maior retorno final para destaque
|
| 307 |
-
const finalInvestimentos = {
|
| 308 |
-
"Studio (Patrimônio + Renda)": studio_total[studio_total.length - 1],
|
| 309 |
-
"Franquia": franquia[franquia.length - 1],
|
| 310 |
-
"Ações": acoes[acoes.length - 1],
|
| 311 |
-
"Renda Fixa": renda_fixa_valores[renda_fixa_valores.length - 1]
|
| 312 |
-
};
|
| 313 |
-
const melhorInvestimento = Object.entries(finalInvestimentos).reduce((a,b) => a[1] > b[1] ? a : b)[0];
|
| 314 |
-
|
| 315 |
-
anos.forEach((ano, i) => {
|
| 316 |
-
tabelaHTML += `<tr>
|
| 317 |
-
<td>${ano}</td>
|
| 318 |
-
<td${melhorInvestimento==="Studio (Patrimônio + Renda)" ? ' style="color:#00ff99;font-weight:700;text-shadow:0 0 6px #00ff99;"' : ''}>${formatarBRL(studio_total[i])}</td>
|
| 319 |
-
<td${melhorInvestimento==="Franquia" ? ' style="color:#00ff99;font-weight:700;text-shadow:0 0 6px #00ff99;"' : ''}>${formatarBRL(franquia[i])}</td>
|
| 320 |
-
<td${melhorInvestimento==="Ações" ? ' style="color:#00ff99;font-weight:700;text-shadow:0 0 6px #00ff99;"' : ''}>${formatarBRL(acoes[i])}</td>
|
| 321 |
-
<td${melhorInvestimento==="Renda Fixa" ? ' style="color:#00ff99;font-weight:700;text-shadow:0 0 6px #00ff99;"' : ''}>${formatarBRL(renda_fixa_valores[i])}</td>
|
| 322 |
-
</tr>`;
|
| 323 |
-
});
|
| 324 |
-
tabelaHTML += `</tbody></table>`;
|
| 325 |
-
|
| 326 |
-
tabelaDiv.innerHTML = tabelaHTML;
|
| 327 |
-
|
| 328 |
-
// Montar análise simplificada (pode ser substituída por chamada à API OpenAI)
|
| 329 |
-
let analiseTexto = `Capital Inicial: ${formatarBRL(capital)}\n\n`;
|
| 330 |
-
analiseTexto += `Após 5 anos, o melhor investimento foi: **${melhorInvestimento}**, com retorno final de ${formatarBRL(finalInvestimentos[melhorInvestimento])}.\n\n`;
|
| 331 |
-
analiseTexto += `Este resultado sugere que, considerando as premissas, investir em ${melhorInvestimento.toLowerCase()} apresentou maior valorização e geração de renda. Recomendamos analisar o perfil de risco e liquidez antes de decidir.\n\n`;
|
| 332 |
-
analiseDiv.textContent = analiseTexto;
|
| 333 |
-
|
| 334 |
-
// Gerar gráfico simples (usando Chart.js CDN)
|
| 335 |
-
if (!window.Chart) {
|
| 336 |
-
const script = document.createElement('script');
|
| 337 |
-
script.src = 'https://cdn.jsdelivr.net/npm/chart.js';
|
| 338 |
-
document.head.appendChild(script);
|
| 339 |
-
script.onload = () => criarGrafico();
|
| 340 |
-
} else {
|
| 341 |
-
criarGrafico();
|
| 342 |
-
}
|
| 343 |
-
|
| 344 |
-
function criarGrafico() {
|
| 345 |
-
graficoImg.style.display = "none";
|
| 346 |
-
|
| 347 |
-
// Criar canvas dinâmico
|
| 348 |
-
let canvas = document.getElementById('chart-canvas');
|
| 349 |
-
if (!canvas) {
|
| 350 |
-
canvas = document.createElement('canvas');
|
| 351 |
-
canvas.id = 'chart-canvas';
|
| 352 |
-
canvas.style.maxWidth = '100%';
|
| 353 |
-
graficoImg.parentNode.insertBefore(canvas, graficoImg);
|
| 354 |
-
}
|
| 355 |
-
|
| 356 |
-
if (window.myChart) {
|
| 357 |
-
window.myChart.destroy();
|
| 358 |
-
}
|
| 359 |
-
|
| 360 |
-
window.myChart = new Chart(canvas.getContext('2d'), {
|
| 361 |
-
type: 'line',
|
| 362 |
-
data: {
|
| 363 |
-
labels: anos,
|
| 364 |
-
datasets: [
|
| 365 |
-
{
|
| 366 |
-
label: 'Studio (Patrimônio + Renda)',
|
| 367 |
-
data: studio_total,
|
| 368 |
-
borderColor: '#00ff99',
|
| 369 |
-
backgroundColor: 'rgba(0,255,153,0.3)',
|
| 370 |
-
tension: 0.3,
|
| 371 |
-
fill: true,
|
| 372 |
-
pointRadius: 5,
|
| 373 |
-
},
|
| 374 |
-
{
|
| 375 |
-
label: 'Franquia',
|
| 376 |
-
data: franquia,
|
| 377 |
-
borderColor: '#00aaff',
|
| 378 |
-
backgroundColor: 'rgba(0,170,255,0.3)',
|
| 379 |
-
tension: 0.3,
|
| 380 |
-
fill: true,
|
| 381 |
-
pointRadius: 5,
|
| 382 |
-
},
|
| 383 |
-
{
|
| 384 |
-
label: 'Ações',
|
| 385 |
-
data: acoes,
|
| 386 |
-
borderColor: '#ffaa00',
|
| 387 |
-
backgroundColor: 'rgba(255,170,0,0.3)',
|
| 388 |
-
tension: 0.3,
|
| 389 |
-
fill: true,
|
| 390 |
-
pointRadius: 5,
|
| 391 |
-
},
|
| 392 |
-
{
|
| 393 |
-
label: 'Renda Fixa',
|
| 394 |
-
data: renda_fixa_valores,
|
| 395 |
-
borderColor: '#ff0055',
|
| 396 |
-
backgroundColor: 'rgba(255,0,85,0.3)',
|
| 397 |
-
tension: 0.3,
|
| 398 |
-
fill: true,
|
| 399 |
-
pointRadius: 5,
|
| 400 |
-
},
|
| 401 |
-
]
|
| 402 |
-
},
|
| 403 |
-
options: {
|
| 404 |
-
responsive: true,
|
| 405 |
-
plugins: {
|
| 406 |
-
legend: {
|
| 407 |
-
labels: {
|
| 408 |
-
color: '#d0f0ff',
|
| 409 |
-
font: { weight: '600' }
|
| 410 |
-
}
|
| 411 |
-
},
|
| 412 |
-
tooltip: {
|
| 413 |
-
mode: 'index',
|
| 414 |
-
intersect: false,
|
| 415 |
-
callbacks: {
|
| 416 |
-
label: ctx => formatarBRL(ctx.parsed.y)
|
| 417 |
-
}
|
| 418 |
-
}
|
| 419 |
-
},
|
| 420 |
-
scales: {
|
| 421 |
-
y: {
|
| 422 |
-
beginAtZero: true,
|
| 423 |
-
ticks: {
|
| 424 |
-
color: '#a0d8ef',
|
| 425 |
-
callback: val => val.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' })
|
| 426 |
-
},
|
| 427 |
-
grid: {
|
| 428 |
-
color: 'rgba(160, 216, 239, 0.3)'
|
| 429 |
-
}
|
| 430 |
-
},
|
| 431 |
-
x: {
|
| 432 |
-
ticks: { color: '#a0d8ef' },
|
| 433 |
-
grid: { color: 'rgba(160, 216, 239, 0.15)' }
|
| 434 |
-
}
|
| 435 |
-
}
|
| 436 |
-
}
|
| 437 |
-
});
|
| 438 |
-
|
| 439 |
-
resultado.style.display = 'block';
|
| 440 |
-
}
|
| 441 |
});
|
| 442 |
</script>
|
| 443 |
</body>
|
| 444 |
</html>
|
| 445 |
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="pt-BR">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
+
<title>Simulador de Investimentos - Relatório</title>
|
| 7 |
<style>
|
| 8 |
+
/* Reset básico */
|
|
|
|
|
|
|
| 9 |
* {
|
| 10 |
box-sizing: border-box;
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 0;
|
| 13 |
}
|
| 14 |
+
|
| 15 |
body {
|
| 16 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 17 |
+
background: linear-gradient(135deg, #0b72f6 0%, #1e90ff 100%);
|
|
|
|
| 18 |
min-height: 100vh;
|
| 19 |
display: flex;
|
| 20 |
+
justify-content: center;
|
| 21 |
+
align-items: flex-start;
|
| 22 |
+
padding: 20px;
|
| 23 |
+
color: #222;
|
|
|
|
| 24 |
}
|
| 25 |
+
|
| 26 |
+
.container {
|
| 27 |
+
background: #fff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
border-radius: 12px;
|
| 29 |
+
padding: 25px 30px;
|
| 30 |
+
max-width: 420px;
|
| 31 |
width: 100%;
|
| 32 |
+
box-shadow: 0 8px 20px rgba(11, 114, 246, 0.3);
|
| 33 |
+
display: flex;
|
| 34 |
+
flex-direction: column;
|
| 35 |
+
gap: 18px;
|
| 36 |
}
|
| 37 |
+
|
| 38 |
+
h1 {
|
| 39 |
+
text-align: center;
|
| 40 |
+
color: #0b72f6;
|
| 41 |
+
margin-bottom: 20px;
|
| 42 |
+
font-weight: 700;
|
| 43 |
+
font-size: 1.8rem;
|
| 44 |
+
letter-spacing: 1px;
|
| 45 |
}
|
| 46 |
+
|
| 47 |
label {
|
|
|
|
| 48 |
font-weight: 600;
|
| 49 |
+
font-size: 0.95rem;
|
| 50 |
+
margin-bottom: 6px;
|
| 51 |
+
display: block;
|
| 52 |
+
color: #333;
|
|
|
|
|
|
|
| 53 |
}
|
| 54 |
+
|
| 55 |
input[type="number"] {
|
| 56 |
width: 100%;
|
| 57 |
+
padding: 10px 12px;
|
| 58 |
+
border: 2px solid #0b72f6;
|
| 59 |
border-radius: 8px;
|
|
|
|
| 60 |
font-size: 1rem;
|
| 61 |
+
transition: border-color 0.3s ease;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
input[type="number"]:focus {
|
| 64 |
+
outline: none;
|
| 65 |
+
border-color: #1e90ff;
|
| 66 |
+
box-shadow: 0 0 8px #1e90ffaa;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
}
|
| 68 |
|
| 69 |
+
form {
|
| 70 |
+
display: flex;
|
| 71 |
+
flex-direction: column;
|
| 72 |
+
gap: 18px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
+
.btn-group {
|
| 76 |
+
display: flex;
|
| 77 |
+
justify-content: space-between;
|
| 78 |
+
align-items: center;
|
| 79 |
+
gap: 12px;
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
|
| 82 |
+
button {
|
| 83 |
+
flex: 1;
|
| 84 |
+
background-color: #0b72f6;
|
| 85 |
+
color: white;
|
| 86 |
+
font-weight: 700;
|
| 87 |
+
font-size: 1.1rem;
|
| 88 |
+
padding: 12px 0;
|
| 89 |
+
border: none;
|
| 90 |
border-radius: 10px;
|
| 91 |
+
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
transition: background-color 0.25s ease;
|
| 93 |
+
user-select: none;
|
| 94 |
}
|
| 95 |
+
button:hover:not(:disabled) {
|
| 96 |
+
background-color: #0958c7;
|
|
|
|
|
|
|
| 97 |
}
|
| 98 |
+
button:disabled {
|
| 99 |
+
background-color: #aac9f9;
|
| 100 |
+
cursor: not-allowed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
}
|
| 102 |
|
| 103 |
+
#loadingMessage {
|
| 104 |
+
font-weight: 600;
|
| 105 |
+
color: #0b72f6;
|
| 106 |
+
white-space: nowrap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
}
|
| 108 |
|
| 109 |
/* Responsividade */
|
| 110 |
@media (max-width: 480px) {
|
| 111 |
+
.container {
|
| 112 |
+
max-width: 100%;
|
| 113 |
+
padding: 20px;
|
| 114 |
+
border-radius: 0;
|
| 115 |
+
min-height: 100vh;
|
| 116 |
+
box-shadow: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
}
|
| 118 |
}
|
| 119 |
</style>
|
| 120 |
</head>
|
| 121 |
<body>
|
| 122 |
+
<main class="container">
|
| 123 |
+
<h1>Simulador de Investimentos</h1>
|
| 124 |
+
<form method="POST" id="formPrincipal">
|
| 125 |
+
<label for="capital">Capital Inicial (R$)</label>
|
| 126 |
+
<input type="number" id="capital" name="capital" step="0.01" min="0" required placeholder="Ex: 100000" />
|
| 127 |
|
| 128 |
+
<label for="studio_ret">Retorno Mensal Studio (%)</label>
|
| 129 |
+
<input type="number" id="studio_ret" name="studio_ret" step="0.01" min="0" required placeholder="Ex: 1.5" />
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
+
<label for="valorizacao">Valorização Anual do Studio (%)</label>
|
| 132 |
+
<input type="number" id="valorizacao" name="valorizacao" step="0.01" min="0" required placeholder="Ex: 5" />
|
| 133 |
|
| 134 |
+
<label for="franquia_ret">Retorno Anual Franquia (R$)</label>
|
| 135 |
+
<input type="number" id="franquia_ret" name="franquia_ret" step="0.01" min="0" required placeholder="Ex: 15000" />
|
| 136 |
|
| 137 |
+
<label for="acoes_ret">Retorno Anual Ações (%)</label>
|
| 138 |
+
<input type="number" id="acoes_ret" name="acoes_ret" step="0.01" min="0" required placeholder="Ex: 8" />
|
| 139 |
|
| 140 |
+
<label for="renda_fixa">Retorno Anual Renda Fixa (%)</label>
|
| 141 |
+
<input type="number" id="renda_fixa" name="renda_fixa" step="0.01" min="0" required placeholder="Ex: 6" />
|
| 142 |
|
| 143 |
+
<label for="inflacao">Inflação Anual (%)</label>
|
| 144 |
+
<input type="number" id="inflacao" name="inflacao" step="0.01" min="0" required placeholder="Ex: 4" />
|
| 145 |
|
| 146 |
+
<div class="btn-group">
|
| 147 |
+
<button type="submit">Calcular</button>
|
| 148 |
+
<button type="submit" id="gerarRelatorio" formaction="/gerar-pdf" formmethod="post">Gerar Relatório</button>
|
| 149 |
+
<span id="loadingMessage" style="display:none;">Gerando relatório...</span>
|
| 150 |
+
</div>
|
| 151 |
+
</form>
|
| 152 |
+
</main>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
<script>
|
| 155 |
+
const btnGerar = document.getElementById("gerarRelatorio");
|
| 156 |
+
const loadingMsg = document.getElementById("loadingMessage");
|
| 157 |
+
|
| 158 |
+
btnGerar.addEventListener("click", () => {
|
| 159 |
+
btnGerar.disabled = true;
|
| 160 |
+
loadingMsg.style.display = "inline";
|
| 161 |
+
|
| 162 |
+
// Caso queira reabilitar após 15 segundos (segurança)
|
| 163 |
+
setTimeout(() => {
|
| 164 |
+
btnGerar.disabled = false;
|
| 165 |
+
loadingMsg.style.display = "none";
|
| 166 |
+
}, 15000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
});
|
| 168 |
</script>
|
| 169 |
</body>
|
| 170 |
</html>
|
| 171 |
|
| 172 |
+
|