blocks-dusted 0.1.10 → 0.1.11
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/README.md +35 -0
- package/package.json +1 -1
- package/src/utils/paths.js +13 -13
- package/templates/blocks/DD-Accordion/Component.tsx +229 -0
- package/templates/blocks/DD-Accordion/README.md +3 -0
- package/templates/blocks/DD-Accordion/config.ts +73 -0
- package/templates/blocks/DD-Accordion/manifest.json +75 -0
- package/templates/blocks/DD-AnimText/Component.tsx +788 -0
- package/templates/blocks/DD-AnimText/README.md +3 -0
- package/templates/blocks/DD-AnimText/config.ts +295 -0
- package/templates/blocks/DD-AnimText/manifest.json +85 -0
- package/templates/blocks/DD-AsideNav/Component.tsx +321 -0
- package/templates/blocks/DD-AsideNav/config.ts +204 -0
- package/templates/blocks/DD-AsideNav/manifest.json +80 -0
- package/templates/blocks/DD-Banner/Component.tsx +51 -0
- package/templates/blocks/DD-Banner/config.ts +57 -0
- package/templates/blocks/DD-Banner/manifest.json +72 -0
- package/templates/blocks/DD-BgLightning/Component.tsx +44 -0
- package/templates/blocks/DD-BgLightning/README.md +3 -0
- package/templates/blocks/DD-BgLightning/config.ts +97 -0
- package/templates/blocks/DD-BgLightning/manifest.json +79 -0
- package/templates/blocks/DD-BookCall/Component.tsx +10 -11
- package/templates/blocks/DD-BookCall/config.ts +238 -238
- package/templates/blocks/DD-ButtonPop/Component.tsx +117 -0
- package/templates/blocks/DD-ButtonPop/config.ts +105 -0
- package/templates/blocks/DD-ButtonPop/manifest.json +88 -0
- package/templates/blocks/DD-ButtonPop/svg-icons/Dust2.tsx +167 -0
- package/templates/blocks/DD-Card/Component.tsx +251 -0
- package/templates/blocks/DD-Card/README.md +4 -0
- package/templates/blocks/DD-Card/config.ts +154 -0
- package/templates/blocks/DD-Card/manifest.json +82 -0
- package/templates/blocks/DD-CardTemplate01/Component.tsx +5 -6
- package/templates/blocks/DD-CardTemplate01/config.ts +106 -106
- package/templates/blocks/DD-Carousel-A/Component.tsx +249 -249
- package/templates/blocks/DD-Carousel-B/Component.tsx +403 -403
- package/templates/blocks/DD-Chip/Component.tsx +250 -0
- package/templates/blocks/DD-Chip/EXAMPLES.md +313 -0
- package/templates/blocks/DD-Chip/README.md +202 -0
- package/templates/blocks/DD-Chip/config.ts +369 -0
- package/templates/blocks/DD-Chip/manifest.json +74 -0
- package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -256
- package/templates/blocks/DD-Contact/Component.tsx +434 -434
- package/templates/blocks/DD-Contact/config.ts +22 -22
- package/templates/blocks/DD-Counter/Component.tsx +190 -0
- package/templates/blocks/DD-Counter/README.md +4 -0
- package/templates/blocks/DD-Counter/config.ts +291 -0
- package/templates/blocks/DD-Counter/manifest.json +74 -0
- package/templates/blocks/DD-CustomCSS/Component.tsx +8 -0
- package/templates/blocks/DD-CustomCSS/README.md +4 -0
- package/templates/blocks/DD-CustomCSS/addToLayout.md +5 -0
- package/templates/blocks/DD-CustomCSS/config.ts +22 -0
- package/templates/blocks/DD-CustomCSS/manifest.json +72 -0
- package/templates/blocks/DD-CustomCSS/renderCustomCSS.md +7 -0
- package/templates/blocks/DD-FeatCat/Component.tsx +302 -302
- package/templates/blocks/DD-FeatCat/config.ts +201 -201
- package/templates/blocks/DD-FeatStrip/Component.tsx +585 -585
- package/templates/blocks/DD-FeatStrip/config.ts +134 -134
- package/templates/blocks/DD-FluidBtn/ButtonsEyeCatching.tsx +628 -0
- package/templates/blocks/DD-FluidBtn/Component.tsx +43 -0
- package/templates/blocks/DD-FluidBtn/README.md +6 -0
- package/templates/blocks/DD-FluidBtn/config.ts +102 -0
- package/templates/blocks/DD-FluidBtn/manifest.json +86 -0
- package/templates/blocks/DD-GooeyInfo/Component.tsx +149 -0
- package/templates/blocks/DD-GooeyInfo/config.ts +135 -0
- package/templates/blocks/DD-GooeyInfo/manifest.json +72 -0
- package/templates/blocks/DD-Hero/Component.tsx +40 -17
- package/templates/blocks/DD-Hero/config.ts +267 -267
- package/templates/blocks/DD-HorizontalScroll/Component.tsx +4 -2
- package/templates/blocks/DD-HorizontalScroll/config.ts +231 -231
- package/templates/blocks/DD-Icon/Component.tsx +287 -0
- package/templates/blocks/DD-Icon/README.md +4 -0
- package/templates/blocks/DD-Icon/config.ts +258 -0
- package/templates/blocks/DD-Icon/hooks/revalidateBlockIds.ts +66 -0
- package/templates/blocks/DD-Icon/manifest.json +82 -0
- package/templates/blocks/DD-IconButton/Component.tsx +455 -0
- package/templates/blocks/DD-IconButton/README.md +326 -0
- package/templates/blocks/DD-IconButton/config.ts +239 -0
- package/templates/blocks/DD-IconButton/manifest.json +85 -0
- package/templates/blocks/DD-IdTag/Component.tsx +21 -0
- package/templates/blocks/DD-IdTag/README.md +4 -0
- package/templates/blocks/DD-IdTag/config.ts +41 -0
- package/templates/blocks/DD-IdTag/manifest.json +72 -0
- package/templates/blocks/DD-Iframe/Component.tsx +45 -0
- package/templates/blocks/DD-Iframe/README.md +4 -0
- package/templates/blocks/DD-Iframe/config.ts +47 -0
- package/templates/blocks/DD-Iframe/manifest.json +72 -0
- package/templates/blocks/DD-IframeMedia/Component.tsx +129 -0
- package/templates/blocks/DD-IframeMedia/README.md +4 -0
- package/templates/blocks/DD-IframeMedia/config.ts +79 -0
- package/templates/blocks/DD-IframeMedia/manifest.json +72 -0
- package/templates/blocks/DD-LineAnim/Component.tsx +36 -0
- package/templates/blocks/DD-LineAnim/README.md +4 -0
- package/templates/blocks/DD-LineAnim/config.ts +90 -0
- package/templates/blocks/DD-LineAnim/manifest.json +80 -0
- package/templates/blocks/DD-LinkGrid/Component.tsx +119 -0
- package/templates/blocks/DD-LinkGrid/README.md +4 -0
- package/templates/blocks/DD-LinkGrid/config.ts +51 -0
- package/templates/blocks/DD-LinkGrid/manifest.json +74 -0
- package/templates/blocks/DD-LogoMarq/Component.tsx +132 -0
- package/templates/blocks/DD-LogoMarq/README.md +4 -0
- package/templates/blocks/DD-LogoMarq/config.ts +264 -0
- package/templates/blocks/DD-LogoMarq/manifest.json +82 -0
- package/templates/blocks/DD-Lottie/Component.tsx +459 -0
- package/templates/blocks/DD-Lottie/README.md +4 -0
- package/templates/blocks/DD-Lottie/config.ts +379 -0
- package/templates/blocks/DD-Lottie/index.tsx +28 -0
- package/templates/blocks/DD-Lottie/manifest.json +83 -0
- package/templates/blocks/DD-MagicBento/Component.tsx +777 -0
- package/templates/blocks/DD-MagicBento/README.md +4 -0
- package/templates/blocks/DD-MagicBento/config.ts +264 -0
- package/templates/blocks/DD-MagicBento/manifest.json +74 -0
- package/templates/blocks/DD-MasonaryMedia/Component.tsx +547 -545
- package/templates/blocks/DD-MasonaryMedia/config.ts +2 -2
- package/templates/blocks/DD-MasonaryMedia/vendor.d.ts +2 -2
- package/templates/blocks/DD-Masonry/Component.tsx +645 -0
- package/templates/blocks/DD-Masonry/README.md +4 -0
- package/templates/blocks/DD-Masonry/config.ts +475 -0
- package/templates/blocks/DD-Masonry/manifest.json +82 -0
- package/templates/blocks/DD-Pricing/Component.tsx +372 -372
- package/templates/blocks/DD-Process/Component.tsx +149 -149
- package/templates/blocks/DD-Process/config.ts +150 -150
- package/templates/blocks/DD-Progress/Component.tsx +141 -0
- package/templates/blocks/DD-Progress/README.md +4 -0
- package/templates/blocks/DD-Progress/config.ts +175 -0
- package/templates/blocks/DD-Progress/manifest.json +74 -0
- package/templates/blocks/DD-ProjHeader/Component.tsx +91 -0
- package/templates/blocks/DD-ProjHeader/README.md +4 -0
- package/templates/blocks/DD-ProjHeader/config.ts +96 -0
- package/templates/blocks/DD-ProjHeader/manifest.json +72 -0
- package/templates/blocks/DD-ProjSlider/Component.tsx +123 -0
- package/templates/blocks/DD-ProjSlider/README.md +4 -0
- package/templates/blocks/DD-ProjSlider/config.ts +64 -0
- package/templates/blocks/DD-ProjSlider/manifest.json +72 -0
- package/templates/blocks/DD-ScrollText/Component.tsx +114 -0
- package/templates/blocks/DD-ScrollText/README.md +4 -0
- package/templates/blocks/DD-ScrollText/config.ts +58 -0
- package/templates/blocks/DD-ScrollText/manifest.json +72 -0
- package/templates/blocks/DD-Section/Component.tsx +266 -266
- package/templates/blocks/DD-Separator/Component.tsx +66 -0
- package/templates/blocks/DD-Separator/README.md +4 -0
- package/templates/blocks/DD-Separator/config.ts +58 -0
- package/templates/blocks/DD-Separator/manifest.json +72 -0
- package/templates/blocks/DD-Services/Component.tsx +176 -176
- package/templates/blocks/DD-Services/config.ts +149 -149
- package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -307
- package/templates/blocks/DD-Slider-A/Component.tsx +237 -237
- package/templates/blocks/DD-StackCards/Component.tsx +473 -473
- package/templates/blocks/DD-StackCards/config.ts +399 -399
- package/templates/blocks/DD-Team/Component.tsx +247 -247
- package/templates/blocks/DD-Team/config.ts +173 -173
- package/templates/blocks/DD-TeamCards/Component.tsx +251 -0
- package/templates/blocks/DD-TeamCards/README.md +4 -0
- package/templates/blocks/DD-TeamCards/config.ts +302 -0
- package/templates/blocks/DD-TeamCards/manifest.json +74 -0
- package/templates/blocks/DD-TechStack/Component.tsx +168 -162
- package/templates/blocks/DD-TechStack/config.ts +153 -153
- package/templates/blocks/DD-TestMarq/Component.tsx +132 -0
- package/templates/blocks/DD-TestMarq/README.md +4 -0
- package/templates/blocks/DD-TestMarq/RowLabel.tsx +9 -0
- package/templates/blocks/DD-TestMarq/config.ts +88 -0
- package/templates/blocks/DD-TestMarq/manifest.json +72 -0
- package/templates/blocks/DD-Testim/Component.tsx +247 -0
- package/templates/blocks/DD-Testim/README.md +4 -0
- package/templates/blocks/DD-Testim/config.ts +101 -0
- package/templates/blocks/DD-Testim/manifest.json +75 -0
- package/templates/blocks/DD-Testim2/Component.tsx +256 -0
- package/templates/blocks/DD-Testim2/README.md +4 -0
- package/templates/blocks/DD-Testim2/config.ts +100 -0
- package/templates/blocks/DD-Testim2/manifest.json +74 -0
- package/templates/blocks/DD-Testimonials/Component.tsx +147 -147
- package/templates/blocks/DD-Testimonials/config.ts +120 -120
- package/templates/blocks/DD-TextMarq/Component.tsx +157 -0
- package/templates/blocks/DD-TextMarq/README.md +4 -0
- package/templates/blocks/DD-TextMarq/config.ts +237 -0
- package/templates/blocks/DD-TextMarq/manifest.json +82 -0
- package/templates/blocks/DD-Thanks/Component.tsx +500 -0
- package/templates/blocks/DD-Thanks/README.md +4 -0
- package/templates/blocks/DD-Thanks/config.ts +224 -0
- package/templates/blocks/DD-Thanks/manifest.json +72 -0
- package/templates/blocks/DD-VertMarq/Component.tsx +154 -0
- package/templates/blocks/DD-VertMarq/README.md +4 -0
- package/templates/blocks/DD-VertMarq/config.ts +236 -0
- package/templates/blocks/DD-VertMarq/dist/index.css +6 -0
- package/templates/blocks/DD-VertMarq/dist/index.min.css +1 -0
- package/templates/blocks/DD-VertMarq/manifest.json +74 -0
- package/templates/blocks/DD-Work/Component.tsx +318 -315
- package/templates/blocks/DD-Work/config.ts +165 -165
- package/templates/blocks/DD-Work-B/Component.tsx +294 -294
- package/templates/blocks/DDHG-CTASection2/Component.tsx +185 -0
- package/templates/blocks/DDHG-CTASection2/config.ts +140 -0
- package/templates/blocks/DDHG-CTASection2/manifest.json +45 -0
- package/templates/blocks/DDHG-HighlightArc/Component.tsx +243 -0
- package/templates/blocks/DDHG-HighlightArc/config.ts +85 -0
- package/templates/blocks/DDHG-HighlightArc/manifest.json +46 -0
- package/templates/blocks/DDHG-LogoMarquee/Component.tsx +93 -0
- package/templates/blocks/DDHG-LogoMarquee/config.ts +66 -0
- package/templates/blocks/DDHG-LogoMarquee/manifest.json +39 -0
- package/templates/blocks/DDHG-NavCodeGrid/Component.tsx +213 -0
- package/templates/blocks/DDHG-NavCodeGrid/config.ts +64 -0
- package/templates/blocks/DDHG-NavCodeGrid/manifest.json +45 -0
- package/templates/blocks/DDHG-ProcessSec/Component.tsx +575 -0
- package/templates/blocks/DDHG-ProcessSec/config.ts +170 -0
- package/templates/blocks/DDHG-ProcessSec/manifest.json +56 -0
- package/templates/blocks/DDHG-ServiceDetails/Component.tsx +164 -0
- package/templates/blocks/DDHG-ServiceDetails/ServiceDetailCard.tsx +394 -0
- package/templates/blocks/DDHG-ServiceDetails/config.ts +77 -0
- package/templates/blocks/DDHG-ServiceDetails/manifest.json +50 -0
- package/templates/blocks/DDHG-ServiceHero/Component.tsx +234 -0
- package/templates/blocks/DDHG-ServiceHero/config.ts +49 -0
- package/templates/blocks/DDHG-ServiceHero/manifest.json +26 -0
- package/templates/blocks/DDHG-ServiceOverview/Component.tsx +277 -0
- package/templates/blocks/DDHG-ServiceOverview/config.ts +64 -0
- package/templates/blocks/DDHG-ServiceOverview/manifest.json +44 -0
- package/templates/blocks/DDHG-StatsFAQ/Component.tsx +389 -0
- package/templates/blocks/DDHG-StatsFAQ/config.ts +204 -0
- package/templates/blocks/DDHG-StatsFAQ/manifest.json +45 -0
- package/templates/blocks/DDHG-TeamCards/Component.tsx +131 -0
- package/templates/blocks/DDHG-TeamCards/config.ts +48 -0
- package/templates/blocks/DDHG-TeamCards/manifest.json +29 -0
- package/templates/shared/src/components/BgLightning/index.tsx +242 -0
- package/templates/shared/src/components/ui/ShareButton/index.tsx +80 -0
- package/templates/shared/src/components/ui/anims/FadeOnScroll.tsx +48 -0
- package/templates/shared/src/components/ui/anims/FadeUpOnInView.tsx +63 -0
- package/templates/shared/src/components/ui/anims/GlareHover.tsx +111 -0
- package/templates/shared/src/components/ui/anims/LineAnims.tsx +81 -0
- package/templates/shared/src/components/ui/anims/TitleAnims01.tsx +54 -0
- package/templates/shared/src/components/ui/anims/animation-container.tsx +29 -0
- package/templates/shared/src/components/ui/anims/blur-in.tsx +26 -0
- package/templates/shared/src/components/ui/anims/counter.tsx +53 -0
- package/templates/shared/src/components/ui/anims/fade.tsx +83 -0
- package/templates/shared/src/components/ui/anims/gradual-spacing.tsx +39 -0
- package/templates/shared/src/components/ui/anims/pull-up.tsx +93 -0
- package/templates/shared/src/components/ui/anims/reveal-text.tsx +76 -0
- package/templates/shared/src/components/ui/anims/rotate-words.tsx +43 -0
- package/templates/shared/src/components/ui/anims/shiny-text.tsx +58 -0
- package/templates/shared/src/components/ui/anims/shuffle-text.tsx +85 -0
- package/templates/shared/src/components/ui/anims/split-text.tsx +211 -0
- package/templates/shared/src/components/ui/anims/staggered-fade.tsx +133 -0
- package/templates/shared/src/components/ui/anims/text-scroll.tsx +111 -0
- package/templates/shared/src/components/ui/anims/typing-effect.tsx +112 -0
- package/templates/shared/src/components/ui/button-dusted-fluid/index.tsx +1521 -0
- package/templates/shared/src/components/ui/separator.tsx +85 -0
- package/templates/shared/src/hooks/useBodyScrollLock.ts +97 -0
- package/templates/shared/src/hooks/useClickOutside.ts +28 -0
- package/templates/shared/src/utilities/renderCustomCSS.ts +5 -0
- package/templates/shared/src/utilities/smoothScroll.ts +65 -0
|
@@ -1,473 +1,473 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React, { useLayoutEffect, useRef, useState } from 'react'
|
|
4
|
-
import Image from 'next/image'
|
|
5
|
-
import * as LucideIcons from 'lucide-react'
|
|
6
|
-
import { ArrowRight } from 'lucide-react'
|
|
7
|
-
import gsap from 'gsap'
|
|
8
|
-
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
|
9
|
-
type Media = { url?: string | null; alt?: string | null; [key: string]: any }
|
|
10
|
-
|
|
11
|
-
import RichText from '@/components/RichText'
|
|
12
|
-
|
|
13
|
-
if (typeof window !== 'undefined') {
|
|
14
|
-
gsap.registerPlugin(ScrollTrigger)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const ACCENTS = {
|
|
18
|
-
lime: { hex: '#84cc16', rgb: '132,204,22' },
|
|
19
|
-
purple: { hex: '#9803e2', rgb: '152,3,226' },
|
|
20
|
-
} as const
|
|
21
|
-
|
|
22
|
-
type AccentVariant = keyof typeof ACCENTS
|
|
23
|
-
|
|
24
|
-
function isLocalImageSrc(src?: string | null): src is string {
|
|
25
|
-
return typeof src === 'string' && src.startsWith('/api/media/file/')
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function DynamicIcon({
|
|
29
|
-
name,
|
|
30
|
-
size = 22,
|
|
31
|
-
...props
|
|
32
|
-
}: { name?: string | null } & Omit<LucideIcons.LucideProps, 'name'>) {
|
|
33
|
-
if (!name) return null
|
|
34
|
-
|
|
35
|
-
const Icon = (LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>)[name]
|
|
36
|
-
|
|
37
|
-
if (!Icon) return null
|
|
38
|
-
|
|
39
|
-
return <Icon size={size} {...props} />
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface TagItem {
|
|
43
|
-
id?: string | null
|
|
44
|
-
tag: string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface CardItem {
|
|
48
|
-
id?: string | null
|
|
49
|
-
iconName?: string | null
|
|
50
|
-
number?: string | null
|
|
51
|
-
title?: string | null
|
|
52
|
-
content?: unknown
|
|
53
|
-
statValue?: string | null
|
|
54
|
-
statLabel?: string | null
|
|
55
|
-
tags?: TagItem[] | null
|
|
56
|
-
ctaLabel?: string | null
|
|
57
|
-
ctaHref?: string | null
|
|
58
|
-
accentVariant?: AccentVariant | null
|
|
59
|
-
image?: Media | string | null
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface DDStackCardsProps {
|
|
63
|
-
cards?: CardItem[] | null
|
|
64
|
-
|
|
65
|
-
cardOffset?: number | null
|
|
66
|
-
initialStickyTop?: number | null
|
|
67
|
-
depthZ?: number | null
|
|
68
|
-
scaleStep?: number | null
|
|
69
|
-
|
|
70
|
-
cardOffsetTablet?: number | null
|
|
71
|
-
initialStickyTopTablet?: number | null
|
|
72
|
-
depthZTablet?: number | null
|
|
73
|
-
scaleStepTablet?: number | null
|
|
74
|
-
|
|
75
|
-
cardOffsetMobile?: number | null
|
|
76
|
-
initialStickyTopMobile?: number | null
|
|
77
|
-
depthZMobile?: number | null
|
|
78
|
-
scaleStepMobile?: number | null
|
|
79
|
-
|
|
80
|
-
sectionId?: string | null
|
|
81
|
-
[key: string]: unknown
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type ResponsiveStackValues = {
|
|
85
|
-
cardOffset: number
|
|
86
|
-
initialStickyTop: number
|
|
87
|
-
depthZ: number
|
|
88
|
-
scaleStep: number
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function getResponsiveStackValues({
|
|
92
|
-
cardOffset,
|
|
93
|
-
initialStickyTop,
|
|
94
|
-
depthZ,
|
|
95
|
-
scaleStep,
|
|
96
|
-
cardOffsetTablet,
|
|
97
|
-
initialStickyTopTablet,
|
|
98
|
-
depthZTablet,
|
|
99
|
-
scaleStepTablet,
|
|
100
|
-
cardOffsetMobile,
|
|
101
|
-
initialStickyTopMobile,
|
|
102
|
-
depthZMobile,
|
|
103
|
-
scaleStepMobile,
|
|
104
|
-
}: DDStackCardsProps): ResponsiveStackValues {
|
|
105
|
-
const desktopValues = {
|
|
106
|
-
cardOffset: typeof cardOffset === 'number' ? cardOffset : 14,
|
|
107
|
-
initialStickyTop: typeof initialStickyTop === 'number' ? initialStickyTop : 0,
|
|
108
|
-
depthZ: typeof depthZ === 'number' ? depthZ : 40,
|
|
109
|
-
scaleStep: typeof scaleStep === 'number' ? scaleStep : 0.18,
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (typeof window === 'undefined') return desktopValues
|
|
113
|
-
|
|
114
|
-
const tabletValues = {
|
|
115
|
-
cardOffset:
|
|
116
|
-
typeof cardOffsetTablet === 'number'
|
|
117
|
-
? cardOffsetTablet
|
|
118
|
-
: Math.max(8, desktopValues.cardOffset * 0.75),
|
|
119
|
-
initialStickyTop:
|
|
120
|
-
typeof initialStickyTopTablet === 'number'
|
|
121
|
-
? initialStickyTopTablet
|
|
122
|
-
: desktopValues.initialStickyTop,
|
|
123
|
-
depthZ:
|
|
124
|
-
typeof depthZTablet === 'number' ? depthZTablet : Math.max(16, desktopValues.depthZ * 0.65),
|
|
125
|
-
scaleStep:
|
|
126
|
-
typeof scaleStepTablet === 'number'
|
|
127
|
-
? scaleStepTablet
|
|
128
|
-
: Math.min(desktopValues.scaleStep, 0.08),
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const mobileValues = {
|
|
132
|
-
cardOffset:
|
|
133
|
-
typeof cardOffsetMobile === 'number'
|
|
134
|
-
? cardOffsetMobile
|
|
135
|
-
: Math.max(6, desktopValues.cardOffset * 0.5),
|
|
136
|
-
initialStickyTop:
|
|
137
|
-
typeof initialStickyTopMobile === 'number'
|
|
138
|
-
? initialStickyTopMobile
|
|
139
|
-
: desktopValues.initialStickyTop,
|
|
140
|
-
depthZ:
|
|
141
|
-
typeof depthZMobile === 'number' ? depthZMobile : Math.max(8, desktopValues.depthZ * 0.35),
|
|
142
|
-
scaleStep:
|
|
143
|
-
typeof scaleStepMobile === 'number'
|
|
144
|
-
? scaleStepMobile
|
|
145
|
-
: Math.min(desktopValues.scaleStep, 0.045),
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (window.matchMedia('(max-width: 767px)').matches) return mobileValues
|
|
149
|
-
if (window.matchMedia('(max-width: 1023px)').matches) return tabletValues
|
|
150
|
-
|
|
151
|
-
return desktopValues
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function DDStackCards(props: DDStackCardsProps) {
|
|
155
|
-
const { cards, sectionId } = props
|
|
156
|
-
|
|
157
|
-
const wrapperRef = useRef<HTMLDivElement | null>(null)
|
|
158
|
-
const cardRefs = useRef<(HTMLElement | null)[]>([])
|
|
159
|
-
const [layoutValues, setLayoutValues] = useState<ResponsiveStackValues>(() => ({
|
|
160
|
-
cardOffset: typeof props.cardOffset === 'number' ? props.cardOffset : 14,
|
|
161
|
-
initialStickyTop: typeof props.initialStickyTop === 'number' ? props.initialStickyTop : 0,
|
|
162
|
-
depthZ: typeof props.depthZ === 'number' ? props.depthZ : 40,
|
|
163
|
-
scaleStep: typeof props.scaleStep === 'number' ? props.scaleStep : 0.18,
|
|
164
|
-
}))
|
|
165
|
-
|
|
166
|
-
useLayoutEffect(() => {
|
|
167
|
-
const updateValues = () => {
|
|
168
|
-
setLayoutValues(getResponsiveStackValues(props))
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
updateValues()
|
|
172
|
-
|
|
173
|
-
window.addEventListener('resize', updateValues)
|
|
174
|
-
|
|
175
|
-
return () => {
|
|
176
|
-
window.removeEventListener('resize', updateValues)
|
|
177
|
-
}
|
|
178
|
-
}, [
|
|
179
|
-
props.cardOffset,
|
|
180
|
-
props.initialStickyTop,
|
|
181
|
-
props.depthZ,
|
|
182
|
-
props.scaleStep,
|
|
183
|
-
props.cardOffsetTablet,
|
|
184
|
-
props.initialStickyTopTablet,
|
|
185
|
-
props.depthZTablet,
|
|
186
|
-
props.scaleStepTablet,
|
|
187
|
-
props.cardOffsetMobile,
|
|
188
|
-
props.initialStickyTopMobile,
|
|
189
|
-
props.depthZMobile,
|
|
190
|
-
props.scaleStepMobile,
|
|
191
|
-
])
|
|
192
|
-
|
|
193
|
-
useLayoutEffect(() => {
|
|
194
|
-
const timer = window.setTimeout(() => {
|
|
195
|
-
const wrapper = wrapperRef.current
|
|
196
|
-
const cardEls = cardRefs.current.filter(Boolean) as HTMLDivElement[]
|
|
197
|
-
|
|
198
|
-
if (!wrapper || !cardEls.length) return
|
|
199
|
-
|
|
200
|
-
const ctx = gsap.context(() => {
|
|
201
|
-
gsap.set(wrapper, {
|
|
202
|
-
autoAlpha: 1,
|
|
203
|
-
willChange: 'opacity',
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
gsap.set(cardEls, {
|
|
207
|
-
transformPerspective: 1200,
|
|
208
|
-
transformOrigin: 'top center',
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
cardEls.forEach((card, i) => {
|
|
212
|
-
for (let j = i + 1; j < cardEls.length; j++) {
|
|
213
|
-
const step = j - i
|
|
214
|
-
const prevStep = step - 1
|
|
215
|
-
const triggerStickyTop =
|
|
216
|
-
layoutValues.initialStickyTop + (j - 1) * layoutValues.cardOffset
|
|
217
|
-
|
|
218
|
-
gsap.fromTo(
|
|
219
|
-
card,
|
|
220
|
-
{
|
|
221
|
-
scale: 1 - prevStep * layoutValues.scaleStep,
|
|
222
|
-
z: -prevStep * layoutValues.depthZ,
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
scale: 1 - step * layoutValues.scaleStep,
|
|
226
|
-
z: -step * layoutValues.depthZ,
|
|
227
|
-
force3D: true,
|
|
228
|
-
filter: `brightness(${Math.max(0.65, 1 - step * 0.06)})`,
|
|
229
|
-
borderRadius: '20px',
|
|
230
|
-
immediateRender: false,
|
|
231
|
-
scrollTrigger: {
|
|
232
|
-
trigger: cardEls[j],
|
|
233
|
-
start: `top ${triggerStickyTop + layoutValues.cardOffset}px`,
|
|
234
|
-
end: `top ${triggerStickyTop}px`,
|
|
235
|
-
scrub: true,
|
|
236
|
-
invalidateOnRefresh: true,
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
)
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
const lastCard = cardEls[cardEls.length - 1]
|
|
244
|
-
|
|
245
|
-
gsap.to(wrapper, {
|
|
246
|
-
autoAlpha: 0,
|
|
247
|
-
ease: 'none',
|
|
248
|
-
scrollTrigger: {
|
|
249
|
-
trigger: lastCard,
|
|
250
|
-
start: 'top top',
|
|
251
|
-
end: () => `+=${window.innerHeight * 0.3}`,
|
|
252
|
-
scrub: true,
|
|
253
|
-
invalidateOnRefresh: true,
|
|
254
|
-
},
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
requestAnimationFrame(() => {
|
|
258
|
-
ScrollTrigger.refresh()
|
|
259
|
-
})
|
|
260
|
-
}, wrapper)
|
|
261
|
-
|
|
262
|
-
return () => ctx.revert()
|
|
263
|
-
}, 120)
|
|
264
|
-
|
|
265
|
-
return () => {
|
|
266
|
-
window.clearTimeout(timer)
|
|
267
|
-
}
|
|
268
|
-
}, [
|
|
269
|
-
layoutValues.cardOffset,
|
|
270
|
-
layoutValues.initialStickyTop,
|
|
271
|
-
layoutValues.depthZ,
|
|
272
|
-
layoutValues.scaleStep,
|
|
273
|
-
])
|
|
274
|
-
|
|
275
|
-
if (!cards?.length) return null
|
|
276
|
-
|
|
277
|
-
const totalCards = cards.length
|
|
278
|
-
|
|
279
|
-
return (
|
|
280
|
-
<section
|
|
281
|
-
ref={wrapperRef}
|
|
282
|
-
className="stack-cards-block relative w-full invert-[0.95] brightness-110 contrast-125 dark:brightness-100 dark:contrast-100 dark:invert-[0]"
|
|
283
|
-
>
|
|
284
|
-
{cards.map((card, i) => {
|
|
285
|
-
const accent = ACCENTS[card.accentVariant ?? 'lime']
|
|
286
|
-
const cardMedia =
|
|
287
|
-
card.image && typeof card.image === 'object' ? (card.image as Media) : null
|
|
288
|
-
|
|
289
|
-
return (
|
|
290
|
-
<section
|
|
291
|
-
key={card.id ?? i}
|
|
292
|
-
id={i === 0 ? (sectionId ?? undefined) : undefined}
|
|
293
|
-
ref={(el) => {
|
|
294
|
-
cardRefs.current[i] = el
|
|
295
|
-
}}
|
|
296
|
-
className="stack-card renderblock-container sticky
|
|
297
|
-
style={{
|
|
298
|
-
top: `${layoutValues.initialStickyTop + i * layoutValues.cardOffset}px`,
|
|
299
|
-
zIndex: i + 1,
|
|
300
|
-
willChange: 'transform',
|
|
301
|
-
}}
|
|
302
|
-
>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useLayoutEffect, useRef, useState } from 'react'
|
|
4
|
+
import Image from 'next/image'
|
|
5
|
+
import * as LucideIcons from 'lucide-react'
|
|
6
|
+
import { ArrowRight } from 'lucide-react'
|
|
7
|
+
import gsap from 'gsap'
|
|
8
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
|
9
|
+
type Media = { url?: string | null; alt?: string | null; [key: string]: any }
|
|
10
|
+
|
|
11
|
+
import RichText from '@/components/RichText'
|
|
12
|
+
|
|
13
|
+
if (typeof window !== 'undefined') {
|
|
14
|
+
gsap.registerPlugin(ScrollTrigger)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const ACCENTS = {
|
|
18
|
+
lime: { hex: '#84cc16', rgb: '132,204,22' },
|
|
19
|
+
purple: { hex: '#9803e2', rgb: '152,3,226' },
|
|
20
|
+
} as const
|
|
21
|
+
|
|
22
|
+
type AccentVariant = keyof typeof ACCENTS
|
|
23
|
+
|
|
24
|
+
function isLocalImageSrc(src?: string | null): src is string {
|
|
25
|
+
return typeof src === 'string' && src.startsWith('/api/media/file/')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function DynamicIcon({
|
|
29
|
+
name,
|
|
30
|
+
size = 22,
|
|
31
|
+
...props
|
|
32
|
+
}: { name?: string | null } & Omit<LucideIcons.LucideProps, 'name'>) {
|
|
33
|
+
if (!name) return null
|
|
34
|
+
|
|
35
|
+
const Icon = (LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>)[name]
|
|
36
|
+
|
|
37
|
+
if (!Icon) return null
|
|
38
|
+
|
|
39
|
+
return <Icon size={size} {...props} />
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface TagItem {
|
|
43
|
+
id?: string | null
|
|
44
|
+
tag: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface CardItem {
|
|
48
|
+
id?: string | null
|
|
49
|
+
iconName?: string | null
|
|
50
|
+
number?: string | null
|
|
51
|
+
title?: string | null
|
|
52
|
+
content?: unknown
|
|
53
|
+
statValue?: string | null
|
|
54
|
+
statLabel?: string | null
|
|
55
|
+
tags?: TagItem[] | null
|
|
56
|
+
ctaLabel?: string | null
|
|
57
|
+
ctaHref?: string | null
|
|
58
|
+
accentVariant?: AccentVariant | null
|
|
59
|
+
image?: Media | string | null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface DDStackCardsProps {
|
|
63
|
+
cards?: CardItem[] | null
|
|
64
|
+
|
|
65
|
+
cardOffset?: number | null
|
|
66
|
+
initialStickyTop?: number | null
|
|
67
|
+
depthZ?: number | null
|
|
68
|
+
scaleStep?: number | null
|
|
69
|
+
|
|
70
|
+
cardOffsetTablet?: number | null
|
|
71
|
+
initialStickyTopTablet?: number | null
|
|
72
|
+
depthZTablet?: number | null
|
|
73
|
+
scaleStepTablet?: number | null
|
|
74
|
+
|
|
75
|
+
cardOffsetMobile?: number | null
|
|
76
|
+
initialStickyTopMobile?: number | null
|
|
77
|
+
depthZMobile?: number | null
|
|
78
|
+
scaleStepMobile?: number | null
|
|
79
|
+
|
|
80
|
+
sectionId?: string | null
|
|
81
|
+
[key: string]: unknown
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type ResponsiveStackValues = {
|
|
85
|
+
cardOffset: number
|
|
86
|
+
initialStickyTop: number
|
|
87
|
+
depthZ: number
|
|
88
|
+
scaleStep: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function getResponsiveStackValues({
|
|
92
|
+
cardOffset,
|
|
93
|
+
initialStickyTop,
|
|
94
|
+
depthZ,
|
|
95
|
+
scaleStep,
|
|
96
|
+
cardOffsetTablet,
|
|
97
|
+
initialStickyTopTablet,
|
|
98
|
+
depthZTablet,
|
|
99
|
+
scaleStepTablet,
|
|
100
|
+
cardOffsetMobile,
|
|
101
|
+
initialStickyTopMobile,
|
|
102
|
+
depthZMobile,
|
|
103
|
+
scaleStepMobile,
|
|
104
|
+
}: DDStackCardsProps): ResponsiveStackValues {
|
|
105
|
+
const desktopValues = {
|
|
106
|
+
cardOffset: typeof cardOffset === 'number' ? cardOffset : 14,
|
|
107
|
+
initialStickyTop: typeof initialStickyTop === 'number' ? initialStickyTop : 0,
|
|
108
|
+
depthZ: typeof depthZ === 'number' ? depthZ : 40,
|
|
109
|
+
scaleStep: typeof scaleStep === 'number' ? scaleStep : 0.18,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (typeof window === 'undefined') return desktopValues
|
|
113
|
+
|
|
114
|
+
const tabletValues = {
|
|
115
|
+
cardOffset:
|
|
116
|
+
typeof cardOffsetTablet === 'number'
|
|
117
|
+
? cardOffsetTablet
|
|
118
|
+
: Math.max(8, desktopValues.cardOffset * 0.75),
|
|
119
|
+
initialStickyTop:
|
|
120
|
+
typeof initialStickyTopTablet === 'number'
|
|
121
|
+
? initialStickyTopTablet
|
|
122
|
+
: desktopValues.initialStickyTop,
|
|
123
|
+
depthZ:
|
|
124
|
+
typeof depthZTablet === 'number' ? depthZTablet : Math.max(16, desktopValues.depthZ * 0.65),
|
|
125
|
+
scaleStep:
|
|
126
|
+
typeof scaleStepTablet === 'number'
|
|
127
|
+
? scaleStepTablet
|
|
128
|
+
: Math.min(desktopValues.scaleStep, 0.08),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const mobileValues = {
|
|
132
|
+
cardOffset:
|
|
133
|
+
typeof cardOffsetMobile === 'number'
|
|
134
|
+
? cardOffsetMobile
|
|
135
|
+
: Math.max(6, desktopValues.cardOffset * 0.5),
|
|
136
|
+
initialStickyTop:
|
|
137
|
+
typeof initialStickyTopMobile === 'number'
|
|
138
|
+
? initialStickyTopMobile
|
|
139
|
+
: desktopValues.initialStickyTop,
|
|
140
|
+
depthZ:
|
|
141
|
+
typeof depthZMobile === 'number' ? depthZMobile : Math.max(8, desktopValues.depthZ * 0.35),
|
|
142
|
+
scaleStep:
|
|
143
|
+
typeof scaleStepMobile === 'number'
|
|
144
|
+
? scaleStepMobile
|
|
145
|
+
: Math.min(desktopValues.scaleStep, 0.045),
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (window.matchMedia('(max-width: 767px)').matches) return mobileValues
|
|
149
|
+
if (window.matchMedia('(max-width: 1023px)').matches) return tabletValues
|
|
150
|
+
|
|
151
|
+
return desktopValues
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function DDStackCards(props: DDStackCardsProps) {
|
|
155
|
+
const { cards, sectionId } = props
|
|
156
|
+
|
|
157
|
+
const wrapperRef = useRef<HTMLDivElement | null>(null)
|
|
158
|
+
const cardRefs = useRef<(HTMLElement | null)[]>([])
|
|
159
|
+
const [layoutValues, setLayoutValues] = useState<ResponsiveStackValues>(() => ({
|
|
160
|
+
cardOffset: typeof props.cardOffset === 'number' ? props.cardOffset : 14,
|
|
161
|
+
initialStickyTop: typeof props.initialStickyTop === 'number' ? props.initialStickyTop : 0,
|
|
162
|
+
depthZ: typeof props.depthZ === 'number' ? props.depthZ : 40,
|
|
163
|
+
scaleStep: typeof props.scaleStep === 'number' ? props.scaleStep : 0.18,
|
|
164
|
+
}))
|
|
165
|
+
|
|
166
|
+
useLayoutEffect(() => {
|
|
167
|
+
const updateValues = () => {
|
|
168
|
+
setLayoutValues(getResponsiveStackValues(props))
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
updateValues()
|
|
172
|
+
|
|
173
|
+
window.addEventListener('resize', updateValues)
|
|
174
|
+
|
|
175
|
+
return () => {
|
|
176
|
+
window.removeEventListener('resize', updateValues)
|
|
177
|
+
}
|
|
178
|
+
}, [
|
|
179
|
+
props.cardOffset,
|
|
180
|
+
props.initialStickyTop,
|
|
181
|
+
props.depthZ,
|
|
182
|
+
props.scaleStep,
|
|
183
|
+
props.cardOffsetTablet,
|
|
184
|
+
props.initialStickyTopTablet,
|
|
185
|
+
props.depthZTablet,
|
|
186
|
+
props.scaleStepTablet,
|
|
187
|
+
props.cardOffsetMobile,
|
|
188
|
+
props.initialStickyTopMobile,
|
|
189
|
+
props.depthZMobile,
|
|
190
|
+
props.scaleStepMobile,
|
|
191
|
+
])
|
|
192
|
+
|
|
193
|
+
useLayoutEffect(() => {
|
|
194
|
+
const timer = window.setTimeout(() => {
|
|
195
|
+
const wrapper = wrapperRef.current
|
|
196
|
+
const cardEls = cardRefs.current.filter(Boolean) as HTMLDivElement[]
|
|
197
|
+
|
|
198
|
+
if (!wrapper || !cardEls.length) return
|
|
199
|
+
|
|
200
|
+
const ctx = gsap.context(() => {
|
|
201
|
+
gsap.set(wrapper, {
|
|
202
|
+
autoAlpha: 1,
|
|
203
|
+
willChange: 'opacity',
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
gsap.set(cardEls, {
|
|
207
|
+
transformPerspective: 1200,
|
|
208
|
+
transformOrigin: 'top center',
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
cardEls.forEach((card, i) => {
|
|
212
|
+
for (let j = i + 1; j < cardEls.length; j++) {
|
|
213
|
+
const step = j - i
|
|
214
|
+
const prevStep = step - 1
|
|
215
|
+
const triggerStickyTop =
|
|
216
|
+
layoutValues.initialStickyTop + (j - 1) * layoutValues.cardOffset
|
|
217
|
+
|
|
218
|
+
gsap.fromTo(
|
|
219
|
+
card,
|
|
220
|
+
{
|
|
221
|
+
scale: 1 - prevStep * layoutValues.scaleStep,
|
|
222
|
+
z: -prevStep * layoutValues.depthZ,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
scale: 1 - step * layoutValues.scaleStep,
|
|
226
|
+
z: -step * layoutValues.depthZ,
|
|
227
|
+
force3D: true,
|
|
228
|
+
filter: `brightness(${Math.max(0.65, 1 - step * 0.06)})`,
|
|
229
|
+
borderRadius: '20px',
|
|
230
|
+
immediateRender: false,
|
|
231
|
+
scrollTrigger: {
|
|
232
|
+
trigger: cardEls[j],
|
|
233
|
+
start: `top ${triggerStickyTop + layoutValues.cardOffset}px`,
|
|
234
|
+
end: `top ${triggerStickyTop}px`,
|
|
235
|
+
scrub: true,
|
|
236
|
+
invalidateOnRefresh: true,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
const lastCard = cardEls[cardEls.length - 1]
|
|
244
|
+
|
|
245
|
+
gsap.to(wrapper, {
|
|
246
|
+
autoAlpha: 0,
|
|
247
|
+
ease: 'none',
|
|
248
|
+
scrollTrigger: {
|
|
249
|
+
trigger: lastCard,
|
|
250
|
+
start: 'top top',
|
|
251
|
+
end: () => `+=${window.innerHeight * 0.3}`,
|
|
252
|
+
scrub: true,
|
|
253
|
+
invalidateOnRefresh: true,
|
|
254
|
+
},
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
requestAnimationFrame(() => {
|
|
258
|
+
ScrollTrigger.refresh()
|
|
259
|
+
})
|
|
260
|
+
}, wrapper)
|
|
261
|
+
|
|
262
|
+
return () => ctx.revert()
|
|
263
|
+
}, 120)
|
|
264
|
+
|
|
265
|
+
return () => {
|
|
266
|
+
window.clearTimeout(timer)
|
|
267
|
+
}
|
|
268
|
+
}, [
|
|
269
|
+
layoutValues.cardOffset,
|
|
270
|
+
layoutValues.initialStickyTop,
|
|
271
|
+
layoutValues.depthZ,
|
|
272
|
+
layoutValues.scaleStep,
|
|
273
|
+
])
|
|
274
|
+
|
|
275
|
+
if (!cards?.length) return null
|
|
276
|
+
|
|
277
|
+
const totalCards = cards.length
|
|
278
|
+
|
|
279
|
+
return (
|
|
280
|
+
<section
|
|
281
|
+
ref={wrapperRef}
|
|
282
|
+
className="stack-cards-block relative w-full invert-[0.95] brightness-110 contrast-125 dark:brightness-100 dark:contrast-100 dark:invert-[0]"
|
|
283
|
+
>
|
|
284
|
+
{cards.map((card, i) => {
|
|
285
|
+
const accent = ACCENTS[card.accentVariant ?? 'lime']
|
|
286
|
+
const cardMedia =
|
|
287
|
+
card.image && typeof card.image === 'object' ? (card.image as Media) : null
|
|
288
|
+
|
|
289
|
+
return (
|
|
290
|
+
<section
|
|
291
|
+
key={card.id ?? i}
|
|
292
|
+
id={i === 0 ? (sectionId ?? undefined) : undefined}
|
|
293
|
+
ref={(el) => {
|
|
294
|
+
cardRefs.current[i] = el
|
|
295
|
+
}}
|
|
296
|
+
className="stack-card renderblock-container !sticky w-full overflow-hidden px-4 py-16 sm:px-6 lg:py-32"
|
|
297
|
+
style={{
|
|
298
|
+
top: `${layoutValues.initialStickyTop + i * layoutValues.cardOffset}px`,
|
|
299
|
+
zIndex: i + 1,
|
|
300
|
+
willChange: 'transform',
|
|
301
|
+
}}
|
|
302
|
+
>
|
|
303
|
+
<div
|
|
304
|
+
className="relative mx-auto w-full max-w-5xl overflow-hidden rounded-2xl"
|
|
305
|
+
style={{
|
|
306
|
+
background: 'rgb(8 8 10 / 90%)',
|
|
307
|
+
border: '1px solid rgba(255,255,255,0.07)',
|
|
308
|
+
backdropFilter: 'blur(8px)',
|
|
309
|
+
}}
|
|
310
|
+
>
|
|
311
|
+
<div
|
|
312
|
+
className="absolute left-0 right-0 top-0 h-px"
|
|
313
|
+
style={{
|
|
314
|
+
background: `linear-gradient(90deg, transparent, rgba(${accent.rgb},0.5), transparent)`,
|
|
315
|
+
}}
|
|
316
|
+
/>
|
|
317
|
+
|
|
318
|
+
<div className="grid min-h-70 grid-cols-[1fr_5.5rem] sm:grid-cols-[1fr_8rem] md:min-h-85 md:grid-cols-[1fr_auto]">
|
|
319
|
+
<div className="stackcard-bg flex flex-col justify-between p-6 md:p-10 lg:p-14">
|
|
320
|
+
<div>
|
|
321
|
+
<div className="mb-6 flex items-start justify-between md:mb-8">
|
|
322
|
+
<div className="flex items-center gap-3 md:gap-4">
|
|
323
|
+
<div
|
|
324
|
+
className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl md:h-12 md:w-12"
|
|
325
|
+
style={{
|
|
326
|
+
background: `rgba(${accent.rgb},0.1)`,
|
|
327
|
+
border: `1px solid rgba(${accent.rgb},0.25)`,
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<span style={{ color: accent.hex }}>
|
|
331
|
+
<DynamicIcon className="shrink-0" name={card.iconName} size={20} />
|
|
332
|
+
</span>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div>
|
|
336
|
+
{card.number && (
|
|
337
|
+
<div
|
|
338
|
+
className="mb-0.5 text-[10px] font-black uppercase tracking-widest md:text-xs"
|
|
339
|
+
style={{ color: `rgba(${accent.rgb},0.6)` }}
|
|
340
|
+
>
|
|
341
|
+
{card.number} / {String(totalCards).padStart(2, '0')}
|
|
342
|
+
</div>
|
|
343
|
+
)}
|
|
344
|
+
|
|
345
|
+
{card.title && (
|
|
346
|
+
<h3 className="text-xl font-extrabold tracking-tight text-stone-50/80 md:text-2xl lg:text-3xl">
|
|
347
|
+
{card.title}
|
|
348
|
+
</h3>
|
|
349
|
+
)}
|
|
350
|
+
</div>
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
{(card.statValue || card.statLabel) && (
|
|
354
|
+
<div className="hidden flex-col items-end md:flex">
|
|
355
|
+
{card.statValue && (
|
|
356
|
+
<span
|
|
357
|
+
className="text-4xl font-black leading-none"
|
|
358
|
+
style={{ color: accent.hex }}
|
|
359
|
+
>
|
|
360
|
+
{card.statValue}
|
|
361
|
+
</span>
|
|
362
|
+
)}
|
|
363
|
+
|
|
364
|
+
{card.statLabel && (
|
|
365
|
+
<span
|
|
366
|
+
className="mt-1 text-xs"
|
|
367
|
+
style={{ color: 'rgba(255,255,255,0.3)' }}
|
|
368
|
+
>
|
|
369
|
+
{card.statLabel}
|
|
370
|
+
</span>
|
|
371
|
+
)}
|
|
372
|
+
</div>
|
|
373
|
+
)}
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
{card.content ? (
|
|
377
|
+
<RichText
|
|
378
|
+
data={card.content as any}
|
|
379
|
+
enableProse={false}
|
|
380
|
+
enableGutter={false}
|
|
381
|
+
className="max-w-xl text-sm leading-relaxed text-stone-200 dark:text-stone-200 md:text-base"
|
|
382
|
+
style={{ color: 'rgba(255,255,255,0.45)' }}
|
|
383
|
+
/>
|
|
384
|
+
) : null}
|
|
385
|
+
</div>
|
|
386
|
+
|
|
387
|
+
<div className="mt-6 flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center md:mt-8">
|
|
388
|
+
{card.tags && card.tags.length > 0 && (
|
|
389
|
+
<div className="flex flex-wrap gap-2">
|
|
390
|
+
{card.tags.map((tagItem, ti) => (
|
|
391
|
+
<span
|
|
392
|
+
key={tagItem.id ?? ti}
|
|
393
|
+
className="rounded-full px-3 py-1 text-xs font-semibold"
|
|
394
|
+
style={{
|
|
395
|
+
background: `rgba(${accent.rgb},0.07)`,
|
|
396
|
+
border: `1px solid rgba(${accent.rgb},0.18)`,
|
|
397
|
+
color: accent.hex,
|
|
398
|
+
}}
|
|
399
|
+
>
|
|
400
|
+
{tagItem.tag}
|
|
401
|
+
</span>
|
|
402
|
+
))}
|
|
403
|
+
</div>
|
|
404
|
+
)}
|
|
405
|
+
|
|
406
|
+
{card.ctaLabel && (
|
|
407
|
+
<a
|
|
408
|
+
href={card.ctaHref ?? '#'}
|
|
409
|
+
className="group flex cursor-pointer items-center gap-2 whitespace-nowrap text-xs font-black uppercase tracking-widest"
|
|
410
|
+
style={{ color: accent.hex }}
|
|
411
|
+
>
|
|
412
|
+
{card.ctaLabel}
|
|
413
|
+
<ArrowRight
|
|
414
|
+
size={14}
|
|
415
|
+
className="transition-transform group-hover:translate-x-1"
|
|
416
|
+
style={{ color: accent.hex }}
|
|
417
|
+
/>
|
|
418
|
+
</a>
|
|
419
|
+
)}
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<div
|
|
424
|
+
className="relative flex w-22 items-center justify-center overflow-hidden sm:w-32 md:w-48 lg:w-64 xl:w-80"
|
|
425
|
+
style={{
|
|
426
|
+
borderLeft: `1px solid rgba(${accent.rgb},0.08)`,
|
|
427
|
+
background: `linear-gradient(135deg, rgba(${accent.rgb},0.04) 0%, transparent 100%)`,
|
|
428
|
+
}}
|
|
429
|
+
>
|
|
430
|
+
<div
|
|
431
|
+
className="absolute inset-0"
|
|
432
|
+
style={{
|
|
433
|
+
background: `radial-gradient(ellipse at 50% 50%, rgba(${accent.rgb},0.25) 0%, transparent 70%)`,
|
|
434
|
+
}}
|
|
435
|
+
/>
|
|
436
|
+
|
|
437
|
+
{isLocalImageSrc(cardMedia?.url) ? (
|
|
438
|
+
<Image
|
|
439
|
+
src={cardMedia.url}
|
|
440
|
+
alt={cardMedia.alt ?? card.title ?? ''}
|
|
441
|
+
fill
|
|
442
|
+
className="relative z-10 object-cover opacity-80"
|
|
443
|
+
sizes="(max-width: 640px) 88px, (max-width: 768px) 128px, (max-width: 1280px) 192px, 320px"
|
|
444
|
+
/>
|
|
445
|
+
) : (
|
|
446
|
+
<>
|
|
447
|
+
<span className="relative z-10" style={{ color: `rgba(${accent.rgb},1)` }}>
|
|
448
|
+
<DynamicIcon className="shrink-0" name={card.iconName} size={96} />
|
|
449
|
+
</span>
|
|
450
|
+
|
|
451
|
+
{card.number && (
|
|
452
|
+
<div
|
|
453
|
+
className="absolute bottom-4 right-6 select-none font-black leading-none"
|
|
454
|
+
style={{
|
|
455
|
+
fontSize: '80px',
|
|
456
|
+
color: `rgba(${accent.rgb},0.2)`,
|
|
457
|
+
}}
|
|
458
|
+
>
|
|
459
|
+
{card.number}
|
|
460
|
+
</div>
|
|
461
|
+
)}
|
|
462
|
+
</>
|
|
463
|
+
)}
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
</div>
|
|
467
|
+
</section>
|
|
468
|
+
)
|
|
469
|
+
})}
|
|
470
|
+
</section>
|
|
471
|
+
)
|
|
472
|
+
}
|
|
473
|
+
|