index.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>HokoriTemp</title>
  7. <link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='favicon.svg') }}">
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
  10. </head>
  11. <body class="bg-gray-50 min-h-screen">
  12. <div class="container mx-auto px-4 py-8">
  13. <!-- Header -->
  14. <div class="text-center mb-8">
  15. <h1 class="text-4xl font-bold text-gray-800 mb-2">Subir Archivos Temporales</h1>
  16. <p class="text-gray-600">Comparte archivos de forma segura y temporal</p>
  17. <div class="mt-4">
  18. <a href="/view" class="text-blue-600 hover:text-blue-800 underline">Ver mis enlaces activos</a>
  19. </div>
  20. </div>
  21. <!-- Main Container -->
  22. <div class="max-w-6xl mx-auto">
  23. <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
  24. <!-- Upload Form -->
  25. <div class="bg-white rounded-lg shadow-lg p-6">
  26. <h2 class="text-xl font-semibold text-gray-800 mb-4">Subir Archivo</h2>
  27. <form id="uploadForm" enctype="multipart/form-data">
  28. <div class="mb-6">
  29. <label class="block text-sm font-medium text-gray-700 mb-2">
  30. Selecciona un archivo para subir
  31. </label>
  32. <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">
  33. <div class="space-y-4">
  34. <svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48">
  35. <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" />
  36. </svg>
  37. <div>
  38. <p class="text-lg font-medium text-gray-700">Arrastra y suelta tu archivo aquí</p>
  39. <p class="text-sm text-gray-500">o haz clic para seleccionar</p>
  40. </div>
  41. </div>
  42. <input type="file" id="fileInput" class="hidden" accept="*/*">
  43. </div>
  44. </div>
  45. <div id="fileInfo" class="hidden mb-6 p-4 bg-blue-50 rounded-lg">
  46. <div class="flex items-center justify-between">
  47. <div class="flex-1 min-w-0 mr-3">
  48. <p class="font-medium text-blue-900 truncate" id="fileName" title=""></p>
  49. <p class="text-sm text-blue-700" id="fileSize"></p>
  50. </div>
  51. <button type="button" id="removeFile" class="text-red-600 hover:text-red-800 flex-shrink-0">
  52. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  53. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
  54. </svg>
  55. </button>
  56. </div>
  57. </div>
  58. <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">
  59. <span id="uploadBtnText">Subir Archivo</span>
  60. <span id="uploadBtnLoading" class="hidden">
  61. <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">
  62. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
  63. <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>
  64. </svg>
  65. Subiendo...
  66. </span>
  67. </button>
  68. </form>
  69. <!-- Error Section -->
  70. <div id="errorSection" class="hidden mt-6 bg-red-50 border border-red-200 rounded-lg p-4">
  71. <div class="flex">
  72. <div class="flex-shrink-0">
  73. <svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
  74. <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" />
  75. </svg>
  76. </div>
  77. <div class="ml-3">
  78. <h3 class="text-sm font-medium text-red-800" id="errorMessage"></h3>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <!-- Result Section -->
  84. <div id="resultSection" class="hidden bg-white rounded-lg shadow-lg p-6 result-section">
  85. <div class="text-center">
  86. <div class="mb-4">
  87. <svg class="mx-auto h-12 w-12 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  88. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
  89. </svg>
  90. </div>
  91. <h3 class="text-lg font-medium text-gray-900 mb-2">¡Archivo subido exitosamente!</h3>
  92. <p class="text-gray-600 mb-4">Tu archivo estará disponible por 24 horas</p>
  93. <div class="bg-gray-50 rounded-lg p-4 mb-4">
  94. <label class="block text-sm font-medium text-gray-700 mb-2">Enlace de descarga:</label>
  95. <div class="flex">
  96. <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>
  97. <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">
  98. Copiar
  99. </button>
  100. </div>
  101. </div>
  102. <div class="flex space-x-4">
  103. <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">
  104. Abrir Enlace
  105. </button>
  106. <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">
  107. Subir Otro
  108. </button>
  109. </div>
  110. </div>
  111. </div>
  112. <!-- Empty State for Result Section -->
  113. <div id="emptyResultSection" class="hidden bg-gray-50 rounded-lg p-8 text-center result-section">
  114. <svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  115. <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>
  116. </svg>
  117. <h3 class="mt-2 text-sm font-medium text-gray-900">Listo para subir</h3>
  118. <p class="mt-1 text-sm text-gray-500">Selecciona un archivo para comenzar</p>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <script>
  124. // Configuración del servidor
  125. const SERVER_CONFIG = {
  126. maxFileSize: {{ max_file_size }},
  127. maxFileSizeMB: {{ max_file_size_mb }}
  128. };
  129. </script>
  130. <script src="{{ url_for('static', filename='app.js') }}"></script>
  131. </body>
  132. </html>