Spaces:
Running

File size: 18,450 Bytes
90b3977
afa95cf
90b3977
 
 
afa95cf
90b3977
afa95cf
90b3977
afa95cf
 
90b3977
afa95cf
5ea3b69
 
 
 
 
 
 
afa95cf
 
5ea3b69
afa95cf
 
90b3977
afa95cf
 
06059e0
90b3977
 
afa95cf
 
 
 
 
 
 
5ea3b69
afa95cf
 
90b3977
8d8e9c7
5ea3b69
afa95cf
 
 
 
 
 
 
 
5ea3b69
afa95cf
 
 
 
 
 
5ea3b69
 
afa95cf
 
 
5ea3b69
afa95cf
 
 
 
 
8d8e9c7
afa95cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90b3977
 
5ea3b69
afa95cf
 
 
 
 
 
 
 
 
 
 
 
 
 
8d8e9c7
afa95cf
 
5ea3b69
afa95cf
 
 
 
 
 
 
 
5ea3b69
afa95cf
 
 
 
 
90b3977
afa95cf
 
 
 
 
5ea3b69
afa95cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5ea3b69
 
 
afa95cf
 
 
5ea3b69
afa95cf
 
 
5ea3b69
 
 
afa95cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5ea3b69
 
90b3977
afa95cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5ea3b69
afa95cf
5ea3b69
afa95cf
 
5ea3b69
afa95cf
 
 
5ea3b69
 
afa95cf
 
 
5ea3b69
 
afa95cf
 
5ea3b69
 
afa95cf
 
 
5ea3b69
afa95cf
5ea3b69
afa95cf
 
 
 
 
5ea3b69
afa95cf
 
 
5ea3b69
afa95cf
 
 
 
5ea3b69
afa95cf
 
 
 
 
5ea3b69
afa95cf
 
 
 
 
 
5ea3b69
afa95cf
 
 
 
 
5ea3b69
afa95cf
 
 
 
5ea3b69
afa95cf
 
5ea3b69
afa95cf
 
5ea3b69
afa95cf
5ea3b69
 
90b3977
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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Análise Sentimental de Ações B3</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%);
        }
        .pulse-animation {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        .sentiment-positive {
            background-color: #10b981;
        }
        .sentiment-neutral {
            background-color: #f59e0b;
        }
        .sentiment-negative {
            background-color: #ef4444;
        }
    </style>
</head>
<body class="bg-gray-100 min-h-screen">
    <div class="gradient-bg text-white py-8 px-4 shadow-lg">
        <div class="container mx-auto">
            <div class="flex items-center justify-between">
                <div>
                    <h1 class="text-3xl font-bold">StockSense B3</h1>
                    <p class="mt-2">Análise sentimental simplificada para investidores</p>
                </div>
                <div class="bg-white/20 p-3 rounded-full">
                    <i class="fas fa-chart-line text-2xl"></i>
                </div>
            </div>
        </div>
    </div>

    <div class="container mx-auto px-4 py-8 -mt-10">
        <div class="bg-white rounded-xl shadow-lg p-6 max-w-4xl mx-auto">
            <div class="flex flex-col md:flex-row gap-6">
                <div class="flex-1">
                    <h2 class="text-2xl font-bold text-gray-800 mb-4">Analisar Ação</h2>
                    <p class="text-gray-600 mb-6">Digite o código da ação da B3 para receber uma análise sentimental completa em linguagem simples.</p>
                    
                    <div class="relative">
                        <input type="text" id="stockInput" placeholder="Ex: PETR4, VALE3, ITUB4..." 
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
                        <button id="analyzeBtn" class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
                            Analisar <i class="fas fa-search ml-2"></i>
                        </button>
                    </div>
                    
                    <div class="mt-4 flex items-center text-sm text-gray-500">
                        <i class="fas fa-info-circle mr-2"></i>
                        <span>Exemplos populares: PETR4, VALE3, BBDC4, ITUB4</span>
                    </div>
                </div>
                
                <div class="md:w-1/3 bg-gray-50 rounded-lg p-4 flex flex-col items-center justify-center">
                    <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-bolt text-blue-600 text-2xl"></i>
                    </div>
                    <h3 class="font-semibold text-center">Análise em 3 Passos</h3>
                    <ol class="mt-3 space-y-2 text-sm text-gray-600">
                        <li class="flex items-start">
                            <span class="bg-blue-600 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs mr-2">1</span>
                            <span>Sentimento do mercado</span>
                        </li>
                        <li class="flex items-start">
                            <span class="bg-blue-600 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs mr-2">2</span>
                            <span>Análise técnica simplificada</span>
                        </li>
                        <li class="flex items-start">
                            <span class="bg-blue-600 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs mr-2">3</span>
                            <span>Recomendação clara</span>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>

    <div id="resultsSection" class="container mx-auto px-4 py-8 hidden">
        <div class="bg-white rounded-xl shadow-lg p-6 max-w-4xl mx-auto">
            <div class="flex justify-between items-start mb-6">
                <div>
                    <h2 class="text-2xl font-bold text-gray-800">
                        <span id="stockSymbol" class="bg-blue-100 text-blue-800 px-3 py-1 rounded-lg">PETR4</span>
                        <span id="stockName" class="ml-2">Petróleo Brasileiro S.A.</span>
                    </h2>
                    <div class="flex items-center mt-2">
                        <span id="currentPrice" class="text-2xl font-bold">R$ 32,15</span>
                        <span id="priceChange" class="ml-3 px-2 py-1 rounded text-sm font-medium bg-red-100 text-red-800">-1,2%</span>
                    </div>
                </div>
                <div id="sentimentBadge" class="px-4 py-2 rounded-full text-white font-medium sentiment-neutral">
                    Neutro
                </div>
            </div>
            
            <div class="grid md:grid-cols-3 gap-6 mb-8">
                <div class="bg-gray-50 p-4 rounded-lg">
                    <h3 class="font-semibold text-gray-700 mb-2 flex items-center">
                        <i class="fas fa-comments mr-2 text-blue-500"></i> Sentimento Geral
                    </h3>
                    <p id="generalSentiment" class="text-gray-600">O mercado está dividido sobre esta ação, com análises neutras predominando.</p>
                </div>
                <div class="bg-gray-50 p-4 rounded-lg">
                    <h3 class="font-semibold text-gray-700 mb-2 flex items-center">
                        <i class="fas fa-chart-bar mr-2 text-blue-500"></i> Tendência Técnica
                    </h3>
                    <p id="technicalTrend" class="text-gray-600">A ação está em uma fase de consolidação após queda recente.</p>
                </div>
                <div class="bg-gray-50 p-4 rounded-lg">
                    <h3 class="font-semibold text-gray-700 mb-2 flex items-center">
                        <i class="fas fa-lightbulb mr-2 text-blue-500"></i> Recomendação
                    </h3>
                    <p id="recommendation" class="text-gray-600">Aguardar melhores oportunidades de entrada.</p>
                </div>
            </div>
            
            <h3 class="text-lg font-semibold text-gray-800 mb-3">Análise Detalhada</h3>
            <div id="detailedAnalysis" class="bg-gray-50 p-4 rounded-lg mb-6">
                <p>A ação <span class="font-medium">PETR4</span> apresenta um momento de indecisão no mercado. Nos últimos 15 dias, o volume negociado ficou 12% abaixo da média histórica, indicando cautela dos investidores.</p>
                <p class="mt-3">Analistas apontam que o preço do petróleo e a política de dividendos são os principais fatores que estão influenciando o sentimento no momento. Recomenda-se acompanhar os próximos balanços trimestrais.</p>
            </div>
            
            <div class="border-t pt-4">
                <h3 class="text-lg font-semibold text-gray-800 mb-3">Fatores Chave</h3>
                <div class="space-y-3">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 h-5 w-5 text-green-500 mt-1">
                            <i class="fas fa-check-circle"></i>
                        </div>
                        <div class="ml-3">
                            <p class="text-sm font-medium text-gray-900">Setor em recuperação</p>
                            <p class="text-sm text-gray-500">O setor de energia tem mostrado sinais de melhora nos últimos meses.</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="flex-shrink-0 h-5 w-5 text-red-500 mt-1">
                            <i class="fas fa-exclamation-circle"></i>
                        </div>
                        <div class="ml-3">
                            <p class="text-sm font-medium text-gray-900">Pressão regulatória</p>
                            <p class="text-sm text-gray-500">Novas regulamentações podem impactar os resultados.</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="flex-shrink-0 h-5 w-5 text-yellow-500 mt-1">
                            <i class="fas fa-info-circle"></i>
                        </div>
                        <div class="ml-3">
                            <p class="text-sm font-medium text-gray-900">Dividendos estáveis</p>
                            <p class="text-sm text-gray-500">Histórico de pagamento de dividendos acima da média do mercado.</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="mt-6 flex justify-between items-center">
                <button id="newAnalysisBtn" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50">
                    <i class="fas fa-redo mr-2"></i> Nova Análise
                </button>
                <div class="text-sm text-gray-500">
                    <i class="fas fa-clock mr-1"></i> Atualizado em <span id="updateTime">05/07/2023 15:42</span>
                </div>
            </div>
        </div>
    </div>

    <div class="bg-gray-800 text-white py-8 mt-12">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between">
                <div class="mb-6 md:mb-0">
                    <h3 class="text-xl font-bold mb-4">StockSense B3</h3>
                    <p class="text-gray-400">Análises simplificadas para investidores de todos os níveis.</p>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-3">Aprenda mais</h4>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white">Termos de Uso</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white">Política de Privacidade</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white">Dúvidas Frequentes</a></li>
                    </ul>
                </div>
            </div>
            <div class="mt-8 pt-6 border-t border-gray-700 text-center text-gray-400 text-sm">
                <p>© 2023 StockSense B3. Este site não oferece recomendações de investimento.</p>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const analyzeBtn = document.getElementById('analyzeBtn');
            const stockInput = document.getElementById('stockInput');
            const resultsSection = document.getElementById('resultsSection');
            const newAnalysisBtn = document.getElementById('newAnalysisBtn');
            
            // Sample stock data (in a real app, this would come from an API)
            const stockDatabase = {
                'PETR4': {
                    name: 'Petróleo Brasileiro S.A.',
                    price: 32.15,
                    change: -1.2,
                    sentiment: 'neutral',
                    generalSentiment: 'O mercado está dividido sobre esta ação, com análises neutras predominando.',
                    technicalTrend: 'A ação está em uma fase de consolidação após queda recente.',
                    recommendation: 'Aguardar melhores oportunidades de entrada.',
                    detailedAnalysis: 'A ação PETR4 apresenta um momento de indecisão no mercado. Nos últimos 15 dias, o volume negociado ficou 12% abaixo da média histórica, indicando cautela dos investidores. Analistas apontam que o preço do petróleo e a política de dividendos são os principais fatores que estão influenciando o sentimento no momento. Recomenda-se acompanhar os próximos balanços trimestrais.'
                },
                'VALE3': {
                    name: 'Vale S.A.',
                    price: 68.90,
                    change: 2.3,
                    sentiment: 'positive',
                    generalSentiment: 'Sentimento positivo devido à alta no preço do minério de ferro.',
                    technicalTrend: 'Tendência de alta com volume crescente.',
                    recommendation: 'Pode ser uma boa oportunidade de compra.',
                    detailedAnalysis: 'A VALE3 tem se beneficiado do aumento nos preços internacionais do minério de ferro. A demanda chinesa e a recuperação da indústria global estão impulsionando os resultados. O último trimestre mostrou crescimento nos lucros e os analistas estão revisando suas projeções para cima.'
                },
                'ITUB4': {
                    name: 'Itaú Unibanco Holding S.A.',
                    price: 27.45,
                    change: -0.5,
                    sentiment: 'negative',
                    generalSentiment: 'Preocupações com aumento da inadimplência afetam o sentimento.',
                    technicalTrend: 'Testando suporte importante após queda.',
                    recommendation: 'Cautela até novo sinal de reversão.',
                    detailedAnalysis: 'O setor bancário está sob pressão devido ao aumento nas taxas de inadimplência. O ITUB4, apesar de ser um dos bancos mais sólidos, não está imune a esse movimento. Os resultados do próximo trimestre serão cruciais para determinar se a queda é momentânea ou o início de uma tendência mais prolongada.'
                }
            };
            
            analyzeBtn.addEventListener('click', function() {
                const stockCode = stockInput.value.trim().toUpperCase();
                
                if (stockCode === '') {
                    alert('Por favor, digite o código de uma ação.');
                    return;
                }
                
                if (!stockDatabase[stockCode]) {
                    alert('Ação não encontrada em nossa base de dados. Tente PETR4, VALE3 ou ITUB4.');
                    return;
                }
                
                // Display results
                displayStockAnalysis(stockCode);
            });
            
            stockInput.addEventListener('keypress', function(e) {
                if (e.key === 'Enter') {
                    analyzeBtn.click();
                }
            });
            
            newAnalysisBtn.addEventListener('click', function() {
                resultsSection.classList.add('hidden');
                stockInput.value = '';
                stockInput.focus();
            });
            
            function displayStockAnalysis(stockCode) {
                const stock = stockDatabase[stockCode];
                const now = new Date();
                
                // Update UI with stock data
                document.getElementById('stockSymbol').textContent = stockCode;
                document.getElementById('stockName').textContent = stock.name;
                document.getElementById('currentPrice').textContent = `R$ ${stock.price.toFixed(2).replace('.', ',')}`;
                
                const changeElement = document.getElementById('priceChange');
                changeElement.textContent = `${stock.change > 0 ? '+' : ''}${stock.change.toFixed(1).replace('.', ',')}%`;
                changeElement.className = `ml-3 px-2 py-1 rounded text-sm font-medium ${
                    stock.change > 0 ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'
                }`;
                
                // Update sentiment
                const sentimentBadge = document.getElementById('sentimentBadge');
                sentimentBadge.className = `px-4 py-2 rounded-full text-white font-medium sentiment-${stock.sentiment}`;
                sentimentBadge.textContent = 
                    stock.sentiment === 'positive' ? 'Positivo' : 
                    stock.sentiment === 'negative' ? 'Negativo' : 'Neutro';
                
                // Update analysis texts
                document.getElementById('generalSentiment').textContent = stock.generalSentiment;
                document.getElementById('technicalTrend').textContent = stock.technicalTrend;
                document.getElementById('recommendation').textContent = stock.recommendation;
                document.getElementById('detailedAnalysis').innerHTML = `<p>${stock.detailedAnalysis}</p>`;
                
                // Update time
                document.getElementById('updateTime').textContent = 
                    `${now.getDate().toString().padStart(2, '0')}/${(now.getMonth()+1).toString().padStart(2, '0')}/${now.getFullYear()} ` +
                    `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`;
                
                // Show results
                resultsSection.classList.remove('hidden');
                
                // Scroll to results
                resultsSection.scrollIntoView({ behavior: 'smooth' });
            }
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=moosee/teste" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>