machadolopes commited on
Commit
9ba7e0d
·
verified ·
1 Parent(s): 36ea5e5

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +397 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Robolit
3
- emoji: 👀
4
- colorFrom: blue
5
- colorTo: gray
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: robolit
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: red
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,397 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="pt-BR">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Upload de Documento DOCX</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
+ .file-upload {
11
+ position: relative;
12
+ overflow: hidden;
13
+ transition: all 0.3s ease;
14
+ }
15
+
16
+ .file-upload:hover {
17
+ transform: translateY(-2px);
18
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
19
+ }
20
+
21
+ .file-upload input[type="file"] {
22
+ position: absolute;
23
+ top: 0;
24
+ right: 0;
25
+ min-width: 100%;
26
+ min-height: 100%;
27
+ font-size: 100px;
28
+ text-align: right;
29
+ filter: alpha(opacity=0);
30
+ opacity: 0;
31
+ outline: none;
32
+ background: white;
33
+ cursor: pointer;
34
+ display: block;
35
+ }
36
+
37
+ .progress-bar {
38
+ height: 6px;
39
+ border-radius: 3px;
40
+ transition: width 0.3s ease;
41
+ }
42
+
43
+ .file-preview {
44
+ max-height: 200px;
45
+ overflow-y: auto;
46
+ }
47
+
48
+ .file-preview::-webkit-scrollbar {
49
+ width: 6px;
50
+ }
51
+
52
+ .file-preview::-webkit-scrollbar-thumb {
53
+ background-color: #cbd5e0;
54
+ border-radius: 3px;
55
+ }
56
+
57
+ .file-preview::-webkit-scrollbar-track {
58
+ background-color: #edf2f7;
59
+ }
60
+
61
+ @keyframes pulse {
62
+ 0%, 100% {
63
+ opacity: 1;
64
+ }
65
+ 50% {
66
+ opacity: 0.5;
67
+ }
68
+ }
69
+
70
+ .animate-pulse {
71
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
72
+ }
73
+ </style>
74
+ </head>
75
+ <body class="bg-gray-50 min-h-screen flex items-center justify-center p-4">
76
+ <div class="w-full max-w-2xl bg-white rounded-xl shadow-lg overflow-hidden">
77
+ <div class="bg-blue-600 py-4 px-6">
78
+ <h1 class="text-2xl font-bold text-white flex items-center">
79
+ <i class="fas fa-file-word mr-3"></i>
80
+ Upload de Documento DOCX
81
+ </h1>
82
+ <p class="text-blue-100 mt-1">Envie seus documentos Word para processamento</p>
83
+ </div>
84
+
85
+ <div class="p-6">
86
+ <form id="uploadForm" class="space-y-6">
87
+ <div class="space-y-2">
88
+ <label for="documentName" class="block text-sm font-medium text-gray-700">
89
+ Nome do Documento
90
+ </label>
91
+ <input
92
+ type="text"
93
+ id="documentName"
94
+ class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"
95
+ placeholder="Ex: Relatório Mensal - Junho 2023"
96
+ required
97
+ >
98
+ </div>
99
+
100
+ <div class="space-y-2">
101
+ <label for="documentDescription" class="block text-sm font-medium text-gray-700">
102
+ Descrição (Opcional)
103
+ </label>
104
+ <textarea
105
+ id="documentDescription"
106
+ rows="3"
107
+ class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"
108
+ placeholder="Forneça detalhes sobre o documento..."
109
+ ></textarea>
110
+ </div>
111
+
112
+ <div class="space-y-2">
113
+ <label class="block text-sm font-medium text-gray-700">
114
+ Arquivo DOCX
115
+ </label>
116
+
117
+ <div class="file-upload mt-1 flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-lg p-8 bg-gray-50 hover:bg-blue-50 transition-colors">
118
+ <i class="fas fa-cloud-upload-alt text-4xl text-blue-500 mb-3"></i>
119
+ <p class="text-sm text-gray-600 mb-2">Arraste e solte seu arquivo aqui ou</p>
120
+ <label for="documentFile" class="cursor-pointer bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition-colors">
121
+ <i class="fas fa-folder-open mr-2"></i>
122
+ Selecione um arquivo
123
+ </label>
124
+ <input
125
+ type="file"
126
+ id="documentFile"
127
+ class="hidden"
128
+ accept=".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
129
+ required
130
+ >
131
+ <p class="text-xs text-gray-500 mt-3">Formatos suportados: DOCX (Tamanho máximo: 10MB)</p>
132
+ </div>
133
+
134
+ <div id="fileInfo" class="hidden mt-3 p-3 bg-gray-50 rounded-md">
135
+ <div class="flex items-center justify-between">
136
+ <div class="flex items-center">
137
+ <i class="fas fa-file-word text-blue-500 text-xl mr-3"></i>
138
+ <div>
139
+ <p id="fileName" class="font-medium text-gray-800"></p>
140
+ <p id="fileSize" class="text-xs text-gray-500"></p>
141
+ </div>
142
+ </div>
143
+ <button id="removeFile" type="button" class="text-red-500 hover:text-red-700">
144
+ <i class="fas fa-times"></i>
145
+ </button>
146
+ </div>
147
+ <div class="mt-2">
148
+ <div class="w-full bg-gray-200 rounded-full h-1.5">
149
+ <div id="uploadProgress" class="progress-bar bg-blue-600 h-1.5 rounded-full w-0"></div>
150
+ </div>
151
+ <p id="uploadStatus" class="text-xs text-gray-500 mt-1">Pronto para upload</p>
152
+ </div>
153
+ </div>
154
+ </div>
155
+
156
+ <div class="flex items-center">
157
+ <input
158
+ id="termsCheckbox"
159
+ type="checkbox"
160
+ class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
161
+ required
162
+ >
163
+ <label for="termsCheckbox" class="ml-2 block text-sm text-gray-700">
164
+ Concordo com os <a href="#" class="text-blue-600 hover:underline">Termos de Serviço</a> e <a href="#" class="text-blue-600 hover:underline">Política de Privacidade</a>
165
+ </label>
166
+ </div>
167
+
168
+ <div class="pt-2">
169
+ <button
170
+ type="submit"
171
+ id="submitButton"
172
+ class="w-full flex justify-center items-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
173
+ disabled
174
+ >
175
+ <span id="buttonText">Enviar Documento</span>
176
+ <span id="buttonSpinner" class="hidden ml-2">
177
+ <i class="fas fa-circle-notch fa-spin"></i>
178
+ </span>
179
+ </button>
180
+ </div>
181
+ </form>
182
+
183
+ <div id="successMessage" class="hidden mt-6 p-4 bg-green-50 rounded-md border border-green-200">
184
+ <div class="flex items-center">
185
+ <div class="flex-shrink-0">
186
+ <i class="fas fa-check-circle text-green-500 text-xl"></i>
187
+ </div>
188
+ <div class="ml-3">
189
+ <h3 class="text-sm font-medium text-green-800">Upload concluído com sucesso!</h3>
190
+ <div class="mt-2 text-sm text-green-700">
191
+ <p>Seu documento foi enviado e está sendo processado.</p>
192
+ <p id="successFileName" class="font-medium mt-1"></p>
193
+ </div>
194
+ <div class="mt-4">
195
+ <button id="newUploadButton" type="button" class="text-sm font-medium text-green-700 hover:text-green-600">
196
+ Fazer novo upload
197
+ </button>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ </div>
203
+
204
+ <div class="bg-gray-50 px-6 py-4 border-t border-gray-200">
205
+ <div class="flex items-center justify-between">
206
+ <p class="text-xs text-gray-500">
207
+ <i class="fas fa-lock mr-1"></i>
208
+ Seus dados estão seguros conosco
209
+ </p>
210
+ <p class="text-xs text-gray-500">
211
+ Suporte: <a href="mailto:support@docupload.com" class="text-blue-600 hover:underline">support@docupload.com</a>
212
+ </p>
213
+ </div>
214
+ </div>
215
+ </div>
216
+
217
+ <script>
218
+ document.addEventListener('DOMContentLoaded', function() {
219
+ const fileInput = document.getElementById('documentFile');
220
+ const fileInfo = document.getElementById('fileInfo');
221
+ const fileName = document.getElementById('fileName');
222
+ const fileSize = document.getElementById('fileSize');
223
+ const removeFile = document.getElementById('removeFile');
224
+ const uploadProgress = document.getElementById('uploadProgress');
225
+ const uploadStatus = document.getElementById('uploadStatus');
226
+ const submitButton = document.getElementById('submitButton');
227
+ const uploadForm = document.getElementById('uploadForm');
228
+ const successMessage = document.getElementById('successMessage');
229
+ const successFileName = document.getElementById('successFileName');
230
+ const newUploadButton = document.getElementById('newUploadButton');
231
+ const buttonText = document.getElementById('buttonText');
232
+ const buttonSpinner = document.getElementById('buttonSpinner');
233
+ const termsCheckbox = document.getElementById('termsCheckbox');
234
+
235
+ // Validação do tipo de arquivo
236
+ function isValidFileType(file) {
237
+ const allowedTypes = [
238
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
239
+ ];
240
+ return allowedTypes.includes(file.type) || file.name.endsWith('.docx');
241
+ }
242
+
243
+ // Formata o tamanho do arquivo
244
+ function formatFileSize(bytes) {
245
+ if (bytes === 0) return '0 Bytes';
246
+ const k = 1024;
247
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
248
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
249
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
250
+ }
251
+
252
+ // Atualiza o estado do botão de envio
253
+ function updateSubmitButton() {
254
+ const fileSelected = fileInput.files.length > 0;
255
+ const termsAccepted = termsCheckbox.checked;
256
+ submitButton.disabled = !(fileSelected && termsAccepted);
257
+ }
258
+
259
+ // Manipulador de seleção de arquivo
260
+ fileInput.addEventListener('change', function(e) {
261
+ if (fileInput.files.length > 0) {
262
+ const file = fileInput.files[0];
263
+
264
+ // Verifica o tipo e tamanho do arquivo
265
+ if (!isValidFileType(file)) {
266
+ alert('Por favor, selecione um arquivo DOCX válido.');
267
+ fileInput.value = '';
268
+ return;
269
+ }
270
+
271
+ if (file.size > 10 * 1024 * 1024) { // 10MB
272
+ alert('O arquivo é muito grande. O tamanho máximo permitido é 10MB.');
273
+ fileInput.value = '';
274
+ return;
275
+ }
276
+
277
+ // Exibe informações do arquivo
278
+ fileName.textContent = file.name;
279
+ fileSize.textContent = formatFileSize(file.size);
280
+ fileInfo.classList.remove('hidden');
281
+
282
+ // Simula progresso de upload (apenas para demonstração)
283
+ uploadProgress.style.width = '0%';
284
+ uploadStatus.textContent = 'Pronto para upload';
285
+
286
+ updateSubmitButton();
287
+ }
288
+ });
289
+
290
+ // Remove o arquivo selecionado
291
+ removeFile.addEventListener('click', function() {
292
+ fileInput.value = '';
293
+ fileInfo.classList.add('hidden');
294
+ updateSubmitButton();
295
+ });
296
+
297
+ // Atualiza o botão quando os termos são aceitos
298
+ termsCheckbox.addEventListener('change', updateSubmitButton);
299
+
300
+ // Manipulador de envio do formulário
301
+ uploadForm.addEventListener('submit', function(e) {
302
+ e.preventDefault();
303
+
304
+ if (fileInput.files.length === 0) {
305
+ alert('Por favor, selecione um arquivo DOCX.');
306
+ return;
307
+ }
308
+
309
+ const file = fileInput.files[0];
310
+ const documentName = document.getElementById('documentName').value;
311
+
312
+ // Mostra o spinner e desabilita o botão
313
+ buttonText.textContent = 'Enviando...';
314
+ buttonSpinner.classList.remove('hidden');
315
+ submitButton.disabled = true;
316
+
317
+ // Simulação de upload com progresso
318
+ let progress = 0;
319
+ const interval = setInterval(() => {
320
+ progress += Math.random() * 10;
321
+ if (progress > 100) progress = 100;
322
+
323
+ uploadProgress.style.width = progress + '%';
324
+ uploadStatus.textContent = progress === 100 ? 'Processando...' : `Enviando... ${Math.round(progress)}%`;
325
+
326
+ if (progress === 100) {
327
+ clearInterval(interval);
328
+
329
+ // Simula tempo de processamento
330
+ setTimeout(() => {
331
+ // Mostra mensagem de sucesso
332
+ uploadForm.classList.add('hidden');
333
+ successFileName.textContent = `${documentName} (${file.name})`;
334
+ successMessage.classList.remove('hidden');
335
+
336
+ // Reseta o spinner
337
+ buttonText.textContent = 'Enviar Documento';
338
+ buttonSpinner.classList.add('hidden');
339
+ }, 1500);
340
+ }
341
+ }, 200);
342
+ });
343
+
344
+ // Botão para novo upload
345
+ newUploadButton.addEventListener('click', function() {
346
+ // Reseta o formulário
347
+ uploadForm.reset();
348
+ fileInfo.classList.add('hidden');
349
+ successMessage.classList.add('hidden');
350
+ uploadForm.classList.remove('hidden');
351
+ submitButton.disabled = true;
352
+ });
353
+
354
+ // Drag and drop functionality
355
+ const dropArea = document.querySelector('.file-upload');
356
+
357
+ ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
358
+ dropArea.addEventListener(eventName, preventDefaults, false);
359
+ });
360
+
361
+ function preventDefaults(e) {
362
+ e.preventDefault();
363
+ e.stopPropagation();
364
+ }
365
+
366
+ ['dragenter', 'dragover'].forEach(eventName => {
367
+ dropArea.addEventListener(eventName, highlight, false);
368
+ });
369
+
370
+ ['dragleave', 'drop'].forEach(eventName => {
371
+ dropArea.addEventListener(eventName, unhighlight, false);
372
+ });
373
+
374
+ function highlight() {
375
+ dropArea.classList.add('border-blue-500', 'bg-blue-50');
376
+ }
377
+
378
+ function unhighlight() {
379
+ dropArea.classList.remove('border-blue-500', 'bg-blue-50');
380
+ }
381
+
382
+ dropArea.addEventListener('drop', handleDrop, false);
383
+
384
+ function handleDrop(e) {
385
+ const dt = e.dataTransfer;
386
+ const files = dt.files;
387
+
388
+ if (files.length > 0) {
389
+ fileInput.files = files;
390
+ const event = new Event('change');
391
+ fileInput.dispatchEvent(event);
392
+ }
393
+ }
394
+ });
395
+ </script>
396
+ <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=machadolopes/robolit" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
397
+ </html>