@shopbite-de/storefront 1.23.3 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +22 -0
- package/.github/workflows/build.yaml +1 -1
- package/.github/workflows/ci.yaml +6 -3
- package/CLAUDE.md +48 -3
- package/README.md +139 -40
- package/api-gen.config.json +9 -0
- package/api-types/storeApiSchema.shopbite.overrides.json +35 -0
- package/api-types/storeApiTypes.d.ts +95 -81
- package/app/app.config.ts +3 -2
- package/app/app.vue +40 -53
- package/app/assets/css/main.css +36 -4
- package/app/components/AddToWishlist.vue +13 -6
- package/app/components/Address/Fields.vue +2 -21
- package/app/components/AnimatedSection.vue +9 -4
- package/app/components/BottomNavi.vue +9 -2
- package/app/components/Cart/Bar.vue +102 -0
- package/app/components/Cart/Item.vue +21 -10
- package/app/components/Cart/QuickView.vue +4 -0
- package/app/components/Cart/Upsell.vue +106 -0
- package/app/components/Category/Header.vue +9 -3
- package/app/components/Category/Listing.vue +62 -45
- package/app/components/Checkout/PaymentAndDelivery.vue +19 -3
- package/app/components/Checkout/Summary.vue +70 -2
- package/app/components/Cta.vue +4 -2
- package/app/components/DemoBanner.vue +13 -0
- package/app/components/Feature/Card.vue +121 -0
- package/app/components/Features.vue +14 -9
- package/app/components/Food/MarqueeItem.vue +20 -8
- package/app/components/Footer/Contact.vue +82 -0
- package/app/components/Footer/StoreStatus.vue +30 -0
- package/app/components/Footer.vue +2 -1
- package/app/components/Header/Body.vue +1 -1
- package/app/components/Header/Right.vue +60 -17
- package/app/components/Header/Title.vue +1 -0
- package/app/components/Header.vue +5 -15
- package/app/components/Hero.vue +169 -36
- package/app/components/ImageGallery.vue +11 -5
- package/app/components/Product/Card.vue +104 -46
- package/app/components/Product/CardCompact.vue +72 -0
- package/app/components/Product/CardDietBadges.vue +38 -31
- package/app/components/Product/CardIngredients.vue +35 -0
- package/app/components/Product/CardSkeleton.vue +10 -18
- package/app/components/Product/Category.vue +9 -2
- package/app/components/Product/Configurator.vue +11 -7
- package/app/components/Product/CrossSelling.vue +45 -34
- package/app/components/Product/DeselectIngredient.vue +37 -31
- package/app/components/Product/Detail.vue +73 -13
- package/app/components/Product/QuickView.vue +77 -0
- package/app/components/Topseller.vue +44 -34
- package/app/components/User/RegistrationForm.vue +0 -1
- package/app/components/Wishlist.vue +2 -15
- package/app/composables/useAddToCart.ts +13 -40
- package/app/composables/useAddressAutocomplete.ts +12 -19
- package/app/composables/useAddressSuggestionArea.ts +16 -0
- package/app/composables/useAddressValidation.ts +3 -19
- package/app/composables/useCartMutations.ts +168 -0
- package/app/composables/useCartQuickView.ts +19 -0
- package/app/composables/useCartUpsell.ts +100 -0
- package/app/composables/{useCategory.ts → useCategoryById.ts} +1 -1
- package/app/composables/useCategorySeo.ts +27 -29
- package/app/composables/useCheckoutMethodGuard.ts +201 -0
- package/app/composables/useMatomo.ts +25 -0
- package/app/composables/useMatomoConfig.ts +12 -0
- package/app/composables/useMenuSectionSchema.ts +55 -0
- package/app/composables/useNavigation.ts +12 -9
- package/app/composables/usePageSeo.ts +50 -0
- package/app/composables/useProductCartQuantity.ts +15 -0
- package/app/composables/useProductCrossSelling.ts +1 -0
- package/app/composables/useProductDetail.ts +15 -1
- package/app/composables/useProductEvents.ts +30 -0
- package/app/composables/useProductQuickView.ts +65 -0
- package/app/composables/useRestaurantSchema.ts +64 -0
- package/app/composables/useScrollAnimation.ts +39 -8
- package/app/composables/useSearchTracking.ts +33 -0
- package/app/composables/useSeoUrlRoute.ts +58 -0
- package/app/composables/useSortingSelection.ts +28 -0
- package/app/composables/useStoreStatus.ts +48 -0
- package/app/composables/useTopSellers.ts +22 -0
- package/app/composables/useTrackEvent.ts +36 -23
- package/app/pages/[...all].vue +4 -4
- package/app/pages/account/recover/password/index.vue +1 -0
- package/app/pages/anmelden.vue +4 -0
- package/app/pages/bestellung/[id]/erfolg.vue +1 -5
- package/app/pages/bestellung/[id]/fehler.vue +2 -2
- package/app/pages/bestellung/[id]/index.vue +9 -3
- package/app/pages/bestellung/bestaetigen.vue +1 -5
- package/app/pages/bestellung/warenkorb.vue +1 -5
- package/app/pages/bestellung/zahlung-versand.vue +1 -5
- package/app/pages/c/[...all].vue +2 -35
- package/app/pages/index.vue +28 -14
- package/app/pages/kontakt.vue +4 -0
- package/app/pages/konto/adressen.vue +4 -0
- package/app/pages/konto/bestellung/[id].vue +4 -0
- package/app/pages/konto/bestellungen.vue +4 -0
- package/app/pages/konto/index.vue +4 -0
- package/app/pages/konto/profil.vue +4 -0
- package/app/pages/maintenance.vue +6 -0
- package/app/pages/merkliste.vue +1 -7
- package/app/pages/passwort-vergessen.vue +1 -0
- package/app/pages/registrierung/bestaetigen.vue +4 -0
- package/app/pages/registrierung/index.vue +4 -0
- package/app/pages/speisekarte/[...all].vue +2 -36
- package/app/pages/suche.vue +42 -26
- package/app/plugins/matomo.ts +35 -0
- package/app/types/Association.d.ts +1 -0
- package/app/utils/hydrateWhenVisible.ts +20 -0
- package/app/utils/media.ts +33 -0
- package/app/utils/openingHours.ts +90 -0
- package/app/utils/product.ts +31 -0
- package/app/utils/schema.ts +235 -0
- package/app/utils/seo.ts +56 -0
- package/app/utils/seoPath.ts +57 -0
- package/content/index.yml +26 -20
- package/content.config.ts +16 -0
- package/docs/notes/2026-07-05-issue-259-matomo-broken.md +7 -0
- package/docs/notes/2026-09-08-issue-240-shipping-method-blocked.md +83 -0
- package/docs/notes/2026-09-08-issue-241-cart-lock-conflicts.md +63 -0
- package/docs/notes/2026-09-08-issue-244-category-url-trailing-slash.md +65 -0
- package/docs/notes/2026-09-08-issue-276-payment-method-blocked.md +39 -0
- package/docs/notes/2026-09-08-issue-277-typecheck.md +99 -0
- package/docs/notes/2026-09-10-issue-250-animated-section.md +23 -0
- package/docs/notes/2026-09-10-issue-251-shop-data-in-base-layer.md +30 -0
- package/docs/notes/2026-09-10-issue-272-restaurant-schema.md +27 -0
- package/docs/notes/2026-09-10-issue-273-performance-media.md +64 -0
- package/docs/notes/2026-09-10-issue-274-seo-basics.md +49 -0
- package/docs/notes/2026-09-10-issue-275-accessibility.md +46 -0
- package/docs/notes/2026-09-10-issue-290-footer-nap.md +28 -0
- package/docs/notes/2026-09-10-issue-291-seo-url-trailing-slash.md +24 -0
- package/docs/notes/2026-09-10-issue-294-matomo-without-config.md +33 -0
- package/docs/notes/2026-09-10-issue-295-search-hydration-mismatch.md +25 -0
- package/docs/notes/2026-09-10-issue-296-track-direct-search.md +19 -0
- package/docs/notes/2026-09-10-issue-312-store-api-criteria-post.md +64 -0
- package/docs/notes/2026-09-10-issue-313-wishlist-scoped-tailwind.md +29 -0
- package/docs/notes/2026-09-10-issue-314-mobile-js-cost.md +119 -0
- package/docs/notes/2026-09-12-issue-319-stylesheet-cost.md +154 -0
- package/docs/notes/2026-09-12-issue-325-product-card.md +100 -0
- package/docs/notes/2026-09-12-issue-327-home-hero.md +64 -0
- package/docs/notes/2026-09-13-demo-banner.md +32 -0
- package/docs/notes/2026-09-13-issue-332-home-info-cards.md +46 -0
- package/docs/notes/2026-09-13-quick-view-flicker.md +65 -0
- package/docs/notes/2026-09-14-cart-upsell.md +105 -0
- package/docs/notes/2026-09-14-demo-noindex.md +57 -0
- package/node.dockerfile +5 -2
- package/nuxt.config.ts +98 -15
- package/package.json +5 -3
- package/patches/@shopware__nuxt-module@1.5.1.patch +32 -0
- package/pnpm-workspace.yaml +2 -0
- package/public/hero-poster.webp +0 -0
- package/scripts/perf/first-render.mjs +30 -0
- package/scripts/perf/h2-proxy.cjs +49 -0
- package/scripts/perf/lighthouse.sh +22 -0
- package/scripts/perf/quick-view-layout.mjs +126 -0
- package/server/api/__sitemap__/urls.get.ts +49 -0
- package/server/api/category/[categoryId].get.ts +20 -9
- package/server/api/content/home.get.ts +14 -0
- package/server/api/content/page.get.ts +22 -0
- package/server/api/listing/[categoryId].get.ts +14 -18
- package/server/api/product/[productId]/cross-selling.get.ts +3 -9
- package/server/api/product/[productId].get.ts +4 -8
- package/server/api/search.get.ts +2 -0
- package/server/plugins/site-url.ts +13 -0
- package/server/plugins/sitemap-trailing-slash.ts +26 -0
- package/server/utils/sitemap.ts +60 -0
- package/server/utils/storeApi.ts +34 -0
- package/shopware.d.ts +35 -11
- package/test/e2e/simple-checkout-as-recurring-customer.test.ts +13 -17
- package/test/nuxt/AddressFields.test.ts +2 -73
- package/test/nuxt/AnimatedSection.test.ts +67 -0
- package/test/nuxt/CartBar.test.ts +110 -0
- package/test/nuxt/CartItem.test.ts +95 -0
- package/test/nuxt/CartUpsell.test.ts +125 -0
- package/test/nuxt/DemoBanner.test.ts +12 -0
- package/test/nuxt/FooterContact.test.ts +102 -0
- package/test/nuxt/FooterStoreStatus.test.ts +48 -0
- package/test/nuxt/HeaderRight.test.ts +14 -10
- package/test/nuxt/Hero.test.ts +68 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +67 -8
- package/test/nuxt/RegistrationForm.test.ts +3 -0
- package/test/nuxt/useAddToCart.test.ts +37 -17
- package/test/nuxt/useAddressAutocomplete.test.ts +2 -38
- package/test/nuxt/useAddressSuggestionArea.test.ts +27 -0
- package/test/nuxt/useBusinessHours.test.ts +1 -1
- package/test/nuxt/useCartMutations.test.ts +225 -0
- package/test/nuxt/useCartUpsell.test.ts +126 -0
- package/test/nuxt/useCheckoutMethodGuard.test.ts +386 -0
- package/test/nuxt/useScrollAnimation.test.ts +55 -49
- package/test/nuxt/useSearchTracking.test.ts +71 -0
- package/test/nuxt/useSeoUrlRoute.test.ts +93 -0
- package/test/nuxt/useStoreStatus.test.ts +77 -0
- package/test/nuxt/useTrackEvent.test.ts +127 -0
- package/test/unit/media.spec.ts +49 -0
- package/test/unit/openingHours.spec.ts +90 -0
- package/test/unit/product.spec.ts +72 -0
- package/test/unit/schema.spec.ts +243 -0
- package/test/unit/seo.spec.ts +107 -0
- package/test/unit/seoPath.spec.ts +116 -0
- package/test/unit/sitemap.spec.ts +88 -0
- package/test/unit/useCategorySeo.spec.ts +42 -31
- package/test/unit/useSortingSelection.spec.ts +39 -0
- package/test/visual/playwright.config.ts +33 -0
- package/test/visual/visual.spec.ts +87 -0
- package/app/components/Product/CardDescription.vue +0 -27
- package/app/components/Product/CardFooter.vue +0 -51
- package/app/composables/useValidCitiesForDelivery.ts +0 -12
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { site } = useRuntimeConfig().public;
|
|
3
|
+
const { businessHours, refresh } = useBusinessHours();
|
|
4
|
+
|
|
5
|
+
// Put the opening hours into the server-rendered HTML (local SEO, #290);
|
|
6
|
+
// app.vue refreshes them on mount for the open/closed toast.
|
|
7
|
+
onServerPrefetch(() => refresh());
|
|
8
|
+
|
|
9
|
+
const openingHours = computed(() =>
|
|
10
|
+
groupOpeningHours(businessHours.value ?? []),
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const { street, postalCode, city } = site.address;
|
|
14
|
+
const locality = [postalCode, city].filter(Boolean).join(" ");
|
|
15
|
+
const hasContact = Boolean(
|
|
16
|
+
street || locality || site.telephone || site.googleBusinessProfileUrl,
|
|
17
|
+
);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div
|
|
22
|
+
v-if="hasContact || openingHours.length"
|
|
23
|
+
class="mb-10 grid gap-8 sm:grid-cols-2 xl:grid-cols-3"
|
|
24
|
+
>
|
|
25
|
+
<address v-if="hasContact" class="not-italic text-sm">
|
|
26
|
+
<p class="font-semibold">{{ site.name }}</p>
|
|
27
|
+
<div class="mt-6 space-y-1 text-muted">
|
|
28
|
+
<p v-if="street">{{ street }}</p>
|
|
29
|
+
<p v-if="locality">{{ locality }}</p>
|
|
30
|
+
</div>
|
|
31
|
+
<ul
|
|
32
|
+
v-if="site.telephone || site.googleBusinessProfileUrl"
|
|
33
|
+
class="mt-4 space-y-3"
|
|
34
|
+
>
|
|
35
|
+
<li v-if="site.telephone">
|
|
36
|
+
<ULink
|
|
37
|
+
:to="toTelHref(site.telephone)"
|
|
38
|
+
class="flex items-center gap-1.5 text-muted hover:text-default"
|
|
39
|
+
>
|
|
40
|
+
<UIcon name="i-lucide-phone" class="size-4 shrink-0" />
|
|
41
|
+
{{ site.telephone }}
|
|
42
|
+
</ULink>
|
|
43
|
+
</li>
|
|
44
|
+
<li v-if="site.googleBusinessProfileUrl">
|
|
45
|
+
<ULink
|
|
46
|
+
:to="site.googleBusinessProfileUrl"
|
|
47
|
+
target="_blank"
|
|
48
|
+
rel="noopener"
|
|
49
|
+
class="flex items-center gap-1.5 text-muted hover:text-default"
|
|
50
|
+
>
|
|
51
|
+
<UIcon name="i-simple-icons-google" class="size-4 shrink-0" />
|
|
52
|
+
Auf Google ansehen
|
|
53
|
+
</ULink>
|
|
54
|
+
</li>
|
|
55
|
+
</ul>
|
|
56
|
+
</address>
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
v-if="openingHours.length"
|
|
60
|
+
id="oeffnungszeiten"
|
|
61
|
+
class="scroll-mt-24 text-sm"
|
|
62
|
+
>
|
|
63
|
+
<p class="font-semibold">Öffnungszeiten</p>
|
|
64
|
+
<FooterStoreStatus class="mt-6" />
|
|
65
|
+
<dl class="mt-4 grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-muted">
|
|
66
|
+
<template v-for="row in openingHours" :key="row.days">
|
|
67
|
+
<dt class="font-medium text-default">{{ row.days }}</dt>
|
|
68
|
+
<dd>
|
|
69
|
+
<span v-if="row.intervals.length === 0">Ruhetag</span>
|
|
70
|
+
<span
|
|
71
|
+
v-for="interval in row.intervals"
|
|
72
|
+
:key="interval"
|
|
73
|
+
class="block"
|
|
74
|
+
>
|
|
75
|
+
{{ interval }}
|
|
76
|
+
</span>
|
|
77
|
+
</dd>
|
|
78
|
+
</template>
|
|
79
|
+
</dl>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Open/closed line above the opening hours. Replaces the status toasts,
|
|
3
|
+
// whose focus proxies Lighthouse flagged on every page (#275). Rendered on
|
|
4
|
+
// the client only, see useStoreStatus.
|
|
5
|
+
const { status } = useStoreStatus();
|
|
6
|
+
|
|
7
|
+
const text = computed(() => {
|
|
8
|
+
if (!status.value) return "";
|
|
9
|
+
if (status.value.open) return `Geöffnet bis ${status.value.closesAt} Uhr`;
|
|
10
|
+
return status.value.nextOpening
|
|
11
|
+
? `Geschlossen, wir öffnen wieder ${status.value.nextOpening}`
|
|
12
|
+
: "Geschlossen";
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<ClientOnly>
|
|
18
|
+
<p v-if="status" role="status" class="flex items-center gap-2 text-sm">
|
|
19
|
+
<span
|
|
20
|
+
class="size-2 shrink-0 rounded-full"
|
|
21
|
+
:class="status.open ? 'bg-success' : 'bg-dimmed'"
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
/>
|
|
24
|
+
<span class="text-default">{{ text }}</span>
|
|
25
|
+
</p>
|
|
26
|
+
<template #fallback>
|
|
27
|
+
<p class="h-5" aria-hidden="true" />
|
|
28
|
+
</template>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
</template>
|
|
@@ -36,6 +36,7 @@ const footerColumns = computed<FooterColumn[]>(() =>
|
|
|
36
36
|
<UFooter :ui="{ top: 'border-b border-default' }">
|
|
37
37
|
<template #top>
|
|
38
38
|
<UContainer>
|
|
39
|
+
<FooterContact />
|
|
39
40
|
<UFooterColumns :columns="footerColumns" />
|
|
40
41
|
</UContainer>
|
|
41
42
|
</template>
|
|
@@ -46,7 +47,7 @@ const footerColumns = computed<FooterColumn[]>(() =>
|
|
|
46
47
|
class="text-sm text-muted"
|
|
47
48
|
target="_blank"
|
|
48
49
|
>
|
|
49
|
-
|
|
50
|
+
Bestellsystem von ShopBite • © {{ new Date().getFullYear() }}
|
|
50
51
|
</NuxtLink>
|
|
51
52
|
</template>
|
|
52
53
|
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useUser } from "@shopware/composables";
|
|
3
3
|
import type { DropdownMenuItem } from "@nuxt/ui";
|
|
4
|
+
import { useMediaQuery } from "@vueuse/core";
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
open: cartQuickViewOpen,
|
|
8
|
+
mounted: cartQuickViewMounted,
|
|
9
|
+
show: openCartQuickView,
|
|
10
|
+
} = useCartQuickView();
|
|
11
|
+
// Bottom sheet on phones (also opened from the cart bar), side panel from
|
|
12
|
+
// the lg breakpoint (64rem); the drawer only renders on the client (#325).
|
|
13
|
+
const isDesktop = useMediaQuery("(min-width: 64rem)");
|
|
14
|
+
const cartDrawerDirection = computed(() =>
|
|
15
|
+
isDesktop.value ? "right" : "bottom",
|
|
16
|
+
);
|
|
4
17
|
|
|
5
|
-
const cartQuickViewOpen = ref(false);
|
|
6
18
|
const { count: cartCount } = useCart();
|
|
19
|
+
|
|
20
|
+
// The cart badge pops when a product goes into the cart (#325).
|
|
21
|
+
const { onCartItemAdded } = useProductEvents();
|
|
22
|
+
const cartPop = ref(0);
|
|
23
|
+
onCartItemAdded(() => {
|
|
24
|
+
cartPop.value++;
|
|
25
|
+
});
|
|
7
26
|
const { count: wishListCount } = useWishlist();
|
|
8
27
|
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
9
28
|
const { isLoggedIn, isGuestSession, logout } = useUser();
|
|
10
29
|
const toast = useToast();
|
|
30
|
+
// Shop phone number from the site config; the button is hidden without one (#251).
|
|
31
|
+
const { site } = useRuntimeConfig().public;
|
|
11
32
|
|
|
12
33
|
const logoutHandler = () => {
|
|
13
34
|
logout();
|
|
@@ -75,12 +96,12 @@ const dropDownMenu = computed<DropdownMenuItem[][]>(() => {
|
|
|
75
96
|
|
|
76
97
|
<template>
|
|
77
98
|
<UButton
|
|
99
|
+
v-if="site.telephone"
|
|
78
100
|
color="neutral"
|
|
79
101
|
variant="ghost"
|
|
80
|
-
to="
|
|
81
|
-
target="_blank"
|
|
102
|
+
:to="toTelHref(site.telephone)"
|
|
82
103
|
icon="i-lucide-phone"
|
|
83
|
-
aria-label="Anrufen"
|
|
104
|
+
:aria-label="`Anrufen: ${site.telephone}`"
|
|
84
105
|
/>
|
|
85
106
|
<UDropdownMenu :items="dropDownMenu">
|
|
86
107
|
<UChip v-if="isLoggedIn || isGuestSession" size="3xl" text="✓">
|
|
@@ -110,27 +131,49 @@ const dropDownMenu = computed<DropdownMenuItem[][]>(() => {
|
|
|
110
131
|
/>
|
|
111
132
|
</UChip>
|
|
112
133
|
</div>
|
|
113
|
-
<
|
|
134
|
+
<UChip
|
|
114
135
|
v-if="isCheckoutEnabled"
|
|
136
|
+
:key="cartPop"
|
|
137
|
+
:text="cartCount"
|
|
138
|
+
size="3xl"
|
|
139
|
+
:class="{ 'motion-safe:animate-cart-pop': cartPop > 0 }"
|
|
140
|
+
>
|
|
141
|
+
<UButton
|
|
142
|
+
aria-label="Zum Warenkorb"
|
|
143
|
+
aria-haspopup="dialog"
|
|
144
|
+
color="neutral"
|
|
145
|
+
variant="ghost"
|
|
146
|
+
icon="i-lucide-shopping-bag"
|
|
147
|
+
@click="openCartQuickView"
|
|
148
|
+
/>
|
|
149
|
+
</UChip>
|
|
150
|
+
<LazyUDrawer
|
|
151
|
+
v-if="cartQuickViewMounted"
|
|
115
152
|
v-model:open="cartQuickViewOpen"
|
|
116
153
|
title="Warenkorb"
|
|
117
|
-
direction="
|
|
154
|
+
:direction="cartDrawerDirection"
|
|
155
|
+
:ui="{
|
|
156
|
+
content:
|
|
157
|
+
cartDrawerDirection === 'right' ? 'w-full max-w-md' : 'max-h-[92vh]',
|
|
158
|
+
}"
|
|
118
159
|
>
|
|
119
|
-
<UChip :text="cartCount" size="3xl">
|
|
120
|
-
<UButton
|
|
121
|
-
aria-label="Zum Warenkorb"
|
|
122
|
-
color="neutral"
|
|
123
|
-
variant="ghost"
|
|
124
|
-
icon="i-lucide-shopping-bag"
|
|
125
|
-
/>
|
|
126
|
-
</UChip>
|
|
127
|
-
|
|
128
160
|
<template #header>
|
|
129
|
-
<div class="h-full
|
|
130
|
-
<h2
|
|
161
|
+
<div class="flex h-full w-full items-center justify-between gap-2">
|
|
162
|
+
<h2
|
|
163
|
+
class="flex items-center gap-2 text-3xl md:text-4xl mb-3 pb-2 lg:mt-8"
|
|
164
|
+
>
|
|
131
165
|
<UIcon name="i-lucide-shopping-bag" class="size-8" color="primary" />
|
|
132
166
|
Warenkorb
|
|
133
167
|
</h2>
|
|
168
|
+
<!-- The sheet also closes by swiping the handle down, tapping the
|
|
169
|
+
overlay or pressing Escape; the button makes it obvious. -->
|
|
170
|
+
<UButton
|
|
171
|
+
icon="i-lucide-x"
|
|
172
|
+
color="neutral"
|
|
173
|
+
variant="ghost"
|
|
174
|
+
aria-label="Warenkorb schließen"
|
|
175
|
+
@click="cartQuickViewOpen = false"
|
|
176
|
+
/>
|
|
134
177
|
</div>
|
|
135
178
|
</template>
|
|
136
179
|
<template #body>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
const { mainMenu } = useNavigation(false);
|
|
3
|
-
|
|
3
|
+
// The logo link's accessible name; Nuxt UI's default is "Nuxt UI" (#275).
|
|
4
|
+
const { site, shopBite } = useRuntimeConfig().public;
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<template>
|
|
7
|
-
<UHeader>
|
|
8
|
+
<UHeader :title="site.name">
|
|
8
9
|
<template #title>
|
|
9
10
|
<HeaderTitle />
|
|
10
11
|
</template>
|
|
11
12
|
|
|
12
13
|
<UNavigationMenu color="primary" variant="pill" :items="mainMenu" />
|
|
13
|
-
|
|
14
|
+
<!-- Lazy keeps USelectMenu out of the entry chunk of single-channel shops (#314). -->
|
|
15
|
+
<LazySalesChannelSwitch v-if="shopBite.feature.multiChannel" />
|
|
14
16
|
|
|
15
17
|
<template #right>
|
|
16
18
|
<HeaderRight />
|
|
@@ -20,16 +22,4 @@ const loginSlide = ref(false);
|
|
|
20
22
|
<LazyHeaderBody />
|
|
21
23
|
</template>
|
|
22
24
|
</UHeader>
|
|
23
|
-
|
|
24
|
-
<USlideover
|
|
25
|
-
v-model:open="loginSlide"
|
|
26
|
-
title="Konto"
|
|
27
|
-
description="Alle Vorteile eines Kontos genießen"
|
|
28
|
-
>
|
|
29
|
-
<template #body>
|
|
30
|
-
<div class="h-full m-4">
|
|
31
|
-
<LazyUserLoginForm />
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
</USlideover>
|
|
35
25
|
</template>
|
package/app/components/Hero.vue
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ButtonProps } from "#ui/components/Button.vue";
|
|
3
3
|
|
|
4
|
-
withDefaults(
|
|
4
|
+
const props = withDefaults(
|
|
5
5
|
defineProps<{
|
|
6
6
|
title: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
headline?: string;
|
|
9
9
|
backgroundVideo?: string;
|
|
10
|
+
/** First frame of the video as an image; the LCP element (#273). */
|
|
11
|
+
poster?: string;
|
|
12
|
+
/** The first link is the one primary action, the others are quiet (#327). */
|
|
10
13
|
links: ButtonProps[];
|
|
11
14
|
usps?: {
|
|
12
15
|
title?: string;
|
|
@@ -19,13 +22,43 @@ withDefaults(
|
|
|
19
22
|
description: undefined,
|
|
20
23
|
headline: undefined,
|
|
21
24
|
backgroundVideo: undefined,
|
|
25
|
+
poster: undefined,
|
|
22
26
|
usps: () => [],
|
|
23
27
|
},
|
|
24
28
|
);
|
|
25
29
|
|
|
30
|
+
// The poster is server-rendered and preloaded, so the largest paint is a
|
|
31
|
+
// small image instead of a multi-megabyte video. The video only joins on
|
|
32
|
+
// wide screens after hydration; phones never request it (#273).
|
|
33
|
+
const VIDEO_MEDIA_QUERY = "(min-width: 768px)";
|
|
34
|
+
const showVideo = ref(false);
|
|
26
35
|
const videoRef = ref<HTMLVideoElement>();
|
|
27
36
|
|
|
37
|
+
useHead(() => ({
|
|
38
|
+
link: props.poster
|
|
39
|
+
? [
|
|
40
|
+
{
|
|
41
|
+
key: "hero-poster-preload",
|
|
42
|
+
rel: "preload",
|
|
43
|
+
as: "image",
|
|
44
|
+
href: props.poster,
|
|
45
|
+
fetchpriority: "high",
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
: [],
|
|
49
|
+
}));
|
|
50
|
+
|
|
28
51
|
onMounted(() => {
|
|
52
|
+
const wide = props.backgroundVideo
|
|
53
|
+
? window.matchMedia?.(VIDEO_MEDIA_QUERY)
|
|
54
|
+
: undefined;
|
|
55
|
+
if (wide) {
|
|
56
|
+
showVideo.value = wide.matches;
|
|
57
|
+
wide.addEventListener("change", (event) => {
|
|
58
|
+
showVideo.value = event.matches;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
29
62
|
// Handle video playback on bfcache restore
|
|
30
63
|
window.addEventListener("pageshow", (event) => {
|
|
31
64
|
if (event.persisted && videoRef.value) {
|
|
@@ -33,58 +66,158 @@ onMounted(() => {
|
|
|
33
66
|
}
|
|
34
67
|
});
|
|
35
68
|
});
|
|
69
|
+
|
|
70
|
+
// Live status line: opening state from the business hours (client only, the
|
|
71
|
+
// browser's clock decides, #275) and the delivery time from the plugin.
|
|
72
|
+
const { status } = useStoreStatus();
|
|
73
|
+
const { deliveryTime, isCheckoutEnabled } = useShopBiteConfig();
|
|
74
|
+
|
|
75
|
+
const statusLabel = computed(() => {
|
|
76
|
+
if (!status.value) return undefined;
|
|
77
|
+
if (status.value.open) return `Geöffnet bis ${status.value.closesAt}`;
|
|
78
|
+
return status.value.nextOpening
|
|
79
|
+
? `Geschlossen · öffnet ${status.value.nextOpening}`
|
|
80
|
+
: "Geschlossen";
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const primaryLink = computed(() => props.links[0]);
|
|
84
|
+
const secondaryLinks = computed(() => props.links.slice(1));
|
|
36
85
|
</script>
|
|
37
86
|
|
|
38
87
|
<template>
|
|
39
|
-
|
|
88
|
+
<!-- Direction A of the canvas "Startseite Hero": full-bleed photo with a
|
|
89
|
+
bottom-to-top gradient instead of a flat overlay, the content bottom
|
|
90
|
+
left inside the container width, one primary action (#327). -->
|
|
91
|
+
<div
|
|
92
|
+
class="relative isolate flex min-h-[520px] flex-col justify-end overflow-hidden bg-neutral-950 sm:min-h-[560px]"
|
|
93
|
+
>
|
|
94
|
+
<!-- No CSS blur on the poster: blur the image file itself (see docs);
|
|
95
|
+
a filter on a full-screen image delays the first paint on phones. -->
|
|
96
|
+
<img
|
|
97
|
+
v-if="poster"
|
|
98
|
+
:src="poster"
|
|
99
|
+
alt=""
|
|
100
|
+
fetchpriority="high"
|
|
101
|
+
class="absolute inset-0 -z-20 h-full w-full object-cover"
|
|
102
|
+
/>
|
|
40
103
|
<video
|
|
104
|
+
v-if="showVideo"
|
|
41
105
|
ref="videoRef"
|
|
42
106
|
autoplay
|
|
43
107
|
loop
|
|
44
108
|
muted
|
|
45
109
|
playsinline
|
|
46
|
-
|
|
47
|
-
|
|
110
|
+
preload="metadata"
|
|
111
|
+
:poster="poster"
|
|
112
|
+
class="absolute inset-0 -z-10 h-full w-full scale-105 object-cover blur-sm"
|
|
48
113
|
>
|
|
49
114
|
<source :src="backgroundVideo" type="video/mp4" />
|
|
50
115
|
</video>
|
|
51
|
-
<div
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
title: 'text-white',
|
|
60
|
-
description: 'text-white',
|
|
61
|
-
}"
|
|
116
|
+
<div
|
|
117
|
+
class="absolute inset-0 -z-10 bg-gradient-to-b from-neutral-950/15 via-neutral-950/35 to-neutral-950/85"
|
|
118
|
+
aria-hidden="true"
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<UContainer>
|
|
122
|
+
<div
|
|
123
|
+
class="flex max-w-2xl flex-col gap-4 py-6 text-white sm:gap-5 sm:py-10 lg:py-14"
|
|
62
124
|
>
|
|
63
|
-
<div
|
|
64
|
-
|
|
125
|
+
<div
|
|
126
|
+
v-if="usps.length > 0"
|
|
127
|
+
class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm"
|
|
128
|
+
>
|
|
129
|
+
<component
|
|
130
|
+
:is="usp.link ? 'a' : 'span'"
|
|
65
131
|
v-for="(usp, index) in usps"
|
|
66
132
|
:key="index"
|
|
67
|
-
|
|
68
|
-
:
|
|
69
|
-
|
|
70
|
-
|
|
133
|
+
:href="usp.link"
|
|
134
|
+
:target="usp.link ? '_blank' : undefined"
|
|
135
|
+
:rel="usp.link ? 'noopener' : undefined"
|
|
136
|
+
class="inline-flex items-center gap-1.5 text-white/90"
|
|
71
137
|
>
|
|
72
|
-
<UIcon
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
138
|
+
<UIcon v-if="usp.icon" :name="usp.icon" class="size-4 shrink-0" />
|
|
139
|
+
<span v-if="usp.title" class="font-semibold text-white">
|
|
140
|
+
{{ usp.title }}
|
|
141
|
+
</span>
|
|
142
|
+
<span v-if="usp.subtitle" class="text-white/80">
|
|
143
|
+
{{ usp.subtitle }}
|
|
144
|
+
</span>
|
|
145
|
+
</component>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="flex flex-col gap-2">
|
|
149
|
+
<span
|
|
150
|
+
v-if="headline"
|
|
151
|
+
class="text-xs font-semibold tracking-widest text-white/80 uppercase"
|
|
152
|
+
>
|
|
153
|
+
{{ headline }}
|
|
154
|
+
</span>
|
|
155
|
+
<h1
|
|
156
|
+
class="text-4xl font-extrabold tracking-tight text-balance sm:text-5xl lg:text-6xl"
|
|
157
|
+
>
|
|
158
|
+
{{ title }}
|
|
159
|
+
</h1>
|
|
160
|
+
<p
|
|
161
|
+
v-if="description"
|
|
162
|
+
class="text-base text-pretty text-white/90 sm:text-lg"
|
|
163
|
+
>
|
|
164
|
+
{{ description }}
|
|
165
|
+
</p>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<!-- Fixed height: the status arrives after hydration (#327). -->
|
|
169
|
+
<div
|
|
170
|
+
class="flex min-h-6 flex-wrap items-center gap-x-4 gap-y-1 text-sm text-white/90"
|
|
171
|
+
aria-live="polite"
|
|
172
|
+
>
|
|
173
|
+
<span
|
|
174
|
+
v-if="statusLabel"
|
|
175
|
+
class="inline-flex items-center gap-2"
|
|
176
|
+
data-testid="hero-status"
|
|
177
|
+
>
|
|
178
|
+
<span
|
|
179
|
+
class="size-2 rounded-full"
|
|
180
|
+
:class="
|
|
181
|
+
status?.open
|
|
182
|
+
? 'bg-green-400 shadow-[0_0_0_3px_rgba(74,222,128,0.3)]'
|
|
183
|
+
: 'bg-neutral-400'
|
|
184
|
+
"
|
|
185
|
+
aria-hidden="true"
|
|
76
186
|
/>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</
|
|
187
|
+
{{ statusLabel }}
|
|
188
|
+
</span>
|
|
189
|
+
<span
|
|
190
|
+
v-if="statusLabel && isCheckoutEnabled"
|
|
191
|
+
class="inline-flex items-center gap-1.5"
|
|
192
|
+
>
|
|
193
|
+
<UIcon name="i-lucide-bike" class="size-4" />
|
|
194
|
+
Lieferung ca. {{ deliveryTime }} Min
|
|
195
|
+
</span>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div
|
|
199
|
+
v-if="links.length > 0"
|
|
200
|
+
class="flex flex-col items-stretch gap-3 sm:flex-row sm:items-center"
|
|
201
|
+
>
|
|
202
|
+
<UButton
|
|
203
|
+
v-if="primaryLink"
|
|
204
|
+
v-bind="primaryLink"
|
|
205
|
+
color="primary"
|
|
206
|
+
variant="solid"
|
|
207
|
+
size="xl"
|
|
208
|
+
class="justify-center px-6 shadow-lg shadow-primary/30"
|
|
209
|
+
/>
|
|
210
|
+
<UButton
|
|
211
|
+
v-for="(link, index) in secondaryLinks"
|
|
212
|
+
:key="index"
|
|
213
|
+
v-bind="link"
|
|
214
|
+
color="neutral"
|
|
215
|
+
variant="ghost"
|
|
216
|
+
size="xl"
|
|
217
|
+
class="justify-center bg-transparent text-white hover:bg-white/10 active:bg-white/10"
|
|
218
|
+
/>
|
|
86
219
|
</div>
|
|
87
|
-
</
|
|
88
|
-
</
|
|
220
|
+
</div>
|
|
221
|
+
</UContainer>
|
|
89
222
|
</div>
|
|
90
223
|
</template>
|
|
@@ -16,6 +16,10 @@ defineProps<{
|
|
|
16
16
|
images: ImageCarousel[] | undefined;
|
|
17
17
|
links?: ButtonProps[] | undefined;
|
|
18
18
|
}>();
|
|
19
|
+
|
|
20
|
+
// The gallery sits below the fold: a fixed aspect ratio reserves the space
|
|
21
|
+
// (no layout shift) and the slides load lazily (#273).
|
|
22
|
+
const imageClass = "aspect-[4/3] w-full rounded-lg object-cover";
|
|
19
23
|
</script>
|
|
20
24
|
|
|
21
25
|
<template>
|
|
@@ -28,7 +32,7 @@ defineProps<{
|
|
|
28
32
|
<template #body>
|
|
29
33
|
<ClientOnly>
|
|
30
34
|
<UCarousel
|
|
31
|
-
v-slot="{ item
|
|
35
|
+
v-slot="{ item }"
|
|
32
36
|
arrows
|
|
33
37
|
:items="images"
|
|
34
38
|
class="w-full max-w-2xl mx-auto"
|
|
@@ -36,8 +40,9 @@ defineProps<{
|
|
|
36
40
|
<img
|
|
37
41
|
:src="item.image"
|
|
38
42
|
:alt="item.alt"
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
loading="lazy"
|
|
44
|
+
decoding="async"
|
|
45
|
+
:class="imageClass"
|
|
41
46
|
/>
|
|
42
47
|
</UCarousel>
|
|
43
48
|
<template #fallback>
|
|
@@ -46,8 +51,9 @@ defineProps<{
|
|
|
46
51
|
v-if="images?.[0]"
|
|
47
52
|
:src="images[0].image"
|
|
48
53
|
:alt="images[0].alt"
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
loading="lazy"
|
|
55
|
+
decoding="async"
|
|
56
|
+
:class="imageClass"
|
|
51
57
|
/>
|
|
52
58
|
</div>
|
|
53
59
|
</template>
|