Add 3 files
Browse files- README.md +7 -5
- index.html +882 -19
- prompts.txt +1 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: foi-g
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: pink
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,882 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Jornal Oliveira</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Open+Sans:wght@400;600;700&display=swap');
|
11 |
+
|
12 |
+
:root {
|
13 |
+
--primary: #354C2B;
|
14 |
+
--secondary: #A4B17B;
|
15 |
+
--accent: #4E653D;
|
16 |
+
--light: #F8F8F8;
|
17 |
+
--dark: #20331B;
|
18 |
+
}
|
19 |
+
|
20 |
+
body {
|
21 |
+
font-family: 'Open Sans', sans-serif;
|
22 |
+
}
|
23 |
+
|
24 |
+
h1, h2, h3, h4 {
|
25 |
+
font-family: 'Merriweather', serif;
|
26 |
+
}
|
27 |
+
|
28 |
+
.article-card:hover {
|
29 |
+
transform: translateY(-5px);
|
30 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
31 |
+
}
|
32 |
+
|
33 |
+
.tab-indicator {
|
34 |
+
position: absolute;
|
35 |
+
bottom: 0;
|
36 |
+
left: 0;
|
37 |
+
height: 3px;
|
38 |
+
background-color: var(--accent);
|
39 |
+
transition: all 0.3s ease;
|
40 |
+
}
|
41 |
+
|
42 |
+
.notification-dot {
|
43 |
+
position: absolute;
|
44 |
+
top: -5px;
|
45 |
+
right: -5px;
|
46 |
+
width: 12px;
|
47 |
+
height: 12px;
|
48 |
+
background-color: #EF4444;
|
49 |
+
border-radius: 50%;
|
50 |
+
}
|
51 |
+
|
52 |
+
.fade-in {
|
53 |
+
animation: fadeIn 0.5s ease-in-out;
|
54 |
+
}
|
55 |
+
|
56 |
+
@keyframes fadeIn {
|
57 |
+
from { opacity: 0; transform: translateY(10px); }
|
58 |
+
to { opacity: 1; transform: translateY(0); }
|
59 |
+
}
|
60 |
+
|
61 |
+
.markdown-content p {
|
62 |
+
margin-bottom: 1rem;
|
63 |
+
}
|
64 |
+
|
65 |
+
.markdown-content h3 {
|
66 |
+
font-size: 1.25rem;
|
67 |
+
font-weight: bold;
|
68 |
+
margin: 1.5rem 0 1rem;
|
69 |
+
}
|
70 |
+
</style>
|
71 |
+
</head>
|
72 |
+
<body class="bg-gray-50">
|
73 |
+
<!-- Header -->
|
74 |
+
<header class="bg-[var(--primary)] text-white shadow-lg">
|
75 |
+
<div class="container mx-auto px-4 py-6">
|
76 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
77 |
+
<div class="text-center md:text-left mb-4 md:mb-0">
|
78 |
+
<h1 class="text-3xl md:text-4xl font-bold">Jornal Oliveira</h1>
|
79 |
+
<p class="text-[var(--secondary)] italic">Feito de alunos para alunos</p>
|
80 |
+
</div>
|
81 |
+
<div class="flex items-center space-x-4">
|
82 |
+
<div class="relative">
|
83 |
+
<button id="loginBtn" class="bg-[var(--accent)] hover:bg-[#3a5530] text-white px-4 py-2 rounded-lg transition">
|
84 |
+
<i class="fas fa-user mr-2"></i>Entrar
|
85 |
+
</button>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
</header>
|
91 |
+
|
92 |
+
<!-- Navigation -->
|
93 |
+
<nav class="bg-white shadow-md sticky top-0 z-10">
|
94 |
+
<div class="container mx-auto px-4">
|
95 |
+
<div class="relative flex overflow-x-auto">
|
96 |
+
<div class="flex space-x-1">
|
97 |
+
<button data-tab="home" class="tab-btn active relative px-6 py-4 font-medium text-gray-700 hover:text-[var(--primary)] transition">
|
98 |
+
<i class="fas fa-home mr-2"></i>Início
|
99 |
+
</button>
|
100 |
+
<button data-tab="enviar" class="tab-btn restricted relative px-6 py-4 font-medium text-gray-700 hover:text-[var(--primary)] transition">
|
101 |
+
<i class="fas fa-paper-plane mr-2"></i>Enviar
|
102 |
+
</button>
|
103 |
+
<button data-tab="pendentes" class="tab-btn restricted relative px-6 py-4 font-medium text-gray-700 hover:text-[var(--primary)] transition">
|
104 |
+
<i class="fas fa-clock mr-2"></i>Pendentes
|
105 |
+
<span id="pendingCount" class="hidden ml-2 bg-[var(--accent)] text-white text-xs font-bold px-2 py-1 rounded-full">0</span>
|
106 |
+
</button>
|
107 |
+
<button data-tab="notificacoes" class="tab-btn restricted relative px-6 py-4 font-medium text-gray-700 hover:text-[var(--primary)] transition">
|
108 |
+
<i class="fas fa-bell mr-2"></i>Notificações
|
109 |
+
<span id="notificationCount" class="hidden ml-2 bg-red-500 text-white text-xs font-bold px-2 py-1 rounded-full">0</span>
|
110 |
+
</button>
|
111 |
+
</div>
|
112 |
+
<div class="tab-indicator"></div>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</nav>
|
116 |
+
|
117 |
+
<!-- Main Content -->
|
118 |
+
<main class="container mx-auto px-4 py-8">
|
119 |
+
<!-- Home Section -->
|
120 |
+
<section id="home" class="content-section active fade-in">
|
121 |
+
<div class="flex justify-between items-center mb-8">
|
122 |
+
<h2 class="text-2xl font-bold text-[var(--primary)]">Últimas Notícias</h2>
|
123 |
+
<div class="relative">
|
124 |
+
<select id="categoryFilter" class="appearance-none bg-white border border-gray-300 rounded-lg px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-[var(--accent)]">
|
125 |
+
<option value="Todas">Todas Categorias</option>
|
126 |
+
<option>Notícias da Escola</option>
|
127 |
+
<option>Entrevistas</option>
|
128 |
+
<option>Opinião</option>
|
129 |
+
<option>Cultura e Arte</option>
|
130 |
+
<option>Esportes</option>
|
131 |
+
<option>Humor</option>
|
132 |
+
<option>Você Sabia?</option>
|
133 |
+
<option>Projetos e Grêmios</option>
|
134 |
+
<option>Fala Estudante</option>
|
135 |
+
<option>Investigação</option>
|
136 |
+
</select>
|
137 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
138 |
+
<i class="fas fa-chevron-down"></i>
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div id="articles" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
144 |
+
<!-- Articles will be loaded here -->
|
145 |
+
</div>
|
146 |
+
|
147 |
+
<div id="noArticles" class="hidden text-center py-12">
|
148 |
+
<i class="fas fa-newspaper text-5xl text-gray-300 mb-4"></i>
|
149 |
+
<h3 class="text-xl font-medium text-gray-500">Nenhuma matéria encontrada</h3>
|
150 |
+
<p class="text-gray-400">Seja o primeiro a publicar uma matéria!</p>
|
151 |
+
</div>
|
152 |
+
</section>
|
153 |
+
|
154 |
+
<!-- Submit Article Section -->
|
155 |
+
<section id="enviar" class="content-section restricted fade-in">
|
156 |
+
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-md overflow-hidden p-6">
|
157 |
+
<h2 class="text-2xl font-bold text-[var(--primary)] mb-6">
|
158 |
+
<i class="fas fa-pen-alt mr-2"></i>Enviar Matéria
|
159 |
+
</h2>
|
160 |
+
|
161 |
+
<form id="formEnviar" class="space-y-4">
|
162 |
+
<div>
|
163 |
+
<label for="artTitle" class="block text-sm font-medium text-gray-700 mb-1">Título da Matéria</label>
|
164 |
+
<input id="artTitle" type="text" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Digite o título da matéria" required>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
168 |
+
<div>
|
169 |
+
<label for="artAuthor" class="block text-sm font-medium text-gray-700 mb-1">Autor</label>
|
170 |
+
<input id="artAuthor" type="text" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Seu nome" required>
|
171 |
+
</div>
|
172 |
+
|
173 |
+
<div>
|
174 |
+
<label for="artDate" class="block text-sm font-medium text-gray-700 mb-1">Data</label>
|
175 |
+
<input id="artDate" type="date" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" required>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
<div>
|
180 |
+
<label for="artCat" class="block text-sm font-medium text-gray-700 mb-1">Categoria</label>
|
181 |
+
<select id="artCat" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" required>
|
182 |
+
<option value="">Selecione uma Categoria</option>
|
183 |
+
<option>Notícias da Escola</option>
|
184 |
+
<option>Entrevistas</option>
|
185 |
+
<option>Opinião</option>
|
186 |
+
<option>Cultura e Arte</option>
|
187 |
+
<option>Esportes</option>
|
188 |
+
<option>Humor</option>
|
189 |
+
<option>Você Sabia?</option>
|
190 |
+
<option>Projetos e Grêmios</option>
|
191 |
+
<option>Fala Estudante</option>
|
192 |
+
<option>Investigação</option>
|
193 |
+
</select>
|
194 |
+
</div>
|
195 |
+
|
196 |
+
<div>
|
197 |
+
<label for="artLide" class="block text-sm font-medium text-gray-700 mb-1">Lide</label>
|
198 |
+
<p class="text-xs text-gray-500 mb-1">O quê, quem, quando, onde, como e por quê.</p>
|
199 |
+
<textarea id="artLide" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Resumo inicial da matéria" required></textarea>
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<div>
|
203 |
+
<label for="artDev" class="block text-sm font-medium text-gray-700 mb-1">Desenvolvimento</label>
|
204 |
+
<p class="text-xs text-gray-500 mb-1">Detalhes, contexto, explicações.</p>
|
205 |
+
<textarea id="artDev" rows="5" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Corpo principal da matéria" required></textarea>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<div>
|
209 |
+
<label for="artConc" class="block text-sm font-medium text-gray-700 mb-1">Conclusão</label>
|
210 |
+
<p class="text-xs text-gray-500 mb-1">Encerramento, reflexões finais.</p>
|
211 |
+
<textarea id="artConc" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Finalização da matéria" required></textarea>
|
212 |
+
</div>
|
213 |
+
|
214 |
+
<div>
|
215 |
+
<label for="artImage" class="block text-sm font-medium text-gray-700 mb-1">Imagem de Capa (Opcional)</label>
|
216 |
+
<div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg">
|
217 |
+
<div class="space-y-1 text-center">
|
218 |
+
<div class="flex text-sm text-gray-600">
|
219 |
+
<label for="artImage" class="relative cursor-pointer bg-white rounded-md font-medium text-[var(--accent)] hover:text-[var(--primary)] focus-within:outline-none">
|
220 |
+
<span>Carregar arquivo</span>
|
221 |
+
<input id="artImage" type="file" class="sr-only" accept="image/*">
|
222 |
+
</label>
|
223 |
+
<p class="pl-1">ou arraste e solte</p>
|
224 |
+
</div>
|
225 |
+
<p class="text-xs text-gray-500">PNG, JPG, GIF até 5MB</p>
|
226 |
+
</div>
|
227 |
+
</div>
|
228 |
+
<div id="imagePreview" class="hidden mt-2">
|
229 |
+
<img id="previewImage" src="#" alt="Preview" class="max-h-48 rounded-lg">
|
230 |
+
</div>
|
231 |
+
</div>
|
232 |
+
|
233 |
+
<div class="pt-4">
|
234 |
+
<button type="submit" class="w-full bg-[var(--accent)] hover:bg-[#3a5530] text-white font-medium py-2 px-4 rounded-lg transition flex items-center justify-center">
|
235 |
+
<i class="fas fa-paper-plane mr-2"></i>Enviar para Aprovação
|
236 |
+
</button>
|
237 |
+
</div>
|
238 |
+
</form>
|
239 |
+
|
240 |
+
<div id="successMessage" class="hidden mt-4 p-4 bg-green-100 border border-green-400 text-green-700 rounded-lg">
|
241 |
+
<i class="fas fa-check-circle mr-2"></i>Sua matéria foi enviada para aprovação!
|
242 |
+
</div>
|
243 |
+
</div>
|
244 |
+
</section>
|
245 |
+
|
246 |
+
<!-- Pending Articles Section -->
|
247 |
+
<section id="pendentes" class="content-section restricted fade-in">
|
248 |
+
<h2 class="text-2xl font-bold text-[var(--primary)] mb-6">
|
249 |
+
<i class="fas fa-clock mr-2"></i>Matérias Pendentes
|
250 |
+
</h2>
|
251 |
+
|
252 |
+
<div id="pendingList" class="space-y-6">
|
253 |
+
<!-- Pending articles will be loaded here -->
|
254 |
+
</div>
|
255 |
+
|
256 |
+
<div id="noPending" class="hidden text-center py-12">
|
257 |
+
<i class="fas fa-check-circle text-5xl text-gray-300 mb-4"></i>
|
258 |
+
<h3 class="text-xl font-medium text-gray-500">Nenhuma matéria pendente</h3>
|
259 |
+
<p class="text-gray-400">Todas as matérias foram revisadas</p>
|
260 |
+
</div>
|
261 |
+
</section>
|
262 |
+
|
263 |
+
<!-- Notifications Section -->
|
264 |
+
<section id="notificacoes" class="content-section restricted fade-in">
|
265 |
+
<h2 class="text-2xl font-bold text-[var(--primary)] mb-6">
|
266 |
+
<i class="fas fa-bell mr-2"></i>Notificações
|
267 |
+
</h2>
|
268 |
+
|
269 |
+
<div id="notificationList" class="space-y-4">
|
270 |
+
<!-- Notifications will be loaded here -->
|
271 |
+
</div>
|
272 |
+
|
273 |
+
<div id="noNotifications" class="hidden text-center py-12">
|
274 |
+
<i class="fas fa-bell-slash text-5xl text-gray-300 mb-4"></i>
|
275 |
+
<h3 class="text-xl font-medium text-gray-500">Nenhuma notificação</h3>
|
276 |
+
<p class="text-gray-400">Você não tem notificações no momento</p>
|
277 |
+
</div>
|
278 |
+
</section>
|
279 |
+
</main>
|
280 |
+
|
281 |
+
<!-- Footer -->
|
282 |
+
<footer class="bg-[var(--primary)] text-white py-8">
|
283 |
+
<div class="container mx-auto px-4">
|
284 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
285 |
+
<div class="mb-4 md:mb-0">
|
286 |
+
<h3 class="text-xl font-bold">Jornal Oliveira</h3>
|
287 |
+
<p class="text-[var(--secondary)] italic">Feito de alunos para alunos</p>
|
288 |
+
</div>
|
289 |
+
<div class="flex space-x-6">
|
290 |
+
<a href="#" class="hover:text-[var(--secondary)] transition">
|
291 |
+
<i class="fab fa-facebook-f"></i>
|
292 |
+
</a>
|
293 |
+
<a href="#" class="hover:text-[var(--secondary)] transition">
|
294 |
+
<i class="fab fa-instagram"></i>
|
295 |
+
</a>
|
296 |
+
<a href="#" class="hover:text-[var(--secondary)] transition">
|
297 |
+
<i class="fab fa-twitter"></i>
|
298 |
+
</a>
|
299 |
+
</div>
|
300 |
+
</div>
|
301 |
+
<div class="mt-6 pt-6 border-t border-[var(--secondary)] text-center text-sm">
|
302 |
+
<p>© 2025 Jornal Oliveira. Todos os direitos reservados.</p>
|
303 |
+
</div>
|
304 |
+
</div>
|
305 |
+
</footer>
|
306 |
+
|
307 |
+
<!-- Login Modal -->
|
308 |
+
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
309 |
+
<div class="bg-white rounded-lg shadow-xl w-full max-w-md">
|
310 |
+
<div class="p-6">
|
311 |
+
<div class="flex justify-between items-center mb-4">
|
312 |
+
<h3 class="text-xl font-bold text-[var(--primary)]">Entrar no Sistema</h3>
|
313 |
+
<button id="closeModal" class="text-gray-500 hover:text-gray-700">
|
314 |
+
<i class="fas fa-times"></i>
|
315 |
+
</button>
|
316 |
+
</div>
|
317 |
+
|
318 |
+
<form id="loginForm" class="space-y-4">
|
319 |
+
<div>
|
320 |
+
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">Nome de Usuário</label>
|
321 |
+
<input id="username" type="text" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Digite seu usuário" required>
|
322 |
+
</div>
|
323 |
+
|
324 |
+
<div>
|
325 |
+
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Senha</label>
|
326 |
+
<input id="password" type="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)]" placeholder="Digite sua senha" required>
|
327 |
+
</div>
|
328 |
+
|
329 |
+
<div class="pt-2">
|
330 |
+
<button type="submit" class="w-full bg-[var(--accent)] hover:bg-[#3a5530] text-white font-medium py-2 px-4 rounded-lg transition">
|
331 |
+
Entrar
|
332 |
+
</button>
|
333 |
+
</div>
|
334 |
+
</form>
|
335 |
+
|
336 |
+
<div id="loginError" class="hidden mt-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded-lg">
|
337 |
+
<i class="fas fa-exclamation-circle mr-2"></i>Usuário ou senha incorretos
|
338 |
+
</div>
|
339 |
+
</div>
|
340 |
+
</div>
|
341 |
+
</div>
|
342 |
+
|
343 |
+
<!-- Article Modal -->
|
344 |
+
<div id="articleModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden overflow-y-auto">
|
345 |
+
<div class="bg-white rounded-lg shadow-xl w-full max-w-4xl my-8">
|
346 |
+
<div class="p-6">
|
347 |
+
<div class="flex justify-between items-start mb-4">
|
348 |
+
<div>
|
349 |
+
<h3 id="modalTitle" class="text-2xl font-bold text-[var(--primary)]"></h3>
|
350 |
+
<div class="flex items-center mt-2 text-sm text-gray-600">
|
351 |
+
<span id="modalAuthor" class="font-medium"></span>
|
352 |
+
<span class="mx-2">•</span>
|
353 |
+
<span id="modalDate"></span>
|
354 |
+
<span class="mx-2">•</span>
|
355 |
+
<span id="modalCategory" class="px-2 py-1 bg-gray-100 rounded-full text-xs"></span>
|
356 |
+
</div>
|
357 |
+
</div>
|
358 |
+
<button id="closeArticleModal" class="text-gray-500 hover:text-gray-700">
|
359 |
+
<i class="fas fa-times"></i>
|
360 |
+
</button>
|
361 |
+
</div>
|
362 |
+
|
363 |
+
<div id="modalImageContainer" class="hidden mb-6">
|
364 |
+
<img id="modalImage" src="#" alt="Article Image" class="w-full h-64 object-cover rounded-lg">
|
365 |
+
</div>
|
366 |
+
|
367 |
+
<div id="modalContent" class="markdown-content space-y-4">
|
368 |
+
<!-- Article content will be loaded here -->
|
369 |
+
</div>
|
370 |
+
</div>
|
371 |
+
</div>
|
372 |
+
</div>
|
373 |
+
|
374 |
+
<script>
|
375 |
+
// Data
|
376 |
+
let authUsers = JSON.parse(localStorage.getItem('jo_users')) || [
|
377 |
+
{ username: 'admin', password: 'admin123', role: 'admin' },
|
378 |
+
{ username: 'editor', password: 'editor123', role: 'editor' },
|
379 |
+
{ username: 'reporter', password: 'reporter123', role: 'reporter' }
|
380 |
+
];
|
381 |
+
|
382 |
+
let pending = JSON.parse(localStorage.getItem('jo_pending') || '[]');
|
383 |
+
let published = JSON.parse(localStorage.getItem('jo_published') || '[]');
|
384 |
+
let notifications = JSON.parse(localStorage.getItem('jo_notifications') || '[]');
|
385 |
+
|
386 |
+
let currentUser = null;
|
387 |
+
let isLoggedIn = false;
|
388 |
+
|
389 |
+
// DOM Elements
|
390 |
+
const loginBtn = document.getElementById('loginBtn');
|
391 |
+
const loginModal = document.getElementById('loginModal');
|
392 |
+
const closeModal = document.getElementById('closeModal');
|
393 |
+
const loginForm = document.getElementById('loginForm');
|
394 |
+
const loginError = document.getElementById('loginError');
|
395 |
+
const articleModal = document.getElementById('articleModal');
|
396 |
+
const closeArticleModal = document.getElementById('closeArticleModal');
|
397 |
+
const categoryFilter = document.getElementById('categoryFilter');
|
398 |
+
const imagePreview = document.getElementById('imagePreview');
|
399 |
+
const previewImage = document.getElementById('previewImage');
|
400 |
+
const artImage = document.getElementById('artImage');
|
401 |
+
const pendingCount = document.getElementById('pendingCount');
|
402 |
+
const notificationCount = document.getElementById('notificationCount');
|
403 |
+
|
404 |
+
// Initialize
|
405 |
+
document.addEventListener('DOMContentLoaded', () => {
|
406 |
+
updateCounts();
|
407 |
+
renderHome();
|
408 |
+
renderPending();
|
409 |
+
renderNotifications();
|
410 |
+
|
411 |
+
// Check if user is already logged in (for demo purposes)
|
412 |
+
// In a real app, you'd check session or token
|
413 |
+
if (localStorage.getItem('jo_currentUser')) {
|
414 |
+
currentUser = JSON.parse(localStorage.getItem('jo_currentUser'));
|
415 |
+
isLoggedIn = true;
|
416 |
+
updateAuthUI();
|
417 |
+
}
|
418 |
+
});
|
419 |
+
|
420 |
+
// Event Listeners
|
421 |
+
loginBtn.addEventListener('click', () => {
|
422 |
+
if (isLoggedIn) {
|
423 |
+
logout();
|
424 |
+
} else {
|
425 |
+
loginModal.classList.remove('hidden');
|
426 |
+
}
|
427 |
+
});
|
428 |
+
|
429 |
+
closeModal.addEventListener('click', () => {
|
430 |
+
loginModal.classList.add('hidden');
|
431 |
+
loginError.classList.add('hidden');
|
432 |
+
});
|
433 |
+
|
434 |
+
closeArticleModal.addEventListener('click', () => {
|
435 |
+
articleModal.classList.add('hidden');
|
436 |
+
});
|
437 |
+
|
438 |
+
loginForm.addEventListener('submit', (e) => {
|
439 |
+
e.preventDefault();
|
440 |
+
const username = document.getElementById('username').value;
|
441 |
+
const password = document.getElementById('password').value;
|
442 |
+
|
443 |
+
const user = authUsers.find(u => u.username === username && u.password === password);
|
444 |
+
|
445 |
+
if (user) {
|
446 |
+
currentUser = user;
|
447 |
+
isLoggedIn = true;
|
448 |
+
localStorage.setItem('jo_currentUser', JSON.stringify(user));
|
449 |
+
loginModal.classList.add('hidden');
|
450 |
+
loginError.classList.add('hidden');
|
451 |
+
updateAuthUI();
|
452 |
+
} else {
|
453 |
+
loginError.classList.remove('hidden');
|
454 |
+
}
|
455 |
+
});
|
456 |
+
|
457 |
+
categoryFilter.addEventListener('change', () => {
|
458 |
+
renderHome(categoryFilter.value);
|
459 |
+
});
|
460 |
+
|
461 |
+
artImage.addEventListener('change', function() {
|
462 |
+
if (this.files && this.files[0]) {
|
463 |
+
const reader = new FileReader();
|
464 |
+
reader.onload = function(e) {
|
465 |
+
imagePreview.classList.remove('hidden');
|
466 |
+
previewImage.src = e.target.result;
|
467 |
+
}
|
468 |
+
reader.readAsDataURL(this.files[0]);
|
469 |
+
} else {
|
470 |
+
imagePreview.classList.add('hidden');
|
471 |
+
}
|
472 |
+
});
|
473 |
+
|
474 |
+
// Tab Navigation
|
475 |
+
document.querySelectorAll('.tab-btn').forEach(tab => {
|
476 |
+
tab.addEventListener('click', () => {
|
477 |
+
if (tab.classList.contains('restricted') && !isLoggedIn) {
|
478 |
+
loginModal.classList.remove('hidden');
|
479 |
+
return;
|
480 |
+
}
|
481 |
+
|
482 |
+
// Update active tab
|
483 |
+
document.querySelectorAll('.tab-btn').forEach(t => t.classList.remove('active'));
|
484 |
+
tab.classList.add('active');
|
485 |
+
|
486 |
+
// Update tab indicator position
|
487 |
+
const indicator = document.querySelector('.tab-indicator');
|
488 |
+
indicator.style.width = `${tab.offsetWidth}px`;
|
489 |
+
indicator.style.left = `${tab.offsetLeft}px`;
|
490 |
+
|
491 |
+
// Show corresponding section
|
492 |
+
const tabId = tab.getAttribute('data-tab');
|
493 |
+
document.querySelectorAll('.content-section').forEach(section => {
|
494 |
+
section.classList.remove('active');
|
495 |
+
if (section.id === tabId) {
|
496 |
+
section.classList.add('active');
|
497 |
+
section.classList.add('fade-in');
|
498 |
+
}
|
499 |
+
});
|
500 |
+
});
|
501 |
+
});
|
502 |
+
|
503 |
+
// Form Submission
|
504 |
+
document.getElementById('formEnviar').addEventListener('submit', (e) => {
|
505 |
+
e.preventDefault();
|
506 |
+
|
507 |
+
const fields = ['Title', 'Author', 'Date', 'Cat', 'Lide', 'Dev', 'Conc'].map(f =>
|
508 |
+
document.getElementById('art' + f)
|
509 |
+
);
|
510 |
+
|
511 |
+
if (fields.slice(0, 6).some(inp => !inp.value.trim())) {
|
512 |
+
alert('Preencha todos os campos obrigatórios!');
|
513 |
+
return;
|
514 |
+
}
|
515 |
+
|
516 |
+
const newArticle = {
|
517 |
+
title: fields[0].value,
|
518 |
+
author: fields[1].value,
|
519 |
+
date: fields[2].value,
|
520 |
+
category: document.getElementById('artCat').value,
|
521 |
+
lide: fields[4].value,
|
522 |
+
desenvolvimento: fields[5].value,
|
523 |
+
conclusao: fields[6].value,
|
524 |
+
imageUrl: ''
|
525 |
+
};
|
526 |
+
|
527 |
+
if (artImage.files.length) {
|
528 |
+
const reader = new FileReader();
|
529 |
+
reader.onload = (e) => {
|
530 |
+
newArticle.imageUrl = e.target.result;
|
531 |
+
savePendingArticle(newArticle);
|
532 |
+
};
|
533 |
+
reader.readAsDataURL(artImage.files[0]);
|
534 |
+
} else {
|
535 |
+
savePendingArticle(newArticle);
|
536 |
+
}
|
537 |
+
});
|
538 |
+
|
539 |
+
// Functions
|
540 |
+
function logout() {
|
541 |
+
currentUser = null;
|
542 |
+
isLoggedIn = false;
|
543 |
+
localStorage.removeItem('jo_currentUser');
|
544 |
+
updateAuthUI();
|
545 |
+
|
546 |
+
// Hide restricted sections if visible
|
547 |
+
document.querySelectorAll('.content-section.restricted.active').forEach(section => {
|
548 |
+
section.classList.remove('active');
|
549 |
+
});
|
550 |
+
|
551 |
+
// Show home section
|
552 |
+
document.getElementById('home').classList.add('active');
|
553 |
+
|
554 |
+
// Reset active tab
|
555 |
+
document.querySelectorAll('.tab-btn').forEach(tab => tab.classList.remove('active'));
|
556 |
+
document.querySelector('[data-tab="home"]').classList.add('active');
|
557 |
+
}
|
558 |
+
|
559 |
+
function updateAuthUI() {
|
560 |
+
if (isLoggedIn) {
|
561 |
+
loginBtn.innerHTML = `<i class="fas fa-sign-out-alt mr-2"></i>Sair`;
|
562 |
+
document.querySelectorAll('.restricted').forEach(el => el.classList.remove('restricted'));
|
563 |
+
|
564 |
+
// Show notification and pending counts for editors/admins
|
565 |
+
if (currentUser.role === 'admin' || currentUser.role === 'editor') {
|
566 |
+
updateCounts();
|
567 |
+
}
|
568 |
+
} else {
|
569 |
+
loginBtn.innerHTML = `<i class="fas fa-user mr-2"></i>Entrar`;
|
570 |
+
document.querySelectorAll('.restricted').forEach(el => el.classList.add('restricted'));
|
571 |
+
pendingCount.classList.add('hidden');
|
572 |
+
notificationCount.classList.add('hidden');
|
573 |
+
}
|
574 |
+
}
|
575 |
+
|
576 |
+
function updateCounts() {
|
577 |
+
if (currentUser && (currentUser.role === 'admin' || currentUser.role === 'editor')) {
|
578 |
+
// Update pending count
|
579 |
+
if (pending.length > 0) {
|
580 |
+
pendingCount.textContent = pending.length;
|
581 |
+
pendingCount.classList.remove('hidden');
|
582 |
+
} else {
|
583 |
+
pendingCount.classList.add('hidden');
|
584 |
+
}
|
585 |
+
|
586 |
+
// Update notification count
|
587 |
+
const unreadNotifications = notifications.filter(n => !n.read).length;
|
588 |
+
if (unreadNotifications > 0) {
|
589 |
+
notificationCount.textContent = unreadNotifications;
|
590 |
+
notificationCount.classList.remove('hidden');
|
591 |
+
} else {
|
592 |
+
notificationCount.classList.add('hidden');
|
593 |
+
}
|
594 |
+
}
|
595 |
+
}
|
596 |
+
|
597 |
+
function savePendingArticle(article) {
|
598 |
+
pending.push(article);
|
599 |
+
localStorage.setItem('jo_pending', JSON.stringify(pending));
|
600 |
+
|
601 |
+
// Add notification for editors
|
602 |
+
if (currentUser && (currentUser.role === 'admin' || currentUser.role === 'editor')) {
|
603 |
+
notifications.unshift({
|
604 |
+
type: 'new',
|
605 |
+
message: `Nova matéria "${article.title}" enviada para aprovação.`,
|
606 |
+
author: article.author,
|
607 |
+
date: new Date().toISOString(),
|
608 |
+
read: false
|
609 |
+
});
|
610 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
611 |
+
}
|
612 |
+
|
613 |
+
// Reset form
|
614 |
+
document.getElementById('formEnviar').reset();
|
615 |
+
imagePreview.classList.add('hidden');
|
616 |
+
|
617 |
+
// Show success message
|
618 |
+
const successMessage = document.getElementById('successMessage');
|
619 |
+
successMessage.classList.remove('hidden');
|
620 |
+
setTimeout(() => successMessage.classList.add('hidden'), 3000);
|
621 |
+
|
622 |
+
// Update UI
|
623 |
+
updateCounts();
|
624 |
+
renderPending();
|
625 |
+
}
|
626 |
+
|
627 |
+
function renderHome(filter = 'Todas') {
|
628 |
+
const container = document.getElementById('articles');
|
629 |
+
const noArticles = document.getElementById('noArticles');
|
630 |
+
container.innerHTML = '';
|
631 |
+
|
632 |
+
let articlesToShow = published;
|
633 |
+
if (filter !== 'Todas') {
|
634 |
+
articlesToShow = published.filter(a => a.category === filter);
|
635 |
+
}
|
636 |
+
|
637 |
+
if (!articlesToShow.length) {
|
638 |
+
noArticles.classList.remove('hidden');
|
639 |
+
return;
|
640 |
+
}
|
641 |
+
|
642 |
+
noArticles.classList.add('hidden');
|
643 |
+
articlesToShow.sort((a, b) => new Date(b.date) - new Date(a.date));
|
644 |
+
|
645 |
+
articlesToShow.forEach(article => {
|
646 |
+
const card = document.createElement('div');
|
647 |
+
card.className = 'article-card bg-white rounded-xl shadow-md overflow-hidden transition duration-300 hover:shadow-lg';
|
648 |
+
card.innerHTML = `
|
649 |
+
${article.imageUrl ? `<img src="${article.imageUrl}" alt="${article.title}" class="w-full h-48 object-cover">` : ''}
|
650 |
+
<div class="p-6">
|
651 |
+
<span class="inline-block px-3 py-1 text-xs font-semibold bg-[var(--secondary)] text-[var(--primary)] rounded-full mb-2">${article.category}</span>
|
652 |
+
<h3 class="text-xl font-bold mb-2 line-clamp-2">${article.title}</h3>
|
653 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-3">${article.lide}</p>
|
654 |
+
<div class="flex justify-between items-center">
|
655 |
+
<span class="text-sm text-gray-500">${formatDate(article.date)}</span>
|
656 |
+
<button onclick="openArticleModal('${article.title}')" class="text-sm font-medium text-[var(--accent)] hover:text-[var(--primary)] transition">
|
657 |
+
Ler mais <i class="fas fa-arrow-right ml-1"></i>
|
658 |
+
</button>
|
659 |
+
</div>
|
660 |
+
</div>
|
661 |
+
`;
|
662 |
+
container.appendChild(card);
|
663 |
+
});
|
664 |
+
}
|
665 |
+
|
666 |
+
function renderPending() {
|
667 |
+
const container = document.getElementById('pendingList');
|
668 |
+
const noPending = document.getElementById('noPending');
|
669 |
+
container.innerHTML = '';
|
670 |
+
|
671 |
+
if (!pending.length) {
|
672 |
+
noPending.classList.remove('hidden');
|
673 |
+
return;
|
674 |
+
}
|
675 |
+
|
676 |
+
noPending.classList.add('hidden');
|
677 |
+
|
678 |
+
pending.forEach((article, index) => {
|
679 |
+
const card = document.createElement('div');
|
680 |
+
card.className = 'bg-white rounded-xl shadow-md overflow-hidden';
|
681 |
+
card.innerHTML = `
|
682 |
+
<div class="p-6">
|
683 |
+
<div class="flex justify-between items-start mb-4">
|
684 |
+
<div>
|
685 |
+
<h3 class="text-lg font-bold">${article.title}</h3>
|
686 |
+
<div class="flex items-center mt-1 text-sm text-gray-600">
|
687 |
+
<span class="font-medium">${article.author}</span>
|
688 |
+
<span class="mx-2">•</span>
|
689 |
+
<span>${formatDate(article.date)}</span>
|
690 |
+
<span class="mx-2">•</span>
|
691 |
+
<span class="px-2 py-1 bg-gray-100 rounded-full text-xs">${article.category}</span>
|
692 |
+
</div>
|
693 |
+
</div>
|
694 |
+
</div>
|
695 |
+
|
696 |
+
${article.imageUrl ? `<img src="${article.imageUrl}" alt="${article.title}" class="w-full h-48 object-cover rounded-lg mb-4">` : ''}
|
697 |
+
|
698 |
+
<div class="space-y-4 mb-4">
|
699 |
+
<div>
|
700 |
+
<h4 class="font-medium text-sm text-gray-700 mb-1">Lide</h4>
|
701 |
+
<p class="text-gray-600">${article.lide}</p>
|
702 |
+
</div>
|
703 |
+
|
704 |
+
<div>
|
705 |
+
<h4 class="font-medium text-sm text-gray-700 mb-1">Desenvolvimento</h4>
|
706 |
+
<p class="text-gray-600 line-clamp-3">${article.desenvolvimento}</p>
|
707 |
+
</div>
|
708 |
+
|
709 |
+
<div>
|
710 |
+
<h4 class="font-medium text-sm text-gray-700 mb-1">Conclusão</h4>
|
711 |
+
<p class="text-gray-600">${article.conclusao}</p>
|
712 |
+
</div>
|
713 |
+
</div>
|
714 |
+
|
715 |
+
<div class="pt-4 border-t border-gray-200">
|
716 |
+
<textarea id="cmt${index}" rows="2" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--accent)] mb-3" placeholder="Adicione um comentário (opcional)"></textarea>
|
717 |
+
|
718 |
+
<div class="flex justify-end space-x-3">
|
719 |
+
<button onclick="rejectArticle(${index})" class="bg-red-100 hover:bg-red-200 text-red-700 font-medium py-2 px-4 rounded-lg transition">
|
720 |
+
<i class="fas fa-times mr-2"></i>Recusar
|
721 |
+
</button>
|
722 |
+
<button onclick="approveArticle(${index})" class="bg-green-100 hover:bg-green-200 text-green-700 font-medium py-2 px-4 rounded-lg transition">
|
723 |
+
<i class="fas fa-check mr-2"></i>Aprovar
|
724 |
+
</button>
|
725 |
+
</div>
|
726 |
+
</div>
|
727 |
+
</div>
|
728 |
+
`;
|
729 |
+
container.appendChild(card);
|
730 |
+
});
|
731 |
+
}
|
732 |
+
|
733 |
+
function renderNotifications() {
|
734 |
+
const container = document.getElementById('notificationList');
|
735 |
+
const noNotifications = document.getElementById('noNotifications');
|
736 |
+
container.innerHTML = '';
|
737 |
+
|
738 |
+
if (!notifications.length) {
|
739 |
+
noNotifications.classList.remove('hidden');
|
740 |
+
return;
|
741 |
+
}
|
742 |
+
|
743 |
+
noNotifications.classList.add('hidden');
|
744 |
+
|
745 |
+
notifications.forEach((notification, index) => {
|
746 |
+
const notificationEl = document.createElement('div');
|
747 |
+
notificationEl.className = `p-4 rounded-lg border ${notification.read ? 'bg-white border-gray-200' : 'bg-blue-50 border-blue-200'}`;
|
748 |
+
|
749 |
+
notificationEl.innerHTML = `
|
750 |
+
<div class="flex justify-between items-start">
|
751 |
+
<div class="flex-1">
|
752 |
+
<div class="flex items-center mb-1">
|
753 |
+
<span class="font-medium ${notification.read ? 'text-gray-700' : 'text-blue-700'}">
|
754 |
+
${notification.type === 'approved' ? 'Matéria Aprovada' :
|
755 |
+
notification.type === 'rejected' ? 'Matéria Recusada' : 'Nova Matéria'}
|
756 |
+
</span>
|
757 |
+
<span class="mx-2 text-gray-400">•</span>
|
758 |
+
<span class="text-sm ${notification.read ? 'text-gray-500' : 'text-blue-500'}">${formatDate(notification.date)}</span>
|
759 |
+
</div>
|
760 |
+
<p class="${notification.read ? 'text-gray-600' : 'text-blue-600'}">${notification.message}</p>
|
761 |
+
${notification.author ? `<p class="text-xs mt-2 ${notification.read ? 'text-gray-500' : 'text-blue-500'}">Autor: ${notification.author}</p>` : ''}
|
762 |
+
</div>
|
763 |
+
<button onclick="markAsRead(${index})" class="ml-2 text-gray-400 hover:text-gray-600">
|
764 |
+
<i class="fas fa-times"></i>
|
765 |
+
</button>
|
766 |
+
</div>
|
767 |
+
`;
|
768 |
+
|
769 |
+
container.appendChild(notificationEl);
|
770 |
+
});
|
771 |
+
}
|
772 |
+
|
773 |
+
function approveArticle(index) {
|
774 |
+
const article = pending[index];
|
775 |
+
const comment = document.getElementById(`cmt${index}`).value;
|
776 |
+
|
777 |
+
// Add to published
|
778 |
+
published.unshift(article);
|
779 |
+
localStorage.setItem('jo_published', JSON.stringify(published));
|
780 |
+
|
781 |
+
// Remove from pending
|
782 |
+
pending.splice(index, 1);
|
783 |
+
localStorage.setItem('jo_pending', JSON.stringify(pending));
|
784 |
+
|
785 |
+
// Add notification
|
786 |
+
notifications.unshift({
|
787 |
+
type: 'approved',
|
788 |
+
message: `Sua matéria "${article.title}" foi aprovada.${comment ? ' Comentário: ' + comment : ''}`,
|
789 |
+
author: article.author,
|
790 |
+
date: new Date().toISOString(),
|
791 |
+
read: false
|
792 |
+
});
|
793 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
794 |
+
|
795 |
+
// Update UI
|
796 |
+
updateCounts();
|
797 |
+
renderPending();
|
798 |
+
renderHome();
|
799 |
+
renderNotifications();
|
800 |
+
}
|
801 |
+
|
802 |
+
function rejectArticle(index) {
|
803 |
+
const article = pending[index];
|
804 |
+
const comment = document.getElementById(`cmt${index}`).value || 'Sem comentários adicionais';
|
805 |
+
|
806 |
+
// Remove from pending
|
807 |
+
pending.splice(index, 1);
|
808 |
+
localStorage.setItem('jo_pending', JSON.stringify(pending));
|
809 |
+
|
810 |
+
// Add notification
|
811 |
+
notifications.unshift({
|
812 |
+
type: 'rejected',
|
813 |
+
message: `Sua matéria "${article.title}" foi recusada. Motivo: ${comment}`,
|
814 |
+
author: article.author,
|
815 |
+
date: new Date().toISOString(),
|
816 |
+
read: false
|
817 |
+
});
|
818 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
819 |
+
|
820 |
+
// Update UI
|
821 |
+
updateCounts();
|
822 |
+
renderPending();
|
823 |
+
renderNotifications();
|
824 |
+
}
|
825 |
+
|
826 |
+
function markAsRead(index) {
|
827 |
+
notifications[index].read = true;
|
828 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
829 |
+
updateCounts();
|
830 |
+
renderNotifications();
|
831 |
+
}
|
832 |
+
|
833 |
+
function openArticleModal(title) {
|
834 |
+
const article = published.find(a => a.title === title);
|
835 |
+
if (!article) return;
|
836 |
+
|
837 |
+
document.getElementById('modalTitle').textContent = article.title;
|
838 |
+
document.getElementById('modalAuthor').textContent = article.author;
|
839 |
+
document.getElementById('modalDate').textContent = formatDate(article.date);
|
840 |
+
document.getElementById('modalCategory').textContent = article.category;
|
841 |
+
|
842 |
+
const imageContainer = document.getElementById('modalImageContainer');
|
843 |
+
const modalImage = document.getElementById('modalImage');
|
844 |
+
if (article.imageUrl) {
|
845 |
+
imageContainer.classList.remove('hidden');
|
846 |
+
modalImage.src = article.imageUrl;
|
847 |
+
} else {
|
848 |
+
imageContainer.classList.add('hidden');
|
849 |
+
}
|
850 |
+
|
851 |
+
const modalContent = document.getElementById('modalContent');
|
852 |
+
modalContent.innerHTML = `
|
853 |
+
<h3 class="text-lg font-bold text-[var(--primary)] mb-2">Lide</h3>
|
854 |
+
<p>${article.lide}</p>
|
855 |
+
|
856 |
+
<h3 class="text-lg font-bold text-[var(--primary)] mb-2">Desenvolvimento</h3>
|
857 |
+
<p>${article.desenvolvimento}</p>
|
858 |
+
|
859 |
+
<h3 class="text-lg font-bold text-[var(--primary)] mb-2">Conclusão</h3>
|
860 |
+
<p>${article.conclusao}</p>
|
861 |
+
`;
|
862 |
+
|
863 |
+
articleModal.classList.remove('hidden');
|
864 |
+
}
|
865 |
+
|
866 |
+
function formatDate(dateString) {
|
867 |
+
const options = { year: 'numeric', month: 'long', day: 'numeric' };
|
868 |
+
return new Date(dateString).toLocaleDateString('pt-BR', options);
|
869 |
+
}
|
870 |
+
|
871 |
+
// Initialize tab indicator position
|
872 |
+
window.addEventListener('load', () => {
|
873 |
+
const activeTab = document.querySelector('.tab-btn.active');
|
874 |
+
if (activeTab) {
|
875 |
+
const indicator = document.querySelector('.tab-indicator');
|
876 |
+
indicator.style.width = `${activeTab.offsetWidth}px`;
|
877 |
+
indicator.style.left = `${activeTab.offsetLeft}px`;
|
878 |
+
}
|
879 |
+
});
|
880 |
+
</script>
|
881 |
+
<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=Rwhehhehe/foi-g" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
882 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
<!DOCTYPE html><html lang="pt-BR"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Jornal Oliveira</title> <style> :root { --bg-main: #C3CA92; --header-bg: #354C2B; --footer-bg: #20331B; --card-bg: #A4B17B; --card-bg-alt: #859864; --button-primary: #4E653D; --button-secondary: #697E50; --text-main: #20331B; --text-light: #FFFFFF; } * { box-sizing: border-box; } body { margin: 0; padding: 0; background-color: var(--bg-main); color: var(--text-main); font-family: Arial, sans-serif; } header { background-color: var(--header-bg); color: var(--text-light); padding: 1rem; text-align: center; } nav { background-color: var(--header-bg); display: flex; justify-content: center; gap: 0.5rem; padding: 0.5rem; } nav .tab { background-color: var(--card-bg); color: var(--text-main); padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; } nav .tab.active { background-color: var(--button-primary); color: var(--text-light); } .content-section { display: none; padding: 1rem; } .content-section.active { display: block; } .card { background-color: var(--card-bg); padding: 1rem; margin-bottom: 1rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .btn { display: inline-block; padding: 0.5rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; } .btn-primary { background-color: var(--button-primary); color: var(--text-light); } .btn-secondary { background-color: var(--button-secondary); color: var(--text-light); } table { width: 100%; border-collapse: collapse; margin-top: 1rem; } th, td { border: 1px solid #ccc; padding: 0.5rem; text-align: left; } th { background-color: var(--card-bg-alt); } .notification { background: #f8d7da; color: #721c24; padding: 0.5rem; margin-bottom: 0.5rem; border-radius: 4px; } .hidden { display: none; } </style> </head> <body> <header> <h1>Jornal Oliveira</h1> <p>Feito de alunos para alunos</p> </header> <nav> <div class="tab active" data-tab="home">Início</div> <div class="tab restricted" data-tab="enviar">Enviar</div> <div class="tab restricted" data-tab="pendentes">Pendentes</div> <div class="tab restricted" data-tab="notificacoes">Notificações</div> </nav> <!-- Seções --> <section id="home" class="content-section active"> <div id="articles"></div> </section> <section id="enviar" class="content-section restricted"> <h2>Enviar Matéria</h2> <form id="formEnviar"> <input id="artTitle" type="text" placeholder="Título da Matéria" required> <input id="artAuthor" type="text" placeholder="Autor" required> <input id="artDate" type="date" required> <select id="artCat" required> <option value="">Selecione uma Categoria</option> <option>Notícias da Escola</option><option>Entrevistas</option><option>Opinião</option> <option>Cultura e Arte</option><option>Esportes</option><option>Humor</option> <option>Você Sabia?</option><option>Projetos e Grêmios</option><option>Fala Estudante</option> <option>Investigação</option> </select> <textarea id="artLide" rows="3" placeholder="Lide: o quê, quem, quando, onde, como e por quê." required></textarea> <textarea id="artDev" rows="5" placeholder="Desenvolvimento: detalhes, contexto, explicações." required></textarea> <textarea id="artConc" rows="3" placeholder="Conclusão: encerramento, reflexões finais." required></textarea> <input id="artImage" type="file" accept="image/*"> <button type="submit" class="btn btn-primary">Enviar para Aprovação</button> </form> <p id="successMessage" class="hidden" style="color:green; margin-top:10px;">Sua matéria foi enviada para aprovação!</p> </section> <section id="pendentes" class="content-section restricted"> <h2>Matérias Pendentes</h2> <div id="pendingList"></div> </section> <section id="notificacoes" class="content-section restricted"> <h2>Notificações</h2> <div id="notificationList"></div> </section> <footer> <p>Jornal Oliveira © 2025</p> </footer><script> // Dados let authUsers = JSON.parse(localStorage.getItem('jo_users')) || []; let pending = JSON.parse(localStorage.getItem('jo_pending') || '[]'); let published = JSON.parse(localStorage.getItem('jo_published') || '[]'); let notifications = JSON.parse(localStorage.getItem('jo_notifications') || '[]'); // Simulação de login já realizado // Em sua implementação real, use o sistema de login anterior // Render Home function renderHome(filter='Todas') { const container = document.getElementById('articles'); container.innerHTML = ''; let list = published; if (filter!=='Todas') list = published.filter(a=>a.category===filter); if (!list.length) { container.innerHTML='<p>Nenhuma matéria.</p>'; return; } list.sort((a,b)=>new Date(b.date)-new Date(a.date)); list.forEach(a=>{ const card=document.createElement('div');card.className='card'; card.innerHTML=`<h3>${a.title}</h3><p><strong>${a.author}</strong> - ${a.date}</p><p><em>${a.category}</em></p><p>${a.lide}</p>`; container.appendChild(card); }); } // Envio de matéria const form = document.getElementById('formEnviar'); form.addEventListener('submit',e=>{ e.preventDefault(); const fields=['Title','Author','Date','Cat','Lide','Dev','Conc'].map(f=>document.getElementById('art'+f)); if(fields.slice(0,6).some(inp=>!inp.value.trim())){alert('Preencha todos os campos!');return;} const reader = new FileReader(); const data={ title:fields[0].value, author:fields[1].value, date:fields[2].value, category:document.getElementById('artCat').value, lide:document.getElementById('artLide').value, desenvolvimento:document.getElementById('artDev').value, conclusao:document.getElementById('artConc').value, imageUrl:'' }; if(document.getElementById('artImage').files.length){ reader.onload=e2=>{ data.imageUrl=e2.target.result; savePending(data); }; reader.readAsDataURL(document.getElementById('artImage').files[0]); } else savePending(data); }); function savePending(data){ pending.push(data); localStorage.setItem('jo_pending',JSON.stringify(pending)); document.getElementById('formEnviar').reset(); document.getElementById('successMessage').classList.remove('hidden'); renderPending();} // Render Pendentes function renderPending(){ const list=document.getElementById('pendingList'); list.innerHTML=''; pending.forEach((a,i)=>{ const c=document.createElement('div');c.className='card'; c.innerHTML=`<h3>${a.title}</h3><p><strong>${a.author}</strong> - ${a.date}</p><p><em>${a.category}</em></p> <p>${a.lide}</p><textarea id='cmt${i}' rows='2' placeholder='Comentário'></textarea><button class='btn btn-primary' onclick='approve(${i})'>Aprovar</button> <button class='btn btn-secondary' onclick='reject(${i})'>Recusar</button>`; list.appendChild(c); }); } function approve(i){ const a=pending[i]; a.comment=document.getElementById('cmt'+i).value; published.push(a); pending.splice(i,1); notifications.push({type:'approved',message:Matéria "${a.title}" aprovada.,author:a.author}); saveAll(); renderPending(); renderNot(); renderHome(); } function reject(i){ const a=pending[i]; const cmt=document.getElementById('cmt'+i).value; pending.splice(i,1); notifications.push({type:'rejected',message:Matéria "${a.title}" recusada. Motivo: ${cmt},author:a.author}); saveAll(); renderPending(); renderNot(); } function saveAll(){ localStorage.setItem('jo_published',JSON.stringify(published)); localStorage.setItem('jo_pending',JSON.stringify(pending)); localStorage.setItem('jo_notifications',JSON.stringify(notifications)); } // Render Notificações function renderNot(){ const n=document.getElementById('notificationList');n.innerHTML=''; notifications.forEach(x=>{ const d=document.createElement('div'); d.className='notification'; d.textContent=x.message; n.appendChild(d); }); } // Tabs document.querySelectorAll('.tab').forEach(t=>t.onclick=()=>{ document.querySelectorAll('.tab').forEach(x=>x.classList.remove('active')); t.classList.add('active'); document.querySelectorAll('.content-section').forEach(s=>s.classList.remove('active')); document.getElementById(t.dataset.tab).classList.add('active'); }); // Init renderHome(); renderPending(); renderNot(); </script> </body> </html>
|