Compare commits
3
Commits
7a92dcbe8e
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5278df56f6 | ||
|
|
dd841dc6d6 | ||
|
|
5ed18bda75 |
No files matched your search
@@ -14,6 +14,7 @@ import ScrollToTop from "./components/ScrollToTop";
|
|||||||
import ShopDrawer from "./components/ShopDrawer";
|
import ShopDrawer from "./components/ShopDrawer";
|
||||||
import CartToast from "./components/CartToast";
|
import CartToast from "./components/CartToast";
|
||||||
import { ProductTransitionProvider } from "./components/ProductTransition";
|
import { ProductTransitionProvider } from "./components/ProductTransition";
|
||||||
|
import { PageTransitionProvider } from "./transitions/PageTransition";
|
||||||
import useLenisSmoothScroll from "./hooks/useLenisSmoothScroll";
|
import useLenisSmoothScroll from "./hooks/useLenisSmoothScroll";
|
||||||
import useScrollTextReveal from "./hooks/useScrollTextReveal";
|
import useScrollTextReveal from "./hooks/useScrollTextReveal";
|
||||||
import useButtonInteractions from "./hooks/useButtonInteractions";
|
import useButtonInteractions from "./hooks/useButtonInteractions";
|
||||||
@@ -59,6 +60,7 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<ThemeProvider value={{ theme, isLight, toggleTheme }}>
|
<ThemeProvider value={{ theme, isLight, toggleTheme }}>
|
||||||
<ProductTransitionProvider>
|
<ProductTransitionProvider>
|
||||||
|
<PageTransitionProvider>
|
||||||
<ScrollToTop />
|
<ScrollToTop />
|
||||||
|
|
||||||
<a href="#main-content" className="skip-link">
|
<a href="#main-content" className="skip-link">
|
||||||
@@ -82,6 +84,7 @@ function App() {
|
|||||||
<CartToast />
|
<CartToast />
|
||||||
<Footer flushTop={shouldFlushFooter} />
|
<Footer flushTop={shouldFlushFooter} />
|
||||||
{showSupportChatbot && <SupportChatbot />}
|
{showSupportChatbot && <SupportChatbot />}
|
||||||
|
</PageTransitionProvider>
|
||||||
</ProductTransitionProvider>
|
</ProductTransitionProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -166,7 +166,7 @@
|
|||||||
.character-facts > div,
|
.character-facts > div,
|
||||||
.meta-card,
|
.meta-card,
|
||||||
.delivery-grid div {
|
.delivery-grid div {
|
||||||
padding-top: 1rem;
|
padding-top: var(--gap-sm);
|
||||||
border-top: 1px solid var(--theme-border);
|
border-top: 1px solid var(--theme-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
.comment-card span,
|
.comment-card span,
|
||||||
.review-detail-row span {
|
.review-detail-row span {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 0.55rem;
|
margin-bottom: var(--gap-2xs);
|
||||||
color: var(--theme-text-muted);
|
color: var(--theme-text-muted);
|
||||||
font-size: var(--text-xs);
|
font-size: var(--text-xs);
|
||||||
letter-spacing: 0.2em;
|
letter-spacing: 0.2em;
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
overflow: visible;
|
overflow: visible;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: clamp(1rem, 1.8vw, 1.45rem);
|
gap: var(--gap-sm);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
|
|
||||||
.purchase-discovery-note strong {
|
.purchase-discovery-note strong {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: var(--gap-2xs);
|
||||||
color: var(--theme-text);
|
color: var(--theme-text);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.purchase-discovery-note .discount-preview {
|
.purchase-discovery-note .discount-preview {
|
||||||
margin-top: 0.5rem;
|
margin-top: var(--gap-2xs);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,7 +391,7 @@
|
|||||||
.reviews-heading h2,
|
.reviews-heading h2,
|
||||||
.recommendation-heading h2,
|
.recommendation-heading h2,
|
||||||
.detail-bottom-cta h2 {
|
.detail-bottom-cta h2 {
|
||||||
margin: 0.85rem 0 0;
|
margin: var(--gap-xs) 0 0;
|
||||||
color: var(--theme-text);
|
color: var(--theme-text);
|
||||||
font-size: clamp(2.2rem, 5.6vw, 6rem);
|
font-size: clamp(2.2rem, 5.6vw, 6rem);
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
@@ -405,7 +405,7 @@
|
|||||||
.reviews-heading p,
|
.reviews-heading p,
|
||||||
.detail-bottom-cta p {
|
.detail-bottom-cta p {
|
||||||
max-width: var(--text-measure);
|
max-width: var(--text-measure);
|
||||||
margin: 1.25rem 0 0;
|
margin: var(--gap-sm) 0 0;
|
||||||
color: var(--theme-text-muted);
|
color: var(--theme-text-muted);
|
||||||
font-size: var(--text-lg);
|
font-size: var(--text-lg);
|
||||||
line-height: 1.62;
|
line-height: 1.62;
|
||||||
@@ -553,7 +553,7 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: var(--gap-sm);
|
gap: var(--gap-sm);
|
||||||
margin-top: clamp(1.6rem, 4vw, 4rem);
|
margin-top: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.structure-phase-card,
|
.structure-phase-card,
|
||||||
@@ -720,7 +720,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comment-spotlight {
|
.comment-spotlight {
|
||||||
margin-top: clamp(1.6rem, 4vw, 4rem);
|
margin-top: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-dots {
|
.comment-dots {
|
||||||
@@ -829,7 +829,7 @@
|
|||||||
grid-template-columns: minmax(0, 1fr) auto;
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
gap: var(--gap-lg);
|
gap: var(--gap-lg);
|
||||||
align-items: end;
|
align-items: end;
|
||||||
margin-top: clamp(1rem, 3vw, 2rem);
|
margin-top: var(--gap-lg);
|
||||||
padding: clamp(1.5rem, 4vw, 3.5rem);
|
padding: clamp(1.5rem, 4vw, 3.5rem);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background:
|
background:
|
||||||
@@ -860,7 +860,7 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: var(--gap-sm);
|
gap: var(--gap-sm);
|
||||||
margin-top: clamp(1.6rem, 4vw, 4rem);
|
margin-top: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommendation-card {
|
.recommendation-card {
|
||||||
@@ -913,7 +913,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.recommendation-card p {
|
.recommendation-card p {
|
||||||
margin: 0.55rem 0 0;
|
margin: var(--gap-2xs) 0 0;
|
||||||
color: var(--theme-text-muted);
|
color: var(--theme-text-muted);
|
||||||
font-size: var(--text-sm);
|
font-size: var(--text-sm);
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
@@ -933,6 +933,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1023px) {
|
@media (max-width: 1023px) {
|
||||||
|
.detail-page {
|
||||||
|
padding-bottom: 4.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.product-hero {
|
.product-hero {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
align-content: start;
|
align-content: start;
|
||||||
@@ -974,11 +978,11 @@
|
|||||||
grid-column: auto;
|
grid-column: auto;
|
||||||
grid-row: auto;
|
grid-row: auto;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
height: clamp(18rem, 48svh, 32rem);
|
height: clamp(22rem, 50svh, 34rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-hero-image {
|
.product-hero-image {
|
||||||
width: min(74%, 460px);
|
width: 100%;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1035,6 +1039,7 @@
|
|||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
.detail-page {
|
.detail-page {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
padding-bottom: 4.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-hero {
|
.product-hero {
|
||||||
@@ -1053,12 +1058,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.product-hero-visual {
|
.product-hero-visual {
|
||||||
height: clamp(13rem, 32svh, 18rem);
|
height: clamp(22rem, 50svh, 32rem);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-hero-image {
|
.product-hero-image {
|
||||||
width: min(68%, 280px);
|
width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-facts,
|
.character-facts,
|
||||||
@@ -1104,16 +1110,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hero-fact-grid {
|
.hero-fact-grid {
|
||||||
gap: 0.45rem;
|
gap: var(--gap-2xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-fact-grid div {
|
.hero-fact-grid div {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding-top: 0.45rem;
|
padding-top: var(--gap-2xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-fact-grid span {
|
.hero-fact-grid span {
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: var(--gap-2xs);
|
||||||
font-size: clamp(0.65rem, 2vw, var(--text-xs));
|
font-size: clamp(0.65rem, 2vw, var(--text-xs));
|
||||||
letter-spacing: 0.09em;
|
letter-spacing: 0.09em;
|
||||||
}
|
}
|
||||||
@@ -1125,8 +1131,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.product-purchase-panel {
|
.product-purchase-panel {
|
||||||
min-width: 0;
|
display: none;
|
||||||
gap: 0.48rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchase-price-row {
|
.purchase-price-row {
|
||||||
@@ -1140,18 +1145,18 @@
|
|||||||
|
|
||||||
.size-card {
|
.size-card {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
min-height: 70px;
|
min-height: 56px;
|
||||||
gap: 0.2rem;
|
gap: 0.15rem;
|
||||||
padding: 0.6rem 0.7rem;
|
padding: 0.5rem 0.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.size-title {
|
.size-title {
|
||||||
font-size: 0.66rem;
|
font-size: 0.64rem;
|
||||||
letter-spacing: 0.14em;
|
letter-spacing: 0.14em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.size-card strong {
|
.size-card strong {
|
||||||
font-size: 0.98rem;
|
font-size: 0.92rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
@@ -1167,6 +1172,10 @@
|
|||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.purchase-actions .restock-button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.purchase-discovery-note,
|
.purchase-discovery-note,
|
||||||
.reviews-heading,
|
.reviews-heading,
|
||||||
.recommendation-heading {
|
.recommendation-heading {
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { Link, useParams } from "react-router";
|
import { Link, useParams } from "react-router";
|
||||||
import perfumes from "../data/perfumes";
|
import perfumes from "../data/perfumes";
|
||||||
import SharedNavbar from "./SharedNavbar";
|
import SharedNavbar from "./SharedNavbar";
|
||||||
import PageMeta from "./seo/PageMeta";
|
import PageMeta from "./seo/PageMeta";
|
||||||
|
import StickyBuyBar from "./StickyBuyBar";
|
||||||
import { useProductTransition } from "../transitions/ProductTransitionContext";
|
import { useProductTransition } from "../transitions/ProductTransitionContext";
|
||||||
import { useShop } from "../shop/useShop";
|
import { useShop } from "../shop/useShop";
|
||||||
import { formatChf } from "../shop/money";
|
import { formatChf } from "../shop/money";
|
||||||
@@ -73,6 +74,7 @@ function ProductPurchasePanel({
|
|||||||
discountPreviewCents,
|
discountPreviewCents,
|
||||||
addToCart,
|
addToCart,
|
||||||
subscribeToProduct,
|
subscribeToProduct,
|
||||||
|
panelRef,
|
||||||
}) {
|
}) {
|
||||||
const selectedProductId = `${perfume.slug}-${selectedSize === "sample" ? "sample" : "full"}`;
|
const selectedProductId = `${perfume.slug}-${selectedSize === "sample" ? "sample" : "full"}`;
|
||||||
const selectedProductLabel = selectedSize === "sample" ? "Probe" : "50 ml Flakon";
|
const selectedProductLabel = selectedSize === "sample" ? "Probe" : "50 ml Flakon";
|
||||||
@@ -92,7 +94,7 @@ function ProductPurchasePanel({
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className="product-purchase-panel" data-product-transition-reveal>
|
<aside className="product-purchase-panel" ref={panelRef} data-product-transition-reveal>
|
||||||
<div className="purchase-price-row">
|
<div className="purchase-price-row">
|
||||||
<span>Preis</span>
|
<span>Preis</span>
|
||||||
<strong>{perfume.prices[selectedSize]}</strong>
|
<strong>{perfume.prices[selectedSize]}</strong>
|
||||||
@@ -176,6 +178,7 @@ function ProductHero({
|
|||||||
discountPreviewCents,
|
discountPreviewCents,
|
||||||
addToCart,
|
addToCart,
|
||||||
subscribeToProduct,
|
subscribeToProduct,
|
||||||
|
panelRef,
|
||||||
}) {
|
}) {
|
||||||
const galleryImages = [...new Set([perfume.image, ...(perfume.gallery || [])])].slice(0, 3);
|
const galleryImages = [...new Set([perfume.image, ...(perfume.gallery || [])])].slice(0, 3);
|
||||||
|
|
||||||
@@ -237,6 +240,7 @@ function ProductHero({
|
|||||||
discountPreviewCents={discountPreviewCents}
|
discountPreviewCents={discountPreviewCents}
|
||||||
addToCart={addToCart}
|
addToCart={addToCart}
|
||||||
subscribeToProduct={subscribeToProduct}
|
subscribeToProduct={subscribeToProduct}
|
||||||
|
panelRef={panelRef}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@@ -559,6 +563,7 @@ function ProductDetailContent({ perfumeSlug }) {
|
|||||||
[perfumeSlug]
|
[perfumeSlug]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const purchasePanelRef = useRef(null);
|
||||||
const [selectedImage, setSelectedImage] = useState(
|
const [selectedImage, setSelectedImage] = useState(
|
||||||
getImageForSize(perfume, "full")
|
getImageForSize(perfume, "full")
|
||||||
);
|
);
|
||||||
@@ -648,6 +653,7 @@ function ProductDetailContent({ perfumeSlug }) {
|
|||||||
discountPreviewCents={discountPreviewCents}
|
discountPreviewCents={discountPreviewCents}
|
||||||
addToCart={addToCart}
|
addToCart={addToCart}
|
||||||
subscribeToProduct={subscribeToProduct}
|
subscribeToProduct={subscribeToProduct}
|
||||||
|
panelRef={purchasePanelRef}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ProductStorySection perfume={perfume} />
|
<ProductStorySection perfume={perfume} />
|
||||||
@@ -667,6 +673,24 @@ function ProductDetailContent({ perfumeSlug }) {
|
|||||||
startProductTransition={startProductTransition}
|
startProductTransition={startProductTransition}
|
||||||
/>
|
/>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
<StickyBuyBar
|
||||||
|
observeRef={purchasePanelRef}
|
||||||
|
alwaysVisibleMobile
|
||||||
|
sizes={[
|
||||||
|
{ key: "full", label: "50 ml", price: perfume.prices.full },
|
||||||
|
{ key: "sample", label: "Probe 2 ml", price: perfume.prices.sample },
|
||||||
|
]}
|
||||||
|
selectedSize={selectedSize}
|
||||||
|
onSizeChange={handleSizeSelection}
|
||||||
|
onBuy={() =>
|
||||||
|
addToCart(
|
||||||
|
`${perfume.slug}-${selectedSize === "sample" ? "sample" : "full"}`,
|
||||||
|
1,
|
||||||
|
`${perfume.name} ${selectedSize === "sample" ? "Probe" : "50 ml Flakon"} wurde in den Warenkorb gelegt.`
|
||||||
|
).catch(() => {})
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,12 +34,15 @@ const getStageRect = (sourceRect) => {
|
|||||||
const viewportWidth = window.innerWidth;
|
const viewportWidth = window.innerWidth;
|
||||||
const viewportHeight = window.innerHeight;
|
const viewportHeight = window.innerHeight;
|
||||||
const sourceRatio = sourceRect.height / sourceRect.width || 1;
|
const sourceRatio = sourceRect.height / sourceRect.width || 1;
|
||||||
|
const isMobile = viewportWidth <= 760;
|
||||||
|
const maxWidthFraction = isMobile ? 0.85 : 0.56;
|
||||||
|
const maxHeightFraction = isMobile ? 0.52 : 0.72;
|
||||||
|
const maxAbsWidth = isMobile ? viewportWidth * maxWidthFraction : 620;
|
||||||
const stageWidth = Math.min(
|
const stageWidth = Math.min(
|
||||||
Math.max(sourceRect.width * 1.16, 260),
|
Math.max(sourceRect.width * 1.16, 260),
|
||||||
viewportWidth * 0.56,
|
maxAbsWidth
|
||||||
620
|
|
||||||
);
|
);
|
||||||
const stageHeight = Math.min(stageWidth * sourceRatio, viewportHeight * 0.72);
|
const stageHeight = Math.min(stageWidth * sourceRatio, viewportHeight * maxHeightFraction);
|
||||||
const normalizedWidth = stageHeight / sourceRatio;
|
const normalizedWidth = stageHeight / sourceRatio;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
.sticky-buy-bar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1023px) {
|
||||||
|
.sticky-buy-bar {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 900;
|
||||||
|
display: block;
|
||||||
|
padding: 0.55rem var(--page-x, 1rem);
|
||||||
|
background: var(--theme-bg);
|
||||||
|
border-top: 1px solid var(--theme-border);
|
||||||
|
transform: translateY(100%);
|
||||||
|
opacity: 0;
|
||||||
|
transition:
|
||||||
|
transform var(--duration-med, 0.3s) var(--ease-out, ease-out),
|
||||||
|
opacity var(--duration-med, 0.3s) var(--ease-out, ease-out);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar.is-visible {
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__inner {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: var(--gap-sm, 0.75rem);
|
||||||
|
max-width: 46rem;
|
||||||
|
margin-inline: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__label {
|
||||||
|
color: var(--theme-text-muted);
|
||||||
|
font-size: var(--text-xs, 0.72rem);
|
||||||
|
letter-spacing: 0.18em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__price {
|
||||||
|
color: var(--theme-text);
|
||||||
|
font-size: clamp(0.92rem, 3vw, 1.1rem);
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- segmented size toggle ---- */
|
||||||
|
|
||||||
|
.sticky-buy-bar__toggle {
|
||||||
|
display: flex;
|
||||||
|
border: 1px solid var(--theme-border);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__tab {
|
||||||
|
padding: 0.4rem 0.65rem;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--theme-text-muted);
|
||||||
|
font-size: 0.66rem;
|
||||||
|
letter-spacing: 0.14em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
transition:
|
||||||
|
color var(--duration-med, 0.3s) var(--ease-out, ease-out),
|
||||||
|
background-color var(--duration-med, 0.3s) var(--ease-out, ease-out);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__tab + .sticky-buy-bar__tab {
|
||||||
|
border-left: 1px solid var(--theme-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sticky-buy-bar__tab.active {
|
||||||
|
color: var(--theme-accent-contrast, #fff);
|
||||||
|
background: var(--theme-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- buy button ---- */
|
||||||
|
|
||||||
|
.sticky-buy-bar .atmos-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
min-width: 6.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 820px) {
|
||||||
|
.sticky-buy-bar.is-always-visible {
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import "./StickyBuyBar.css";
|
||||||
|
|
||||||
|
function StickyBuyBar({ label, price, onBuy, observeRef, sizes, selectedSize, onSizeChange, alwaysVisibleMobile }) {
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
const sentinelRef = useRef(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const target = observeRef?.current ?? sentinelRef.current;
|
||||||
|
if (!target) return;
|
||||||
|
|
||||||
|
const observer = new IntersectionObserver(
|
||||||
|
([entry]) => setVisible(!entry.isIntersecting),
|
||||||
|
{ threshold: 0 }
|
||||||
|
);
|
||||||
|
|
||||||
|
observer.observe(target);
|
||||||
|
return () => observer.disconnect();
|
||||||
|
}, [observeRef]);
|
||||||
|
|
||||||
|
const classes = [
|
||||||
|
"sticky-buy-bar",
|
||||||
|
visible && "is-visible",
|
||||||
|
alwaysVisibleMobile && "is-always-visible",
|
||||||
|
].filter(Boolean).join(" ");
|
||||||
|
|
||||||
|
const currentPrice = sizes
|
||||||
|
? sizes.find((s) => s.key === selectedSize)?.price
|
||||||
|
: price;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{!observeRef && <span ref={sentinelRef} aria-hidden="true" />}
|
||||||
|
<div className={classes}>
|
||||||
|
<div className="sticky-buy-bar__inner">
|
||||||
|
{sizes ? (
|
||||||
|
<div className="sticky-buy-bar__left">
|
||||||
|
<div className="sticky-buy-bar__toggle">
|
||||||
|
{sizes.map((s) => (
|
||||||
|
<button
|
||||||
|
key={s.key}
|
||||||
|
type="button"
|
||||||
|
className={`sticky-buy-bar__tab ${selectedSize === s.key ? "active" : ""}`}
|
||||||
|
onClick={() => onSizeChange(s.key)}
|
||||||
|
>
|
||||||
|
{s.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<strong className="sticky-buy-bar__price">{currentPrice}</strong>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="sticky-buy-bar__left">
|
||||||
|
<span className="sticky-buy-bar__label">{label}</span>
|
||||||
|
<strong className="sticky-buy-bar__price">{currentPrice}</strong>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="atmos-btn atmos-btn--primary atmos-btn--uppercase atmos-btn--sm"
|
||||||
|
onClick={onBuy}
|
||||||
|
>
|
||||||
|
Kaufen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default StickyBuyBar;
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useLayoutEffect } from "react";
|
import { useLayoutEffect } from "react";
|
||||||
import { gsap } from "gsap";
|
import { gsap } from "gsap";
|
||||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||||
|
import { isPageTransitionActive } from "../transitions/PageTransition";
|
||||||
|
|
||||||
let pluginsRegistered = false;
|
let pluginsRegistered = false;
|
||||||
|
|
||||||
@@ -65,29 +66,34 @@ const restoreRevealWords = (element) => {
|
|||||||
delete element.dataset.revealOriginalHtml;
|
delete element.dataset.revealOriginalHtml;
|
||||||
};
|
};
|
||||||
|
|
||||||
function useScrollTextReveal(scopeRef, dependencyKey = "") {
|
function collectRevealItems(scope) {
|
||||||
useLayoutEffect(() => {
|
const groups = gsap.utils.toArray("[data-reveal-group]", scope);
|
||||||
const scope = scopeRef.current;
|
return groups.map((group) => ({
|
||||||
|
group,
|
||||||
if (!scope || typeof window === "undefined") {
|
items: Array.from(group.querySelectorAll("[data-reveal]")).filter(
|
||||||
return undefined;
|
(item) => item.closest("[data-reveal-group]") === group
|
||||||
|
),
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
function hideRevealItems(scope) {
|
||||||
return undefined;
|
collectRevealItems(scope).forEach(({ items }) => {
|
||||||
|
items.forEach((item) => {
|
||||||
|
if (item.dataset.reveal === "lines") {
|
||||||
|
gsap.set(item, { autoAlpha: 0 });
|
||||||
|
} else {
|
||||||
|
gsap.set(item, { y: 36, autoAlpha: 0, force3D: true });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
registerGsap();
|
function setupReveals(scope) {
|
||||||
|
|
||||||
const preparedElements = [];
|
const preparedElements = [];
|
||||||
const ctx = gsap.context(() => {
|
const ctx = gsap.context(() => {
|
||||||
const groups = gsap.utils.toArray("[data-reveal-group]");
|
const entries = collectRevealItems(scope);
|
||||||
|
|
||||||
groups.forEach((group) => {
|
|
||||||
const items = Array.from(group.querySelectorAll("[data-reveal]")).filter(
|
|
||||||
(item) => item.closest("[data-reveal-group]") === group
|
|
||||||
);
|
|
||||||
|
|
||||||
|
entries.forEach(({ group, items }) => {
|
||||||
if (items.length === 0) {
|
if (items.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -107,7 +113,7 @@ function useScrollTextReveal(scopeRef, dependencyKey = "") {
|
|||||||
|
|
||||||
ScrollTrigger.create({
|
ScrollTrigger.create({
|
||||||
trigger: group,
|
trigger: group,
|
||||||
start: group.dataset.revealStart || "top 86%",
|
start: group.dataset.revealStart || "top 78%",
|
||||||
once: true,
|
once: true,
|
||||||
onEnter: () => {
|
onEnter: () => {
|
||||||
const timeline = gsap.timeline();
|
const timeline = gsap.timeline();
|
||||||
@@ -166,9 +172,44 @@ function useScrollTextReveal(scopeRef, dependencyKey = "") {
|
|||||||
ScrollTrigger.refresh();
|
ScrollTrigger.refresh();
|
||||||
}, scope);
|
}, scope);
|
||||||
|
|
||||||
|
return { ctx, preparedElements };
|
||||||
|
}
|
||||||
|
|
||||||
|
function useScrollTextReveal(scopeRef, dependencyKey = "") {
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const scope = scopeRef.current;
|
||||||
|
|
||||||
|
if (!scope || typeof window === "undefined") {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
registerGsap();
|
||||||
|
|
||||||
|
let result = null;
|
||||||
|
let handleReady = null;
|
||||||
|
|
||||||
|
if (isPageTransitionActive()) {
|
||||||
|
hideRevealItems(scope);
|
||||||
|
handleReady = () => {
|
||||||
|
result = setupReveals(scope);
|
||||||
|
};
|
||||||
|
window.addEventListener("page-transition-ready", handleReady, { once: true });
|
||||||
|
} else {
|
||||||
|
result = setupReveals(scope);
|
||||||
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
ctx.revert();
|
if (handleReady) {
|
||||||
preparedElements.forEach((element) => restoreRevealWords(element));
|
window.removeEventListener("page-transition-ready", handleReady);
|
||||||
|
}
|
||||||
|
if (result) {
|
||||||
|
result.ctx.revert();
|
||||||
|
result.preparedElements.forEach((element) => restoreRevealWords(element));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, [scopeRef, dependencyKey]);
|
}, [scopeRef, dependencyKey]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
.about-section-head {
|
.about-section-head {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--gap-2xs);
|
gap: var(--gap-2xs);
|
||||||
margin-bottom: clamp(1.6rem, 4vw, 3rem);
|
margin-bottom: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.about-section-head h2 {
|
.about-section-head h2 {
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--gap-xs);
|
gap: var(--gap-xs);
|
||||||
min-height: 14rem;
|
min-height: 14rem;
|
||||||
padding: clamp(1.1rem, 2.4vw, 1.8rem);
|
padding: clamp(1.1rem, 2.4vw, 1.6rem);
|
||||||
border: 1px solid var(--theme-border);
|
border: 1px solid var(--theme-border);
|
||||||
background:
|
background:
|
||||||
linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
|
linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function AboutPage() {
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="about-pillars" data-reveal-group data-reveal-start="top 86%">
|
<section className="about-pillars" data-reveal-group data-reveal-start="top 78%">
|
||||||
<header className="about-section-head">
|
<header className="about-section-head">
|
||||||
<span className="about-eyebrow" data-reveal="fade">
|
<span className="about-eyebrow" data-reveal="fade">
|
||||||
Unser Ansatz
|
Unser Ansatz
|
||||||
|
|||||||
@@ -98,9 +98,8 @@
|
|||||||
filter: saturate(0.92) contrast(1.04) var(--shadow-product);
|
filter: saturate(0.92) contrast(1.04) var(--shadow-product);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-panel-facts div,
|
.discovery-panel-facts div {
|
||||||
.discovery-benefit {
|
padding-top: var(--gap-sm);
|
||||||
padding-top: 1rem;
|
|
||||||
border-top: 1px solid var(--theme-border);
|
border-top: 1px solid var(--theme-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +120,7 @@
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: clamp(1rem, 1.8vw, 1.45rem);
|
gap: var(--gap-sm);
|
||||||
width: min(100%, 390px);
|
width: min(100%, 390px);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -150,7 +149,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.discovery-panel-facts span {
|
.discovery-panel-facts span {
|
||||||
margin-bottom: 0.55rem;
|
margin-bottom: var(--gap-2xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-product-tags span {
|
.discovery-product-tags span {
|
||||||
@@ -235,7 +234,7 @@
|
|||||||
.discovery-section-heading h2,
|
.discovery-section-heading h2,
|
||||||
.discovery-section-intro h2,
|
.discovery-section-intro h2,
|
||||||
.discovery-final-cta h2 {
|
.discovery-final-cta h2 {
|
||||||
margin: 0.85rem 0 0;
|
margin: var(--gap-xs) 0 0;
|
||||||
color: var(--theme-text);
|
color: var(--theme-text);
|
||||||
font-size: clamp(2.2rem, 5.6vw, 6rem);
|
font-size: clamp(2.2rem, 5.6vw, 6rem);
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
@@ -249,23 +248,21 @@
|
|||||||
.discovery-section-heading p,
|
.discovery-section-heading p,
|
||||||
.discovery-final-cta p {
|
.discovery-final-cta p {
|
||||||
max-width: var(--text-measure);
|
max-width: var(--text-measure);
|
||||||
margin: 1.25rem 0 0;
|
margin: var(--gap-sm) 0 0;
|
||||||
color: var(--theme-text-muted);
|
color: var(--theme-text-muted);
|
||||||
font-size: var(--text-lg);
|
font-size: var(--text-lg);
|
||||||
line-height: 1.62;
|
line-height: 1.62;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-benefit-panel {
|
.discovery-benefit-panel {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: 1fr;
|
flex-direction: column;
|
||||||
align-content: end;
|
justify-content: center;
|
||||||
gap: clamp(0.9rem, 1.8vw, 1.25rem);
|
gap: 0;
|
||||||
min-height: clamp(360px, 42vw, 620px);
|
min-height: clamp(360px, 42vw, 620px);
|
||||||
padding: clamp(1.2rem, 3vw, 2.4rem);
|
padding: 0;
|
||||||
border: 1px solid var(--theme-border);
|
border: 0;
|
||||||
background:
|
background: transparent;
|
||||||
linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.008)),
|
|
||||||
color-mix(in srgb, var(--theme-bg) 88%, #000 12%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-benefit-panel-head {
|
.discovery-benefit-panel-head {
|
||||||
@@ -273,7 +270,8 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: end;
|
align-items: end;
|
||||||
gap: var(--gap-sm);
|
gap: var(--gap-sm);
|
||||||
padding-bottom: clamp(1rem, 2vw, 1.35rem);
|
padding-bottom: var(--gap-md);
|
||||||
|
margin-bottom: var(--gap-md);
|
||||||
border-bottom: 1px solid var(--theme-border);
|
border-bottom: 1px solid var(--theme-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,16 +292,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.discovery-benefit {
|
.discovery-benefit {
|
||||||
display: grid;
|
padding-top: var(--gap-sm);
|
||||||
grid-template-columns: minmax(0, 1fr);
|
border-top: 1px solid var(--theme-border);
|
||||||
gap: var(--gap-sm);
|
margin-top: var(--gap-sm);
|
||||||
align-items: start;
|
}
|
||||||
padding-top: 1rem;
|
|
||||||
|
.discovery-benefit:first-of-type {
|
||||||
|
border-top: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-benefit strong {
|
.discovery-benefit strong {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 0.35rem;
|
margin-bottom: var(--gap-2xs);
|
||||||
color: var(--theme-text);
|
color: var(--theme-text);
|
||||||
font-size: var(--text-base);
|
font-size: var(--text-base);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -324,7 +326,7 @@
|
|||||||
|
|
||||||
.discovery-section-heading {
|
.discovery-section-heading {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: clamp(1.8rem, 4vw, 3.8rem);
|
margin-bottom: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-section-heading h2 {
|
.discovery-section-heading h2 {
|
||||||
@@ -339,48 +341,42 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layout columns are provided by the global Grid12 system (see Grid.jsx). */
|
.discovery-steps {
|
||||||
.discovery-steps-grid {
|
display: grid;
|
||||||
margin-top: clamp(1.6rem, 4vw, 4rem);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
}
|
|
||||||
|
|
||||||
.discovery-step-card {
|
|
||||||
border: 1px solid var(--theme-border);
|
|
||||||
background:
|
|
||||||
linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
|
|
||||||
var(--theme-surface-soft);
|
|
||||||
}
|
|
||||||
|
|
||||||
.discovery-step-card {
|
|
||||||
min-height: 280px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: var(--gap-md);
|
gap: var(--gap-md);
|
||||||
padding: clamp(1rem, 2vw, 1.5rem);
|
margin-top: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-step-number {
|
.discovery-step {
|
||||||
|
padding-top: var(--gap-sm);
|
||||||
|
border-top: 1px solid var(--theme-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.discovery-step__number {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: var(--gap-md);
|
||||||
color: var(--theme-accent);
|
color: var(--theme-accent);
|
||||||
font-size: var(--text-sm);
|
font-size: var(--text-xs);
|
||||||
letter-spacing: 0.2em;
|
letter-spacing: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-step-card h3 {
|
.discovery-step__title {
|
||||||
margin: 0;
|
margin: 0 0 var(--gap-xs);
|
||||||
color: var(--theme-text);
|
color: var(--theme-text);
|
||||||
font-size: var(--text-lg);
|
font-size: clamp(1.1rem, 1.8vw, 1.35rem);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.08;
|
line-height: 1.1;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-step-card p {
|
.discovery-step__text {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
max-width: 32ch;
|
||||||
color: var(--theme-text-muted);
|
color: var(--theme-text-muted);
|
||||||
font-size: var(--text-base);
|
font-size: var(--text-sm);
|
||||||
line-height: 1.65;
|
line-height: 1.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-included-layout {
|
.discovery-included-layout {
|
||||||
@@ -569,7 +565,7 @@
|
|||||||
grid-template-columns: minmax(0, 1fr) auto;
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
gap: var(--gap-lg);
|
gap: var(--gap-lg);
|
||||||
align-items: end;
|
align-items: end;
|
||||||
margin-top: clamp(1rem, 3vw, 2rem);
|
margin-top: var(--gap-lg);
|
||||||
padding: clamp(1.5rem, 4vw, 3.5rem);
|
padding: clamp(1.5rem, 4vw, 3.5rem);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background:
|
background:
|
||||||
@@ -660,11 +656,11 @@
|
|||||||
grid-row: auto;
|
grid-row: auto;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
height: clamp(18rem, 48svh, 32rem);
|
height: clamp(20rem, 50svh, 34rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-hero-visual img {
|
.discovery-hero-visual img {
|
||||||
width: min(78%, 500px);
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
@@ -680,6 +676,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 820px) {
|
@media (max-width: 820px) {
|
||||||
|
.discovery-page {
|
||||||
|
padding-bottom: 4.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.discovery-hero {
|
.discovery-hero {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: clamp(0.75rem, 2vw, 1rem);
|
gap: clamp(0.75rem, 2vw, 1rem);
|
||||||
@@ -688,12 +688,15 @@
|
|||||||
padding-bottom: clamp(1rem, 3vw, 1.5rem);
|
padding-bottom: clamp(1rem, 3vw, 1.5rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-hero-stage,
|
.discovery-hero-stage {
|
||||||
.discovery-order-panel {
|
|
||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
grid-row: auto;
|
grid-row: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.discovery-order-panel {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.discovery-hero-copy {
|
.discovery-hero-copy {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -715,12 +718,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.discovery-hero-visual {
|
.discovery-hero-visual {
|
||||||
height: clamp(15rem, 36svh, 24rem);
|
height: clamp(22rem, 52svh, 34rem);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-hero-visual img {
|
.discovery-hero-visual img {
|
||||||
width: min(82%, 420px);
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-panel-facts,
|
.discovery-panel-facts,
|
||||||
@@ -741,6 +744,10 @@
|
|||||||
order: 3;
|
order: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.discovery-steps {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
.discovery-story-grid::before,
|
.discovery-story-grid::before,
|
||||||
.discovery-process-section::before,
|
.discovery-process-section::before,
|
||||||
.discovery-included::before {
|
.discovery-included::before {
|
||||||
@@ -763,7 +770,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.discovery-included .discovery-section-heading {
|
.discovery-included .discovery-section-heading {
|
||||||
margin-bottom: clamp(1.6rem, 8vw, 2.6rem);
|
margin-bottom: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-section-heading h2.discovery-included-title {
|
.discovery-section-heading h2.discovery-included-title {
|
||||||
@@ -801,7 +808,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.discovery-scroll-item .discovery-product-index {
|
.discovery-scroll-item .discovery-product-index {
|
||||||
margin-bottom: 0.1rem;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-scroll-copy h3 {
|
.discovery-scroll-copy h3 {
|
||||||
@@ -816,9 +823,9 @@
|
|||||||
|
|
||||||
.discovery-scroll-mobile-detail {
|
.discovery-scroll-mobile-detail {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.45rem;
|
gap: var(--gap-2xs);
|
||||||
max-width: var(--text-measure);
|
max-width: var(--text-measure);
|
||||||
margin-top: 0.15rem;
|
margin-top: var(--gap-2xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-scroll-mobile-detail p {
|
.discovery-scroll-mobile-detail p {
|
||||||
@@ -829,7 +836,7 @@
|
|||||||
.discovery-scroll-mobile-tags {
|
.discovery-scroll-mobile-tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--gap-2xs);
|
gap: var(--gap-2xs);
|
||||||
margin-top: 0.45rem;
|
margin-top: var(--gap-2xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-story-visual-panel {
|
.discovery-story-visual-panel {
|
||||||
@@ -871,11 +878,7 @@
|
|||||||
.discovery-price-row {
|
.discovery-price-row {
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.25rem;
|
gap: var(--gap-2xs);
|
||||||
}
|
|
||||||
|
|
||||||
.discovery-included .discovery-section-heading {
|
|
||||||
margin-bottom: clamp(1.4rem, 7vw, 2rem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.discovery-section-heading h2.discovery-included-title {
|
.discovery-section-heading h2.discovery-included-title {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import perfumes from "../data/perfumes";
|
|||||||
import SharedNavbar from "../components/SharedNavbar";
|
import SharedNavbar from "../components/SharedNavbar";
|
||||||
import Grid, { Col } from "../components/layout/Grid";
|
import Grid, { Col } from "../components/layout/Grid";
|
||||||
import PageMeta from "../components/seo/PageMeta";
|
import PageMeta from "../components/seo/PageMeta";
|
||||||
|
import StickyBuyBar from "../components/StickyBuyBar";
|
||||||
import { useShop } from "../shop/useShop";
|
import { useShop } from "../shop/useShop";
|
||||||
import "./DiscoverySetPage.css";
|
import "./DiscoverySetPage.css";
|
||||||
|
|
||||||
@@ -54,9 +55,9 @@ const discoverySteps = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
function DiscoveryOrderPanel({ onBuy }) {
|
function DiscoveryOrderPanel({ onBuy, panelRef }) {
|
||||||
return (
|
return (
|
||||||
<aside className="discovery-order-panel">
|
<aside className="discovery-order-panel" ref={panelRef}>
|
||||||
<div className="discovery-price-row">
|
<div className="discovery-price-row">
|
||||||
<span>Preis</span>
|
<span>Preis</span>
|
||||||
<strong>CHF 48.–</strong>
|
<strong>CHF 48.–</strong>
|
||||||
@@ -85,11 +86,11 @@ function DiscoveryOrderPanel({ onBuy }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DiscoveryHero({ onBuy }) {
|
function DiscoveryHero({ onBuy, panelRef }) {
|
||||||
return (
|
return (
|
||||||
<section className="discovery-hero">
|
<section className="discovery-hero" data-reveal-group data-reveal-start="top 90%">
|
||||||
<div className="discovery-hero-stage">
|
<div className="discovery-hero-stage">
|
||||||
<div className="discovery-hero-copy">
|
<div className="discovery-hero-copy" data-reveal="fade">
|
||||||
<span className="discovery-kicker">Discovery Set</span>
|
<span className="discovery-kicker">Discovery Set</span>
|
||||||
<h1>Der Einstieg</h1>
|
<h1>Der Einstieg</h1>
|
||||||
|
|
||||||
@@ -100,7 +101,7 @@ function DiscoveryHero({ onBuy }) {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<figure className="discovery-hero-visual">
|
<figure className="discovery-hero-visual" data-reveal="fade">
|
||||||
<img
|
<img
|
||||||
src={DISCOVERY_SET_IMAGE}
|
src={DISCOVERY_SET_IMAGE}
|
||||||
alt="Atmos Discovery Set"
|
alt="Atmos Discovery Set"
|
||||||
@@ -110,7 +111,7 @@ function DiscoveryHero({ onBuy }) {
|
|||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DiscoveryOrderPanel onBuy={onBuy} />
|
<DiscoveryOrderPanel onBuy={onBuy} panelRef={panelRef} />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -159,23 +160,15 @@ function DiscoveryProcessSection() {
|
|||||||
<h2 data-reveal="lines">So funktioniert's</h2>
|
<h2 data-reveal="lines">So funktioniert's</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Grid gap="sm" className="discovery-steps-grid">
|
<div className="discovery-steps">
|
||||||
{discoverySteps.map((step) => (
|
{discoverySteps.map((step) => (
|
||||||
<Col
|
<article key={step.number} className="discovery-step" data-reveal="fade">
|
||||||
key={step.number}
|
<span className="discovery-step__number">{step.number}</span>
|
||||||
as="article"
|
<h3 className="discovery-step__title">{step.title}</h3>
|
||||||
span={12}
|
<p className="discovery-step__text">{step.text}</p>
|
||||||
md={6}
|
</article>
|
||||||
lg={4}
|
|
||||||
className="discovery-step-card"
|
|
||||||
data-reveal="fade"
|
|
||||||
>
|
|
||||||
<span className="discovery-step-number">{step.number}</span>
|
|
||||||
<h3>{step.title}</h3>
|
|
||||||
<p>{step.text}</p>
|
|
||||||
</Col>
|
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -290,7 +283,7 @@ function DiscoveryIncludedSection() {
|
|||||||
const isActive = activeIndex === index;
|
const isActive = activeIndex === index;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="discovery-scroll-list-item" key={perfume.id}>
|
<li className="discovery-scroll-list-item" key={perfume.id} data-reveal-group data-reveal-start="top 84%">
|
||||||
<article
|
<article
|
||||||
className={`discovery-scroll-item${
|
className={`discovery-scroll-item${
|
||||||
isActive ? " discovery-scroll-item--active" : ""
|
isActive ? " discovery-scroll-item--active" : ""
|
||||||
@@ -298,9 +291,9 @@ function DiscoveryIncludedSection() {
|
|||||||
aria-current={isActive ? "true" : undefined}
|
aria-current={isActive ? "true" : undefined}
|
||||||
ref={(element) => setItemRef(element, index)}
|
ref={(element) => setItemRef(element, index)}
|
||||||
>
|
>
|
||||||
<span className="discovery-product-index">{perfume.id}</span>
|
<span className="discovery-product-index" data-reveal="fade">{perfume.id}</span>
|
||||||
|
|
||||||
<div className="discovery-scroll-copy">
|
<div className="discovery-scroll-copy" data-reveal="fade">
|
||||||
<h3>{perfume.name}</h3>
|
<h3>{perfume.name}</h3>
|
||||||
<div className="discovery-scroll-line" aria-hidden="true" />
|
<div className="discovery-scroll-line" aria-hidden="true" />
|
||||||
<div className="discovery-scroll-mobile-detail">
|
<div className="discovery-scroll-mobile-detail">
|
||||||
@@ -381,6 +374,7 @@ function DiscoveryFinalCta({ onBuy }) {
|
|||||||
|
|
||||||
function DiscoverySetPage() {
|
function DiscoverySetPage() {
|
||||||
const { addToCart } = useShop();
|
const { addToCart } = useShop();
|
||||||
|
const orderPanelRef = useRef(null);
|
||||||
const buyDiscoverySet = () =>
|
const buyDiscoverySet = () =>
|
||||||
addToCart("discovery-set", 1, "Discovery Set wurde in den Warenkorb gelegt.").catch(() => {});
|
addToCart("discovery-set", 1, "Discovery Set wurde in den Warenkorb gelegt.").catch(() => {});
|
||||||
|
|
||||||
@@ -394,12 +388,20 @@ function DiscoverySetPage() {
|
|||||||
<SharedNavbar variant="hero" active="testen" />
|
<SharedNavbar variant="hero" active="testen" />
|
||||||
|
|
||||||
<main id="main-content" className="shell">
|
<main id="main-content" className="shell">
|
||||||
<DiscoveryHero onBuy={buyDiscoverySet} />
|
<DiscoveryHero onBuy={buyDiscoverySet} panelRef={orderPanelRef} />
|
||||||
<DiscoveryStorySection />
|
<DiscoveryStorySection />
|
||||||
<DiscoveryIncludedSection />
|
<DiscoveryIncludedSection />
|
||||||
<DiscoveryProcessSection />
|
<DiscoveryProcessSection />
|
||||||
<DiscoveryFinalCta onBuy={buyDiscoverySet} />
|
<DiscoveryFinalCta onBuy={buyDiscoverySet} />
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
<StickyBuyBar
|
||||||
|
label="Discovery Set"
|
||||||
|
price="CHF 48.–"
|
||||||
|
observeRef={orderPanelRef}
|
||||||
|
onBuy={buyDiscoverySet}
|
||||||
|
alwaysVisibleMobile
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ function ImpressumPage() {
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="legal-fact-grid" data-reveal-group data-reveal-start="top 88%">
|
<section className="legal-fact-grid" data-reveal-group data-reveal-start="top 80%">
|
||||||
{FACTS.map((fact) => (
|
{FACTS.map((fact) => (
|
||||||
<article className="legal-fact" key={fact.label} data-reveal="fade">
|
<article className="legal-fact" key={fact.label} data-reveal="fade">
|
||||||
<span className="legal-eyebrow">{fact.label}</span>
|
<span className="legal-eyebrow">{fact.label}</span>
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ body.theme-light .hero-wordmark__image {
|
|||||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||||
gap: var(--gap-md);
|
gap: var(--gap-md);
|
||||||
align-items: end;
|
align-items: end;
|
||||||
margin-bottom: clamp(1.6rem, 4vw, 4.8rem);
|
margin-bottom: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-heading::after {
|
.section-heading::after {
|
||||||
@@ -670,14 +670,12 @@ body.theme-light .hero-wordmark__image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hero-product {
|
.hero-product {
|
||||||
/* Phone: keep the product centered, but narrower than the viewport
|
|
||||||
so it does not crowd the copy block near the bottom. */
|
|
||||||
aspect-ratio: auto;
|
aspect-ratio: auto;
|
||||||
top: clamp(12.5rem, 28svh, 16rem);
|
top: clamp(11.5rem, 26svh, 15rem);
|
||||||
left: 50%;
|
left: 50%;
|
||||||
right: auto;
|
right: auto;
|
||||||
width: clamp(12.5rem, 62vw, 17rem);
|
width: clamp(14rem, 72vw, 20rem);
|
||||||
height: clamp(13.5rem, 31svh, 17rem);
|
height: clamp(15rem, 38svh, 20rem);
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -734,7 +732,7 @@ body.theme-light .hero-wordmark__image {
|
|||||||
|
|
||||||
.discovery-banner {
|
.discovery-banner {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
aspect-ratio: 1 / 1;
|
aspect-ratio: 4 / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -746,10 +744,9 @@ body.theme-light .hero-wordmark__image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hero-product {
|
.hero-product {
|
||||||
/* Slightly tighter slot for compact phones. */
|
top: clamp(11rem, 26svh, 14rem);
|
||||||
top: clamp(12rem, 28svh, 14.5rem);
|
width: clamp(13rem, 70vw, 18rem);
|
||||||
width: clamp(12rem, 62vw, 16rem);
|
height: clamp(14rem, 36svh, 18rem);
|
||||||
height: clamp(13rem, 31svh, 16.5rem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-copy {
|
.hero-copy {
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ function LandingPage() {
|
|||||||
className="discovery-section"
|
className="discovery-section"
|
||||||
id="testen"
|
id="testen"
|
||||||
data-reveal-group
|
data-reveal-group
|
||||||
data-reveal-start="top 82%"
|
data-reveal-start="top 74%"
|
||||||
>
|
>
|
||||||
<div className="discovery-copy">
|
<div className="discovery-copy">
|
||||||
<h2 data-reveal="lines">
|
<h2 data-reveal="lines">
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ function SmallBatchPage() {
|
|||||||
<section
|
<section
|
||||||
className="release-grid"
|
className="release-grid"
|
||||||
data-reveal-group
|
data-reveal-group
|
||||||
data-reveal-start="top 88%"
|
data-reveal-start="top 80%"
|
||||||
>
|
>
|
||||||
{state.releases.map((release) => (
|
{state.releases.map((release) => (
|
||||||
<article className="release-card" key={release.name} data-reveal="fade">
|
<article className="release-card" key={release.name} data-reveal="fade">
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
.support-section-head {
|
.support-section-head {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--gap-2xs);
|
gap: var(--gap-2xs);
|
||||||
margin-bottom: clamp(1.6rem, 4vw, 3rem);
|
margin-bottom: var(--gap-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.support-section-head h2 {
|
.support-section-head h2 {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function SupportPage() {
|
|||||||
</aside>
|
</aside>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="support-topics" data-reveal-group data-reveal-start="top 88%">
|
<section className="support-topics" data-reveal-group data-reveal-start="top 80%">
|
||||||
{TOPICS.map((topic) => (
|
{TOPICS.map((topic) => (
|
||||||
<article className="support-topic" key={topic.label} data-reveal="fade">
|
<article className="support-topic" key={topic.label} data-reveal="fade">
|
||||||
<span className="support-eyebrow">{topic.label}</span>
|
<span className="support-eyebrow">{topic.label}</span>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/* Page transition styles removed — fade is handled entirely by GSAP inline. */
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
import { createContext, useCallback, useContext, useLayoutEffect, useRef } from "react";
|
||||||
|
import { useLocation, useNavigate } from "react-router";
|
||||||
|
import { gsap } from "gsap";
|
||||||
|
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||||
|
import { useProductTransition } from "./ProductTransitionContext";
|
||||||
|
|
||||||
|
const PageTransitionContext = createContext({ navigateWithTransition: () => {} });
|
||||||
|
|
||||||
|
export const usePageTransition = () => useContext(PageTransitionContext);
|
||||||
|
|
||||||
|
let transitionActive = false;
|
||||||
|
export const isPageTransitionActive = () => transitionActive;
|
||||||
|
|
||||||
|
const prefersReducedMotion = () =>
|
||||||
|
typeof window !== "undefined" &&
|
||||||
|
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||||
|
|
||||||
|
const isInternalLink = (anchor) => {
|
||||||
|
if (!anchor || anchor.target === "_blank") return false;
|
||||||
|
const href = anchor.getAttribute("href");
|
||||||
|
if (!href || href.startsWith("http") || href.startsWith("mailto:") || href.startsWith("#")) return false;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function PageTransitionProvider({ children }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const location = useLocation();
|
||||||
|
const { phase: productPhase } = useProductTransition();
|
||||||
|
const tlRef = useRef(null);
|
||||||
|
const isTransitioning = useRef(false);
|
||||||
|
|
||||||
|
const navigateWithTransition = useCallback(
|
||||||
|
(to) => {
|
||||||
|
if (isTransitioning.current) return;
|
||||||
|
if (productPhase !== "idle") {
|
||||||
|
navigate(to);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (prefersReducedMotion()) {
|
||||||
|
navigate(to);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const routeContent = document.querySelector("[data-route-content]");
|
||||||
|
if (!routeContent) {
|
||||||
|
navigate(to);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
isTransitioning.current = true;
|
||||||
|
transitionActive = true;
|
||||||
|
tlRef.current?.kill();
|
||||||
|
|
||||||
|
const tl = gsap.timeline({
|
||||||
|
onComplete: () => {
|
||||||
|
navigate(to);
|
||||||
|
window.scrollTo({ top: 0, behavior: "instant" });
|
||||||
|
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
gsap.fromTo(
|
||||||
|
routeContent,
|
||||||
|
{ autoAlpha: 0 },
|
||||||
|
{
|
||||||
|
autoAlpha: 1,
|
||||||
|
duration: 0.4,
|
||||||
|
ease: "power2.out",
|
||||||
|
onComplete: () => {
|
||||||
|
isTransitioning.current = false;
|
||||||
|
transitionActive = false;
|
||||||
|
gsap.set(routeContent, { clearProps: "opacity,visibility" });
|
||||||
|
window.dispatchEvent(new CustomEvent("page-transition-ready"));
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
tl.to(routeContent, {
|
||||||
|
autoAlpha: 0,
|
||||||
|
duration: 0.3,
|
||||||
|
ease: "power2.in",
|
||||||
|
});
|
||||||
|
|
||||||
|
tlRef.current = tl;
|
||||||
|
},
|
||||||
|
[navigate, productPhase]
|
||||||
|
);
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const handleClick = (event) => {
|
||||||
|
if (event.button !== 0 || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return;
|
||||||
|
|
||||||
|
const anchor = event.target.closest("a[href]");
|
||||||
|
if (!anchor || !isInternalLink(anchor)) return;
|
||||||
|
|
||||||
|
if (anchor.querySelector("[data-product-transition-source]")) return;
|
||||||
|
|
||||||
|
const href = anchor.getAttribute("href");
|
||||||
|
const resolved = new URL(href, window.location.origin);
|
||||||
|
if (resolved.pathname === location.pathname) return;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
navigateWithTransition(href);
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("click", handleClick, { capture: true });
|
||||||
|
return () => document.removeEventListener("click", handleClick, { capture: true });
|
||||||
|
}, [location.pathname, navigateWithTransition]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageTransitionContext.Provider value={{ navigateWithTransition }}>
|
||||||
|
{children}
|
||||||
|
</PageTransitionContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user