| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <!DOCTYPE html>
- <html lang="es">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>HokoriTemp</title>
- <link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='favicon.svg') }}">
- <script src="https://cdn.tailwindcss.com"></script>
- <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
- </head>
- <body class="bg-gray-50 min-h-screen">
- <div class="container mx-auto px-4 py-8">
- <!-- Header -->
- <div class="text-center mb-8">
- <h1 class="text-4xl font-bold text-gray-800 mb-2">Subir Archivos Temporales</h1>
- <p class="text-gray-600">Comparte archivos de forma segura y temporal</p>
- <div class="mt-4">
- <a href="/view" class="text-blue-600 hover:text-blue-800 underline">Ver mis enlaces activos</a>
- </div>
- </div>
- <!-- Main Container -->
- <div class="max-w-6xl mx-auto">
- <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
-
- <!-- Upload Form -->
- <div class="bg-white rounded-lg shadow-lg p-6">
- <h2 class="text-xl font-semibold text-gray-800 mb-4">Subir Archivo</h2>
- <form id="uploadForm" enctype="multipart/form-data">
- <div class="mb-6">
- <label class="block text-sm font-medium text-gray-700 mb-2">
- Selecciona un archivo para subir
- </label>
- <div id="dropZone" class="drop-zone border-2 border-dashed border-gray-300 rounded-lg p-8 text-center cursor-pointer hover:border-gray-400 transition-colors">
- <div class="space-y-4">
- <svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48">
- <path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
- </svg>
- <div>
- <p class="text-lg font-medium text-gray-700">Arrastra y suelta tu archivo aquí</p>
- <p class="text-sm text-gray-500">o haz clic para seleccionar</p>
- </div>
- </div>
- <input type="file" id="fileInput" class="hidden" accept="*/*">
- </div>
- </div>
- <div id="fileInfo" class="hidden mb-6 p-4 bg-blue-50 rounded-lg">
- <div class="flex items-center justify-between">
- <div class="flex-1 min-w-0 mr-3">
- <p class="font-medium text-blue-900 truncate" id="fileName" title=""></p>
- <p class="text-sm text-blue-700" id="fileSize"></p>
- </div>
- <button type="button" id="removeFile" class="text-red-600 hover:text-red-800 flex-shrink-0">
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
- </svg>
- </button>
- </div>
- </div>
- <button type="submit" id="uploadBtn" class="w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed">
- <span id="uploadBtnText">Subir Archivo</span>
- <span id="uploadBtnLoading" class="hidden">
- <svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
- <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
- Subiendo...
- </span>
- </button>
- </form>
- <!-- Error Section -->
- <div id="errorSection" class="hidden mt-6 bg-red-50 border border-red-200 rounded-lg p-4">
- <div class="flex">
- <div class="flex-shrink-0">
- <svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
- </svg>
- </div>
- <div class="ml-3">
- <h3 class="text-sm font-medium text-red-800" id="errorMessage"></h3>
- </div>
- </div>
- </div>
- </div>
- <!-- Result Section -->
- <div id="resultSection" class="hidden bg-white rounded-lg shadow-lg p-6 result-section">
- <div class="text-center">
- <div class="mb-4">
- <svg class="mx-auto h-12 w-12 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
- </svg>
- </div>
- <h3 class="text-lg font-medium text-gray-900 mb-2">¡Archivo subido exitosamente!</h3>
- <p class="text-gray-600 mb-4">Tu archivo estará disponible por 24 horas</p>
-
- <div class="bg-gray-50 rounded-lg p-4 mb-4">
- <label class="block text-sm font-medium text-gray-700 mb-2">Enlace de descarga:</label>
- <div class="flex">
- <input type="text" id="downloadLink" class="flex-1 px-3 py-2 border border-gray-300 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" readonly>
- <button onclick="copyLink()" class="px-4 py-2 bg-blue-600 text-white rounded-r-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
- Copiar
- </button>
- </div>
- </div>
- <div class="flex space-x-4">
- <button onclick="openLink()" class="flex-1 bg-green-600 text-white py-2 px-4 rounded-lg hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500">
- Abrir Enlace
- </button>
- <button onclick="resetForm()" class="flex-1 bg-gray-600 text-white py-2 px-4 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500">
- Subir Otro
- </button>
- </div>
- </div>
- </div>
- <!-- Empty State for Result Section -->
- <div id="emptyResultSection" class="hidden bg-gray-50 rounded-lg p-8 text-center result-section">
- <svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
- </svg>
- <h3 class="mt-2 text-sm font-medium text-gray-900">Listo para subir</h3>
- <p class="mt-1 text-sm text-gray-500">Selecciona un archivo para comenzar</p>
- </div>
- </div>
- </div>
- </div>
- <script>
- // Configuración del servidor
- const SERVER_CONFIG = {
- maxFileSize: {{ max_file_size }},
- maxFileSizeMB: {{ max_file_size_mb }}
- };
- </script>
- <script src="{{ url_for('static', filename='app.js') }}"></script>
- </body>
- </html>
|