Finish-him commited on
Commit
6e9d77b
·
verified ·
1 Parent(s): 28c6c44

não está dando para selecionar os arquivos

Browse files
Files changed (1) hide show
  1. index.html +50 -13
index.html CHANGED
@@ -56,16 +56,19 @@
56
  <div class="bg-white rounded-xl shadow-lg overflow-hidden">
57
  <div class="p-8">
58
  <div class="file-upload rounded-lg p-12 text-center cursor-pointer">
59
- <div class="flex flex-col items-center justify-center space-y-4">
60
- <i data-feather="upload" class="w-12 h-12 text-blue-500"></i>
61
- <h3 class="text-xl font-semibold text-gray-800">Arraste e solte PDFs SEI aqui</h3>
62
- <p class="text-gray-500">ou clique para selecionar arquivos</p>
63
- <button class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg font-medium transition">
64
- Selecionar Arquivos
65
- </button>
66
- </div>
 
 
 
67
  </div>
68
- </div>
69
  <div class="bg-gray-50 px-8 py-4 border-t border-gray-200">
70
  <div class="flex items-center justify-between">
71
  <span class="text-sm text-gray-500">Formatos suportados: PDF, DOCX</span>
@@ -244,7 +247,7 @@
244
  <script>
245
  // Initialize Vanta.js background
246
  VANTA.NET({
247
- el: "#vanta-bg",
248
  mouseControls: true,
249
  touchControls: true,
250
  gyroControls: false,
@@ -258,11 +261,45 @@
258
  maxDistance: 22.00,
259
  spacing: 18.00
260
  });
261
-
262
- // Initialize Feather Icons
263
  document.addEventListener('DOMContentLoaded', function() {
264
  feather.replace();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  });
266
- </script>
267
  </body>
268
  </html>
 
56
  <div class="bg-white rounded-xl shadow-lg overflow-hidden">
57
  <div class="p-8">
58
  <div class="file-upload rounded-lg p-12 text-center cursor-pointer">
59
+ <form id="uploadForm" enctype="multipart/form-data">
60
+ <input type="file" id="fileInput" class="hidden" accept=".pdf,.docx" multiple>
61
+ <label for="fileInput" class="flex flex-col items-center justify-center space-y-4 cursor-pointer">
62
+ <i data-feather="upload" class="w-12 h-12 text-blue-500"></i>
63
+ <h3 class="text-xl font-semibold text-gray-800">Arraste e solte PDFs SEI aqui</h3>
64
+ <p class="text-gray-500">ou clique para selecionar arquivos</p>
65
+ <span class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg font-medium transition">
66
+ Selecionar Arquivos
67
+ </span>
68
+ </label>
69
+ </form>
70
  </div>
71
+ </div>
72
  <div class="bg-gray-50 px-8 py-4 border-t border-gray-200">
73
  <div class="flex items-center justify-between">
74
  <span class="text-sm text-gray-500">Formatos suportados: PDF, DOCX</span>
 
247
  <script>
248
  // Initialize Vanta.js background
249
  VANTA.NET({
250
+ el: "#vanta-bg",
251
  mouseControls: true,
252
  touchControls: true,
253
  gyroControls: false,
 
261
  maxDistance: 22.00,
262
  spacing: 18.00
263
  });
264
+ // Initialize Feather Icons and file upload handling
 
265
  document.addEventListener('DOMContentLoaded', function() {
266
  feather.replace();
267
+
268
+ const fileInput = document.getElementById('fileInput');
269
+
270
+ fileInput.addEventListener('change', function(e) {
271
+ if (e.target.files.length > 0) {
272
+ const files = Array.from(e.target.files);
273
+ console.log('Files selected:', files);
274
+ // Here you would typically handle the file upload
275
+ // Example: uploadFiles(files);
276
+ alert(`${files.length} arquivo(s) selecionado(s)!`);
277
+ }
278
+ });
279
+
280
+ // Drag and drop support
281
+ const uploadArea = document.querySelector('.file-upload');
282
+
283
+ uploadArea.addEventListener('dragover', (e) => {
284
+ e.preventDefault();
285
+ uploadArea.classList.add('bg-blue-50');
286
+ });
287
+
288
+ uploadArea.addEventListener('dragleave', () => {
289
+ uploadArea.classList.remove('bg-blue-50');
290
+ });
291
+
292
+ uploadArea.addEventListener('drop', (e) => {
293
+ e.preventDefault();
294
+ uploadArea.classList.remove('bg-blue-50');
295
+
296
+ if (e.dataTransfer.files.length) {
297
+ fileInput.files = e.dataTransfer.files;
298
+ const event = new Event('change');
299
+ fileInput.dispatchEvent(event);
300
+ }
301
+ });
302
  });
303
+ </script>
304
  </body>
305
  </html>