increase z-index of filters to go above card links, fit to width of screen; import Button but remove borders

This commit is contained in:
padreug 2025-02-11 01:46:50 +01:00
parent 02e699aad5
commit 53a2982716
3 changed files with 33 additions and 30 deletions

View file

@ -87,9 +87,9 @@ const towns = computed(() => [
</script> </script>
<template> <template>
<div class="w-full space-y-4"> <div class="w-full space-y-3">
<!-- Search Input --> <!-- Search Input -->
<div class="relative w-full max-w-2xl mx-auto"> <div class="relative w-full max-w-xl mx-auto">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<Search class="h-5 w-5 text-muted-foreground" /> <Search class="h-5 w-5 text-muted-foreground" />
</div> </div>
@ -99,7 +99,7 @@ const towns = computed(() => [
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
<!-- Town Filter --> <!-- Town Filter -->
<div class="flex justify-start md:justify-center gap-2 overflow-x-auto pb-2 px-2 md:px-0 <div class="flex justify-start md:justify-center gap-1 overflow-x-auto pb-2 px-2 md:px-0
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"> [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]">
<Button v-for="to in towns" :key="to.id" @click="emit('update:town', to.id)" <Button v-for="to in towns" :key="to.id" @click="emit('update:town', to.id)"
:variant="props.town === to.id ? 'default' : 'secondary'" size="sm" :variant="props.town === to.id ? 'default' : 'secondary'" size="sm"
@ -109,7 +109,7 @@ const towns = computed(() => [
</div> </div>
<!-- Category Filter --> <!-- Category Filter -->
<div class="flex justify-start md:justify-center gap-2 overflow-x-auto pb-2 px-2 md:px-0 <div class="flex justify-start md:justify-center gap-1 overflow-x-auto pb-2 px-2 md:px-0
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"> [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]">
<Button v-for="cat in categories" :key="cat.id" @click="emit('update:category', cat.id)" <Button v-for="cat in categories" :key="cat.id" @click="emit('update:category', cat.id)"
:variant="props.category === cat.id ? 'default' : 'secondary'" size="sm" :variant="props.category === cat.id ? 'default' : 'secondary'" size="sm"

View file

@ -61,13 +61,13 @@ const filteredItems = computed(() => {
<template> <template>
<div class="container mx-auto px-4 py-2 md:py-8"> <div class="container mx-auto px-4 py-2 md:py-8">
<div class="space-y-4 sm:space-y-8"> <div class="space-y-4">
<!-- Directory Header --> <!-- Directory Header -->
<div class="hidden sm:block text-center space-y-4"> <div class="text-center space-y-2 mb-6">
<h1 class="text-3xl font-bold tracking-tight sm:text-4xl"> <h1 class="text-2xl font-bold tracking-tight sm:text-3xl">
{{ t('directory.title') }} {{ t('directory.title') }}
</h1> </h1>
<p class="text-lg text-muted-foreground"> <p class="text-sm sm:text-base text-muted-foreground">
{{ t('directory.subtitle') }} {{ t('directory.subtitle') }}
</p> </p>
</div> </div>
@ -77,10 +77,11 @@ const filteredItems = computed(() => {
v-model:category="category" v-model:category="category"
v-model:search="search" v-model:search="search"
v-model:town="town" v-model:town="town"
class="sticky top-0 z-50 -mx-4 px-4 py-2 bg-background/95 backdrop-blur-sm border-b w-screen left-0"
/> />
<!-- Directory Grid --> <!-- Directory Grid -->
<DirectoryGrid :items="filteredItems" /> <DirectoryGrid :items="filteredItems" class="pt-4" />
</div> </div>
</div> </div>
</template> </template>

View file

@ -8,6 +8,7 @@ import {
SelectTrigger, SelectTrigger,
SelectValue, SelectValue,
} from '@/components/ui/select' } from '@/components/ui/select'
import { Button } from '@/components/ui/button'
import { computed } from 'vue' import { computed } from 'vue'
import { import {
UtensilsCrossed, UtensilsCrossed,
@ -63,30 +64,18 @@ const towns = computed(() => [
<template> <template>
<div class="container mx-auto px-4 py-8"> <div class="container mx-auto px-4 py-8">
<div class="max-w-4xl mx-auto text-center space-y-8"> <div class="max-w-3xl mx-auto text-center space-y-6 sm:space-y-8">
<h1 class="text-3xl font-bold tracking-tight sm:text-6xl"> <h1 class="text-3xl font-bold tracking-tight sm:text-6xl">
{{ t('home.title') }} {{ t('home.title') }}
</h1> </h1>
<p class="text-lg sm:text-xl text-muted-foreground"> <p class="text-base sm:text-lg text-muted-foreground max-w-2xl mx-auto">
{{ t('home.subtitle') }} {{ t('home.subtitle') }}
</p> </p>
<div class="flex flex-col sm:flex-row gap-4 justify-center"> <!-- Town Selector - Move above category buttons -->
<router-link to="/directory" <div class="flex flex-col items-center gap-2">
class="inline-flex items-center justify-center rounded-md bg-primary px-6 py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90"> <h2 class="text-base font-medium text-muted-foreground">{{ t('home.selectTown') }}</h2>
{{ t('home.browse') }}
</router-link>
<router-link to="/faq"
class="inline-flex items-center justify-center rounded-md border border-input bg-background px-6 py-3 text-sm font-medium hover:bg-accent hover:text-accent-foreground">
{{ t('home.learnMore') }}
</router-link>
</div>
<!-- Town Selector -->
<div class="flex flex-col items-center gap-2 sm:gap-4">
<h2 class="text-lg sm:text-xl font-semibold">{{ t('home.selectTown') }}</h2>
<Select :model-value="currentTown" @update:model-value="setCurrentTown"> <Select :model-value="currentTown" @update:model-value="setCurrentTown">
<SelectTrigger class="w-[200px]"> <SelectTrigger class="w-[200px]">
<SelectValue :placeholder="t('home.selectTownPlaceholder')" /> <SelectValue :placeholder="t('home.selectTownPlaceholder')" />
@ -99,8 +88,8 @@ const towns = computed(() => [
</Select> </Select>
</div> </div>
<!-- Category Buttons --> <!-- Category Buttons - Adjust spacing -->
<div class="relative mt-4 sm:mt-8"> <div class="relative -mx-4 sm:mx-0">
<!-- Gradient Fade Edges --> <!-- Gradient Fade Edges -->
<div class="absolute left-0 top-0 bottom-0 w-4 bg-gradient-to-r from-background to-transparent z-10"></div> <div class="absolute left-0 top-0 bottom-0 w-4 bg-gradient-to-r from-background to-transparent z-10"></div>
<div class="absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-background to-transparent z-10"></div> <div class="absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-background to-transparent z-10"></div>
@ -116,9 +105,9 @@ const towns = computed(() => [
class="group flex-shrink-0 w-[100px] sm:w-[120px]" class="group flex-shrink-0 w-[100px] sm:w-[120px]"
> >
<Button <Button
variant="outline" variant="ghost"
size="default" size="default"
class="w-full h-20 sm:h-24 flex flex-col items-center justify-center gap-1 sm:gap-2 group-hover:border-primary/50 transition-colors" class="w-full h-20 sm:h-24 flex flex-col items-center justify-center gap-1 sm:gap-2 group-hover:bg-accent transition-colors"
> >
<component <component
:is="categoryIcons[category]" :is="categoryIcons[category]"
@ -130,6 +119,19 @@ const towns = computed(() => [
</router-link> </router-link>
</div> </div>
</div> </div>
<!-- Move action buttons to bottom -->
<div class="flex flex-col sm:flex-row gap-2 sm:gap-4 justify-center mt-4">
<router-link to="/directory"
class="inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90">
{{ t('home.browse') }}
</router-link>
<router-link to="/faq"
class="inline-flex items-center justify-center rounded-md border border-input bg-background px-6 py-3 text-sm font-medium hover:bg-accent hover:text-accent-foreground">
{{ t('home.learnMore') }}
</router-link>
</div>
</div> </div>
</div> </div>
</template> </template>