base.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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>{% block title %}Renako{% endblock %}</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. <script>
  9. tailwind.config = {
  10. theme: {
  11. extend: {
  12. colors: {
  13. primary: '#6366F1',
  14. secondary: '#4F46E5'
  15. }
  16. }
  17. }
  18. }
  19. </script>
  20. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
  21. </head>
  22. <body class="bg-gray-50 min-h-screen flex flex-col">
  23. <!-- Header Component -->
  24. {% include 'components/header.html' %}
  25. <!-- Main Content -->
  26. <main class="flex-1 flex items-center justify-center">
  27. <div class="max-w-4xl w-full px-4 py-8">
  28. {% block content %}{% endblock %}
  29. </div>
  30. </main>
  31. <!-- Toast Notifications -->
  32. <div id="toast-container" class="fixed top-4 right-4 z-50 space-y-2"></div>
  33. <script>
  34. // Función para mostrar notificaciones toast
  35. function showToast(message, type = 'success') {
  36. const toastContainer = document.getElementById('toast-container');
  37. const toast = document.createElement('div');
  38. const bgColor = type === 'success' ? 'bg-green-500' : 'bg-red-500';
  39. const icon = type === 'success' ? 'fa-check-circle' : 'fa-exclamation-circle';
  40. toast.className = `${bgColor} text-white px-6 py-3 rounded-lg shadow-lg flex items-center space-x-2 transform transition-all duration-300 translate-x-full opacity-0`;
  41. toast.innerHTML = `
  42. <i class="fas ${icon}"></i>
  43. <span>${message}</span>
  44. <button onclick="this.parentElement.remove()" class="ml-4 text-white hover:text-gray-200">
  45. <i class="fas fa-times"></i>
  46. </button>
  47. `;
  48. toastContainer.appendChild(toast);
  49. // Animar entrada
  50. setTimeout(() => {
  51. toast.classList.remove('translate-x-full', 'opacity-0');
  52. }, 100);
  53. // Auto-remover después de 5 segundos
  54. setTimeout(() => {
  55. toast.classList.add('translate-x-full', 'opacity-0');
  56. setTimeout(() => toast.remove(), 300);
  57. }, 5000);
  58. }
  59. // Función para copiar al portapapeles
  60. function copyToClipboard(text) {
  61. navigator.clipboard.writeText(text).then(() => {
  62. showToast('¡Enlace copiado al portapapeles!');
  63. }).catch(() => {
  64. showToast('Error al copiar enlace', 'error');
  65. });
  66. }
  67. </script>
  68. </body>
  69. </html>