Spaces:
Running
Running
redise帽a esta pagina mas moderna posible pero deja las conexiones de la api postman <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <title>Inventario Electr贸nico | Gestor de Productos</title> <style> :root { --primary-color: #4361ee; --secondary-color: #3f37c9; --accent-color: #4895ef; --light-color: #f8f9fa; --dark-color: #212529; --success-color: #4cc9f0; --error-color: #f72585; --border-radius: 8px; --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); --transition: all 0.3s ease; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Montserrat', sans-serif; background-color: #f5f7fa; color: var(--dark-color); line-height: 1.6; padding: 0; margin: 0; min-height: 100vh; display: flex; flex-direction: column; } .container { max-width: 1200px; margin: 0 auto; padding: 2rem; width: 100%; } header { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); background-color: var(--primary-color); color: white; padding: 1.5rem 0; box-shadow: var(--box-shadow); position: relative; z-index: 10; } .header-content { display: flex; justify-content: space-between; align-items: center; } .logo { font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; } .logo-icon { font-size: 2rem; } .auth-section { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 200px); } .card { background: white; border-radius: var(--border-radius); box-shadow: var(--box-shadow); padding: 2.5rem; width: 100%; max-width: 500px; margin: 2rem auto; transition: var(--transition); } .card:hover { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); } h1, h2 { color: var(--dark-color); margin-bottom: 1.5rem; text-align: center; } h1 { font-size: 2.2rem; font-weight: 600; color: var(--primary-color); } h2 { font-size: 1.8rem; font-weight: 500; } form { display: flex; flex-direction: column; gap: 1.5rem; } .form-group { display: flex; flex-direction: column; gap: 0.5rem; } label { font-weight: 500; color: var(--dark-color); } input { padding: 0.8rem 1rem; border: 1px solid #ddd; border-radius: var(--border-radius); font-size: 1rem; transition: var(--transition); } input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2); } button { background-color: var(--primary-color); color: white; border: none; padding: 1rem; border-radius: var(--border-radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); text-transform: uppercase; letter-spacing: 0.5px; } button:hover { background-color: var(--secondary-color); transform: translateY(-2px); } button:active { transform: translateY(0); } #formSection { display: none; animation: fadeIn 0.5s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .status-message { padding: 1rem; border-radius: var(--border-radius); margin-top: 1rem; text-align: center; display: none; } .success { background-color: rgba(76, 201, 240, 0.2); color: #0a6c74; display: block; } .error { background-color: rgba(247, 37, 133, 0.2); color: #a4133c; display: block; } footer { background-color: var(--dark-color); color: white; text-align: center; padding: 1.5rem; margin-top: auto; } .footer-content { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; } .copyright { font-size: 0.9rem; } .social-links { display: flex; gap: 1rem; } .social-icon { color: white; font-size: 1.2rem; transition: var(--transition); } .social-icon:hover { color: var(--accent-color); } @media (max-width: 768px) { .container { padding: 1rem; } .card { padding: 1.5rem; } h1 { font-size: 1.8rem; } h2 { font-size: 1.5rem; } .header-content { flex-direction: column; gap: 1rem; } .footer-content { flex-direction: column; gap: 1rem; } } </style> </head> <body> <header> <div class="container header-content"> <div class="logo"> <span class="logo-icon">馃摝</span> <span>Inventario Electr贸nico</span> </div> <div> <label for="languageSelect">Idioma:</label> <select id="languageSelect"> <option value="es">Espa帽ol</option> <option value="en">English</option> </select> </div> </div> </header> <main class="container"> <section class="auth-section"> <div class="card"> <h1>Iniciar Sesi贸n</h1> <form id="loginForm"> <div class="form-group"> <label for="username">Usuario</label> <input type="text" id="username" required> </div> <div class="form-group"> <label for="password">Contrase帽a</label> <input type="password" id="password" required> </div> <button type="submit">Acceder al Sistema</button> </form> </div> <div id="formSection" class="card" style="display: none;"> <h2>Registrar Nuevo Producto</h2> <form id="productoForm"> <input type="text" id="nombre" placeholder="Nombre del producto" required> <input type="text" id="descripcion" placeholder="Descripci贸n" required> <input type="number" id="precio" placeholder="Precio unitario" required> <input type="number" id="stock" placeholder="Cantidad en stock" required> <button type="submit">Guardar Producto</button> </form> <div id="statusMessage" class="status-message"></div> </div> </section> </main> <footer> <div class="container"> <p>漏 2025 Gestor de Inventario Electr贸nico</p> </div> </footer> <script> let authHeader = ""; function encodeBasicAuth(username, password) { return btoa(username + ":" + password); } // Login document.getElementById('loginForm').addEventListener('submit', function(e) { e.preventDefault(); const user = document.getElementById('username').value; const pass = document.getElementById('password').value; authHeader = "Basic " + encodeBasicAuth(user, pass); document.getElementById('formSection').style.display = 'block'; document.getElementById('loginForm').parentElement.style.display = 'none'; }); // Env铆o de producto con i18n document.getElementById('productoForm').addEventListener('submit', async function(e) { e.preventDefault(); const lang = document.getElementById('languageSelect').value; const producto = { nombre: document.getElementById('nombre').value, descripcion: document.getElementById('descripcion').value, precio: parseFloat(document.getElementById('precio').value), stock: parseInt(document.getElementById('stock').value) }; try { const res = await fetch('http://localhost:8080/api/productos', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': authHeader, 'Accept-Language': lang }, body: JSON.stringify(producto) }); const data = await res.json(); showStatus(data.message || 'Operaci贸n completada.', res.ok ? 'success' : 'error'); if (res.ok) document.getElementById('productoForm').reset(); } catch (err) { showStatus('Error de conexi贸n con el servidor', 'error'); } }); function showStatus(message, type) { const status = document.getElementById('statusMessage'); status.textContent = message; status.className = 'status-message ' + type; status.style.display = 'block'; setTimeout(() => { status.style.display = 'none'; }, 5000); } </script> </body> </html> - Initial Deployment
Browse files- README.md +7 -5
- index.html +380 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 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: test23
|
| 3 |
+
emoji: 馃惓
|
| 4 |
+
colorFrom: blue
|
| 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,380 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Inventario Electr贸nico | Gestor de Productos</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
+
<script>
|
| 11 |
+
tailwind.config = {
|
| 12 |
+
theme: {
|
| 13 |
+
extend: {
|
| 14 |
+
colors: {
|
| 15 |
+
primary: {
|
| 16 |
+
50: '#f0f4ff',
|
| 17 |
+
100: '#e0e8ff',
|
| 18 |
+
200: '#c7d2fe',
|
| 19 |
+
300: '#a5b4fc',
|
| 20 |
+
400: '#818cf8',
|
| 21 |
+
500: '#6366f1',
|
| 22 |
+
600: '#4f46e5',
|
| 23 |
+
700: '#4338ca',
|
| 24 |
+
800: '#3730a3',
|
| 25 |
+
900: '#312e81',
|
| 26 |
+
},
|
| 27 |
+
},
|
| 28 |
+
fontFamily: {
|
| 29 |
+
sans: ['Inter', 'sans-serif'],
|
| 30 |
+
},
|
| 31 |
+
animation: {
|
| 32 |
+
'fade-in': 'fadeIn 0.3s ease-in-out',
|
| 33 |
+
},
|
| 34 |
+
keyframes: {
|
| 35 |
+
fadeIn: {
|
| 36 |
+
'0%': { opacity: '0', transform: 'translateY(10px)' },
|
| 37 |
+
'100%': { opacity: '1', transform: 'translateY(0)' },
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
</script>
|
| 44 |
+
<style>
|
| 45 |
+
@keyframes float {
|
| 46 |
+
0% { transform: translateY(0px); }
|
| 47 |
+
50% { transform: translateY(-10px); }
|
| 48 |
+
100% { transform: translateY(0px); }
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.gradient-text {
|
| 52 |
+
background: linear-gradient(90deg, #6366f1, #8b5cf6);
|
| 53 |
+
-webkit-background-clip: text;
|
| 54 |
+
background-clip: text;
|
| 55 |
+
color: transparent;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.electron-bg {
|
| 59 |
+
position: absolute;
|
| 60 |
+
top: 0;
|
| 61 |
+
left: 0;
|
| 62 |
+
width: 100%;
|
| 63 |
+
height: 100%;
|
| 64 |
+
z-index: -1;
|
| 65 |
+
opacity: 0.1;
|
| 66 |
+
background-image: radial-gradient(#4338ca 1px, transparent 1px);
|
| 67 |
+
background-size: 20px 20px;
|
| 68 |
+
}
|
| 69 |
+
</style>
|
| 70 |
+
</head>
|
| 71 |
+
<body class="bg-gray-50 min-h-screen flex flex-col font-sans">
|
| 72 |
+
<div class="electron-bg"></div>
|
| 73 |
+
|
| 74 |
+
<!-- Header -->
|
| 75 |
+
<header class="bg-gradient-to-r from-primary-700 to-primary-800 shadow-lg">
|
| 76 |
+
<div class="container mx-auto px-6 py-4">
|
| 77 |
+
<div class="flex items-center justify-between">
|
| 78 |
+
<div class="flex items-center space-x-2">
|
| 79 |
+
<div class="text-white p-2 bg-primary-600 rounded-lg shadow">
|
| 80 |
+
<i class="fas fa-microchip text-xl"></i>
|
| 81 |
+
</div>
|
| 82 |
+
<h1 class="text-2xl font-bold text-white">Inventario<span class="font-light">Electr贸nico</span></h1>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<div class="flex items-center space-x-4">
|
| 86 |
+
<div class="relative">
|
| 87 |
+
<label class="sr-only" for="languageSelect">Idioma</label>
|
| 88 |
+
<div class="relative">
|
| 89 |
+
<select id="languageSelect" class="appearance-none bg-white bg-opacity-20 border border-white border-opacity-20 text-white pl-4 pr-8 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-200 cursor-pointer">
|
| 90 |
+
<option value="es" class="text-gray-900">馃嚜馃嚫 Espa帽ol</option>
|
| 91 |
+
<option value="en" class="text-gray-900">馃嚞馃嚙 English</option>
|
| 92 |
+
</select>
|
| 93 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-white">
|
| 94 |
+
<i class="fas fa-chevron-down text-sm"></i>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</header>
|
| 102 |
+
|
| 103 |
+
<main class="flex-grow flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
|
| 104 |
+
<!-- Login Card -->
|
| 105 |
+
<div id="loginCard" class="w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transition-all duration-300 transform animate-fade-in">
|
| 106 |
+
<div class="p-8">
|
| 107 |
+
<div class="flex justify-center mb-6">
|
| 108 |
+
<div class="p-3 bg-primary-100 rounded-full animate-float">
|
| 109 |
+
<i class="fas fa-lock text-primary-600 text-3xl"></i>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
|
| 113 |
+
<h2 class="text-center text-2xl font-bold text-gray-800 mb-6">
|
| 114 |
+
<span class="gradient-text">Acceso al Sistema</span>
|
| 115 |
+
</h2>
|
| 116 |
+
|
| 117 |
+
<form id="loginForm" class="space-y-6">
|
| 118 |
+
<div>
|
| 119 |
+
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">Usuario</label>
|
| 120 |
+
<div class="relative">
|
| 121 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 122 |
+
<i class="fas fa-user text-gray-400"></i>
|
| 123 |
+
</div>
|
| 124 |
+
<input id="username" name="username" type="text" required
|
| 125 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 outline-none transition duration-300"
|
| 126 |
+
placeholder="Ingrese su usuario">
|
| 127 |
+
</div>
|
| 128 |
+
</div>
|
| 129 |
+
|
| 130 |
+
<div>
|
| 131 |
+
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Contrase帽a</label>
|
| 132 |
+
<div class="relative">
|
| 133 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 134 |
+
<i class="fas fa-key text-gray-400"></i>
|
| 135 |
+
</div>
|
| 136 |
+
<input id="password" name="password" type="password" required
|
| 137 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 outline-none transition duration-300"
|
| 138 |
+
placeholder="Ingrese su contrase帽a">
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
|
| 142 |
+
<div>
|
| 143 |
+
<button type="submit"
|
| 144 |
+
class="w-full flex justify-center items-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-gradient-to-r from-primary-600 to-primary-700 hover:from-primary-700 hover:to-primary-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition duration-300 transform hover:scale-[1.02]">
|
| 145 |
+
<i class="fas fa-sign-in-alt mr-2"></i> Iniciar Sesi贸n
|
| 146 |
+
</button>
|
| 147 |
+
</div>
|
| 148 |
+
</form>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<div class="bg-gray-50 px-8 py-4 border-t border-gray-200">
|
| 152 |
+
<p class="text-xs text-gray-500 text-center">
|
| 153 |
+
驴Necesitas ayuda? <a href="#" class="font-medium text-primary-600 hover:text-primary-700">Cont谩ctanos</a>
|
| 154 |
+
</p>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<!-- Product Form Card (initially hidden) -->
|
| 159 |
+
<div id="formSection" class="w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transition-all duration-300 transform animate-fade-in hidden">
|
| 160 |
+
<div class="p-8">
|
| 161 |
+
<div class="flex justify-center mb-6">
|
| 162 |
+
<div class="p-3 bg-primary-100 rounded-full animate-float">
|
| 163 |
+
<i class="fas fa-boxes text-primary-600 text-3xl"></i>
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
|
| 167 |
+
<h2 class="text-center text-2xl font-bold text-gray-800 mb-6">
|
| 168 |
+
<span class="gradient-text">Registrar Producto</span>
|
| 169 |
+
</h2>
|
| 170 |
+
|
| 171 |
+
<form id="productoForm" class="space-y-4">
|
| 172 |
+
<div>
|
| 173 |
+
<label for="nombre" class="block text-sm font-medium text-gray-700 mb-1">Nombre del producto</label>
|
| 174 |
+
<div class="relative">
|
| 175 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 176 |
+
<i class="fas fa-tag text-gray-400"></i>
|
| 177 |
+
</div>
|
| 178 |
+
<input id="nombre" name="nombre" type="text" required
|
| 179 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 outline-none transition duration-300"
|
| 180 |
+
placeholder="Ej: Resistor 1k惟">
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<div>
|
| 185 |
+
<label for="descripcion" class="block text-sm font-medium text-gray-700 mb-1">Descripci贸n</label>
|
| 186 |
+
<div class="relative">
|
| 187 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 188 |
+
<i class="fas fa-align-left text-gray-400"></i>
|
| 189 |
+
</div>
|
| 190 |
+
<input id="descripcion" name="descripcion" type="text" required
|
| 191 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 outline-none transition duration-300"
|
| 192 |
+
placeholder="Especificaciones t茅cnicas">
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
|
| 196 |
+
<div class="grid grid-cols-2 gap-4">
|
| 197 |
+
<div>
|
| 198 |
+
<label for="precio" class="block text-sm font-medium text-gray-700 mb-1">Precio unitario</label>
|
| 199 |
+
<div class="relative">
|
| 200 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 201 |
+
<i class="fas fa-dollar-sign text-gray-400"></i>
|
| 202 |
+
</div>
|
| 203 |
+
<input id="precio" name="precio" type="number" step="0.01" min="0" required
|
| 204 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 outline-none transition duration-300"
|
| 205 |
+
placeholder="0.00">
|
| 206 |
+
</div>
|
| 207 |
+
</div>
|
| 208 |
+
|
| 209 |
+
<div>
|
| 210 |
+
<label for="stock" class="block text-sm font-medium text-gray-700 mb-1">Cantidad en stock</label>
|
| 211 |
+
<div class="relative">
|
| 212 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 213 |
+
<i class="fas fa-cubes text-gray-400"></i>
|
| 214 |
+
</div>
|
| 215 |
+
<input id="stock" name="stock" type="number" min="0" required
|
| 216 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 outline-none transition duration-300"
|
| 217 |
+
placeholder="0">
|
| 218 |
+
</div>
|
| 219 |
+
</div>
|
| 220 |
+
</div>
|
| 221 |
+
|
| 222 |
+
<div class="pt-2">
|
| 223 |
+
<button type="submit"
|
| 224 |
+
class="w-full flex justify-center items-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-gradient-to-r from-primary-600 to-primary-700 hover:from-primary-700 hover:to-primary-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition duration-300 transform hover:scale-[1.02]">
|
| 225 |
+
<i class="fas fa-save mr-2"></i> Guardar Producto
|
| 226 |
+
</button>
|
| 227 |
+
</div>
|
| 228 |
+
</form>
|
| 229 |
+
|
| 230 |
+
<div id="statusMessage" class="mt-4 hidden">
|
| 231 |
+
<div id="statusContent" class="p-3 rounded-lg text-sm"></div>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
<div class="bg-gray-50 px-8 py-4 border-t border-gray-200">
|
| 236 |
+
<p class="text-xs text-gray-500 text-center">
|
| 237 |
+
<a href="#" id="backToLogin" class="font-medium text-primary-600 hover:text-primary-700 flex items-center justify-center">
|
| 238 |
+
<i class="fas fa-arrow-left mr-1"></i> Volver al inicio de sesi贸n
|
| 239 |
+
</a>
|
| 240 |
+
</p>
|
| 241 |
+
</div>
|
| 242 |
+
</div>
|
| 243 |
+
</main>
|
| 244 |
+
|
| 245 |
+
<footer class="bg-gray-800 text-white py-6">
|
| 246 |
+
<div class="container mx-auto px-6">
|
| 247 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 248 |
+
<div class="text-center md:text-left mb-4 md:mb-0">
|
| 249 |
+
<p class="text-sm">漏 2025 <span class="font-medium">Inventario Electr贸nico</span>. Todos los derechos reservados.</p>
|
| 250 |
+
</div>
|
| 251 |
+
|
| 252 |
+
<div class="flex space-x-6">
|
| 253 |
+
<a href="#" class="text-gray-400 hover:text-primary-400 transition duration-300">
|
| 254 |
+
<i class="fab fa-github"></i>
|
| 255 |
+
</a>
|
| 256 |
+
<a href="#" class="text-gray-400 hover:text-primary-400 transition duration-300">
|
| 257 |
+
<i class="fab fa-linkedin"></i>
|
| 258 |
+
</a>
|
| 259 |
+
<a href="#" class="text-gray-400 hover:text-primary-400 transition duration-300">
|
| 260 |
+
<i class="fab fa-twitter"></i>
|
| 261 |
+
</a>
|
| 262 |
+
<a href="#" class="text-gray-400 hover:text-primary-400 transition duration-300">
|
| 263 |
+
<i class="fas fa-envelope"></i>
|
| 264 |
+
</a>
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
</div>
|
| 268 |
+
</footer>
|
| 269 |
+
|
| 270 |
+
<script>
|
| 271 |
+
let authHeader = "";
|
| 272 |
+
|
| 273 |
+
// Floating animation for icons
|
| 274 |
+
document.querySelectorAll('.animate-float').forEach(el => {
|
| 275 |
+
el.style.animation = 'float 3s ease-in-out infinite';
|
| 276 |
+
});
|
| 277 |
+
|
| 278 |
+
function encodeBasicAuth(username, password) {
|
| 279 |
+
return btoa(username + ":" + password);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
// Login
|
| 283 |
+
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
| 284 |
+
e.preventDefault();
|
| 285 |
+
const user = document.getElementById('username').value;
|
| 286 |
+
const pass = document.getElementById('password').value;
|
| 287 |
+
|
| 288 |
+
// Basic animation to hide login and show product form
|
| 289 |
+
const loginCard = document.getElementById('loginCard');
|
| 290 |
+
const formSection = document.getElementById('formSection');
|
| 291 |
+
|
| 292 |
+
loginCard.classList.add('-translate-y-2', 'opacity-0');
|
| 293 |
+
setTimeout(() => {
|
| 294 |
+
loginCard.classList.add('hidden');
|
| 295 |
+
loginCard.classList.remove('-translate-y-2', 'opacity-0');
|
| 296 |
+
formSection.classList.remove('hidden');
|
| 297 |
+
formSection.classList.add('animate-fade-in');
|
| 298 |
+
|
| 299 |
+
authHeader = "Basic " + encodeBasicAuth(user, pass);
|
| 300 |
+
}, 300);
|
| 301 |
+
});
|
| 302 |
+
|
| 303 |
+
// Back to login button
|
| 304 |
+
document.getElementById('backToLogin').addEventListener('click', function(e) {
|
| 305 |
+
e.preventDefault();
|
| 306 |
+
|
| 307 |
+
const loginCard = document.getElementById('loginCard');
|
| 308 |
+
const formSection = document.getElementById('formSection');
|
| 309 |
+
|
| 310 |
+
formSection.classList.add('hidden');
|
| 311 |
+
loginCard.classList.remove('hidden');
|
| 312 |
+
loginCard.classList.add('animate-fade-in');
|
| 313 |
+
});
|
| 314 |
+
|
| 315 |
+
// Product form submission with i18n
|
| 316 |
+
document.getElementById('productoForm').addEventListener('submit', async function(e) {
|
| 317 |
+
e.preventDefault();
|
| 318 |
+
|
| 319 |
+
const lang = document.getElementById('languageSelect').value;
|
| 320 |
+
const statusMessage = document.getElementById('statusMessage');
|
| 321 |
+
const statusContent = document.getElementById('statusContent');
|
| 322 |
+
|
| 323 |
+
const producto = {
|
| 324 |
+
nombre: document.getElementById('nombre').value,
|
| 325 |
+
descripcion: document.getElementById('descripcion').value,
|
| 326 |
+
precio: parseFloat(document.getElementById('precio').value),
|
| 327 |
+
stock: parseInt(document.getElementById('stock').value)
|
| 328 |
+
};
|
| 329 |
+
|
| 330 |
+
// Show loading state
|
| 331 |
+
const submitBtn = e.target.querySelector('button[type="submit"]');
|
| 332 |
+
const originalBtnText = submitBtn.innerHTML;
|
| 333 |
+
submitBtn.innerHTML = '<i class="fas fa-circle-notch fa-spin mr-2"></i> Procesando...';
|
| 334 |
+
submitBtn.disabled = true;
|
| 335 |
+
|
| 336 |
+
try {
|
| 337 |
+
const res = await fetch('http://localhost:8080/api/productos', {
|
| 338 |
+
method: 'POST',
|
| 339 |
+
headers: {
|
| 340 |
+
'Content-Type': 'application/json',
|
| 341 |
+
'Authorization': authHeader,
|
| 342 |
+
'Accept-Language': lang
|
| 343 |
+
},
|
| 344 |
+
body: JSON.stringify(producto)
|
| 345 |
+
});
|
| 346 |
+
|
| 347 |
+
const data = await res.json();
|
| 348 |
+
|
| 349 |
+
// Show status message with appropriate styling
|
| 350 |
+
statusMessage.classList.remove('hidden');
|
| 351 |
+
statusContent.textContent = data.message || (res.ok ? 'Operaci贸n completada exitosamente!' : 'Hubo un error');
|
| 352 |
+
|
| 353 |
+
if (res.ok) {
|
| 354 |
+
statusContent.className = 'p-3 rounded-lg text-sm bg-green-100 text-green-800';
|
| 355 |
+
document.getElementById('productoForm').reset();
|
| 356 |
+
} else {
|
| 357 |
+
statusContent.className = 'p-3 rounded-lg text-sm bg-red-100 text-red-800';
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
// Hide status message after 5 seconds
|
| 361 |
+
setTimeout(() => {
|
| 362 |
+
statusMessage.classList.add('hidden');
|
| 363 |
+
}, 5000);
|
| 364 |
+
|
| 365 |
+
} catch (err) {
|
| 366 |
+
statusMessage.classList.remove('hidden');
|
| 367 |
+
statusContent.className = 'p-3 rounded-lg text-sm bg-red-100 text-red-800';
|
| 368 |
+
statusContent.textContent = 'Error de conexi贸n con el servidor';
|
| 369 |
+
|
| 370 |
+
setTimeout(() => {
|
| 371 |
+
statusMessage.classList.add('hidden');
|
| 372 |
+
}, 5000);
|
| 373 |
+
} finally {
|
| 374 |
+
submitBtn.innerHTML = originalBtnText;
|
| 375 |
+
submitBtn.disabled = false;
|
| 376 |
+
}
|
| 377 |
+
});
|
| 378 |
+
</script>
|
| 379 |
+
<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=fakesisalg/test23" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 380 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
redise帽a esta pagina mas moderna posible pero deja las conexiones de la api postman <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <title>Inventario Electr贸nico | Gestor de Productos</title> <style> :root { --primary-color: #4361ee; --secondary-color: #3f37c9; --accent-color: #4895ef; --light-color: #f8f9fa; --dark-color: #212529; --success-color: #4cc9f0; --error-color: #f72585; --border-radius: 8px; --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); --transition: all 0.3s ease; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Montserrat', sans-serif; background-color: #f5f7fa; color: var(--dark-color); line-height: 1.6; padding: 0; margin: 0; min-height: 100vh; display: flex; flex-direction: column; } .container { max-width: 1200px; margin: 0 auto; padding: 2rem; width: 100%; } header { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); background-color: var(--primary-color); color: white; padding: 1.5rem 0; box-shadow: var(--box-shadow); position: relative; z-index: 10; } .header-content { display: flex; justify-content: space-between; align-items: center; } .logo { font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; } .logo-icon { font-size: 2rem; } .auth-section { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 200px); } .card { background: white; border-radius: var(--border-radius); box-shadow: var(--box-shadow); padding: 2.5rem; width: 100%; max-width: 500px; margin: 2rem auto; transition: var(--transition); } .card:hover { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); } h1, h2 { color: var(--dark-color); margin-bottom: 1.5rem; text-align: center; } h1 { font-size: 2.2rem; font-weight: 600; color: var(--primary-color); } h2 { font-size: 1.8rem; font-weight: 500; } form { display: flex; flex-direction: column; gap: 1.5rem; } .form-group { display: flex; flex-direction: column; gap: 0.5rem; } label { font-weight: 500; color: var(--dark-color); } input { padding: 0.8rem 1rem; border: 1px solid #ddd; border-radius: var(--border-radius); font-size: 1rem; transition: var(--transition); } input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2); } button { background-color: var(--primary-color); color: white; border: none; padding: 1rem; border-radius: var(--border-radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); text-transform: uppercase; letter-spacing: 0.5px; } button:hover { background-color: var(--secondary-color); transform: translateY(-2px); } button:active { transform: translateY(0); } #formSection { display: none; animation: fadeIn 0.5s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .status-message { padding: 1rem; border-radius: var(--border-radius); margin-top: 1rem; text-align: center; display: none; } .success { background-color: rgba(76, 201, 240, 0.2); color: #0a6c74; display: block; } .error { background-color: rgba(247, 37, 133, 0.2); color: #a4133c; display: block; } footer { background-color: var(--dark-color); color: white; text-align: center; padding: 1.5rem; margin-top: auto; } .footer-content { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; } .copyright { font-size: 0.9rem; } .social-links { display: flex; gap: 1rem; } .social-icon { color: white; font-size: 1.2rem; transition: var(--transition); } .social-icon:hover { color: var(--accent-color); } @media (max-width: 768px) { .container { padding: 1rem; } .card { padding: 1.5rem; } h1 { font-size: 1.8rem; } h2 { font-size: 1.5rem; } .header-content { flex-direction: column; gap: 1rem; } .footer-content { flex-direction: column; gap: 1rem; } } </style> </head> <body> <header> <div class="container header-content"> <div class="logo"> <span class="logo-icon">馃摝</span> <span>Inventario Electr贸nico</span> </div> <div> <label for="languageSelect">Idioma:</label> <select id="languageSelect"> <option value="es">Espa帽ol</option> <option value="en">English</option> </select> </div> </div> </header> <main class="container"> <section class="auth-section"> <div class="card"> <h1>Iniciar Sesi贸n</h1> <form id="loginForm"> <div class="form-group"> <label for="username">Usuario</label> <input type="text" id="username" required> </div> <div class="form-group"> <label for="password">Contrase帽a</label> <input type="password" id="password" required> </div> <button type="submit">Acceder al Sistema</button> </form> </div> <div id="formSection" class="card" style="display: none;"> <h2>Registrar Nuevo Producto</h2> <form id="productoForm"> <input type="text" id="nombre" placeholder="Nombre del producto" required> <input type="text" id="descripcion" placeholder="Descripci贸n" required> <input type="number" id="precio" placeholder="Precio unitario" required> <input type="number" id="stock" placeholder="Cantidad en stock" required> <button type="submit">Guardar Producto</button> </form> <div id="statusMessage" class="status-message"></div> </div> </section> </main> <footer> <div class="container"> <p>漏 2025 Gestor de Inventario Electr贸nico</p> </div> </footer> <script> let authHeader = ""; function encodeBasicAuth(username, password) { return btoa(username + ":" + password); } // Login document.getElementById('loginForm').addEventListener('submit', function(e) { e.preventDefault(); const user = document.getElementById('username').value; const pass = document.getElementById('password').value; authHeader = "Basic " + encodeBasicAuth(user, pass); document.getElementById('formSection').style.display = 'block'; document.getElementById('loginForm').parentElement.style.display = 'none'; }); // Env铆o de producto con i18n document.getElementById('productoForm').addEventListener('submit', async function(e) { e.preventDefault(); const lang = document.getElementById('languageSelect').value; const producto = { nombre: document.getElementById('nombre').value, descripcion: document.getElementById('descripcion').value, precio: parseFloat(document.getElementById('precio').value), stock: parseInt(document.getElementById('stock').value) }; try { const res = await fetch('http://localhost:8080/api/productos', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': authHeader, 'Accept-Language': lang }, body: JSON.stringify(producto) }); const data = await res.json(); showStatus(data.message || 'Operaci贸n completada.', res.ok ? 'success' : 'error'); if (res.ok) document.getElementById('productoForm').reset(); } catch (err) { showStatus('Error de conexi贸n con el servidor', 'error'); } }); function showStatus(message, type) { const status = document.getElementById('statusMessage'); status.textContent = message; status.className = 'status-message ' + type; status.style.display = 'block'; setTimeout(() => { status.style.display = 'none'; }, 5000); } </script> </body> </html>
|