Private
Public Access
progreso con la landing page
This commit is contained in:
1 parent
ad0612c4d8
commit
ea29c7d3f0
9 files changed
+648
-77
No files matched your search
@@ -28,7 +28,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<CarbonHeader companyName="Repuestera" href="/">
|
<CarbonHeader companyName="Repuestera" href="/menu">
|
||||||
<HeaderNav>
|
<HeaderNav>
|
||||||
{#if !usuario}
|
{#if !usuario}
|
||||||
<HeaderNavItem text="Inicio" href="/" />
|
<HeaderNavItem text="Inicio" href="/" />
|
||||||
|
|||||||
@@ -0,0 +1,549 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { Button } from 'carbon-components-svelte';
|
||||||
|
import InventoryManagement from 'carbon-icons-svelte/lib/InventoryManagement.svelte';
|
||||||
|
import ShoppingCart from 'carbon-icons-svelte/lib/ShoppingCart.svelte';
|
||||||
|
import Barcode from 'carbon-icons-svelte/lib/Barcode.svelte';
|
||||||
|
import Report from 'carbon-icons-svelte/lib/Report.svelte';
|
||||||
|
import UserMultiple from 'carbon-icons-svelte/lib/UserMultiple.svelte';
|
||||||
|
import Api from 'carbon-icons-svelte/lib/Api.svelte';
|
||||||
|
import CheckmarkFilled from 'carbon-icons-svelte/lib/CheckmarkFilled.svelte';
|
||||||
|
import ArrowRight from 'carbon-icons-svelte/lib/ArrowRight.svelte';
|
||||||
|
import type { Usuario } from '../../types';
|
||||||
|
|
||||||
|
let { usuario }: { usuario?: Usuario } = $props();
|
||||||
|
|
||||||
|
const features = [
|
||||||
|
{
|
||||||
|
icon: InventoryManagement,
|
||||||
|
title: 'Gestión de Inventario',
|
||||||
|
desc: 'Control total de tu stock con actualizaciones en tiempo real, alertas de bajo inventario y categorización inteligente.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: ShoppingCart,
|
||||||
|
title: 'Órdenes y Ventas',
|
||||||
|
desc: 'Administra pedidos, cotizaciones y ventas desde un solo lugar. Historial completo de cada transacción.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: Barcode,
|
||||||
|
title: 'Código de Barras',
|
||||||
|
desc: 'Escanea y registra productos al instante. Compatible con lectores de código de barras estándar.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: Report,
|
||||||
|
title: 'Reportes y Analytics',
|
||||||
|
desc: 'Visualiza tus métricas clave: productos más vendidos, rotación de inventario y rentabilidad.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: UserMultiple,
|
||||||
|
title: 'Usuarios y Roles',
|
||||||
|
desc: 'Control de acceso granular con permisos personalizables por grupo y usuario.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: Api,
|
||||||
|
title: 'API Completa',
|
||||||
|
desc: 'Integra Repuestera con tus sistemas existentes mediante nuestra API REST documentada.'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const plans = [
|
||||||
|
{
|
||||||
|
name: 'Starter',
|
||||||
|
price: '0',
|
||||||
|
desc: 'Perfecto para negocios que inician',
|
||||||
|
features: [
|
||||||
|
'Hasta 100 productos',
|
||||||
|
'1 usuario',
|
||||||
|
'Gestión básica de inventario',
|
||||||
|
'Reportes básicos'
|
||||||
|
],
|
||||||
|
cta: 'Comenzar gratis',
|
||||||
|
href: '/register',
|
||||||
|
highlight: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Profesional',
|
||||||
|
price: '29',
|
||||||
|
desc: 'Para negocios en crecimiento',
|
||||||
|
features: [
|
||||||
|
'Productos ilimitados',
|
||||||
|
'Hasta 10 usuarios',
|
||||||
|
'Órdenes de compra',
|
||||||
|
'Código de barras',
|
||||||
|
'Reportes avanzados',
|
||||||
|
'Soporte prioritario'
|
||||||
|
],
|
||||||
|
cta: 'Probar gratis',
|
||||||
|
href: '/register',
|
||||||
|
highlight: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Enterprise',
|
||||||
|
price: '99',
|
||||||
|
desc: 'Para operaciones a gran escala',
|
||||||
|
features: [
|
||||||
|
'Todo lo de Profesional',
|
||||||
|
'Usuarios ilimitados',
|
||||||
|
'Multi-almacén',
|
||||||
|
'API completa',
|
||||||
|
'Integraciones personalizadas',
|
||||||
|
'Soporte dedicado 24/7'
|
||||||
|
],
|
||||||
|
cta: 'Contactar ventas',
|
||||||
|
href: '/register',
|
||||||
|
highlight: false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<section class="hero-section">
|
||||||
|
<div class="hero-content">
|
||||||
|
<span class="hero-badge">Nueva plataforma</span>
|
||||||
|
<h1 class="hero-title">
|
||||||
|
Gestiona tu <span class="text-[#0f62fe]">repuestera</span><br />
|
||||||
|
desde cualquier lugar
|
||||||
|
</h1>
|
||||||
|
<p class="hero-subtitle">
|
||||||
|
La plataforma todo-en-uno para administrar inventario, ventas y usuarios
|
||||||
|
de tu negocio de repuestos. Simple, rápida y segura.
|
||||||
|
</p>
|
||||||
|
{#if !usuario}
|
||||||
|
<div class="hero-buttons">
|
||||||
|
<Button href="/register" icon={ArrowRight} iconDescription="Comenzar">
|
||||||
|
Comenzar gratis
|
||||||
|
</Button>
|
||||||
|
<Button kind="secondary" href="/login">Iniciar sesión</Button>
|
||||||
|
</div>
|
||||||
|
<p class="hero-footnote">Sin tarjeta de crédito • 14 días gratis • Cancela cuando quieras</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="features-section" id="features">
|
||||||
|
<h2 class="section-title">Todo lo que necesitas para tu negocio</h2>
|
||||||
|
<p class="section-subtitle">
|
||||||
|
Repuestera combina todas las herramientas esenciales en una plataforma integrada
|
||||||
|
</p>
|
||||||
|
<div class="features-grid">
|
||||||
|
{#each features as f}
|
||||||
|
<div class="feature-card">
|
||||||
|
<div class="feature-icon-wrapper">
|
||||||
|
<f.icon size={28} />
|
||||||
|
</div>
|
||||||
|
<h3 class="feature-card-title">{f.title}</h3>
|
||||||
|
<p class="feature-card-desc">{f.desc}</p>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="pricing-section" id="pricing">
|
||||||
|
<h2 class="section-title">Planes simples y transparentes</h2>
|
||||||
|
<p class="section-subtitle">Elige el plan que mejor se adapte a tu negocio</p>
|
||||||
|
<div class="pricing-grid">
|
||||||
|
{#each plans as plan}
|
||||||
|
<div class="pricing-card" class:highlight={plan.highlight}>
|
||||||
|
{#if plan.highlight}
|
||||||
|
<div class="pricing-badge">Más popular</div>
|
||||||
|
{/if}
|
||||||
|
<div class="pricing-header">
|
||||||
|
<h3 class="pricing-name">{plan.name}</h3>
|
||||||
|
<p class="pricing-desc">{plan.desc}</p>
|
||||||
|
</div>
|
||||||
|
<div class="pricing-price">
|
||||||
|
<span class="pricing-amount">${plan.price}</span>
|
||||||
|
<span class="pricing-period">/mes</span>
|
||||||
|
</div>
|
||||||
|
<ul class="pricing-features">
|
||||||
|
{#each plan.features as feature}
|
||||||
|
<li class="pricing-feature">
|
||||||
|
<CheckmarkFilled size={20} />
|
||||||
|
<span>{feature}</span>
|
||||||
|
</li>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
<Button
|
||||||
|
href={plan.href}
|
||||||
|
kind={plan.highlight ? 'primary' : 'secondary'}
|
||||||
|
icon={ArrowRight}
|
||||||
|
iconDescription={plan.cta}
|
||||||
|
>
|
||||||
|
{plan.cta}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{#if !usuario}
|
||||||
|
<section class="cta-section">
|
||||||
|
<div class="cta-card">
|
||||||
|
<h2 class="cta-title">¿Listo para transformar tu repuestera?</h2>
|
||||||
|
<p class="cta-subtitle">
|
||||||
|
Únete a cientos de negocios que ya confían en Repuestera.
|
||||||
|
Empieza hoy y lleva tu inventario al siguiente nivel.
|
||||||
|
</p>
|
||||||
|
<Button href="/register" icon={ArrowRight} iconDescription="Comenzar ahora">
|
||||||
|
Comenzar ahora
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-content">
|
||||||
|
<div class="footer-brand">
|
||||||
|
<span class="footer-logo">Repuestera</span>
|
||||||
|
<p class="footer-desc">Tu tienda de repuestos de confianza</p>
|
||||||
|
</div>
|
||||||
|
<nav class="footer-nav">
|
||||||
|
<div class="footer-col">
|
||||||
|
<h4>Producto</h4>
|
||||||
|
<a href="#features">Características</a>
|
||||||
|
<a href="#pricing">Precios</a>
|
||||||
|
<a href="/register">Registro</a>
|
||||||
|
</div>
|
||||||
|
<div class="footer-col">
|
||||||
|
<h4>Compañía</h4>
|
||||||
|
<a href="/about">Nosotros</a>
|
||||||
|
<a href="/contact">Contacto</a>
|
||||||
|
<a href="/login">Iniciar sesión</a>
|
||||||
|
</div>
|
||||||
|
<div class="footer-col">
|
||||||
|
<h4>Legal</h4>
|
||||||
|
<a href="/privacy">Privacidad</a>
|
||||||
|
<a href="/terms">Términos</a>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div class="footer-bottom">
|
||||||
|
<p>© 2026 Repuestera. Todos los derechos reservados.</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.hero-section {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 6rem 1rem 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-content {
|
||||||
|
text-align: center;
|
||||||
|
max-width: 720px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-badge {
|
||||||
|
display: inline-block;
|
||||||
|
background: rgba(15, 98, 254, 0.15);
|
||||||
|
color: #0f62fe;
|
||||||
|
padding: 0.35rem 1rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
border: 1px solid rgba(15, 98, 254, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-title {
|
||||||
|
font-size: clamp(2rem, 5vw, 3.25rem);
|
||||||
|
font-weight: 800;
|
||||||
|
line-height: 1.15;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-subtitle {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
max-width: 560px;
|
||||||
|
margin: 0 auto 2rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-footnote {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-subtitle {
|
||||||
|
font-size: 1.05rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
text-align: center;
|
||||||
|
max-width: 520px;
|
||||||
|
margin: 0 auto 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.features-section {
|
||||||
|
padding: 5rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.features-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||||
|
gap: 1.5rem;
|
||||||
|
max-width: 1100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feature-card {
|
||||||
|
background: var(--cds-layer-02, #393939);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 1.75rem;
|
||||||
|
transition: transform 0.2s, box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feature-card:hover {
|
||||||
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.feature-icon-wrapper {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(15, 98, 254, 0.12);
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
color: #0f62fe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feature-card-title {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feature-card-desc {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
line-height: 1.55;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-section {
|
||||||
|
padding: 5rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||||
|
gap: 1.5rem;
|
||||||
|
max-width: 1000px;
|
||||||
|
margin: 0 auto;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-card {
|
||||||
|
background: var(--cds-layer-02, #393939);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 2rem 1.75rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.25rem;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
transition: transform 0.2s, box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-card.highlight {
|
||||||
|
border-color: #0f62fe;
|
||||||
|
background: linear-gradient(135deg, rgba(15, 98, 254, 0.06), transparent);
|
||||||
|
transform: scale(1.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-card:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-card.highlight:hover {
|
||||||
|
transform: scale(1.04) translateY(-4px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: -12px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background: #0f62fe;
|
||||||
|
color: #fff;
|
||||||
|
padding: 0.25rem 1rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-header {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-name {
|
||||||
|
font-size: 1.3rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-desc {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-price {
|
||||||
|
text-align: center;
|
||||||
|
padding: 0.75rem 0;
|
||||||
|
border-top: 1px solid var(--cds-border-subtle-01, #525252);
|
||||||
|
border-bottom: 1px solid var(--cds-border-subtle-01, #525252);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-amount {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-period {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-features {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.75rem;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-feature {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.6rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-feature :global(svg) {
|
||||||
|
color: #42be65;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pricing-card :global(.bx--btn) {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-section {
|
||||||
|
padding: 5rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-card {
|
||||||
|
max-width: 680px;
|
||||||
|
margin: 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
background: linear-gradient(135deg, rgba(15, 98, 254, 0.1), rgba(15, 98, 254, 0.03));
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 3.5rem 2rem;
|
||||||
|
border: 1px solid rgba(15, 98, 254, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-title {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-subtitle {
|
||||||
|
font-size: 1rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
max-width: 480px;
|
||||||
|
margin: 0 auto 2rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
border-top: 1px solid var(--cds-border-subtle-01, #525252);
|
||||||
|
padding: 3rem 1rem 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-content {
|
||||||
|
max-width: 1100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 2rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-brand {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-logo {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-desc {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-nav {
|
||||||
|
display: flex;
|
||||||
|
gap: 2.5rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-col h4 {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-col a {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
padding: 0.3rem 0;
|
||||||
|
color: var(--cds-text-primary, #f4f4f4);
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.15s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-col a:hover {
|
||||||
|
color: #0f62fe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-bottom {
|
||||||
|
max-width: 1100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 2rem;
|
||||||
|
padding-top: 1rem;
|
||||||
|
border-top: 1px solid var(--cds-border-subtle-01, #525252);
|
||||||
|
text-align: center;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -12,7 +12,7 @@ async function handleResponse<T>(response: Response): Promise<T> {
|
|||||||
removeToken();
|
removeToken();
|
||||||
removeAuthTokens();
|
removeAuthTokens();
|
||||||
removeCurrentUser();
|
removeCurrentUser();
|
||||||
goto('/');
|
goto('/login');
|
||||||
}
|
}
|
||||||
throw new Error(error.message || error.error || 'Error en la petición');
|
throw new Error(error.message || error.error || 'Error en la petición');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
|
||||||
import { getCurrentUser, ObtenerGruposDeUsuario } from '$lib/api';
|
import { getCurrentUser, ObtenerGruposDeUsuario } from '$lib/api';
|
||||||
import CardError from '$lib/components/CardError.svelte';
|
|
||||||
import Header from '$lib/components/Header.svelte';
|
import Header from '$lib/components/Header.svelte';
|
||||||
import {
|
import LandingPage from '$lib/components/LandingPage.svelte';
|
||||||
Accordion,
|
|
||||||
AccordionItem,
|
|
||||||
ContainedList,
|
|
||||||
ContainedListItem
|
|
||||||
} from 'carbon-components-svelte';
|
|
||||||
|
|
||||||
let usuario = getCurrentUser();
|
let usuario = getCurrentUser();
|
||||||
|
|
||||||
let grupos = usuario ? ObtenerGruposDeUsuario(usuario) : undefined;
|
let grupos = usuario ? ObtenerGruposDeUsuario(usuario) : undefined;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Header {usuario} {grupos} />
|
<Header {usuario} {grupos} />
|
||||||
|
<LandingPage {usuario} />
|
||||||
<div class="w-full flex-col justify-center p-2!">
|
|
||||||
<div class="hero">
|
|
||||||
<h1 class="hero-title">Bienvenido a Repuestera</h1>
|
|
||||||
<p class="hero-subtitle">Tu tienda de repuestos de confianza</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex w-full justify-center gap-2">
|
|
||||||
<div class="w-[75%]">
|
|
||||||
{#await grupos}
|
|
||||||
<Accordion skeleton></Accordion>
|
|
||||||
{:then gg}
|
|
||||||
{#if gg == undefined}{:else}
|
|
||||||
<Accordion>
|
|
||||||
{#each gg.groups as g}
|
|
||||||
<AccordionItem title={g.nombre}>
|
|
||||||
{#if g.permisos?.length == 0}
|
|
||||||
<p class="text-neutral-500">No hay permisos en este grupo</p>
|
|
||||||
{:else}
|
|
||||||
<ContainedList>
|
|
||||||
{#each g.permisos as p}
|
|
||||||
<ContainedListItem on:click={() => goto(p.alias)}>
|
|
||||||
<span class="cursor-pointer">
|
|
||||||
{p.nombre}
|
|
||||||
</span>
|
|
||||||
</ContainedListItem>
|
|
||||||
{/each}
|
|
||||||
</ContainedList>
|
|
||||||
{/if}
|
|
||||||
</AccordionItem>
|
|
||||||
{/each}
|
|
||||||
</Accordion>
|
|
||||||
{/if}
|
|
||||||
{:catch err}
|
|
||||||
<CardError>
|
|
||||||
{err}
|
|
||||||
</CardError>
|
|
||||||
{/await}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.hero {
|
|
||||||
text-align: center;
|
|
||||||
padding: 6rem 0 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero-title {
|
|
||||||
font-size: 2.5rem;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-bottom: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero-subtitle {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
:global(.feature-tile) {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
import { resolve } from '$app/paths';
|
||||||
import Header from '$lib/components/Header.svelte';
|
import Header from '$lib/components/Header.svelte';
|
||||||
import type { Grupo } from '../../../types';
|
import type { Grupo } from '../../../types';
|
||||||
import {
|
import {
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
{#if data.grupo.permisos && data.grupo.permisos.length > 0}
|
{#if data.grupo.permisos && data.grupo.permisos.length > 0}
|
||||||
<ContainedList>
|
<ContainedList>
|
||||||
{#each data.grupo.permisos as p (p.id)}
|
{#each data.grupo.permisos as p (p.id)}
|
||||||
<ContainedListItem on:click={() => goto(p.alias)}>
|
<ContainedListItem on:click={() => goto('/' + p.alias)}>
|
||||||
<div class="permiso-item">
|
<div class="permiso-item">
|
||||||
<span>{p.nombre}</span>
|
<span>{p.nombre}</span>
|
||||||
<Tag type="blue">{p.alias}</Tag>
|
<Tag type="blue">{p.alias}</Tag>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await loginApi({ email, password });
|
const response = await loginApi({ email, password });
|
||||||
goto('/');
|
goto('/menu');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e instanceof Error ? e.message : 'Error al iniciar sesión';
|
error = e instanceof Error ? e.message : 'Error al iniciar sesión';
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
import { getCurrentUser, ObtenerGruposDeUsuario } from '$lib/api';
|
||||||
|
import CardError from '$lib/components/CardError.svelte';
|
||||||
|
import Header from '$lib/components/Header.svelte';
|
||||||
|
import {
|
||||||
|
Accordion,
|
||||||
|
AccordionItem,
|
||||||
|
ContainedList,
|
||||||
|
ContainedListItem
|
||||||
|
} from 'carbon-components-svelte';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
|
let usuario = getCurrentUser();
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if (!usuario) goto('/login');
|
||||||
|
});
|
||||||
|
|
||||||
|
let grupos = usuario ? ObtenerGruposDeUsuario(usuario) : undefined;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Header {usuario} {grupos} />
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<section class="dashboard-section">
|
||||||
|
<div class="dashboard-header">
|
||||||
|
<h2 class="section-title">Tu panel de control</h2>
|
||||||
|
<p class="section-subtitle">Accede a los módulos de tu cuenta</p>
|
||||||
|
</div>
|
||||||
|
{#await grupos}
|
||||||
|
<Accordion skeleton />
|
||||||
|
{:then gg}
|
||||||
|
{#if gg == undefined}
|
||||||
|
<p class="text-neutral-500 text-center py-8">No tienes grupos asignados</p>
|
||||||
|
{:else}
|
||||||
|
<Accordion>
|
||||||
|
{#each gg.groups as g}
|
||||||
|
<AccordionItem title={g.nombre}>
|
||||||
|
{#if g.permisos?.length == 0}
|
||||||
|
<p class="text-neutral-500">No hay permisos en este grupo</p>
|
||||||
|
{:else}
|
||||||
|
<ContainedList>
|
||||||
|
{#each g.permisos as p}
|
||||||
|
<ContainedListItem on:click={() => goto(p.alias)}>
|
||||||
|
<span class="cursor-pointer">{p.nombre}</span>
|
||||||
|
</ContainedListItem>
|
||||||
|
{/each}
|
||||||
|
</ContainedList>
|
||||||
|
{/if}
|
||||||
|
</AccordionItem>
|
||||||
|
{/each}
|
||||||
|
</Accordion>
|
||||||
|
{/if}
|
||||||
|
{:catch err}
|
||||||
|
<CardError>{err}</CardError>
|
||||||
|
{/await}
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.section-title {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-subtitle {
|
||||||
|
font-size: 1.05rem;
|
||||||
|
color: var(--cds-text-secondary, #c6c6c6);
|
||||||
|
text-align: center;
|
||||||
|
max-width: 520px;
|
||||||
|
margin: 0 auto 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-section {
|
||||||
|
padding: 5rem 1rem;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-header {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-section :global(.bx--accordion) {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
const response = await registerApi({ name, email, password });
|
const response = await registerApi({ name, email, password });
|
||||||
// setToken(response.token);
|
// setToken(response.token);
|
||||||
// setCurrentUser(response);
|
// setCurrentUser(response);
|
||||||
goto('/');
|
goto('/menu');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e instanceof Error ? e.message : 'Error al registrar';
|
error = e instanceof Error ? e.message : 'Error al registrar';
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ export interface Grupo {
|
|||||||
nombre: string;
|
nombre: string;
|
||||||
descripcion?: string;
|
descripcion?: string;
|
||||||
permisos?: Permiso[];
|
permisos?: Permiso[];
|
||||||
grupos?: Grupo[];
|
grupos_hijos?: Grupo[];
|
||||||
usuarios?: Usuario[];
|
usuarios?: Usuario[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user