Persano commited on
Commit
0df9a4e
·
verified ·
1 Parent(s): 3eff84a

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +78 -147
templates/index.html CHANGED
@@ -3,170 +3,101 @@
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
-
 
3
  <head>
4
  <meta charset="UTF-8" />
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Simulador de Investimento</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
8
  <style>
 
 
 
 
 
 
 
9
  body {
10
+ padding-top: 30px;
11
+ background-color: #f8f9fa;
 
 
 
 
 
 
12
  }
 
13
  .container {
14
+ max-width: 900px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
+ img {
17
+ max-width: 100%;
18
+ height: auto;
19
  }
20
+ .table td, .table th {
21
+ vertical-align: middle;
 
22
  }
23
+ .grafico {
24
+ text-align: center;
25
+ margin: 30px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
  </style>
28
  </head>
29
  <body>
30
+ <div class="container">
31
+ <h1 class="mb-4 text-center">Simulador de Investimento</h1>
32
+
33
+ <form method="POST" action="/">
34
+ <div class="row g-3">
35
+ <div class="col-md-6">
36
+ <label class="form-label">Capital Inicial (R$)</label>
37
+ <input type="number" class="form-control" step="0.01" name="capital" placeholder="Ex: 100000" required>
38
+ </div>
39
+ <div class="col-md-6">
40
+ <label class="form-label">Retorno Studio (% a.m.)</label>
41
+ <input type="number" class="form-control" step="0.01" name="studio_ret" placeholder="Ex: 0.8" required>
42
+ </div>
43
+ <div class="col-md-6">
44
+ <label class="form-label">Valorização Imóvel (% a.a.)</label>
45
+ <input type="number" class="form-control" step="0.01" name="valorizacao" placeholder="Ex: 6.0" required>
46
+ </div>
47
+ <div class="col-md-6">
48
+ <label class="form-label">Retorno Franquia (R$/ano)</label>
49
+ <input type="number" class="form-control" step="0.01" name="franquia_ret" placeholder="Ex: 20000" required>
50
+ </div>
51
+ <div class="col-md-6">
52
+ <label class="form-label">Retorno Ações (% a.a.)</label>
53
+ <input type="number" class="form-control" step="0.01" name="acoes_ret" placeholder="Ex: 12.0" required>
54
+ </div>
55
+ <div class="col-md-6">
56
+ <label class="form-label">Renda Fixa (% a.a.)</label>
57
+ <input type="number" class="form-control" step="0.01" name="renda_fixa" placeholder="Ex: 9.0" required>
58
+ </div>
59
+ <div class="col-md-6">
60
+ <label class="form-label">Inflação estimada (% a.a.)</label>
61
+ <input type="number" class="form-control" step="0.01" name="inflacao" placeholder="Ex: 4.5" required>
62
+ </div>
63
+ </div>
64
 
65
+ <div class="mt-4 d-grid gap-2">
66
+ <button type="submit" class="btn btn-primary">Simular Investimentos</button>
67
+ </div>
68
+ </form>
69
 
70
+ {% if tabela %}
71
+ <hr class="my-5" />
72
 
73
+ <h2 class="text-center">Gráfico de Projeção</h2>
74
+ <div class="grafico">
75
+ <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico de projeção">
 
76
  </div>
 
 
77
 
78
+ <h2 class="mt-5">Tabela Comparativa (5 anos)</h2>
79
+ <div class="table-responsive">
80
+ {{ tabela|safe }}
81
+ </div>
82
 
83
+ <h2 class="mt-5">Análise Final</h2>
84
+ <div class="mt-3">
85
+ {{ analise_final|safe }}
86
+ </div>
87
 
88
+ <form action="/gerar-pdf" method="POST">
89
+ <input type="hidden" name="capital" value="{{ capital }}">
90
+ <input type="hidden" name="studio_ret" value="{{ request.form['studio_ret'] }}">
91
+ <input type="hidden" name="valorizacao" value="{{ request.form['valorizacao'] }}">
92
+ <input type="hidden" name="franquia_ret" value="{{ request.form['franquia_ret'] }}">
93
+ <input type="hidden" name="acoes_ret" value="{{ request.form['acoes_ret'] }}">
94
+ <input type="hidden" name="renda_fixa" value="{{ request.form['renda_fixa'] }}">
95
+ <input type="hidden" name="inflacao" value="{{ request.form['inflacao'] }}">
96
+ <div class="mt-4 d-grid">
97
+ <button type="submit" class="btn btn-success">📄 Baixar PDF com Análise Profunda (IA)</button>
98
+ </div>
99
+ </form>
100
+ {% endif %}
101
+ </div>
102
  </body>
103
  </html>