Persano commited on
Commit
c0592b0
·
verified ·
1 Parent(s): f72cd57

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +141 -143
templates/index.html CHANGED
@@ -3,167 +3,165 @@
3
  <head>
4
  <meta charset="UTF-8" />
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Simulador de Investimentos</title>
 
 
 
 
7
  <style>
8
  body {
9
- font-family: 'Segoe UI', sans-serif;
10
- background-color: #f4f6f9;
11
- color: #333;
12
  padding: 20px;
13
- margin: 0;
 
14
  }
15
- h1, h2 {
16
- text-align: center;
17
  color: #2c3e50;
18
  }
19
- form {
20
- background: #fff;
21
- max-width: 600px;
22
- margin: 0 auto 30px auto;
23
- padding: 30px;
24
- border-radius: 10px;
25
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
26
  }
27
- label {
28
- display: block;
29
- margin-bottom: 6px;
30
- font-weight: 600;
31
- color: #555;
32
- }
33
- input[type="number"] {
34
- width: 100%;
35
- padding: 10px;
36
- margin-bottom: 16px;
37
- border: 1px solid #ccc;
38
- border-radius: 5px;
39
- box-sizing: border-box;
40
- }
41
- button {
42
- width: 100%;
43
- padding: 12px;
44
- background: #007bff;
45
- color: white;
46
- border: none;
47
- font-size: 1em;
48
- border-radius: 5px;
49
- cursor: pointer;
50
- margin-top: 10px;
51
- transition: background 0.3s;
52
- }
53
- button:hover {
54
- background: #0056b3;
55
- }
56
- .grafico {
57
- text-align: center;
58
- margin-bottom: 40px;
59
- }
60
- table {
61
- width: 95%;
62
- margin: 20px auto;
63
- border-collapse: collapse;
64
- background: white;
65
- border-radius: 8px;
66
- overflow: hidden;
67
- box-shadow: 0 2px 8px rgba(0,0,0,0.05);
68
- }
69
- th, td {
70
- padding: 12px 15px;
71
- border: 1px solid #ddd;
72
- text-align: right;
73
- }
74
- th {
75
- background-color: #007bff;
76
- color: white;
77
- text-align: center;
78
- }
79
- tr:hover {
80
- background-color: #f1f1f1;
81
- }
82
- .resultado-destaque {
83
- max-width: 800px;
84
- margin: 30px auto;
85
- background: #e8f5e9;
86
- color: #2e7d32;
87
- padding: 20px;
88
- font-size: 1.2em;
89
- font-weight: bold;
90
- text-align: center;
91
  border-left: 6px solid #2e7d32;
92
- border-radius: 6px;
93
- }
94
- .botao-pdf {
95
- text-align: center;
96
- margin-top: 30px;
97
- }
98
- .botao-pdf form {
99
- display: inline-block;
100
- }
101
- @media print {
102
- form, .botao-pdf, button {
103
- display: none !important;
104
- }
105
  }
106
  </style>
107
  </head>
108
  <body>
109
-
110
- <h1>Simulador de Investimentos</h1>
111
-
112
- <form method="post" action="/">
113
- <label for="capital">Capital Inicial (R$):</label>
114
- <input type="number" id="capital" name="capital" step="0.01" required value="{{ capital or 400000 }}">
115
-
116
- <label for="studio_ret">Retorno Mensal do Studio (%):</label>
117
- <input type="number" id="studio_ret" name="studio_ret" step="0.01" required value="{{ studio_ret or 1 }}">
118
-
119
- <label for="valorizacao">Valorização Anual do Imóvel (%):</label>
120
- <input type="number" id="valorizacao" name="valorizacao" step="0.01" required value="{{ valorizacao or 4 }}">
121
-
122
- <label for="franquia_ret">Lucro Anual da Franquia (R$):</label>
123
- <input type="number" id="franquia_ret" name="franquia_ret" step="0.01" required value="{{ franquia_ret or 40000 }}">
124
-
125
- <label for="acoes_ret">Retorno Anual em Ações (%):</label>
126
- <input type="number" id="acoes_ret" name="acoes_ret" step="0.01" required value="{{ acoes_ret or 11 }}">
127
-
128
- <label for="renda_fixa">Retorno Anual Renda Fixa (%):</label>
129
- <input type="number" id="renda_fixa" name="renda_fixa" step="0.01" required value="{{ renda_fixa or 12 }}">
130
-
131
- <label for="inflacao">Inflação Anual Esperada (%):</label>
132
- <input type="number" id="inflacao" name="inflacao" step="0.01" required value="{{ inflacao or 5 }}">
133
-
134
- <button type="submit">Rodar Simulação</button>
135
- </form>
136
-
137
- {% if tabela %}
138
- <div class="grafico">
139
- <h2>Gráfico Comparativo</h2>
140
- <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico de Investimentos" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  </div>
142
 
143
- <div>
144
- {{ tabela | safe }}
145
  </div>
146
 
147
- <div class="resultado-destaque">
148
- Investimento com maior retorno: <span style="color:#1b5e20;">{{ investimento_mais_valorizado }}</span><br>
149
- Valor final estimado: <span style="color:#1b5e20;">R$ {{ valor_mais_alto | round(2) | string | replace('.', ',') }}</span>
150
- </div>
151
 
152
- <div class="botao-pdf">
153
- <form action="/download_pdf" method="post">
154
- <input type="hidden" name="capital" value="{{ capital }}">
155
- <input type="hidden" name="studio_ret" value="{{ studio_ret }}">
156
- <input type="hidden" name="valorizacao" value="{{ valorizacao }}">
157
- <input type="hidden" name="franquia_ret" value="{{ franquia_ret }}">
158
- <input type="hidden" name="acoes_ret" value="{{ acoes_ret }}">
159
- <input type="hidden" name="renda_fixa" value="{{ renda_fixa }}">
160
- <input type="hidden" name="inflacao" value="{{ inflacao }}">
161
- <button type="submit" style="background: #28a745;">Gerar PDF do Relatório</button>
162
- </form>
163
  </div>
164
- {% endif %}
165
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  </body>
167
  </html>
168
-
169
-
 
3
  <head>
4
  <meta charset="UTF-8" />
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Simulação de Investimentos</title>
7
+ <link
8
+ href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
9
+ rel="stylesheet"
10
+ />
11
  <style>
12
  body {
 
 
 
13
  padding: 20px;
14
+ background-color: #f8f9fa;
15
+ font-family: Arial, sans-serif;
16
  }
17
+ h1 {
18
+ margin-bottom: 30px;
19
  color: #2c3e50;
20
  }
21
+ .table-wrapper {
22
+ overflow-x: auto;
 
 
 
 
 
23
  }
24
+ .analise {
25
+ background-color: #e8f5e9;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  border-left: 6px solid #2e7d32;
27
+ padding: 15px;
28
+ margin: 15px 0;
29
+ font-size: 1rem;
 
 
 
 
 
 
 
 
 
 
30
  }
31
  </style>
32
  </head>
33
  <body>
34
+ <div class="container">
35
+ <h1>Simulação de Investimentos - 5 anos</h1>
36
+
37
+ <form method="POST" action="/" class="mb-4">
38
+ <div class="row g-3">
39
+ <div class="col-md-4">
40
+ <label for="capital" class="form-label">Capital Inicial (R$)</label>
41
+ <input
42
+ type="number"
43
+ step="0.01"
44
+ class="form-control"
45
+ id="capital"
46
+ name="capital"
47
+ required
48
+ value="{{ capital or 100000 }}"
49
+ />
50
+ </div>
51
+
52
+ <div class="col-md-4">
53
+ <label for="studio_ret" class="form-label">Retorno mensal Studio (%)</label>
54
+ <input
55
+ type="number"
56
+ step="0.01"
57
+ class="form-control"
58
+ id="studio_ret"
59
+ name="studio_ret"
60
+ required
61
+ value="{{ studio_ret or 0.5 }}"
62
+ />
63
+ </div>
64
+
65
+ <div class="col-md-4">
66
+ <label for="valorizacao" class="form-label">Valorização anual Studio (%)</label>
67
+ <input
68
+ type="number"
69
+ step="0.01"
70
+ class="form-control"
71
+ id="valorizacao"
72
+ name="valorizacao"
73
+ required
74
+ value="{{ valorizacao or 5 }}"
75
+ />
76
+ </div>
77
+
78
+ <div class="col-md-4">
79
+ <label for="franquia_ret" class="form-label">Retorno anual Franquia (R$)</label>
80
+ <input
81
+ type="number"
82
+ step="0.01"
83
+ class="form-control"
84
+ id="franquia_ret"
85
+ name="franquia_ret"
86
+ required
87
+ value="{{ franquia_ret or 12000 }}"
88
+ />
89
+ </div>
90
+
91
+ <div class="col-md-4">
92
+ <label for="acoes_ret" class="form-label">Retorno anual Ações (%)</label>
93
+ <input
94
+ type="number"
95
+ step="0.01"
96
+ class="form-control"
97
+ id="acoes_ret"
98
+ name="acoes_ret"
99
+ required
100
+ value="{{ acoes_ret or 10 }}"
101
+ />
102
+ </div>
103
+
104
+ <div class="col-md-4">
105
+ <label for="renda_fixa" class="form-label">Retorno anual Renda Fixa (%)</label>
106
+ <input
107
+ type="number"
108
+ step="0.01"
109
+ class="form-control"
110
+ id="renda_fixa"
111
+ name="renda_fixa"
112
+ required
113
+ value="{{ renda_fixa or 7 }}"
114
+ />
115
+ </div>
116
+
117
+ <div class="col-md-4">
118
+ <label for="inflacao" class="form-label">Inflação anual estimada (%)</label>
119
+ <input
120
+ type="number"
121
+ step="0.01"
122
+ class="form-control"
123
+ id="inflacao"
124
+ name="inflacao"
125
+ required
126
+ value="{{ inflacao or 4 }}"
127
+ />
128
+ </div>
129
+ </div>
130
+
131
+ <button type="submit" class="btn btn-primary mt-4">Simular</button>
132
+ </form>
133
+
134
+ {% if tabela and grafico %}
135
+ <hr />
136
+ <h2>Resultados da Simulação</h2>
137
+
138
+ <div class="analise">
139
+ {{ analise_final | safe }}
140
  </div>
141
 
142
+ <div class="analise">
143
+ {{ consideracoes | safe }}
144
  </div>
145
 
146
+ <h3>Gráfico de Evolução dos Investimentos</h3>
147
+ <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico de investimentos" class="img-fluid mb-4" />
 
 
148
 
149
+ <h3>Evolução Ano a Ano</h3>
150
+ <div class="table-wrapper">
151
+ {{ tabela | safe }}
 
 
 
 
 
 
 
 
152
  </div>
 
153
 
154
+ <form method="POST" action="/download_pdf" class="mt-4">
155
+ <input type="hidden" name="capital" value="{{ capital }}" />
156
+ <input type="hidden" name="studio_ret" value="{{ studio_ret }}" />
157
+ <input type="hidden" name="valorizacao" value="{{ valorizacao }}" />
158
+ <input type="hidden" name="franquia_ret" value="{{ franquia_ret }}" />
159
+ <input type="hidden" name="acoes_ret" value="{{ acoes_ret }}" />
160
+ <input type="hidden" name="renda_fixa" value="{{ renda_fixa }}" />
161
+ <input type="hidden" name="inflacao" value="{{ inflacao }}" />
162
+ <button type="submit" class="btn btn-success">Baixar Relatório em PDF</button>
163
+ </form>
164
+ {% endif %}
165
+ </div>
166
  </body>
167
  </html>