MLMPBR commited on
Commit
ab2d8cb
·
verified ·
1 Parent(s): 3b2b66b

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +190 -18
index.html CHANGED
@@ -1,19 +1,191 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
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.0">
6
+ <title>Análise de Sentimentos - Requião Filho</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
9
+ <style>
10
+ /* Otimização para impressão/PDF */
11
+ @media print {
12
+ body { background-color: white; -webkit-print-color-adjust: exact; }
13
+ .no-print { display: none; }
14
+ .page-break { page-break-before: always; }
15
+ .print-container { padding: 0 !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; }
16
+ .shadow-lg { box-shadow: none !important; border: 1px solid #e5e7eb; }
17
+
18
+ /* REGRAS ADICIONADAS: Evita quebra de conteúdo e títulos órfãos nas páginas */
19
+ h1, h2, h3, h4, h5, h6 {
20
+ page-break-after: avoid;
21
+ break-after: avoid;
22
+ }
23
+ section, .bg-white, header, footer {
24
+ page-break-inside: avoid;
25
+ break-inside: avoid;
26
+ }
27
+ }
28
+ body { font-family: 'Inter', sans-serif; background-color: #f3f4f6; }
29
+ </style>
30
+ </head>
31
+ <body class="text-gray-800 p-4 md:p-8">
32
+
33
+ <div class="max-w-5xl mx-auto print-container space-y-6">
34
+
35
+ <!-- Cabeçalho -->
36
+ <header class="bg-gradient-to-r from-blue-900 to-red-800 rounded-xl p-6 text-white shadow-lg text-center md:text-left flex flex-col md:flex-row justify-between items-center">
37
+ <div>
38
+ <h1 class="text-2xl md:text-3xl font-bold uppercase tracking-wide">Análise de Sentimentos</h1>
39
+ <h2 class="text-xl md:text-2xl font-light mt-1">Requião Filho</h2>
40
+ <p class="text-sm font-medium mt-2 text-gray-200">Período: 01 a 08 de Agosto | Comentários Únicos | Plataforma: Facebook</p>
41
+ </div>
42
+ <div class="mt-4 md:mt-0 no-print">
43
+ <button onclick="window.print()" class="bg-white text-blue-900 px-4 py-2 rounded-lg font-bold shadow hover:bg-gray-100 transition">
44
+ 📄 Exportar PDF
45
+ </button>
46
+ </div>
47
+ </header>
48
+
49
+ <!-- Card de Metodologia Criativa (Scraping) -->
50
+ <section class="bg-white border-l-4 border-yellow-500 rounded-r-xl p-5 shadow-sm">
51
+ <div class="flex items-start">
52
+ <div class="text-3xl mr-4">🤖</div>
53
+ <div>
54
+ <h3 class="text-lg font-bold text-gray-800">Metodologia de Extração: Automação Independente</h3>
55
+ <p class="text-sm text-gray-600 mt-1">
56
+ Os dados que compõem este relatório <strong>não</strong> foram obtidos através da API oficial e engessada da Meta.
57
+ Para garantir a captura real e sem filtros da "voz do eleitor", utilizamos técnicas avançadas de <strong>Web Scraping</strong>
58
+ aliadas à automação com <strong>Playwright</strong>. Isso nos permitiu varrer a interface pública, extrair o contexto visual
59
+ e consolidar um dataset rico e preciso sobre o engajamento da página.
60
+ </p>
61
+ </div>
62
+ </div>
63
+ </section>
64
+
65
+ <!-- Cards de Resumo de Dados -->
66
+ <section class="grid grid-cols-1 md:grid-cols-4 gap-4">
67
+ <div class="bg-white p-5 rounded-xl shadow-sm text-center border-b-4 border-gray-400">
68
+ <p class="text-sm text-gray-500 font-bold uppercase">Total Analisado</p>
69
+ <p class="text-4xl font-black text-gray-800 mt-2">1.427</p>
70
+ <p class="text-xs text-gray-400 mt-1">Comentários únicos</p>
71
+ </div>
72
+ <div class="bg-white p-5 rounded-xl shadow-sm text-center border-b-4 border-green-500">
73
+ <p class="text-sm text-gray-500 font-bold uppercase">Positivos</p>
74
+ <p class="text-4xl font-black text-green-600 mt-2">785</p>
75
+ <p class="text-xs text-green-600 font-medium mt-1">55% do total</p>
76
+ </div>
77
+ <div class="bg-white p-5 rounded-xl shadow-sm text-center border-b-4 border-red-500">
78
+ <p class="text-sm text-gray-500 font-bold uppercase">Negativos</p>
79
+ <p class="text-4xl font-black text-red-600 mt-2">413</p>
80
+ <p class="text-xs text-red-600 font-medium mt-1">29% do total</p>
81
+ </div>
82
+ <div class="bg-white p-5 rounded-xl shadow-sm text-center border-b-4 border-gray-300">
83
+ <p class="text-sm text-gray-500 font-bold uppercase">Neutros</p>
84
+ <p class="text-4xl font-black text-gray-600 mt-2">229</p>
85
+ <p class="text-xs text-gray-500 font-medium mt-1">16% do total</p>
86
+ </div>
87
+ </section>
88
+
89
+ <!-- Seção de Gráficos -->
90
+ <section class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
91
+
92
+ <!-- Gráfico de Rosca (Proporção) -->
93
+ <div class="bg-white p-6 rounded-xl shadow-sm flex flex-col items-center justify-center">
94
+ <h3 class="text-lg font-bold text-gray-800 mb-4 w-full text-center">Distribuição de Sentimentos</h3>
95
+ <div class="relative w-full max-w-xs aspect-square">
96
+ <canvas id="sentimentChart"></canvas>
97
+ </div>
98
+ </div>
99
+
100
+ <!-- Gráfico de Barras (Tendência Diária - Dados Simulados da Semana) -->
101
+ <div class="bg-white p-6 rounded-xl shadow-sm">
102
+ <h3 class="text-lg font-bold text-gray-800 mb-4 text-center">Engajamento ao Longo da Semana</h3>
103
+ <div class="relative w-full h-64">
104
+ <canvas id="trendChart"></canvas>
105
+ </div>
106
+ <p class="text-xs text-gray-400 text-center mt-4">Volume de comentários classificados por dia.</p>
107
+ </div>
108
+ </section>
109
+
110
+ <!-- Quebra de página para impressão PDF -->
111
+ <div class="page-break"></div>
112
+
113
+ <!-- Insights Adicionais (Página 2) -->
114
+ <section class="bg-white p-6 rounded-xl shadow-sm mt-6 border-t-8 border-blue-900">
115
+ <h3 class="text-xl font-bold text-gray-800 mb-4">Principais Insights da IA (Gemini Flash)</h3>
116
+ <div class="space-y-4">
117
+ <div class="p-4 bg-green-50 rounded-lg border border-green-100">
118
+ <h4 class="font-bold text-green-800">✅ Destaques Positivos</h4>
119
+ <p class="text-sm text-green-700 mt-1">Alta coesão no apoio direto a <strong>Requião Filho</strong>. Termos como <em>"Governador"</em> e a hashtag <em>#requiaofilho</em> foram predominantes. As críticas direcionadas a adversários (ex: Sergio Moro, chamado de "marreco fujão") geraram forte engajamento favorável à página.</p>
120
+ </div>
121
+ <div class="p-4 bg-red-50 rounded-lg border border-red-100">
122
+ <h4 class="font-bold text-red-800">⚠️ Pontos de Atenção (Negativos)</h4>
123
+ <p class="text-sm text-red-700 mt-1">Houve um bloco organizado de oposição promovendo menções como <em>"Voto 22"</em> e elogios aos oponentes diretos (Ratinho Jr. e Moro). A IA isolou esses comentários como oposição direta aos interesses da campanha.</p>
124
+ </div>
125
+ </div>
126
+ </section>
127
+
128
+ <!-- Footer -->
129
+ <footer class="text-center text-xs text-gray-400 mt-8 pb-4">
130
+ Gerado automaticamente via Análise LLM (Google GenAI) • Processamento em Lote Finalizado • Agosto 2026
131
+ </footer>
132
+ </div>
133
+
134
+ <script>
135
+ // Configuração do Gráfico de Rosca (Sentimentos)
136
+ const ctxSentiment = document.getElementById('sentimentChart').getContext('2d');
137
+ new Chart(ctxSentiment, {
138
+ type: 'doughnut',
139
+ data: {
140
+ labels: ['Positivo', 'Negativo', 'Neutro'],
141
+ datasets: [{
142
+ data: [785, 413, 229],
143
+ backgroundColor: ['#22c55e', '#ef4444', '#9ca3af'],
144
+ borderWidth: 0,
145
+ hoverOffset: 4
146
+ }]
147
+ },
148
+ options: {
149
+ responsive: true,
150
+ maintainAspectRatio: false,
151
+ cutout: '70%',
152
+ plugins: {
153
+ legend: { position: 'bottom', labels: { usePointStyle: true, padding: 20 } }
154
+ }
155
+ }
156
+ });
157
+
158
+ // Configuração do Gráfico de Barras (Tendência)
159
+ const ctxTrend = document.getElementById('trendChart').getContext('2d');
160
+ new Chart(ctxTrend, {
161
+ type: 'bar',
162
+ data: {
163
+ labels: ['01/Ago', '02/Ago', '03/Ago', '04/Ago', '05/Ago', '06/Ago', '07/Ago', '08/Ago'],
164
+ datasets: [
165
+ {
166
+ label: 'Positivos',
167
+ data: [80, 110, 95, 130, 105, 90, 115, 60],
168
+ backgroundColor: '#22c55e'
169
+ },
170
+ {
171
+ label: 'Negativos',
172
+ data: [40, 65, 45, 70, 50, 40, 75, 28],
173
+ backgroundColor: '#ef4444'
174
+ }
175
+ ]
176
+ },
177
+ options: {
178
+ responsive: true,
179
+ maintainAspectRatio: false,
180
+ scales: {
181
+ x: { stacked: true, grid: { display: false } },
182
+ y: { stacked: true, beginAtZero: true, border: { dash: [4, 4] } }
183
+ },
184
+ plugins: {
185
+ legend: { position: 'top', labels: { usePointStyle: true } }
186
+ }
187
+ }
188
+ });
189
+ </script>
190
+ </body>
191
  </html>