Agregar búsqueda de aplicaciones y fix línea blanca
- Campo de búsqueda con glassmorphism - Filtrar por nombre, URL y descripción - Icono de lupa y botón para limpiar búsqueda - Persistencia en cookie (1 semana) - Estilos completos para modo día y noche - Eliminar border-bottom blanco de barra de título - Agregar box-shadow: none a barra de título
This commit is contained in:
@@ -72,8 +72,11 @@ onMounted(() => {
|
||||
transition: all 0.3s ease;
|
||||
/* Bloquear interacción con elementos debajo */
|
||||
pointer-events: auto;
|
||||
/* Eliminar cualquier margen o gap */
|
||||
/* Eliminar cualquier margen, gap o border */
|
||||
margin: 0;
|
||||
border: none;
|
||||
border-bottom: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.titlebar-content {
|
||||
|
||||
@@ -11,6 +11,27 @@
|
||||
</UBadge>
|
||||
</div>
|
||||
|
||||
<!-- Campo de búsqueda -->
|
||||
<div class="search-section">
|
||||
<div class="search-input-wrapper">
|
||||
<UIcon name="i-heroicons-magnifying-glass" class="search-icon" />
|
||||
<input
|
||||
v-model="searchQuery"
|
||||
type="text"
|
||||
placeholder="Buscar aplicaciones..."
|
||||
class="search-input"
|
||||
/>
|
||||
<button
|
||||
v-if="searchQuery"
|
||||
@click="searchQuery = ''"
|
||||
class="search-clear"
|
||||
title="Limpiar búsqueda"
|
||||
>
|
||||
<UIcon name="i-heroicons-x-mark" class="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filtros por grupos -->
|
||||
<div v-if="availableGroups.length > 0" class="filter-section">
|
||||
<button
|
||||
@@ -127,9 +148,19 @@ const filtersCookie = useCookie<string[]>('app-filters', {
|
||||
default: () => []
|
||||
})
|
||||
|
||||
// Cookie para persistir búsqueda
|
||||
const searchCookie = useCookie<string>('app-search', {
|
||||
maxAge: 60 * 60 * 24 * 7, // 1 semana
|
||||
sameSite: 'lax',
|
||||
default: () => ''
|
||||
})
|
||||
|
||||
// Estado de filtros (inicializado desde cookie)
|
||||
const selectedGroups = ref<string[]>(filtersCookie.value || [])
|
||||
|
||||
// Estado de búsqueda (inicializado desde cookie)
|
||||
const searchQuery = ref<string>(searchCookie.value || '')
|
||||
|
||||
// Estado para iconos fallidos (para no intentar cargarlos de nuevo)
|
||||
const failedIcons = ref<Set<string>>(new Set())
|
||||
|
||||
@@ -202,21 +233,37 @@ const availableGroups = computed(() => {
|
||||
return Array.from(groups).sort()
|
||||
})
|
||||
|
||||
// Filtrar aplicaciones según grupos seleccionados
|
||||
// Filtrar aplicaciones según grupos seleccionados y búsqueda
|
||||
const filteredApplications = computed(() => {
|
||||
// Si no hay grupos seleccionados, mostrar todas
|
||||
if (selectedGroups.value.length === 0) {
|
||||
return applications.value
|
||||
}
|
||||
let filtered = applications.value
|
||||
|
||||
// Filtrar apps que contengan al menos uno de los grupos seleccionados
|
||||
return applications.value.filter(app => {
|
||||
// Filtrar por grupos si hay grupos seleccionados
|
||||
if (selectedGroups.value.length > 0) {
|
||||
filtered = filtered.filter(app => {
|
||||
if (!app.group) return false
|
||||
const appGroups = app.group.split(',').map(g => g.trim())
|
||||
return selectedGroups.value.some(selectedGroup =>
|
||||
appGroups.includes(selectedGroup)
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// Filtrar por búsqueda si hay término de búsqueda
|
||||
if (searchQuery.value.trim()) {
|
||||
const search = searchQuery.value.toLowerCase().trim()
|
||||
filtered = filtered.filter(app => {
|
||||
// Buscar en nombre
|
||||
const nameMatch = app.name.toLowerCase().includes(search)
|
||||
// Buscar en URL
|
||||
const urlMatch = app.launchUrl.toLowerCase().includes(search)
|
||||
// Buscar en descripción
|
||||
const descriptionMatch = app.description?.toLowerCase().includes(search) || false
|
||||
|
||||
return nameMatch || urlMatch || descriptionMatch
|
||||
})
|
||||
}
|
||||
|
||||
return filtered
|
||||
})
|
||||
|
||||
// Toggle de selección de grupos
|
||||
@@ -236,6 +283,11 @@ watch(selectedGroups, (newFilters) => {
|
||||
filtersCookie.value = newFilters
|
||||
})
|
||||
|
||||
// Sincronizar con cookie cuando cambia la búsqueda
|
||||
watch(searchQuery, (newSearch) => {
|
||||
searchCookie.value = newSearch
|
||||
})
|
||||
|
||||
// Refrescar automáticamente cada 5 minutos
|
||||
const refreshInterval = setInterval(() => {
|
||||
refresh()
|
||||
@@ -275,6 +327,81 @@ onUnmounted(() => {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.search-section {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.search-input-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
color: var(--color-gray-400);
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
padding: 0.75rem 3rem 0.75rem 3rem;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
border-radius: 1rem;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
backdrop-filter: blur(10px) saturate(150%);
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
color: var(--color-gray-800);
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
box-shadow:
|
||||
0 2px 6px 0 rgba(31, 38, 135, 0.08),
|
||||
inset 0 1px 1px 0 rgba(255, 255, 255, 0.3);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.search-input::placeholder {
|
||||
color: var(--color-gray-400);
|
||||
}
|
||||
|
||||
.search-input:focus {
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-color: rgba(var(--color-primary-500), 0.3);
|
||||
box-shadow:
|
||||
0 4px 12px 0 rgba(var(--color-primary-500), 0.15),
|
||||
0 0 0 3px rgba(var(--color-primary-500), 0.1),
|
||||
inset 0 1px 1px 0 rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.search-clear {
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 0.5rem;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
border: none;
|
||||
color: var(--color-gray-500);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.search-clear:hover {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: var(--color-gray-700);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.filter-section {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -555,4 +682,40 @@ onUnmounted(() => {
|
||||
inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
|
||||
inset 0 -1px 2px 0 rgba(var(--color-primary-500), 0.25) !important;
|
||||
}
|
||||
|
||||
.dark .search-input {
|
||||
background: rgba(255, 255, 255, 0.05) !important;
|
||||
border-color: rgba(255, 255, 255, 0.1) !important;
|
||||
color: var(--color-gray-200) !important;
|
||||
box-shadow:
|
||||
0 2px 6px 0 rgba(0, 0, 0, 0.3),
|
||||
inset 0 1px 1px 0 rgba(255, 255, 255, 0.05) !important;
|
||||
}
|
||||
|
||||
.dark .search-input::placeholder {
|
||||
color: var(--color-gray-500) !important;
|
||||
}
|
||||
|
||||
.dark .search-input:focus {
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
border-color: rgba(var(--color-primary-500), 0.5) !important;
|
||||
box-shadow:
|
||||
0 4px 12px 0 rgba(var(--color-primary-500), 0.3),
|
||||
0 0 0 3px rgba(var(--color-primary-500), 0.15),
|
||||
inset 0 1px 1px 0 rgba(255, 255, 255, 0.08) !important;
|
||||
}
|
||||
|
||||
.dark .search-icon {
|
||||
color: var(--color-gray-500) !important;
|
||||
}
|
||||
|
||||
.dark .search-clear {
|
||||
background: rgba(255, 255, 255, 0.05) !important;
|
||||
color: var(--color-gray-400) !important;
|
||||
}
|
||||
|
||||
.dark .search-clear:hover {
|
||||
background: rgba(255, 255, 255, 0.1) !important;
|
||||
color: var(--color-gray-200) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user