feat: redesign Schedules, Discover, and Routes views with SIBU Main HUD aesthetic and Tailwind v4
This commit is contained in:
@ -6,6 +6,7 @@ import type { Business } from '@/types';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue';
|
||||
import { analyticsService } from '@/services/analyticsService';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
@ -13,8 +14,7 @@ const businesses = ref<Business[]>([]);
|
||||
const isLoading = ref(true);
|
||||
const selectedArea = ref('Todas');
|
||||
const selectedCategory = ref('Todas');
|
||||
|
||||
import { analyticsService } from '@/services/analyticsService';
|
||||
const searchQuery = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'Discover' });
|
||||
@ -46,6 +46,15 @@ const filteredBusinesses = computed(() => {
|
||||
if (selectedCategory.value !== 'Todas') {
|
||||
filtered = filtered.filter(b => b.category === selectedCategory.value);
|
||||
}
|
||||
|
||||
if (searchQuery.value.trim() !== '') {
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
filtered = filtered.filter(b =>
|
||||
b.name.toLowerCase().includes(query) ||
|
||||
(b.area && b.area.toLowerCase().includes(query)) ||
|
||||
(b.category && b.category.toLowerCase().includes(query))
|
||||
);
|
||||
}
|
||||
|
||||
return filtered;
|
||||
});
|
||||
@ -55,6 +64,11 @@ const categories = computed<string[]>(() => {
|
||||
return ['Todas', ...Array.from(cats)];
|
||||
});
|
||||
|
||||
const areas = computed<string[]>(() => {
|
||||
const ars = new Set(businesses.value.map(b => b.area).filter(Boolean) as string[]);
|
||||
return ['Todas', ...Array.from(ars)];
|
||||
});
|
||||
|
||||
function getImageUrl(path: string | null | undefined) {
|
||||
if (!path) return '/default-business.jpg';
|
||||
if (path.startsWith('http')) return path;
|
||||
@ -75,119 +89,108 @@ function getCategoryIcon(category: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="discover-view">
|
||||
<!-- Compact Glass Header -->
|
||||
<header class="premium-header">
|
||||
<div class="header-glass-card">
|
||||
<div class="header-icon-box">
|
||||
<span class="material-icons">explore</span>
|
||||
<div class="icon-pulse"></div>
|
||||
</div>
|
||||
<div class="header-text-box">
|
||||
<h1 class="gradient-text">{{ t('discover.title') }}</h1>
|
||||
<p class="subtitle">{{ t('discover.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="discover-view bg-white dark:bg-zinc-950 text-slate-900 dark:text-gray-200 min-h-screen pb-32">
|
||||
<!-- Header Area -->
|
||||
<header class="bg-white/80 dark:bg-zinc-950/80 backdrop-blur-md px-6 pt-12 pb-4 sticky top-0 z-50 border-b border-slate-100 dark:border-zinc-800">
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<button @click="router.back()" class="material-icons text-3xl font-bold cursor-pointer dark:text-white">arrow_back</button>
|
||||
<h1 class="text-2xl font-extrabold tracking-tighter dark:text-white uppercase italic">SIBU</h1>
|
||||
<div class="w-8"></div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Integrated High-Tech Filters -->
|
||||
<div class="filters-panel">
|
||||
<div class="glass-filters">
|
||||
<div class="filter-item">
|
||||
<div class="filter-label">
|
||||
<span class="material-icons">location_on</span>
|
||||
<span>Región</span>
|
||||
</div>
|
||||
<div class="custom-select-box">
|
||||
<select v-model="selectedArea" class="modern-select">
|
||||
<option value="Todas">{{ t('discover.allAreas') }}</option>
|
||||
<option value="Boquete">Boquete</option>
|
||||
<option value="Dolega">Dolega</option>
|
||||
<option value="David">David</option>
|
||||
</select>
|
||||
<span class="material-icons">expand_more</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-divider"></div>
|
||||
|
||||
<div class="filter-item">
|
||||
<div class="filter-label">
|
||||
<span class="material-icons">category</span>
|
||||
<span>Categoría</span>
|
||||
</div>
|
||||
<div class="custom-select-box">
|
||||
<select v-model="selectedCategory" class="modern-select">
|
||||
<option v-for="cat in categories" :key="cat" :value="cat">
|
||||
{{ cat }}
|
||||
</option>
|
||||
</select>
|
||||
<span class="material-icons">expand_more</span>
|
||||
<main class="px-5 pt-6">
|
||||
<!-- Search Bar -->
|
||||
<div class="mb-6">
|
||||
<div class="relative flex items-center bg-slate-50 dark:bg-zinc-900 rounded-2xl shadow-sm p-1 border border-slate-100 dark:border-zinc-800">
|
||||
<div class="p-3">
|
||||
<span class="material-icons text-slate-400 dark:text-gray-500">search</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="searchQuery"
|
||||
class="w-full bg-transparent border-none focus:ring-0 text-slate-900 dark:text-gray-200 font-medium placeholder:text-slate-400 dark:placeholder:text-gray-500 text-[15px]"
|
||||
:placeholder="t('discover.searchPlaceholder') || 'Explora los mejores lugares en Chiriquí'"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main Content Area -->
|
||||
<main class="discover-main">
|
||||
<!-- Loading Experience -->
|
||||
<div v-if="isLoading" class="loading-container">
|
||||
<div class="nexus-loader">
|
||||
<div class="nexus-dot"></div>
|
||||
<div class="nexus-ring"></div>
|
||||
<!-- Region & Category Selectors -->
|
||||
<div class="flex gap-3 mb-8">
|
||||
<div class="flex-1 bg-slate-50 dark:bg-zinc-900 p-4 rounded-2xl shadow-sm border border-slate-100 dark:border-zinc-800 flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="material-icons text-blue-500 text-[18px] font-bold">location_on</span>
|
||||
<span class="text-[10px] font-bold text-slate-400 dark:text-gray-500 uppercase tracking-widest">Región</span>
|
||||
</div>
|
||||
<select v-model="selectedArea" class="bg-transparent border-none focus:ring-0 p-0 font-bold text-slate-900 dark:text-white text-sm appearance-none cursor-pointer">
|
||||
<option value="Todas">{{ t('discover.allAreas') }}</option>
|
||||
<option v-for="area in areas" :key="area" :value="area">{{ area }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="loading-text">Sincronizando con SIBU...</p>
|
||||
<div class="flex-1 bg-slate-50 dark:bg-zinc-900 p-4 rounded-2xl shadow-sm border border-slate-100 dark:border-zinc-800 flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="material-icons text-blue-500 text-[18px] font-bold">category</span>
|
||||
<span class="text-[10px] font-bold text-slate-400 dark:text-gray-500 uppercase tracking-widest">Categoría</span>
|
||||
</div>
|
||||
<select v-model="selectedCategory" class="bg-transparent border-none focus:ring-0 p-0 font-bold text-slate-900 dark:text-white text-sm appearance-none cursor-pointer">
|
||||
<option v-for="cat in categories" :key="cat" :value="cat">{{ cat }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
<div v-if="isLoading" class="flex flex-col items-center justify-center py-20">
|
||||
<div class="w-10 h-10 border-4 border-blue-500/20 border-t-blue-500 rounded-full animate-spin mb-4"></div>
|
||||
<p class="text-slate-500 dark:text-gray-400 font-bold tracking-widest uppercase text-xs">Sincronizando con SIBU...</p>
|
||||
</div>
|
||||
|
||||
<!-- Empty State -->
|
||||
<div v-else-if="filteredBusinesses.length === 0" class="empty-nexus">
|
||||
<div class="empty-nexus-box">
|
||||
<span class="material-icons">search_off</span>
|
||||
<h3>Sin resultados</h3>
|
||||
<p>La búsqueda no devolvió datos en esta frecuencia.</p>
|
||||
<button class="reboot-btn" @click="selectedArea = 'Todas'; selectedCategory = 'Todas'">
|
||||
<div v-else-if="filteredBusinesses.length === 0" class="text-center py-20">
|
||||
<div class="bg-slate-50 dark:bg-zinc-900 rounded-[2rem] p-10 border border-dashed border-slate-200 dark:border-zinc-800">
|
||||
<span class="material-icons text-slate-300 dark:text-gray-600 text-5xl mb-4">search_off</span>
|
||||
<h3 class="text-lg font-bold text-slate-900 dark:text-white mb-2">Sin resultados</h3>
|
||||
<p class="text-slate-500 dark:text-gray-400 mb-6">La búsqueda no devolvió datos en esta frecuencia.</p>
|
||||
<button @click="selectedArea = 'Todas'; selectedCategory = 'Todas'; searchQuery = ''" class="bg-blue-500 text-white px-8 py-3 rounded-xl font-black uppercase text-xs tracking-widest active:scale-95 transition-all">
|
||||
REINICIAR SENSORES
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Business Grid Premium -->
|
||||
<!-- Business Grid -->
|
||||
<TransitionGroup
|
||||
v-else
|
||||
name="stagger-list"
|
||||
name="fade"
|
||||
tag="div"
|
||||
class="premium-business-grid"
|
||||
class="grid grid-cols-2 gap-4"
|
||||
>
|
||||
<div v-for="(biz, index) in filteredBusinesses"
|
||||
<div v-for="biz in filteredBusinesses"
|
||||
:key="biz.id"
|
||||
class="nexus-card"
|
||||
class="bg-slate-50 dark:bg-zinc-900 rounded-[2rem] overflow-hidden shadow-sm border border-slate-100 dark:border-zinc-800 flex flex-col active:scale-95 transition-all cursor-pointer"
|
||||
@click="handleExplore(biz)"
|
||||
:style="{ '--order': index }"
|
||||
>
|
||||
<div class="nexus-card-inner">
|
||||
<div class="nexus-image-container">
|
||||
<img :src="getImageUrl(biz.image_url)" alt="" class="nexus-img">
|
||||
<div class="nexus-overlay-gradient"></div>
|
||||
|
||||
<!-- Floating Badges -->
|
||||
<div class="nexus-badge category">
|
||||
<span class="material-icons">{{ getCategoryIcon(biz.category || '') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="nexus-fav">
|
||||
<FavoriteButton
|
||||
item-type="business"
|
||||
:item-id="biz.id"
|
||||
:item-name="biz.name"
|
||||
:item-image="biz.image_url || undefined"
|
||||
/>
|
||||
</div>
|
||||
<div class="relative h-44">
|
||||
<img :src="getImageUrl(biz.image_url)" alt="" class="w-full h-full object-cover">
|
||||
<div class="absolute inset-0 bg-gradient-to-b from-black/40 to-transparent"></div>
|
||||
<div class="absolute top-3 left-3 bg-black/60 backdrop-blur-md p-1.5 rounded-xl border border-white/10">
|
||||
<span class="material-icons text-blue-400 text-[18px] flex items-center justify-center">
|
||||
{{ getCategoryIcon(biz.category || '') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="nexus-card-details">
|
||||
<h3 class="nexus-biz-name">{{ biz.name }}</h3>
|
||||
<div class="nexus-biz-meta">
|
||||
<span class="area"><span class="material-icons">near_me</span>{{ biz.area }}</span>
|
||||
<div class="absolute top-3 right-3">
|
||||
<FavoriteButton
|
||||
item-type="business"
|
||||
:item-id="biz.id"
|
||||
:item-name="biz.name"
|
||||
:item-image="biz.image_url || undefined"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-4 flex flex-col flex-grow">
|
||||
<h3 class="font-bold text-slate-900 dark:text-white text-[15px] leading-tight mb-2">{{ biz.name }}</h3>
|
||||
<div class="mt-auto flex items-center justify-between">
|
||||
<div class="flex items-center gap-1">
|
||||
<span class="material-icons text-blue-400 text-[14px]">near_me</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-gray-500">{{ biz.area }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -199,390 +202,22 @@ function getCategoryIcon(category: string) {
|
||||
|
||||
<style scoped>
|
||||
.discover-view {
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
padding: 20px 16px 150px;
|
||||
overflow-x: hidden;
|
||||
font-family: 'Plus Jakarta Sans', sans-serif;
|
||||
}
|
||||
|
||||
/* Contenido directo */
|
||||
.premium-header,
|
||||
.filters-panel,
|
||||
.discover-main {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Tarjetas nitidas */
|
||||
.header-glass-card,
|
||||
.glass-filters,
|
||||
.nexus-card-inner {
|
||||
background: var(--card-bg) !important;
|
||||
backdrop-filter: none !important;
|
||||
border: 1px solid var(--border-color) !important;
|
||||
}
|
||||
|
||||
/* Premium Header */
|
||||
.premium-header {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.header-glass-card {
|
||||
background: var(--card-bg);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 24px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.header-icon-box {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
background: var(--active-bg);
|
||||
border-radius: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-icon-box .material-icons {
|
||||
color: var(--active-color);
|
||||
font-size: 28px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.icon-pulse {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 18px;
|
||||
border: 2px solid var(--active-color);
|
||||
animation: pulse-out 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-out {
|
||||
0% { transform: scale(1); opacity: 0.5; }
|
||||
100% { transform: scale(1.5); opacity: 0; }
|
||||
}
|
||||
|
||||
.header-text-box h1 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 900;
|
||||
margin: 0;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 4px 0 0;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Unified Filters */
|
||||
.filters-panel {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.glass-filters {
|
||||
background: var(--glass-bg);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
padding: 8px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.filter-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 4px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.filter-label .material-icons {
|
||||
font-size: 14px;
|
||||
color: var(--active-color);
|
||||
}
|
||||
|
||||
.custom-select-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.modern-select {
|
||||
width: 100%;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-primary);
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
padding-right: 24px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.custom-select-box .material-icons {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
color: var(--text-secondary);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.filter-divider {
|
||||
width: 1px;
|
||||
background: var(--border-color);
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
/* Premium Grid */
|
||||
.premium-business-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.premium-business-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.premium-business-grid {
|
||||
grid-template-columns: repeat(2, 1fr); /* Mantenemos 2 en móvil para aprovechar el espacio nexus */
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.nexus-card {
|
||||
perspective: 1000px;
|
||||
}
|
||||
|
||||
.nexus-card-inner {
|
||||
background: var(--card-bg);
|
||||
border-radius: 24px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border-color);
|
||||
.fade-move,
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.nexus-card:hover .nexus-card-inner {
|
||||
transform: translateY(-8px);
|
||||
border-color: var(--active-color);
|
||||
box-shadow: 0 15px 30px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.nexus-image-container {
|
||||
position: relative;
|
||||
aspect-ratio: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nexus-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.nexus-card:hover .nexus-img {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.nexus-overlay-gradient {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, transparent 60%);
|
||||
}
|
||||
|
||||
.nexus-badge {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 12px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: var(--active-bg);
|
||||
backdrop-filter: blur(8px);
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--active-color);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.nexus-fav {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
}
|
||||
|
||||
.nexus-card-details {
|
||||
padding: 16px;
|
||||
background: var(--card-bg);
|
||||
}
|
||||
|
||||
.nexus-biz-name {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 800;
|
||||
color: var(--text-primary);
|
||||
line-height: 1.2;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nexus-biz-meta {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.area {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.area .material-icons {
|
||||
font-size: 14px;
|
||||
color: var(--active-color);
|
||||
}
|
||||
|
||||
/* Loading & Empty States */
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100px 0;
|
||||
}
|
||||
|
||||
.nexus-loader {
|
||||
position: relative;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.nexus-dot {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background: var(--active-color);
|
||||
border-radius: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
box-shadow: 0 0 20px var(--active-color);
|
||||
}
|
||||
|
||||
.nexus-ring {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border: 4px solid var(--active-bg);
|
||||
border-top-color: var(--active-color);
|
||||
border-radius: 50%;
|
||||
animation: spin 1s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
margin-top: 24px;
|
||||
font-weight: 700;
|
||||
color: var(--text-secondary);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.empty-nexus {
|
||||
padding: 60px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-nexus-box {
|
||||
background: var(--card-bg);
|
||||
border-radius: 30px;
|
||||
padding: 40px;
|
||||
border: 1px dashed var(--border-color);
|
||||
}
|
||||
|
||||
.empty-nexus-box .material-icons {
|
||||
font-size: 48px;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.reboot-btn {
|
||||
margin-top: 24px;
|
||||
background: var(--active-color);
|
||||
color: #101820;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 12px;
|
||||
font-weight: 800;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
.stagger-list-enter-active {
|
||||
transition: all 0.5s ease;
|
||||
transition-delay: calc(0.1s * var(--order));
|
||||
}
|
||||
|
||||
.stagger-list-enter-from {
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
transform: translateY(20px);
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.header-glass-card {
|
||||
padding: 16px;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.header-icon-box {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.header-text-box h1 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
.fade-leave-active {
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,28 +1,45 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRouteStore } from '@/stores/route'
|
||||
import { useTaxiStore } from '@/stores/taxi'
|
||||
import { analyticsService } from '@/services/analyticsService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
const routeStore = useRouteStore()
|
||||
const taxiStore = useTaxiStore()
|
||||
|
||||
const activeTab = ref<'routes' | 'taxis'>('routes')
|
||||
const originSearch = ref('')
|
||||
const destinationSearch = ref('')
|
||||
const selectedCorregimiento = ref('')
|
||||
const englishOnly = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'Routes' })
|
||||
await routeStore.loadRoutes()
|
||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'Transport' })
|
||||
await Promise.all([
|
||||
routeStore.loadRoutes(),
|
||||
taxiStore.loadTaxis()
|
||||
])
|
||||
})
|
||||
|
||||
const handleSearch = async () => {
|
||||
const handleBusSearch = async () => {
|
||||
await routeStore.loadRoutes({
|
||||
originCity: originSearch.value,
|
||||
destinationCity: destinationSearch.value
|
||||
})
|
||||
}
|
||||
|
||||
const handleTaxiFilter = async () => {
|
||||
await taxiStore.loadTaxis({
|
||||
corregimiento: selectedCorregimiento.value || undefined,
|
||||
english_speaking: englishOnly.value || undefined
|
||||
})
|
||||
}
|
||||
|
||||
const goToSchedules = (route: any) => {
|
||||
analyticsService.logEvent({
|
||||
event_name: 'route_selected',
|
||||
@ -30,259 +47,239 @@ const goToSchedules = (route: any) => {
|
||||
properties: { route_id: route.id }
|
||||
})
|
||||
routeStore.selectRoute(route.id, route.name)
|
||||
router.push('/schedules')
|
||||
router.push({ path: '/schedules', query: { routeId: route.id } })
|
||||
}
|
||||
|
||||
const callTaxi = (phoneNumber: string) => {
|
||||
window.open(`tel:${phoneNumber}`)
|
||||
}
|
||||
|
||||
const correlimientos = computed(() => {
|
||||
const set = new Set(taxiStore.taxis.map(t => t.corregimiento).filter(Boolean))
|
||||
return Array.from(set).sort()
|
||||
})
|
||||
|
||||
const getStatusClass = (status: string) => {
|
||||
if (status === 'active') return 'bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-400'
|
||||
return 'bg-slate-100 dark:bg-zinc-800 text-slate-500 dark:text-zinc-400'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="routes-view">
|
||||
<div class="header">
|
||||
<h1>Búsqueda de Rutas</h1>
|
||||
<p>Encuentra tu próximo viaje fácilmente</p>
|
||||
</div>
|
||||
|
||||
<div class="search-box">
|
||||
<div class="input-group">
|
||||
<span class="material-icons">location_on</span>
|
||||
<input
|
||||
v-model="originSearch"
|
||||
placeholder="Origen (Ciudad)"
|
||||
@keyup.enter="handleSearch"
|
||||
>
|
||||
</div>
|
||||
<div class="divider">
|
||||
<span class="material-icons">swap_vert</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="material-icons">flag</span>
|
||||
<input
|
||||
v-model="destinationSearch"
|
||||
placeholder="Destino (Ciudad)"
|
||||
@keyup.enter="handleSearch"
|
||||
>
|
||||
</div>
|
||||
<button @click="handleSearch" class="search-btn">
|
||||
<span class="material-icons">search</span>
|
||||
Buscar Rutas
|
||||
<div class="transport-view bg-white dark:bg-background-dark min-h-screen text-slate-900 dark:text-white pb-32">
|
||||
<!-- Header -->
|
||||
<div class="px-6 pt-12 pb-4 flex items-center justify-between sticky top-0 z-50 bg-white/80 dark:bg-background-dark/80 backdrop-blur-md">
|
||||
<button @click="router.back()" class="size-10 flex items-center justify-center rounded-full bg-slate-100 dark:bg-card-dark text-slate-600 dark:text-gray-300 active:scale-95 transition-transform">
|
||||
<span class="material-icons text-[20px]">arrow_back</span>
|
||||
</button>
|
||||
<h1 class="text-xl font-extrabold tracking-tight text-primary uppercase italic">SIBU</h1>
|
||||
<div class="size-10"></div>
|
||||
</div>
|
||||
|
||||
<div v-if="routeStore.isLoadingRoutes" class="loading">
|
||||
<div class="spinner"></div>
|
||||
<p>Buscando mejores rutas...</p>
|
||||
</div>
|
||||
<div class="px-6 py-2 space-y-6">
|
||||
<!-- Tabs Selector -->
|
||||
<div class="bg-slate-50 dark:bg-card-dark rounded-[2.5rem] p-1.5 flex shadow-inner border border-slate-200 dark:border-white/5">
|
||||
<button
|
||||
@click="activeTab = 'routes'"
|
||||
class="flex-1 py-3 px-4 rounded-[2rem] flex items-center justify-center gap-2 text-sm font-bold transition-all"
|
||||
:class="activeTab === 'routes' ? 'bg-primary shadow-lg text-slate-900' : 'bg-transparent text-slate-500 dark:text-gray-500'"
|
||||
>
|
||||
<span class="material-icons text-lg">directions_bus</span>
|
||||
Rutas de Bus
|
||||
</button>
|
||||
<button
|
||||
@click="activeTab = 'taxis'"
|
||||
class="flex-1 py-3 px-4 rounded-[2rem] flex items-center justify-center gap-2 text-sm font-bold transition-all"
|
||||
:class="activeTab === 'taxis' ? 'bg-primary shadow-lg text-slate-900' : 'bg-transparent text-slate-500 dark:text-gray-500'"
|
||||
>
|
||||
<span class="material-icons text-lg">local_taxi</span>
|
||||
Taxis Locales
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-else-if="routeStore.allRoutes.length === 0" class="no-results">
|
||||
<span class="material-icons">sentiment_dissatisfied</span>
|
||||
<p>No encontramos rutas que coincidan con tu búsqueda.</p>
|
||||
<button @click="originSearch = ''; destinationSearch = ''; handleSearch()" class="reset-btn">Ver todas las rutas</button>
|
||||
</div>
|
||||
|
||||
<div v-else class="routes-list">
|
||||
<div
|
||||
v-for="route in routeStore.allRoutes"
|
||||
:key="route.id"
|
||||
class="route-card"
|
||||
@click="goToSchedules(route)"
|
||||
>
|
||||
<div class="route-header">
|
||||
<div class="route-name">
|
||||
<span class="dot" :style="{ backgroundColor: route.color || '#fee715' }"></span>
|
||||
<h3>{{ route.name }}</h3>
|
||||
<!-- Search Panel -->
|
||||
<div class="bg-slate-50 dark:bg-card-dark rounded-[2.5rem] p-6 shadow-xl border border-slate-200 dark:border-white/10">
|
||||
<div v-if="activeTab === 'routes'" class="space-y-4">
|
||||
<div class="relative group">
|
||||
<div class="flex items-center gap-3 px-4 h-14 rounded-2xl border border-slate-200 dark:border-white/10 bg-white dark:bg-input-dark">
|
||||
<span class="material-icons text-primary font-bold">location_on</span>
|
||||
<input
|
||||
v-model="originSearch"
|
||||
@keyup.enter="handleBusSearch"
|
||||
class="bg-transparent border-none focus:ring-0 text-sm font-semibold w-full placeholder:text-slate-400 dark:placeholder:text-gray-500"
|
||||
placeholder="Ciudad de Origen"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="route-actions">
|
||||
<FavoriteButton
|
||||
item-type="route"
|
||||
:item-id="route.id"
|
||||
:item-name="route.name"
|
||||
/>
|
||||
<span class="material-icons chevron">chevron_right</span>
|
||||
<div class="relative group">
|
||||
<div class="flex items-center gap-3 px-4 h-14 rounded-2xl border border-slate-200 dark:border-white/10 bg-white dark:bg-input-dark">
|
||||
<span class="material-icons text-primary font-bold">flag</span>
|
||||
<input
|
||||
v-model="destinationSearch"
|
||||
@keyup.enter="handleBusSearch"
|
||||
class="bg-transparent border-none focus:ring-0 text-sm font-semibold w-full placeholder:text-slate-400 dark:placeholder:text-gray-500"
|
||||
placeholder="Ciudad de Destino"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<button @click="handleBusSearch" class="w-full bg-primary py-4 rounded-2xl text-slate-900 font-bold uppercase tracking-widest text-xs shadow-lg active:scale-95 transition-all">
|
||||
Buscar Rutas
|
||||
</button>
|
||||
</div>
|
||||
<div class="route-details">
|
||||
<div class="city-flow">
|
||||
<span>{{ route.origin_city }}</span>
|
||||
<span class="material-icons">arrow_forward</span>
|
||||
<span>{{ route.destination_city }}</span>
|
||||
|
||||
<div v-else class="flex gap-4">
|
||||
<div class="flex-1 space-y-4">
|
||||
<div class="relative">
|
||||
<div class="flex items-center gap-3 px-4 h-14 rounded-2xl border border-slate-200 dark:border-white/10 bg-white dark:bg-input-dark">
|
||||
<span class="material-icons text-primary font-bold">near_me</span>
|
||||
<select
|
||||
v-model="selectedCorregimiento"
|
||||
@change="handleTaxiFilter"
|
||||
class="bg-transparent border-none focus:ring-0 text-sm font-semibold w-full dark:text-gray-200 appearance-none cursor-pointer"
|
||||
>
|
||||
<option value="">Todos los corregimientos</option>
|
||||
<option v-for="c in correlimientos" :key="c" :value="c">{{ c }}</option>
|
||||
</select>
|
||||
<span class="material-icons ml-auto text-gray-500 text-sm">unfold_more</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center px-2">
|
||||
<span class="text-[10px] font-black text-slate-400 dark:text-gray-400 mb-2 uppercase">Inglés</span>
|
||||
<div
|
||||
@click="englishOnly = !englishOnly; handleTaxiFilter()"
|
||||
class="size-10 rounded-lg border-2 border-primary flex items-center justify-center bg-transparent cursor-pointer transition-colors"
|
||||
:class="englishOnly ? 'bg-primary' : ''"
|
||||
>
|
||||
<span class="material-icons text-slate-900" v-if="englishOnly">check</span>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="route.distance_km" class="meta">
|
||||
{{ route.distance_km }} km • {{ route.estimated_duration_minutes }} min aprox.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Results Area -->
|
||||
<div class="flex-1 px-6 pt-8 space-y-4 pb-32">
|
||||
<h2 class="text-[11px] font-black text-slate-400 dark:text-gray-500 uppercase tracking-[0.15em] mb-4">
|
||||
{{ activeTab === 'routes' ? 'Rutas Disponibles' : 'Conductores Recomendados' }}
|
||||
</h2>
|
||||
|
||||
<!-- Loading Results -->
|
||||
<div v-if="routeStore.isLoadingRoutes || taxiStore.isLoading" class="flex justify-center py-10">
|
||||
<div class="w-10 h-10 border-4 border-primary/20 border-t-primary rounded-full animate-spin"></div>
|
||||
</div>
|
||||
|
||||
<!-- Bus Routes List -->
|
||||
<template v-else-if="activeTab === 'routes'">
|
||||
<div
|
||||
v-for="route in routeStore.allRoutes"
|
||||
:key="route.id"
|
||||
class="bg-slate-50 dark:bg-card-dark p-5 rounded-[2rem] shadow-sm border border-slate-200 dark:border-white/5 flex flex-col gap-4 active:scale-[0.98] transition-all cursor-pointer"
|
||||
@click="goToSchedules(route)"
|
||||
>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary">
|
||||
<span class="material-icons text-[32px]">directions_bus</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center gap-2">
|
||||
<p class="font-extrabold text-xl">{{ route.name }}</p>
|
||||
<span class="px-2 py-0.5 rounded-full bg-primary text-[9px] font-black uppercase tracking-wider text-slate-900">ACTIVA</span>
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-500 dark:text-gray-400 font-bold uppercase tracking-tight">
|
||||
{{ route.origin_city }} → {{ route.destination_city }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<FavoriteButton
|
||||
item-type="route"
|
||||
:item-id="route.id"
|
||||
:item-name="route.name"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 bg-white dark:bg-input-dark px-3 py-2 rounded-xl border border-slate-200 dark:border-white/5">
|
||||
<span class="text-[10px] font-black dark:text-gray-200">{{ route.estimated_duration_minutes }} min • {{ route.distance_km }} km</span>
|
||||
</div>
|
||||
<button class="bg-primary px-8 py-3 rounded-2xl text-xs font-black uppercase tracking-widest shadow-sm hover:brightness-110 text-slate-900 transition-all">
|
||||
Ver Horarios
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="routeStore.allRoutes.length === 0" class="text-center py-10 opacity-50 italic">
|
||||
No se encontraron rutas para tu búsqueda.
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Taxis List -->
|
||||
<template v-else>
|
||||
<div
|
||||
v-for="taxi in taxiStore.taxis"
|
||||
:key="taxi.id"
|
||||
class="bg-slate-50 dark:bg-card-dark p-5 rounded-[2rem] shadow-sm border border-slate-200 dark:border-white/5 flex flex-col gap-4 active:scale-[0.98] transition-all"
|
||||
>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary overflow-hidden">
|
||||
<img v-if="taxi.image_url" :src="taxi.image_url" class="w-full h-full object-cover">
|
||||
<span v-else class="material-icons text-[32px]">local_taxi</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center gap-2">
|
||||
<p class="font-extrabold text-xl">{{ taxi.owner_name }}</p>
|
||||
<span class="px-2 py-0.5 rounded-full bg-primary text-[9px] font-black uppercase tracking-wider text-slate-900">PRO</span>
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-500 dark:text-gray-400 font-bold uppercase tracking-tight">
|
||||
{{ taxi.corregimiento }} • {{ taxi.license_plate }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p class="font-black text-xl text-primary">{{ taxi.shift }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 bg-white dark:bg-input-dark px-3 py-2 rounded-xl border border-slate-200 dark:border-white/5">
|
||||
<span class="text-[10px] font-black dark:text-gray-200">{{ taxi.rating || 5.0 }} ★</span>
|
||||
<span v-if="taxi.english_speaking" class="text-[10px] font-black text-blue-500 uppercase">EN</span>
|
||||
</div>
|
||||
<button
|
||||
@click="callTaxi(taxi.phone_number)"
|
||||
class="bg-primary px-8 py-3 rounded-2xl text-xs font-black uppercase tracking-widest shadow-sm hover:brightness-110 text-slate-900 transition-all"
|
||||
>
|
||||
Contactar
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="taxiStore.taxis.length === 0" class="text-center py-10 opacity-50 italic">
|
||||
No hay taxis disponibles en esta zona.
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.routes-view {
|
||||
padding: 24px;
|
||||
background: var(--bg-primary);
|
||||
min-height: 100vh;
|
||||
.transport-view {
|
||||
font-family: 'Plus Jakarta Sans', sans-serif;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 32px;
|
||||
.bg-background-dark {
|
||||
background-color: #0F1115;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 28px;
|
||||
font-weight: 800;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 4px;
|
||||
.bg-card-dark {
|
||||
background-color: #1C1F26;
|
||||
}
|
||||
|
||||
.header p {
|
||||
color: var(--text-secondary);
|
||||
font-size: 16px;
|
||||
.bg-input-dark {
|
||||
background-color: #252932;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
background: var(--card-bg);
|
||||
border-radius: 24px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 10px 30px var(--shadow);
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
background: var(--bg-secondary);
|
||||
padding: 12px 20px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.input-group input {
|
||||
border: none;
|
||||
background: transparent;
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
select {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.divider {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 8px 0;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
background: var(--header-bg);
|
||||
color: var(--header-text);
|
||||
border: none;
|
||||
padding: 16px;
|
||||
border-radius: 16px;
|
||||
font-weight: 800;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.search-btn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.routes-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.route-card {
|
||||
background: var(--card-bg);
|
||||
border-radius: 20px;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 4px 15px var(--shadow);
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.route-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 10px 25px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.route-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.route-name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.route-name h3 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.city-flow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.route-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.chevron {
|
||||
color: #ced4da;
|
||||
}
|
||||
|
||||
.loading, .no-results {
|
||||
text-align: center;
|
||||
padding: 60px 20px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid #f3f3f3;
|
||||
border-top: 4px solid #fee715;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 0 auto 16px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
margin-top: 16px;
|
||||
background: transparent;
|
||||
border: 1px solid #dee2e6;
|
||||
padding: 8px 16px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -5,7 +5,6 @@ import { useScheduleStore } from '@/stores/schedule'
|
||||
import { useRouteStore } from '@/stores/route'
|
||||
import { formatTo12Hour } from '@/utils/timeFormatter'
|
||||
import { analyticsService } from '@/services/analyticsService'
|
||||
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
|
||||
const { t } = useI18n()
|
||||
@ -15,27 +14,14 @@ const router = useRouter()
|
||||
const scheduleStore = useScheduleStore()
|
||||
const routeStore = useRouteStore()
|
||||
|
||||
const showRouteDropdown = ref(false)
|
||||
const routeCardRef = ref<HTMLElement | null>(null)
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
function handleClickOutside(event: MouseEvent) {
|
||||
if (routeCardRef.value && !routeCardRef.value.contains(event.target as Node)) {
|
||||
showRouteDropdown.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'Schedules' })
|
||||
document.addEventListener('click', handleClickOutside)
|
||||
await routeStore.loadRoutes()
|
||||
|
||||
// Point 1: Smart synchronization from MapView
|
||||
const queryRouteId = route.query.routeId as string
|
||||
if (queryRouteId) {
|
||||
const foundRoute = routeStore.allRoutes.find(r => r.id === queryRouteId)
|
||||
if (foundRoute) {
|
||||
// FIX: Use sync function to avoid redirect loop back to map
|
||||
syncRouteSelection(foundRoute.id, foundRoute.name)
|
||||
}
|
||||
}
|
||||
@ -54,14 +40,12 @@ const unwatchQuery = watch(
|
||||
)
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('click', handleClickOutside)
|
||||
unwatchQuery()
|
||||
})
|
||||
|
||||
function syncRouteSelection(routeId: string, routeName: string) {
|
||||
routeStore.selectRoute(routeId, routeName)
|
||||
scheduleStore.loadRouteSchedules(routeId)
|
||||
showRouteDropdown.value = false
|
||||
}
|
||||
|
||||
function selectRouteAndClose(routeId: string, routeName: string) {
|
||||
@ -73,7 +57,6 @@ function selectRouteAndClose(routeId: string, routeName: string) {
|
||||
|
||||
routeStore.selectRoute(routeId, routeName)
|
||||
scheduleStore.loadRouteSchedules(routeId)
|
||||
showRouteDropdown.value = false
|
||||
}
|
||||
|
||||
function goToMap() {
|
||||
@ -84,457 +67,148 @@ function goToMap() {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function clearRouteAndClose() {
|
||||
routeStore.clearSelection()
|
||||
scheduleStore.schedules = []
|
||||
showRouteDropdown.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="schedules-view">
|
||||
<h1>{{ t('schedules.title') }}</h1>
|
||||
|
||||
<div v-if="routeStore.isLoadingRoutes">
|
||||
<p>{{ t('schedules.loadingRoutes') }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="routeStore.allRoutes.length === 0">
|
||||
<p>{{ t('schedules.noRoutesAvailable') }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<!-- Quick Select Route Buttons (Nexus Style) -->
|
||||
<div class="quick-routes-container">
|
||||
<div
|
||||
v-for="route in routeStore.allRoutes"
|
||||
:key="route.id"
|
||||
class="route-chip-nexus"
|
||||
:class="{ 'active': route.id === routeStore.selectedRouteId }"
|
||||
@click="selectRouteAndClose(route.id, route.name)"
|
||||
>
|
||||
<span class="material-icons chip-icon">directions_bus</span>
|
||||
<span class="chip-text">{{ route.name }}</span>
|
||||
<div v-if="route.id === routeStore.selectedRouteId" class="active-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Route selector card (As backup/dropdown) -->
|
||||
<div class="route-card" ref="routeCardRef">
|
||||
<div class="route-card-content" @click.stop="showRouteDropdown = !showRouteDropdown">
|
||||
<span class="material-icons route-icon">search</span>
|
||||
<div class="route-info">
|
||||
<div v-if="routeStore.selectedRouteId && routeStore.selectedRouteName" class="route-name">
|
||||
{{ routeStore.selectedRouteName }}
|
||||
</div>
|
||||
<div v-else class="route-name">Buscar otra ruta...</div>
|
||||
</div>
|
||||
<span class="material-icons arrow-icon" :class="{ 'rotated': showRouteDropdown }">
|
||||
keyboard_arrow_down
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Dropdown menu -->
|
||||
<div v-if="showRouteDropdown" class="route-dropdown" @click.stop>
|
||||
<div
|
||||
v-for="route in routeStore.allRoutes"
|
||||
:key="route.id"
|
||||
class="route-option"
|
||||
:class="{ 'selected': route.id === routeStore.selectedRouteId }"
|
||||
@click="selectRouteAndClose(route.id, route.name)"
|
||||
>
|
||||
{{ route.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="schedules-view-redesign bg-slate-50 dark:bg-zinc-950 text-slate-900 dark:text-slate-100 min-h-screen">
|
||||
<!-- Header Sticky con Blur -->
|
||||
<header class="sticky top-0 z-50 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-md px-6 pt-10 pb-4 border-b border-slate-200 dark:border-zinc-800">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<button @click="router.back()" class="w-10 h-10 flex items-center justify-center -ml-2 rounded-full active:bg-slate-100 dark:active:bg-zinc-800 transition-colors">
|
||||
<span class="material-icons text-2xl">arrow_back</span>
|
||||
</button>
|
||||
<h1 class="text-xl font-bold tracking-tight">{{ t('schedules.title') }}</h1>
|
||||
<div class="w-10"></div>
|
||||
</div>
|
||||
|
||||
<div v-if="routeStore.selectedRouteId" class="schedules-content">
|
||||
<div class="schedules-header">
|
||||
<h2 v-if="routeStore.selectedRouteName">{{ routeStore.selectedRouteName }}</h2>
|
||||
<button class="view-route-btn" @click="goToMap">
|
||||
<span class="material-icons">map</span>
|
||||
Ver ruta
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="scheduleStore.isLoading" class="schedules-loading">
|
||||
<span class="material-icons spin">refresh</span>
|
||||
<p>Cargando horarios...</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="scheduleStore.error" class="schedules-error">
|
||||
<p>{{ scheduleStore.error }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="scheduleStore.schedules.length > 0">
|
||||
<ul class="schedule-list">
|
||||
<li v-for="schedule in scheduleStore.schedules" :key="schedule.id" class="schedule-item">
|
||||
<div class="schedule-item-info">
|
||||
<span class="material-icons">schedule</span>
|
||||
<span class="departure-time">{{ formatTo12Hour(schedule.departure_time) }}</span>
|
||||
</div>
|
||||
<span class="schedule-type">{{ schedule.schedule_type }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else class="schedules-empty">
|
||||
<span class="material-icons">event_busy</span>
|
||||
<p>No hay horarios disponibles para esta ruta.</p>
|
||||
<!-- Selector de Línea -->
|
||||
<div class="relative group" v-if="!routeStore.isLoadingRoutes && routeStore.allRoutes.length > 0">
|
||||
<label class="block text-[10px] font-bold text-slate-400 dark:text-zinc-500 uppercase tracking-widest mb-1.5 ml-1">{{ t('schedules.selectRoute') || 'Seleccionar Línea' }}</label>
|
||||
<div class="relative">
|
||||
<select
|
||||
class="w-full pl-4 pr-12 py-4 bg-slate-50 dark:bg-zinc-800 border-2 border-transparent focus:border-primary focus:ring-0 rounded-2xl text-lg font-bold transition-all cursor-pointer appearance-none"
|
||||
id="route-select"
|
||||
:value="routeStore.selectedRouteId"
|
||||
@change="e => {
|
||||
const target = e.target as HTMLSelectElement;
|
||||
if (target) {
|
||||
const selectedRoute = routeStore.allRoutes.find(r => r.id === target.value);
|
||||
if (selectedRoute) selectRouteAndClose(target.value, selectedRoute.name);
|
||||
}
|
||||
}"
|
||||
>
|
||||
<option value="" disabled>{{ t('schedules.placeholder') || 'Elige una ruta...' }}</option>
|
||||
<option v-for="route in routeStore.allRoutes" :key="route.id" :value="route.id">
|
||||
{{ route.name }}
|
||||
</option>
|
||||
</select>
|
||||
<span class="material-icons absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none">expand_more</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="flex-1 px-6 pt-6 pb-32">
|
||||
<div v-if="routeStore.isLoadingRoutes" class="flex flex-col items-center justify-center py-20">
|
||||
<div class="w-12 h-12 border-4 border-primary/20 border-t-primary rounded-full animate-spin mb-4"></div>
|
||||
<p class="text-slate-500 dark:text-zinc-400 font-medium">{{ t('schedules.loadingRoutes') }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="!routeStore.selectedRouteId" class="flex flex-col items-center justify-center py-20 text-center">
|
||||
<span class="material-icons text-6xl text-slate-200 dark:text-zinc-800 mb-4">route</span>
|
||||
<p class="text-slate-500 dark:text-zinc-400 font-medium italic">Selecciona una ruta para ver sus horarios</p>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<!-- Estado Próximas Salidas -->
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h2 class="text-sm font-semibold text-slate-500 dark:text-zinc-400">{{ t('schedules.upcoming') || 'Próximas salidas' }}</h2>
|
||||
<div class="flex items-center gap-1.5 px-2.5 py-1 bg-[#fee715]/10 rounded-full">
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-[#fee715] animate-pulse"></span>
|
||||
<span class="text-[10px] font-bold text-slate-700 dark:text-[#fee715] tracking-wide">EN VIVO</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Listado de Horarios -->
|
||||
<div v-if="scheduleStore.isLoading" class="flex justify-center py-10">
|
||||
<div class="w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin"></div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="scheduleStore.schedules.length === 0" class="bg-white dark:bg-zinc-800/50 p-8 rounded-2xl border border-slate-100 dark:border-zinc-800 text-center">
|
||||
<span class="material-icons text-slate-300 dark:text-zinc-700 text-4xl mb-2">event_busy</span>
|
||||
<p class="text-slate-500 dark:text-zinc-400">{{ t('schedules.noSchedules') || 'No hay salidas programadas para hoy' }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="space-y-4">
|
||||
<div
|
||||
v-for="schedule in scheduleStore.schedules"
|
||||
:key="schedule.id"
|
||||
class="p-4 bg-white dark:bg-zinc-800/50 border border-slate-100 dark:border-zinc-800 rounded-2xl flex items-center justify-between hover:border-primary/50 transition-all shadow-sm"
|
||||
>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="text-3xl font-extrabold tracking-tighter text-slate-900 dark:text-white">
|
||||
{{ formatTo12Hour(schedule.departure_time) }}
|
||||
</div>
|
||||
<div class="h-8 w-px bg-slate-200 dark:bg-zinc-700"></div>
|
||||
<div>
|
||||
<p class="text-[10px] font-medium text-slate-400 dark:text-zinc-500 uppercase tracking-wider">Línea</p>
|
||||
<p class="font-bold text-slate-900 dark:text-white leading-tight">
|
||||
{{ routeStore.selectedRouteName }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="px-3 py-1 text-[10px] font-bold uppercase tracking-wider rounded-full"
|
||||
:class="schedule.schedule_type === 'weekday' ? 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400' : 'bg-slate-100 dark:bg-zinc-700 text-slate-500 dark:text-zinc-400'"
|
||||
>
|
||||
{{ t(`schedules.types.${schedule.schedule_type}`) || schedule.schedule_type }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</main>
|
||||
|
||||
<!-- Botón Flotante para ir al Mapa -->
|
||||
<Transition name="fade">
|
||||
<button
|
||||
v-if="routeStore.selectedRouteId"
|
||||
@click="goToMap"
|
||||
class="fixed bottom-24 right-6 w-14 h-14 bg-primary text-slate-900 rounded-full shadow-2xl flex items-center justify-center active:scale-95 transition-all z-40"
|
||||
>
|
||||
<span class="material-icons text-3xl">map</span>
|
||||
</button>
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.schedules-view {
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
padding: 1.5rem 1rem 150px;
|
||||
color: var(--text-primary);
|
||||
.schedules-view-redesign {
|
||||
font-family: 'Plus Jakarta Sans', sans-serif;
|
||||
overflow-x: hidden;
|
||||
background: var(--bg-primary) !important;
|
||||
}
|
||||
|
||||
|
||||
/* Asegurar que el contenido flote sobre el fondo */
|
||||
.schedules-view > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
select {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 1rem center;
|
||||
background-size: 1.25rem;
|
||||
}
|
||||
|
||||
.schedules-view h1 {
|
||||
font-size: 2.2rem;
|
||||
font-weight: 800;
|
||||
text-shadow: 0 2px 10px rgba(0,0,0,0.3);
|
||||
margin-bottom: 2rem;
|
||||
text-align: center;
|
||||
.fade-enter-active, .fade-leave-active {
|
||||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||||
}
|
||||
|
||||
.quick-routes-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 24px;
|
||||
max-width: 800px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
.fade-enter-from, .fade-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
|
||||
.route-chip-nexus {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid var(--border-color);
|
||||
padding: 12px 20px;
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* Transiciones para la lista */
|
||||
.space-y-4 > * {
|
||||
animation: slideUp 0.4s ease-out forwards;
|
||||
}
|
||||
|
||||
.route-chip-nexus:hover {
|
||||
background: rgba(254, 231, 21, 0.1);
|
||||
border-color: var(--active-color);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.route-chip-nexus.active {
|
||||
background: var(--active-color);
|
||||
border-color: var(--active-color);
|
||||
color: #101820;
|
||||
box-shadow: 0 8px 20px rgba(254, 231, 21, 0.3);
|
||||
}
|
||||
|
||||
.chip-icon {
|
||||
font-size: 20px;
|
||||
color: var(--active-color);
|
||||
}
|
||||
|
||||
.route-chip-nexus.active .chip-icon {
|
||||
color: #101820;
|
||||
}
|
||||
|
||||
.chip-text {
|
||||
font-weight: 800;
|
||||
font-size: 0.9rem;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.active-dot {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background: #101820;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.route-card {
|
||||
margin-bottom: 2rem;
|
||||
max-width: 400px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.route-card-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 18px;
|
||||
background: var(--card-bg);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 16px;
|
||||
box-shadow: var(--shadow);
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.route-card-content:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 12px 30px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.route-card-content:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.route-icon {
|
||||
color: var(--active-color);
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.route-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.route-name {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.route-stops {
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
color: var(--text-secondary);
|
||||
font-size: 24px;
|
||||
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.arrow-icon.rotated {
|
||||
transform: rotate(180deg);
|
||||
color: var(--active-color);
|
||||
}
|
||||
|
||||
.route-dropdown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-top: 10px;
|
||||
background: var(--card-bg);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 16px;
|
||||
box-shadow: var(--shadow);
|
||||
max-height: 250px;
|
||||
overflow-y: auto;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.route-option {
|
||||
padding: 14px 20px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
color: var(--text-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.route-option:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.route-option:hover {
|
||||
background-color: var(--hover-bg);
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
.route-option.selected {
|
||||
background-color: var(--active-bg);
|
||||
color: var(--active-color);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.route-option.clear-option {
|
||||
color: #ef4444; /* Rojo para limpiar */
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.schedules-content {
|
||||
margin-top: 1.5rem;
|
||||
background: var(--card-bg);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
padding: 24px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 24px;
|
||||
box-shadow: var(--shadow);
|
||||
max-width: 800px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.schedules-content h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 1.5rem;
|
||||
color: var(--active-color);
|
||||
font-size: 1.5rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.schedules-loading, .schedules-empty, .schedules-error {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.spin {
|
||||
animation: spin 1s linear infinite;
|
||||
font-size: 3rem;
|
||||
color: var(--active-color);
|
||||
margin-bottom: 16px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.schedule-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.schedule-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16px 20px;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--border-color);
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.schedule-item:hover {
|
||||
transform: translateY(-3px) scale(1.02);
|
||||
border-color: var(--active-color);
|
||||
box-shadow: 0 8px 20px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.schedule-item-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.schedule-item .material-icons {
|
||||
color: var(--active-color);
|
||||
}
|
||||
|
||||
.departure-time {
|
||||
font-size: 1.3rem;
|
||||
font-weight: 800;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.5px;
|
||||
}
|
||||
|
||||
.schedule-type {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
padding: 5px 10px;
|
||||
background: var(--active-bg);
|
||||
color: var(--active-color);
|
||||
border-radius: 8px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.schedules-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 2rem;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.schedules-header h2 {
|
||||
margin-bottom: 0 !important;
|
||||
text-align: left !important;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.view-route-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 24px;
|
||||
background: #FEE715;
|
||||
color: #101820;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.view-route-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
|
||||
.view-route-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.schedules-header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
.schedules-header h2 {
|
||||
text-align: center !important;
|
||||
}
|
||||
.view-route-btn {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
@keyframes slideUp {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user