Persano commited on
Commit
491fe90
·
verified ·
1 Parent(s): dbfe4cd

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +53 -95
templates/index.html CHANGED
@@ -1,109 +1,67 @@
1
  <!DOCTYPE html>
2
- <html lang="pt-br">
3
  <head>
4
  <meta charset="UTF-8" />
5
- <title>Simulador de Investimentos</title>
6
- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" />
7
- <style>
8
- body {
9
- margin: 20px;
10
- background: #f9f9f9;
11
- }
12
- .container {
13
- max-width: 900px;
14
- background: white;
15
- padding: 20px 30px;
16
- border-radius: 8px;
17
- box-shadow: 0 0 15px #ddd;
18
- }
19
- h1 {
20
- margin-bottom: 25px;
21
- color: #2E7D32;
22
- }
23
- .btn-pdf {
24
- background-color: #2E7D32;
25
- color: white;
26
- }
27
- .btn-pdf:hover {
28
- background-color: #1B4D24;
29
- color: white;
30
- }
31
- footer {
32
- margin-top: 40px;
33
- font-size: 0.9em;
34
- color: #666;
35
- text-align: center;
36
- }
37
- </style>
38
  </head>
39
- <body>
40
- <div class="container">
41
- <h1>Simulador de Investimentos Imobiliários</h1>
42
  <form method="POST" action="/">
43
- <div class="row g-3">
44
- <div class="col-md-6">
45
- <label for="capital" class="form-label">Capital Inicial (R$):</label>
46
- <input type="number" class="form-control" id="capital" name="capital" required step="0.01" min="1" value="{{ capital or 100000 }}" />
47
- </div>
48
- <div class="col-md-6">
49
- <label for="studio_ret" class="form-label">Retorno Mensal Studio (%):</label>
50
- <input type="number" class="form-control" id="studio_ret" name="studio_ret" required step="0.01" value="{{ studio_ret or 1.0 }}" />
51
- </div>
52
- <div class="col-md-6">
53
- <label for="valorizacao" class="form-label">Valorização Anual Studio (%):</label>
54
- <input type="number" class="form-control" id="valorizacao" name="valorizacao" required step="0.01" value="{{ valorizacao or 5.0 }}" />
55
- </div>
56
- <div class="col-md-6">
57
- <label for="franquia_ret" class="form-label">Retorno Anual Franquia (R$):</label>
58
- <input type="number" class="form-control" id="franquia_ret" name="franquia_ret" required step="0.01" value="{{ franquia_ret or 5000 }}" />
59
- </div>
60
- <div class="col-md-6">
61
- <label for="acoes_ret" class="form-label">Retorno Anual Ações (%):</label>
62
- <input type="number" class="form-control" id="acoes_ret" name="acoes_ret" required step="0.01" value="{{ acoes_ret or 8.0 }}" />
63
- </div>
64
- <div class="col-md-6">
65
- <label for="renda_fixa" class="form-label">Retorno Anual Renda Fixa (%):</label>
66
- <input type="number" class="form-control" id="renda_fixa" name="renda_fixa" required step="0.01" value="{{ renda_fixa or 6.0 }}" />
67
- </div>
68
- <div class="col-md-6">
69
- <label for="inflacao" class="form-label">Inflação Anual Estimada (%):</label>
70
- <input type="number" class="form-control" id="inflacao" name="inflacao" required step="0.01" value="{{ inflacao or 4.0 }}" />
71
- </div>
72
  </div>
73
- <div class="mt-4 d-flex gap-3">
74
- <button type="submit" class="btn btn-success">Calcular</button>
75
-
76
- {% if capital %}
77
- <form method="POST" action="/download_pdf" style="display:inline;">
78
- <input type="hidden" name="capital" value="{{ capital }}">
79
- <input type="hidden" name="studio_ret" value="{{ studio_ret }}">
80
- <input type="hidden" name="valorizacao" value="{{ valorizacao }}">
81
- <input type="hidden" name="franquia_ret" value="{{ franquia_ret }}">
82
- <input type="hidden" name="acoes_ret" value="{{ acoes_ret }}">
83
- <input type="hidden" name="renda_fixa" value="{{ renda_fixa }}">
84
- <input type="hidden" name="inflacao" value="{{ inflacao }}">
85
- <button type="submit" class="btn btn-pdf">Gerar PDF</button>
86
- </form>
87
- {% endif %}
88
  </div>
 
 
 
 
 
 
 
 
 
89
  </form>
90
 
91
  {% if tabela %}
92
- <hr class="my-4" />
93
- <h3>Evolução dos Investimentos - 5 anos</h3>
94
- <div class="table-responsive">
95
- {{ tabela | safe }}
96
- </div>
97
- <div class="mt-4">
98
- <h4>Análise Final:</h4>
99
- <p>{{ analise_final | safe }}</p>
100
- <p><strong>Investimento com maior retorno:</strong> {{ investimento_mais_valorizado }} ({{ valor_mais_alto | round(2) | string | replace(".", ",") }})</p>
101
- </div>
 
 
 
 
 
 
 
 
 
 
102
  {% endif %}
103
- </div>
104
- <footer>
105
- Desenvolvido por Rafael Persano - Simulador Financeiro
106
- </footer>
107
  </body>
108
  </html>
109
 
 
1
  <!DOCTYPE html>
2
+ <html lang="pt-BR">
3
  <head>
4
  <meta charset="UTF-8" />
5
+ <title>Simulador Investimentos</title>
6
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  </head>
8
+ <body class="p-4">
9
+ <h1>Simulador de Investimentos</h1>
10
+
11
  <form method="POST" action="/">
12
+ <div class="mb-3">
13
+ <label>Capital Inicial (R$):</label>
14
+ <input type="number" step="0.01" name="capital" class="form-control" required value="{{ capital or '' }}">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  </div>
16
+ <div class="mb-3">
17
+ <label>Retorno Mensal Studio (%):</label>
18
+ <input type="number" step="0.01" name="studio_ret" class="form-control" required value="{{ studio_ret or '' }}">
19
+ </div>
20
+ <div class="mb-3">
21
+ <label>Valorização Anual (%):</label>
22
+ <input type="number" step="0.01" name="valorizacao" class="form-control" required value="{{ valorizacao or '' }}">
23
+ </div>
24
+ <div class="mb-3">
25
+ <label>Lucro Anual Franquia (R$):</label>
26
+ <input type="number" step="0.01" name="franquia_ret" class="form-control" required value="{{ franquia_ret or '' }}">
27
+ </div>
28
+ <div class="mb-3">
29
+ <label>Retorno Anual Ações (%):</label>
30
+ <input type="number" step="0.01" name="acoes_ret" class="form-control" required value="{{ acoes_ret or '' }}">
31
  </div>
32
+ <div class="mb-3">
33
+ <label>Retorno Anual Renda Fixa (%):</label>
34
+ <input type="number" step="0.01" name="renda_fixa" class="form-control" required value="{{ renda_fixa or '' }}">
35
+ </div>
36
+ <div class="mb-3">
37
+ <label>Inflação Anual (%):</label>
38
+ <input type="number" step="0.01" name="inflacao" class="form-control" required value="{{ inflacao or '' }}">
39
+ </div>
40
+ <button type="submit" class="btn btn-primary">Calcular</button>
41
  </form>
42
 
43
  {% if tabela %}
44
+ <hr>
45
+ <h2>Análise dos Investimentos</h2>
46
+ <p>{{ analise_final|safe }}</p>
47
+
48
+ <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico" class="img-fluid mb-3" />
49
+
50
+ <h3>Tabela de Resultados</h3>
51
+ {{ tabela|safe }}
52
+
53
+ <form method="POST" action="/download_pdf">
54
+ <!-- Enviar mesmos dados para gerar PDF -->
55
+ <input type="hidden" name="capital" value="{{ capital }}">
56
+ <input type="hidden" name="studio_ret" value="{{ studio_ret }}">
57
+ <input type="hidden" name="valorizacao" value="{{ valorizacao }}">
58
+ <input type="hidden" name="franquia_ret" value="{{ franquia_ret }}">
59
+ <input type="hidden" name="acoes_ret" value="{{ acoes_ret }}">
60
+ <input type="hidden" name="renda_fixa" value="{{ renda_fixa }}">
61
+ <input type="hidden" name="inflacao" value="{{ inflacao }}">
62
+ <button type="submit" class="btn btn-success mt-3">Baixar Relatório PDF</button>
63
+ </form>
64
  {% endif %}
 
 
 
 
65
  </body>
66
  </html>
67