Add 3 files
Browse files- README.md +7 -5
- index.html +789 -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: sim
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: purple
|
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,789 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>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 |
+
:root {
|
11 |
+
--primary: #4E653D;
|
12 |
+
--primary-light: #6B8C4A;
|
13 |
+
--secondary: #354C2B;
|
14 |
+
--accent: #A4B17B;
|
15 |
+
--background: #F5F7F0;
|
16 |
+
--text: #20331B;
|
17 |
+
--text-light: #FFFFFF;
|
18 |
+
}
|
19 |
+
|
20 |
+
body {
|
21 |
+
background-color: var(--background);
|
22 |
+
color: var(--text);
|
23 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
24 |
+
}
|
25 |
+
|
26 |
+
.card-hover:hover {
|
27 |
+
transform: translateY(-2px);
|
28 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
29 |
+
}
|
30 |
+
|
31 |
+
.preview-image {
|
32 |
+
transition: all 0.3s ease;
|
33 |
+
}
|
34 |
+
|
35 |
+
.preview-image:hover {
|
36 |
+
transform: scale(1.02);
|
37 |
+
}
|
38 |
+
|
39 |
+
.tab-active {
|
40 |
+
background-color: var(--primary);
|
41 |
+
color: white;
|
42 |
+
}
|
43 |
+
|
44 |
+
.notification-unread {
|
45 |
+
border-left: 4px solid var(--primary-light);
|
46 |
+
}
|
47 |
+
|
48 |
+
#preview {
|
49 |
+
max-height: 300px;
|
50 |
+
object-fit: contain;
|
51 |
+
}
|
52 |
+
|
53 |
+
/* Custom scrollbar */
|
54 |
+
::-webkit-scrollbar {
|
55 |
+
width: 8px;
|
56 |
+
}
|
57 |
+
|
58 |
+
::-webkit-scrollbar-track {
|
59 |
+
background: #f1f1f1;
|
60 |
+
}
|
61 |
+
|
62 |
+
::-webkit-scrollbar-thumb {
|
63 |
+
background: var(--accent);
|
64 |
+
border-radius: 4px;
|
65 |
+
}
|
66 |
+
|
67 |
+
::-webkit-scrollbar-thumb:hover {
|
68 |
+
background: var(--primary-light);
|
69 |
+
}
|
70 |
+
</style>
|
71 |
+
</head>
|
72 |
+
<body class="min-h-screen flex flex-col">
|
73 |
+
<!-- Header -->
|
74 |
+
<header class="bg-gradient-to-r from-green-900 to-green-700 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-lg italic">Feito de alunos para alunos</p>
|
80 |
+
</div>
|
81 |
+
<div class="flex items-center space-x-4">
|
82 |
+
<div id="userInfo" class="hidden bg-green-800 px-4 py-2 rounded-full flex items-center">
|
83 |
+
<i class="fas fa-user-circle mr-2"></i>
|
84 |
+
<span id="usernameDisplay"></span>
|
85 |
+
</div>
|
86 |
+
<button id="loginBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-full transition">
|
87 |
+
<i class="fas fa-sign-in-alt mr-2"></i>Entrar
|
88 |
+
</button>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</header>
|
93 |
+
|
94 |
+
<!-- Navigation -->
|
95 |
+
<nav class="bg-green-800 text-white shadow-md sticky top-0 z-10">
|
96 |
+
<div class="container mx-auto px-4">
|
97 |
+
<div class="flex overflow-x-auto py-2 space-x-1">
|
98 |
+
<button data-tab="home" class="tab-btn px-4 py-2 rounded-lg font-medium transition whitespace-nowrap active">
|
99 |
+
<i class="fas fa-home mr-2"></i>Início
|
100 |
+
</button>
|
101 |
+
<button data-tab="enviar" class="tab-btn restricted px-4 py-2 rounded-lg font-medium transition whitespace-nowrap">
|
102 |
+
<i class="fas fa-paper-plane mr-2"></i>Enviar
|
103 |
+
</button>
|
104 |
+
<button data-tab="pendentes" class="tab-btn restricted px-4 py-2 rounded-lg font-medium transition whitespace-nowrap">
|
105 |
+
<i class="fas fa-clock mr-2"></i>Pendentes
|
106 |
+
</button>
|
107 |
+
<button data-tab="notificacoes" class="tab-btn restricted px-4 py-2 rounded-lg font-medium transition whitespace-nowrap relative">
|
108 |
+
<i class="fas fa-bell mr-2"></i>Notificações
|
109 |
+
<span id="notificationBadge" class="hidden absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">0</span>
|
110 |
+
</button>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
</nav>
|
114 |
+
|
115 |
+
<!-- Main Content -->
|
116 |
+
<main class="flex-grow container mx-auto px-4 py-6">
|
117 |
+
<!-- Home Section -->
|
118 |
+
<section id="home" class="content-section active">
|
119 |
+
<div class="mb-8">
|
120 |
+
<h2 class="text-2xl font-bold mb-4 text-green-900 border-b-2 border-green-200 pb-2">Últimas Notícias</h2>
|
121 |
+
<div id="articles" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"></div>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
<div class="mb-8">
|
125 |
+
<h2 class="text-2xl font-bold mb-4 text-green-900 border-b-2 border-green-200 pb-2">Destaques</h2>
|
126 |
+
<div id="featured" class="grid grid-cols-1 gap-6">
|
127 |
+
<!-- Featured articles will be inserted here -->
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
</section>
|
131 |
+
|
132 |
+
<!-- Submit Section -->
|
133 |
+
<section id="enviar" class="content-section restricted max-w-4xl mx-auto">
|
134 |
+
<div class="bg-white rounded-lg shadow-md p-6">
|
135 |
+
<h2 class="text-2xl font-bold mb-6 text-green-900">
|
136 |
+
<i class="fas fa-edit mr-2"></i>Enviar Matéria
|
137 |
+
</h2>
|
138 |
+
|
139 |
+
<form id="formEnviar" class="space-y-4">
|
140 |
+
<div>
|
141 |
+
<label for="artTitle" class="block text-sm font-medium text-gray-700 mb-1">Título da Matéria</label>
|
142 |
+
<input id="artTitle" type="text" placeholder="Digite o título da matéria" required
|
143 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition">
|
144 |
+
</div>
|
145 |
+
|
146 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
147 |
+
<div>
|
148 |
+
<label for="artAuthor" class="block text-sm font-medium text-gray-700 mb-1">Autor</label>
|
149 |
+
<input id="artAuthor" type="text" placeholder="Seu nome" required
|
150 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition">
|
151 |
+
</div>
|
152 |
+
|
153 |
+
<div>
|
154 |
+
<label for="artDate" class="block text-sm font-medium text-gray-700 mb-1">Data</label>
|
155 |
+
<input id="artDate" type="date" required
|
156 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition">
|
157 |
+
</div>
|
158 |
+
</div>
|
159 |
+
|
160 |
+
<div>
|
161 |
+
<label for="artCat" class="block text-sm font-medium text-gray-700 mb-1">Categoria</label>
|
162 |
+
<select id="artCat" required
|
163 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition">
|
164 |
+
<option value="">Selecione uma Categoria</option>
|
165 |
+
<option>Notícias da Escola</option>
|
166 |
+
<option>Entrevistas</option>
|
167 |
+
<option>Opinião</option>
|
168 |
+
<option>Cultura e Arte</option>
|
169 |
+
<option>Esportes</option>
|
170 |
+
<option>Humor</option>
|
171 |
+
<option>Você Sabia?</option>
|
172 |
+
<option>Projetos e Grêmios</option>
|
173 |
+
<option>Fala Estudante</option>
|
174 |
+
<option>Investigação</option>
|
175 |
+
</select>
|
176 |
+
</div>
|
177 |
+
|
178 |
+
<div>
|
179 |
+
<label for="artLide" class="block text-sm font-medium text-gray-700 mb-1">Lide</label>
|
180 |
+
<p class="text-xs text-gray-500 mb-1">Responda: o quê, quem, quando, onde, como e por quê</p>
|
181 |
+
<textarea id="artLide" rows="3" placeholder="Escreva o lide da matéria..." required
|
182 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition"></textarea>
|
183 |
+
</div>
|
184 |
+
|
185 |
+
<div>
|
186 |
+
<label for="artDev" class="block text-sm font-medium text-gray-700 mb-1">Desenvolvimento</label>
|
187 |
+
<p class="text-xs text-gray-500 mb-1">Detalhes, contexto, explicações</p>
|
188 |
+
<textarea id="artDev" rows="5" placeholder="Desenvolva sua matéria..." required
|
189 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition"></textarea>
|
190 |
+
</div>
|
191 |
+
|
192 |
+
<div>
|
193 |
+
<label for="artConc" class="block text-sm font-medium text-gray-700 mb-1">Conclusão</label>
|
194 |
+
<p class="text-xs text-gray-500 mb-1">Reflexões finais</p>
|
195 |
+
<textarea id="artConc" rows="3" placeholder="Conclua sua matéria..." required
|
196 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition"></textarea>
|
197 |
+
</div>
|
198 |
+
|
199 |
+
<div>
|
200 |
+
<label for="artImage" class="block text-sm font-medium text-gray-700 mb-1">Imagem (opcional)</label>
|
201 |
+
<div class="flex items-center space-x-4">
|
202 |
+
<label class="cursor-pointer bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg transition inline-flex items-center">
|
203 |
+
<i class="fas fa-image mr-2"></i>
|
204 |
+
Escolher Imagem
|
205 |
+
<input id="artImage" type="file" accept="image/*" class="hidden">
|
206 |
+
</label>
|
207 |
+
<span id="fileName" class="text-sm text-gray-500">Nenhum arquivo selecionado</span>
|
208 |
+
</div>
|
209 |
+
<img id="preview" class="mt-2 rounded-lg hidden max-w-full h-auto max-h-64 object-contain mx-auto">
|
210 |
+
</div>
|
211 |
+
|
212 |
+
<div class="pt-4">
|
213 |
+
<button type="submit" class="w-full bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-4 rounded-lg transition flex items-center justify-center">
|
214 |
+
<i class="fas fa-paper-plane mr-2"></i>Enviar para Aprovação
|
215 |
+
</button>
|
216 |
+
</div>
|
217 |
+
</form>
|
218 |
+
|
219 |
+
<div id="successMessage" class="hidden mt-4 p-4 bg-green-100 border border-green-400 text-green-700 rounded-lg">
|
220 |
+
<i class="fas fa-check-circle mr-2"></i> Sua matéria foi enviada para aprovação com sucesso!
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
</section>
|
224 |
+
|
225 |
+
<!-- Pending Section -->
|
226 |
+
<section id="pendentes" class="content-section restricted">
|
227 |
+
<div class="bg-white rounded-lg shadow-md p-6">
|
228 |
+
<h2 class="text-2xl font-bold mb-6 text-green-900">
|
229 |
+
<i class="fas fa-clock mr-2"></i>Matérias Pendentes
|
230 |
+
</h2>
|
231 |
+
|
232 |
+
<div id="pendingList" class="space-y-6">
|
233 |
+
<!-- Pending articles will be inserted here -->
|
234 |
+
</div>
|
235 |
+
</div>
|
236 |
+
</section>
|
237 |
+
|
238 |
+
<!-- Notifications Section -->
|
239 |
+
<section id="notificacoes" class="content-section restricted max-w-4xl mx-auto">
|
240 |
+
<div class="bg-white rounded-lg shadow-md p-6">
|
241 |
+
<div class="flex justify-between items-center mb-6">
|
242 |
+
<h2 class="text-2xl font-bold text-green-900">
|
243 |
+
<i class="fas fa-bell mr-2"></i>Notificações
|
244 |
+
</h2>
|
245 |
+
<button id="markAllRead" class="text-sm text-green-600 hover:text-green-800 transition">
|
246 |
+
<i class="fas fa-check-double mr-1"></i>Marcar todas como lidas
|
247 |
+
</button>
|
248 |
+
</div>
|
249 |
+
|
250 |
+
<div id="notificationList" class="space-y-4">
|
251 |
+
<!-- Notifications will be inserted here -->
|
252 |
+
</div>
|
253 |
+
</div>
|
254 |
+
</section>
|
255 |
+
</main>
|
256 |
+
|
257 |
+
<!-- Footer -->
|
258 |
+
<footer class="bg-green-900 text-white py-6">
|
259 |
+
<div class="container mx-auto px-4 text-center">
|
260 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
261 |
+
<div class="mb-4 md:mb-0">
|
262 |
+
<h3 class="text-xl font-bold">Jornal Oliveira</h3>
|
263 |
+
<p class="text-sm">Feito de alunos para alunos</p>
|
264 |
+
</div>
|
265 |
+
|
266 |
+
<div class="flex space-x-4">
|
267 |
+
<a href="#" class="hover:text-green-300 transition">
|
268 |
+
<i class="fab fa-facebook-f text-lg"></i>
|
269 |
+
</a>
|
270 |
+
<a href="#" class="hover:text-green-300 transition">
|
271 |
+
<i class="fab fa-instagram text-lg"></i>
|
272 |
+
</a>
|
273 |
+
<a href="#" class="hover:text-green-300 transition">
|
274 |
+
<i class="fab fa-twitter text-lg"></i>
|
275 |
+
</a>
|
276 |
+
</div>
|
277 |
+
</div>
|
278 |
+
|
279 |
+
<div class="mt-4 pt-4 border-t border-green-700 text-sm">
|
280 |
+
<p>© 2025 Jornal Oliveira. Todos os direitos reservados.</p>
|
281 |
+
</div>
|
282 |
+
</div>
|
283 |
+
</footer>
|
284 |
+
|
285 |
+
<!-- Login Modal -->
|
286 |
+
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
287 |
+
<div class="bg-white rounded-lg shadow-xl max-w-md w-full p-6">
|
288 |
+
<div class="flex justify-between items-center mb-4">
|
289 |
+
<h3 class="text-xl font-bold text-green-900">Acesso ao Sistema</h3>
|
290 |
+
<button id="closeModal" class="text-gray-500 hover:text-gray-700">
|
291 |
+
<i class="fas fa-times"></i>
|
292 |
+
</button>
|
293 |
+
</div>
|
294 |
+
|
295 |
+
<form id="loginForm" class="space-y-4">
|
296 |
+
<div>
|
297 |
+
<label for="loginName" class="block text-sm font-medium text-gray-700 mb-1">Nome do editor</label>
|
298 |
+
<input id="loginName" type="text" placeholder="Digite seu nome" required
|
299 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition">
|
300 |
+
</div>
|
301 |
+
|
302 |
+
<div>
|
303 |
+
<label for="loginPass" class="block text-sm font-medium text-gray-700 mb-1">Senha</label>
|
304 |
+
<input id="loginPass" type="password" placeholder="Digite sua senha" required
|
305 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition">
|
306 |
+
</div>
|
307 |
+
|
308 |
+
<div class="pt-2">
|
309 |
+
<button type="submit" class="w-full bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-lg transition">
|
310 |
+
<i class="fas fa-sign-in-alt mr-2"></i>Entrar
|
311 |
+
</button>
|
312 |
+
</div>
|
313 |
+
</form>
|
314 |
+
|
315 |
+
<div id="loginError" class="hidden mt-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded-lg">
|
316 |
+
<i class="fas fa-exclamation-circle mr-2"></i> Credenciais inválidas. Por favor, tente novamente.
|
317 |
+
</div>
|
318 |
+
</div>
|
319 |
+
</div>
|
320 |
+
|
321 |
+
<script>
|
322 |
+
// Initialization
|
323 |
+
let authUsers = JSON.parse(localStorage.getItem('jo_users')) || [
|
324 |
+
{ name: 'Mikael Silva', pass: '1903', role: 'editor' },
|
325 |
+
{ name: 'Lorena Rangel', pass: 'Editor chefe 2', role: 'editor' }
|
326 |
+
];
|
327 |
+
|
328 |
+
localStorage.setItem('jo_users', JSON.stringify(authUsers));
|
329 |
+
|
330 |
+
let pending = JSON.parse(localStorage.getItem('jo_pending') || '[]');
|
331 |
+
let published = JSON.parse(localStorage.getItem('jo_published') || '[]');
|
332 |
+
let notifications = JSON.parse(localStorage.getItem('jo_notifications') || '[]');
|
333 |
+
let currentUser = null;
|
334 |
+
|
335 |
+
// DOM Elements
|
336 |
+
const loginBtn = document.getElementById('loginBtn');
|
337 |
+
const loginModal = document.getElementById('loginModal');
|
338 |
+
const closeModal = document.getElementById('closeModal');
|
339 |
+
const loginForm = document.getElementById('loginForm');
|
340 |
+
const loginError = document.getElementById('loginError');
|
341 |
+
const userInfo = document.getElementById('userInfo');
|
342 |
+
const usernameDisplay = document.getElementById('usernameDisplay');
|
343 |
+
const notificationBadge = document.getElementById('notificationBadge');
|
344 |
+
const markAllRead = document.getElementById('markAllRead');
|
345 |
+
|
346 |
+
// Event Listeners
|
347 |
+
loginBtn.addEventListener('click', () => loginModal.classList.remove('hidden'));
|
348 |
+
closeModal.addEventListener('click', () => loginModal.classList.add('hidden'));
|
349 |
+
|
350 |
+
loginForm.addEventListener('submit', (e) => {
|
351 |
+
e.preventDefault();
|
352 |
+
const name = document.getElementById('loginName').value.trim();
|
353 |
+
const pass = document.getElementById('loginPass').value;
|
354 |
+
|
355 |
+
// Special password for demo
|
356 |
+
if (pass.toLowerCase() === 'jornal oliveira') {
|
357 |
+
currentUser = { name, role: 'editor' };
|
358 |
+
handleSuccessfulLogin();
|
359 |
+
return;
|
360 |
+
}
|
361 |
+
|
362 |
+
// Check against authorized users
|
363 |
+
const user = authUsers.find(u =>
|
364 |
+
u.name.toLowerCase() === name.toLowerCase() && u.pass === pass
|
365 |
+
);
|
366 |
+
|
367 |
+
if (user) {
|
368 |
+
currentUser = user;
|
369 |
+
handleSuccessfulLogin();
|
370 |
+
} else {
|
371 |
+
loginError.classList.remove('hidden');
|
372 |
+
}
|
373 |
+
});
|
374 |
+
|
375 |
+
function handleSuccessfulLogin() {
|
376 |
+
loginModal.classList.add('hidden');
|
377 |
+
loginError.classList.add('hidden');
|
378 |
+
document.getElementById('loginName').value = '';
|
379 |
+
document.getElementById('loginPass').value = '';
|
380 |
+
|
381 |
+
// Update UI
|
382 |
+
loginBtn.classList.add('hidden');
|
383 |
+
userInfo.classList.remove('hidden');
|
384 |
+
usernameDisplay.textContent = currentUser.name;
|
385 |
+
|
386 |
+
// Show restricted content
|
387 |
+
document.querySelectorAll('.restricted').forEach(el => el.style.display = 'block');
|
388 |
+
|
389 |
+
// Render all content
|
390 |
+
renderAll();
|
391 |
+
|
392 |
+
// Update notification badge
|
393 |
+
updateNotificationBadge();
|
394 |
+
}
|
395 |
+
|
396 |
+
// Tab Navigation
|
397 |
+
document.querySelectorAll('.tab-btn').forEach(tab => {
|
398 |
+
tab.addEventListener('click', () => {
|
399 |
+
// Update active tab
|
400 |
+
document.querySelectorAll('.tab-btn').forEach(t => t.classList.remove('active'));
|
401 |
+
tab.classList.add('active');
|
402 |
+
|
403 |
+
// Show corresponding section
|
404 |
+
document.querySelectorAll('.content-section').forEach(section => {
|
405 |
+
section.classList.remove('active');
|
406 |
+
});
|
407 |
+
document.getElementById(tab.dataset.tab).classList.add('active');
|
408 |
+
});
|
409 |
+
});
|
410 |
+
|
411 |
+
// Image Preview
|
412 |
+
const artImage = document.getElementById('artImage');
|
413 |
+
const preview = document.getElementById('preview');
|
414 |
+
const fileName = document.getElementById('fileName');
|
415 |
+
|
416 |
+
artImage.addEventListener('change', (e) => {
|
417 |
+
const file = e.target.files[0];
|
418 |
+
if (!file) return;
|
419 |
+
|
420 |
+
fileName.textContent = file.name;
|
421 |
+
|
422 |
+
const reader = new FileReader();
|
423 |
+
reader.onload = (event) => {
|
424 |
+
preview.src = event.target.result;
|
425 |
+
preview.classList.remove('hidden');
|
426 |
+
};
|
427 |
+
reader.readAsDataURL(file);
|
428 |
+
});
|
429 |
+
|
430 |
+
// Form Submission
|
431 |
+
const formEnviar = document.getElementById('formEnviar');
|
432 |
+
const successMessage = document.getElementById('successMessage');
|
433 |
+
|
434 |
+
formEnviar.addEventListener('submit', (e) => {
|
435 |
+
e.preventDefault();
|
436 |
+
|
437 |
+
const article = {
|
438 |
+
title: document.getElementById('artTitle').value.trim(),
|
439 |
+
author: document.getElementById('artAuthor').value.trim(),
|
440 |
+
date: document.getElementById('artDate').value,
|
441 |
+
category: document.getElementById('artCat').value,
|
442 |
+
lide: document.getElementById('artLide').value.trim(),
|
443 |
+
desenvolvimento: document.getElementById('artDev').value.trim(),
|
444 |
+
conclusao: document.getElementById('artConc').value.trim(),
|
445 |
+
imageUrl: preview.src || '',
|
446 |
+
submittedBy: currentUser.name,
|
447 |
+
submittedAt: new Date().toISOString()
|
448 |
+
};
|
449 |
+
|
450 |
+
pending.push(article);
|
451 |
+
localStorage.setItem('jo_pending', JSON.stringify(pending));
|
452 |
+
|
453 |
+
// Reset form
|
454 |
+
formEnviar.reset();
|
455 |
+
preview.classList.add('hidden');
|
456 |
+
fileName.textContent = 'Nenhum arquivo selecionado';
|
457 |
+
|
458 |
+
// Show success message
|
459 |
+
successMessage.classList.remove('hidden');
|
460 |
+
setTimeout(() => {
|
461 |
+
successMessage.classList.add('hidden');
|
462 |
+
}, 5000);
|
463 |
+
|
464 |
+
// Add notification for editors
|
465 |
+
notifications.push({
|
466 |
+
message: `Nova matéria submetida: "${article.title}" por ${currentUser.name}`,
|
467 |
+
read: false,
|
468 |
+
date: new Date().toISOString(),
|
469 |
+
type: 'submission'
|
470 |
+
});
|
471 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
472 |
+
|
473 |
+
// Update UI
|
474 |
+
renderPending();
|
475 |
+
updateNotificationBadge();
|
476 |
+
});
|
477 |
+
|
478 |
+
// Render Home Page
|
479 |
+
function renderHome() {
|
480 |
+
const articlesContainer = document.getElementById('articles');
|
481 |
+
const featuredContainer = document.getElementById('featured');
|
482 |
+
|
483 |
+
articlesContainer.innerHTML = '';
|
484 |
+
featuredContainer.innerHTML = '';
|
485 |
+
|
486 |
+
if (!published.length) {
|
487 |
+
createWelcome();
|
488 |
+
}
|
489 |
+
|
490 |
+
// Sort by date (newest first)
|
491 |
+
published.sort((a, b) => new Date(b.date) - new Date(a.date));
|
492 |
+
|
493 |
+
// Regular articles
|
494 |
+
published.forEach((article, index) => {
|
495 |
+
const card = createArticleCard(article);
|
496 |
+
|
497 |
+
// First 3 articles are featured
|
498 |
+
if (index < 3) {
|
499 |
+
const featuredCard = card.cloneNode(true);
|
500 |
+
featuredCard.classList.add('bg-green-50', 'border-l-4', 'border-green-500');
|
501 |
+
featuredContainer.appendChild(featuredCard);
|
502 |
+
}
|
503 |
+
|
504 |
+
articlesContainer.appendChild(card);
|
505 |
+
});
|
506 |
+
}
|
507 |
+
|
508 |
+
function createArticleCard(article) {
|
509 |
+
const card = document.createElement('div');
|
510 |
+
card.className = 'bg-white rounded-lg shadow-md overflow-hidden transition duration-300 card-hover';
|
511 |
+
|
512 |
+
card.innerHTML = `
|
513 |
+
${article.imageUrl ? `
|
514 |
+
<div class="h-48 overflow-hidden">
|
515 |
+
<img src="${article.imageUrl}" alt="${article.title}" class="w-full h-full object-cover preview-image">
|
516 |
+
</div>
|
517 |
+
` : ''}
|
518 |
+
|
519 |
+
<div class="p-6">
|
520 |
+
<div class="flex justify-between items-start mb-2">
|
521 |
+
<span class="inline-block bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">
|
522 |
+
${article.category}
|
523 |
+
</span>
|
524 |
+
<span class="text-sm text-gray-500">${formatDate(article.date)}</span>
|
525 |
+
</div>
|
526 |
+
|
527 |
+
<h3 class="text-xl font-bold text-green-900 mb-2">${article.title}</h3>
|
528 |
+
<p class="text-sm text-gray-600 mb-3">Por <span class="font-medium">${article.author}</span></p>
|
529 |
+
|
530 |
+
<p class="text-gray-700 mb-3">${article.lide}</p>
|
531 |
+
|
532 |
+
<button class="text-green-600 hover:text-green-800 font-medium text-sm transition">
|
533 |
+
Ler mais <i class="fas fa-arrow-right ml-1"></i>
|
534 |
+
</button>
|
535 |
+
</div>
|
536 |
+
`;
|
537 |
+
|
538 |
+
return card;
|
539 |
+
}
|
540 |
+
|
541 |
+
function createWelcome() {
|
542 |
+
published.push({
|
543 |
+
title: 'Bem-vindo ao Jornal Oliveira!',
|
544 |
+
author: 'Equipe',
|
545 |
+
date: new Date().toISOString(),
|
546 |
+
category: 'Notícias da Escola',
|
547 |
+
lide: 'Este é o primeiro artigo do nosso jornal escolar digital.',
|
548 |
+
desenvolvimento: 'Aqui você encontrará as últimas notícias, eventos e artigos escritos por alunos para alunos. Nosso objetivo é manter toda a comunidade escolar informada e engajada.',
|
549 |
+
conclusao: 'Participe você também! Envie suas matérias e faça parte deste projeto.',
|
550 |
+
imageUrl: ''
|
551 |
+
});
|
552 |
+
|
553 |
+
localStorage.setItem('jo_published', JSON.stringify(published));
|
554 |
+
}
|
555 |
+
|
556 |
+
// Render Pending Articles
|
557 |
+
function renderPending() {
|
558 |
+
const pendingList = document.getElementById('pendingList');
|
559 |
+
pendingList.innerHTML = '';
|
560 |
+
|
561 |
+
if (!pending.length) {
|
562 |
+
pendingList.innerHTML = `
|
563 |
+
<div class="bg-gray-100 rounded-lg p-6 text-center">
|
564 |
+
<i class="fas fa-inbox text-4xl text-gray-400 mb-4"></i>
|
565 |
+
<p class="text-gray-600">Nenhuma matéria pendente no momento.</p>
|
566 |
+
</div>
|
567 |
+
`;
|
568 |
+
return;
|
569 |
+
}
|
570 |
+
|
571 |
+
pending.forEach((article, index) => {
|
572 |
+
const card = document.createElement('div');
|
573 |
+
card.className = 'bg-white rounded-lg shadow-md overflow-hidden';
|
574 |
+
|
575 |
+
card.innerHTML = `
|
576 |
+
<div class="p-6">
|
577 |
+
<div class="flex justify-between items-start mb-4">
|
578 |
+
<div>
|
579 |
+
<span class="inline-block bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded-full mb-2">
|
580 |
+
Pendente
|
581 |
+
</span>
|
582 |
+
<h3 class="text-xl font-bold text-green-900">${article.title}</h3>
|
583 |
+
</div>
|
584 |
+
<span class="text-sm text-gray-500">${formatDate(article.date)}</span>
|
585 |
+
</div>
|
586 |
+
|
587 |
+
<div class="mb-4">
|
588 |
+
<p class="text-sm text-gray-600 mb-1"><span class="font-medium">Autor:</span> ${article.author}</p>
|
589 |
+
<p class="text-sm text-gray-600"><span class="font-medium">Categoria:</span> ${article.category}</p>
|
590 |
+
</div>
|
591 |
+
|
592 |
+
${article.imageUrl ? `
|
593 |
+
<div class="mb-4">
|
594 |
+
<img src="${article.imageUrl}" alt="${article.title}" class="max-h-40 mx-auto rounded-lg">
|
595 |
+
</div>
|
596 |
+
` : ''}
|
597 |
+
|
598 |
+
<div class="mb-4">
|
599 |
+
<h4 class="font-medium text-gray-800 mb-1">Lide:</h4>
|
600 |
+
<p class="text-gray-700 text-sm">${article.lide}</p>
|
601 |
+
</div>
|
602 |
+
|
603 |
+
<div class="mb-6">
|
604 |
+
<label for="cmt${index}" class="block text-sm font-medium text-gray-700 mb-1">Comentário:</label>
|
605 |
+
<textarea id="cmt${index}" rows="2" placeholder="Digite seu comentário..."
|
606 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition text-sm"></textarea>
|
607 |
+
</div>
|
608 |
+
|
609 |
+
<div class="flex justify-end space-x-3">
|
610 |
+
<button onclick="reject(${index})" class="bg-red-100 hover:bg-red-200 text-red-700 px-4 py-2 rounded-lg transition text-sm">
|
611 |
+
<i class="fas fa-times mr-1"></i> Recusar
|
612 |
+
</button>
|
613 |
+
<button onclick="approve(${index})" class="bg-green-100 hover:bg-green-200 text-green-700 px-4 py-2 rounded-lg transition text-sm">
|
614 |
+
<i class="fas fa-check mr-1"></i> Aprovar
|
615 |
+
</button>
|
616 |
+
</div>
|
617 |
+
</div>
|
618 |
+
`;
|
619 |
+
|
620 |
+
pendingList.appendChild(card);
|
621 |
+
});
|
622 |
+
}
|
623 |
+
|
624 |
+
// Approve Article
|
625 |
+
function approve(index) {
|
626 |
+
const article = pending[index];
|
627 |
+
const comment = document.getElementById(`cmt${index}`).value;
|
628 |
+
|
629 |
+
// Add editor info
|
630 |
+
article.approvedBy = currentUser.name;
|
631 |
+
article.approvedAt = new Date().toISOString();
|
632 |
+
article.editorComment = comment;
|
633 |
+
|
634 |
+
// Move to published
|
635 |
+
published.push(article);
|
636 |
+
pending.splice(index, 1);
|
637 |
+
|
638 |
+
// Add notification
|
639 |
+
notifications.push({
|
640 |
+
message: `Sua matéria "${article.title}" foi aprovada! ${comment ? `Comentário: ${comment}` : ''}`,
|
641 |
+
read: false,
|
642 |
+
date: new Date().toISOString(),
|
643 |
+
type: 'approval',
|
644 |
+
recipient: article.submittedBy
|
645 |
+
});
|
646 |
+
|
647 |
+
saveAll();
|
648 |
+
renderPending();
|
649 |
+
renderHome();
|
650 |
+
updateNotificationBadge();
|
651 |
+
}
|
652 |
+
|
653 |
+
// Reject Article
|
654 |
+
function reject(index) {
|
655 |
+
const article = pending[index];
|
656 |
+
const comment = document.getElementById(`cmt${index}`).value;
|
657 |
+
|
658 |
+
if (!comment) {
|
659 |
+
alert('Por favor, forneça um motivo para a recusa.');
|
660 |
+
return;
|
661 |
+
}
|
662 |
+
|
663 |
+
// Add rejection info
|
664 |
+
article.rejectedBy = currentUser.name;
|
665 |
+
article.rejectedAt = new Date().toISOString();
|
666 |
+
article.rejectionReason = comment;
|
667 |
+
|
668 |
+
// Remove from pending
|
669 |
+
pending.splice(index, 1);
|
670 |
+
|
671 |
+
// Add notification
|
672 |
+
notifications.push({
|
673 |
+
message: `Sua matéria "${article.title}" foi recusada. Motivo: ${comment}`,
|
674 |
+
read: false,
|
675 |
+
date: new Date().toISOString(),
|
676 |
+
type: 'rejection',
|
677 |
+
recipient: article.submittedBy
|
678 |
+
});
|
679 |
+
|
680 |
+
saveAll();
|
681 |
+
renderPending();
|
682 |
+
updateNotificationBadge();
|
683 |
+
}
|
684 |
+
|
685 |
+
// Render Notifications
|
686 |
+
function renderNotifications() {
|
687 |
+
const notificationList = document.getElementById('notificationList');
|
688 |
+
notificationList.innerHTML = '';
|
689 |
+
|
690 |
+
if (!notifications.length) {
|
691 |
+
notificationList.innerHTML = `
|
692 |
+
<div class="bg-gray-100 rounded-lg p-6 text-center">
|
693 |
+
<i class="fas fa-bell-slash text-4xl text-gray-400 mb-4"></i>
|
694 |
+
<p class="text-gray-600">Nenhuma notificação no momento.</p>
|
695 |
+
</div>
|
696 |
+
`;
|
697 |
+
return;
|
698 |
+
}
|
699 |
+
|
700 |
+
// Filter notifications for current user (if not admin/editor)
|
701 |
+
let userNotifications = notifications;
|
702 |
+
if (currentUser.role !== 'editor') {
|
703 |
+
userNotifications = notifications.filter(n => n.recipient === currentUser.name);
|
704 |
+
}
|
705 |
+
|
706 |
+
// Sort by date (newest first)
|
707 |
+
userNotifications.sort((a, b) => new Date(b.date) - new Date(a.date));
|
708 |
+
|
709 |
+
userNotifications.forEach((notification, index) => {
|
710 |
+
const notificationElement = document.createElement('div');
|
711 |
+
notificationElement.className = `bg-white rounded-lg shadow-sm p-4 ${!notification.read ? 'notification-unread' : ''}`;
|
712 |
+
|
713 |
+
notificationElement.innerHTML = `
|
714 |
+
<div class="flex justify-between items-start">
|
715 |
+
<div class="flex-1">
|
716 |
+
<p class="text-gray-800">${notification.message}</p>
|
717 |
+
<p class="text-xs text-gray-500 mt-1">${formatDate(notification.date)}</p>
|
718 |
+
</div>
|
719 |
+
<button onclick="markAsRead(${index})" class="ml-2 text-gray-400 hover:text-gray-600 transition">
|
720 |
+
<i class="fas fa-check-circle"></i>
|
721 |
+
</button>
|
722 |
+
</div>
|
723 |
+
`;
|
724 |
+
|
725 |
+
notificationList.appendChild(notificationElement);
|
726 |
+
});
|
727 |
+
}
|
728 |
+
|
729 |
+
// Mark Notification as Read
|
730 |
+
function markAsRead(index) {
|
731 |
+
notifications[index].read = true;
|
732 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
733 |
+
updateNotificationBadge();
|
734 |
+
renderNotifications();
|
735 |
+
}
|
736 |
+
|
737 |
+
// Mark All Notifications as Read
|
738 |
+
markAllRead.addEventListener('click', () => {
|
739 |
+
notifications.forEach(n => n.read = true);
|
740 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
741 |
+
updateNotificationBadge();
|
742 |
+
renderNotifications();
|
743 |
+
});
|
744 |
+
|
745 |
+
// Update Notification Badge
|
746 |
+
function updateNotificationBadge() {
|
747 |
+
let unreadCount = 0;
|
748 |
+
|
749 |
+
if (currentUser) {
|
750 |
+
if (currentUser.role === 'editor') {
|
751 |
+
unreadCount = notifications.filter(n => !n.read).length;
|
752 |
+
} else {
|
753 |
+
unreadCount = notifications.filter(n => !n.read && n.recipient === currentUser.name).length;
|
754 |
+
}
|
755 |
+
}
|
756 |
+
|
757 |
+
if (unreadCount > 0) {
|
758 |
+
notificationBadge.textContent = unreadCount;
|
759 |
+
notificationBadge.classList.remove('hidden');
|
760 |
+
} else {
|
761 |
+
notificationBadge.classList.add('hidden');
|
762 |
+
}
|
763 |
+
}
|
764 |
+
|
765 |
+
// Save All Data
|
766 |
+
function saveAll() {
|
767 |
+
localStorage.setItem('jo_published', JSON.stringify(published));
|
768 |
+
localStorage.setItem('jo_pending', JSON.stringify(pending));
|
769 |
+
localStorage.setItem('jo_notifications', JSON.stringify(notifications));
|
770 |
+
}
|
771 |
+
|
772 |
+
// Format Date
|
773 |
+
function formatDate(dateString) {
|
774 |
+
const options = { year: 'numeric', month: 'long', day: 'numeric' };
|
775 |
+
return new Date(dateString).toLocaleDateString('pt-BR', options);
|
776 |
+
}
|
777 |
+
|
778 |
+
// Render All Content
|
779 |
+
function renderAll() {
|
780 |
+
renderHome();
|
781 |
+
renderPending();
|
782 |
+
renderNotifications();
|
783 |
+
}
|
784 |
+
|
785 |
+
// Initialize
|
786 |
+
updateNotificationBadge();
|
787 |
+
</script>
|
788 |
+
<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/sim" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
789 |
+
</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; --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; } .tab { background-color: var(--card-bg); padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; color: var(--text-main); } .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 { padding: 0.5rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; margin-right: 0.5rem; } .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; } img.preview { max-width: 100%; height: auto; margin-top: 0.5rem; border-radius: 4px; } </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> <!-- Home --> <section id="home" class="content-section active"> <div id="articles"></div> </section> <!-- Enviar Matéria --> <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 (reflexões finais)" required></textarea> <input id="artImage" type="file" accept="image/*"> <img id="preview" class="preview hidden" alt="Pré-visualização"> <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> <!-- Pendentes --> <section id="pendentes" class="content-section restricted"> <h2>Matérias Pendentes</h2> <div id="pendingList"></div> </section> <!-- Notificações --> <section id="notificacoes" class="content-section restricted"> <h2>Notificações</h2> <div id="notificationList"></div> </section> <footer> <p>Jornal Oliveira © 2025</p> </footer><script> // Inicialização let authUsers = JSON.parse(localStorage.getItem('jo_users')) || [ { name: 'Mikael Silva', pass: '1903', role: 'editor' }, { name: 'Lorena Rangel', pass: 'Editor chefe 2', role: 'editor' } ]; localStorage.setItem('jo_users', JSON.stringify(authUsers)); let pending = JSON.parse(localStorage.getItem('jo_pending') || '[]'); let published = JSON.parse(localStorage.getItem('jo_published') || '[]'); let notifications = JSON.parse(localStorage.getItem('jo_notifications') || '[]'); let currentUser = null; // Login simulado (substitua por seu sistema de login) function simulateLogin() { const name = prompt('Nome do editor:'); const pass = prompt('Senha:'); if (pass.toLowerCase() === 'jornal oliveira') { currentUser = { name, role: 'editor' }; } else { const user = authUsers.find(u => u.name.toLowerCase() === name.toLowerCase().trim() && u.pass === pass); if (user) currentUser = user; } if (!currentUser) { alert('Login falhou'); return; } document.querySelectorAll('.restricted').forEach(el => el.style.display = 'block'); renderAll(); } simulateLogin(); // Render Home function renderHome() { const container = document.getElementById('articles'); container.innerHTML = ''; if (!published.length) createWelcome(); published.sort((a,b) => new Date(b.date) - new Date(a.date)); published.forEach(a => { const card = document.createElement('div'); card.className = 'card'; card.innerHTML = ` <h3>${a.title}</h3> <p><strong>${a.author}</strong> - ${a.date} (<em>${a.category}</em>)</p> ${a.imageUrl ? `<img src="${a.imageUrl}" class="preview" alt="">` : ''} <p>${a.lide}</p> <p>${a.desenvolvimento}</p> <p>${a.conclusao}</p> `; container.appendChild(card); }); } function createWelcome() { published.push({ title: 'Bem-vindo ao Jornal Oliveira!', author:'Equipe', date: new Date().toLocaleDateString('pt-BR'), category:'Notícias da Escola', lide:'Este é nosso primeiro artigo.', desenvolvimento:'Aguarde novas matérias feitas por alunos.', conclusao:'Participe você também!', imageUrl:'' }); localStorage.setItem('jo_published', JSON.stringify(published)); } // Formulário de envio const previewImg = document.getElementById('preview'); document.getElementById('artImage').addEventListener('change', e=>{ const file = e.target.files[0]; if (!file) return; const reader = new FileReader(); reader.onload = ev => { previewImg.src = ev.target.result; previewImg.classList.remove('hidden'); }; reader.readAsDataURL(file); }); document.getElementById('formEnviar').addEventListener('submit', e=>{ e.preventDefault(); const data = { title: document.getElementById('artTitle').value.trim(), author: document.getElementById('artAuthor').value.trim(), date: document.getElementById('artDate').value, category: document.getElementById('artCat').value, lide: document.getElementById('artLide').value.trim(), desenvolvimento: document.getElementById('artDev').value.trim(), conclusao: document.getElementById('artConc').value.trim(), imageUrl: previewImg.src || '' }; pending.push(data); localStorage.setItem('jo_pending', JSON.stringify(pending)); document.getElementById('formEnviar').reset(); previewImg.classList.add('hidden'); 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} (<em>${a.category}</em>)</p> ${a.imageUrl ? `<img src="${a.imageUrl}" class="preview" alt="">` : ''} <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({ message:Sua matéria "${a.title}" foi aprovada! }); saveAll(); renderPending(); renderHome(); renderNotifications(); } function reject(i) { const a = pending[i]; const cmt = document.getElementById('cmt'+i).value; pending.splice(i,1); notifications.push({ message:Sua matéria "${a.title}" foi recusada. Motivo: ${cmt} }); saveAll(); renderPending(); renderNotifications(); } 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 renderNotifications() { const n = document.getElementById('notificationList'); n.innerHTML=''; notifications.forEach(nt => { const d = document.createElement('div'); d.className='notification'; d.textContent = nt.message; n.appendChild(d); }); } // Controle de abas function renderAll() { renderHome(); renderPending(); renderNotifications(); } 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'); }); // Iniciar renderAll(); </script> </body> </html>
|