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
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import type { Block } from 'payload'
|
|
2
|
+
|
|
3
|
+
import { defaultLexical } from '@/fields/defaultLexical'
|
|
4
|
+
|
|
5
|
+
export const DDAnimText: Block = {
|
|
6
|
+
slug: 'DD-AnimText',
|
|
7
|
+
interfaceName: 'DDAnimText',
|
|
8
|
+
labels: {
|
|
9
|
+
singular: 'Animated Text',
|
|
10
|
+
plural: 'Animated Texts'
|
|
11
|
+
},
|
|
12
|
+
fields: [
|
|
13
|
+
{
|
|
14
|
+
name: 'animTextScrollSpeed',
|
|
15
|
+
type: 'text',
|
|
16
|
+
hidden: true,
|
|
17
|
+
label: 'Scroll Data Speed',
|
|
18
|
+
defaultValue: '0.2',
|
|
19
|
+
admin: {
|
|
20
|
+
description: 'Default value 0.2'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
// Custom class for textbox container - not working - not required
|
|
24
|
+
{
|
|
25
|
+
admin: {
|
|
26
|
+
initCollapsed: true,
|
|
27
|
+
hidden: true,
|
|
28
|
+
className: 'custom-css-class',
|
|
29
|
+
condition: (data) =>
|
|
30
|
+
data.variation === 'text-fade-up' ||
|
|
31
|
+
data.variation === 'text-fade-down' ||
|
|
32
|
+
data.variation === 'blur-in'
|
|
33
|
+
},
|
|
34
|
+
type: 'collapsible',
|
|
35
|
+
label: 'Container Classes (RichText Variations)',
|
|
36
|
+
fields: [
|
|
37
|
+
{
|
|
38
|
+
name: 'aniTextBoxContainerClass',
|
|
39
|
+
type: 'text',
|
|
40
|
+
hidden: false,
|
|
41
|
+
label: 'Animated Text Container Class'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'aniTextBoxClass',
|
|
45
|
+
type: 'text',
|
|
46
|
+
hidden: false,
|
|
47
|
+
label: 'Animated Text Box Class',
|
|
48
|
+
admin: {
|
|
49
|
+
description: 'Add additional class to the animated richText box.'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
// Custom class for all variations
|
|
55
|
+
{
|
|
56
|
+
admin: {
|
|
57
|
+
initCollapsed: true,
|
|
58
|
+
className: 'custom-css-class'
|
|
59
|
+
},
|
|
60
|
+
type: 'collapsible',
|
|
61
|
+
label: 'Text Classes (All Variations)',
|
|
62
|
+
fields: [
|
|
63
|
+
{
|
|
64
|
+
name: 'aniTextClass',
|
|
65
|
+
type: 'text',
|
|
66
|
+
label: false,
|
|
67
|
+
admin: {
|
|
68
|
+
description:
|
|
69
|
+
'Add an additional class to the animated text. This can be used to style the text or apply additional animations.'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'animatedText',
|
|
76
|
+
type: 'richText',
|
|
77
|
+
label: 'Text Content',
|
|
78
|
+
editor: defaultLexical,
|
|
79
|
+
admin: {
|
|
80
|
+
condition: (data, siblingData) =>
|
|
81
|
+
siblingData.variation === 'text-fade-up' ||
|
|
82
|
+
siblingData.variation === 'text-fade-down' ||
|
|
83
|
+
siblingData.variation === 'blur-in',
|
|
84
|
+
description:
|
|
85
|
+
'Add the text that will be animated. This will be used for text fade and blur effects.'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
name: 'plainText',
|
|
91
|
+
type: 'text',
|
|
92
|
+
label: 'Content',
|
|
93
|
+
admin: {
|
|
94
|
+
condition: (data, siblingData) =>
|
|
95
|
+
siblingData.variation !== 'text-fade-up' &&
|
|
96
|
+
siblingData.variation !== 'text-fade-down' &&
|
|
97
|
+
siblingData.variation !== 'blur-in',
|
|
98
|
+
description: 'The text content that will be animated.'
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'rotateWords',
|
|
103
|
+
type: 'text',
|
|
104
|
+
label: 'Rotating Words or Letters',
|
|
105
|
+
admin: {
|
|
106
|
+
condition: (data, siblingData) => siblingData.variation === 'rotate',
|
|
107
|
+
description: 'Comma-separated words to rotate through.'
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'variation',
|
|
112
|
+
type: 'select',
|
|
113
|
+
label: 'Animation Type',
|
|
114
|
+
defaultValue: 'text-fade-up',
|
|
115
|
+
options: [
|
|
116
|
+
{ label: 'No Animation', value: 'no-animation' },
|
|
117
|
+
{ label: 'Split Text', value: 'split-text' },
|
|
118
|
+
{ label: 'Text Type', value: 'text-type' },
|
|
119
|
+
{ label: 'Shuffle Text', value: 'shuffle-text' },
|
|
120
|
+
{ label: 'Shiny Text', value: 'shiny-text' },
|
|
121
|
+
{ label: 'Gradual Spacing', value: 'gradual-spacing' },
|
|
122
|
+
{ label: 'Typing Effect', value: 'typing' },
|
|
123
|
+
{ label: 'Staggered Fade', value: 'staggered-fade' },
|
|
124
|
+
{ label: 'Rotate Words', value: 'rotate' },
|
|
125
|
+
{ label: 'Letters Pull Up', value: 'letters-pull-up' },
|
|
126
|
+
{ label: 'Words Pull Up', value: 'words-pull-up' },
|
|
127
|
+
{ label: 'Blur In', value: 'blur-in' },
|
|
128
|
+
{ label: 'Text Fade Up', value: 'text-fade-up' },
|
|
129
|
+
{ label: 'Text Fade Down', value: 'text-fade-down' }
|
|
130
|
+
],
|
|
131
|
+
|
|
132
|
+
admin: {
|
|
133
|
+
description: 'Select the animation style for this text.'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
// Split Text variant fields
|
|
137
|
+
{
|
|
138
|
+
admin: {
|
|
139
|
+
initCollapsed: true,
|
|
140
|
+
condition: (data, siblingData) => siblingData.variation === 'split-text'
|
|
141
|
+
},
|
|
142
|
+
type: 'collapsible',
|
|
143
|
+
label: 'Split Text Settings',
|
|
144
|
+
fields: [
|
|
145
|
+
{
|
|
146
|
+
name: 'splitTrigger',
|
|
147
|
+
type: 'select',
|
|
148
|
+
label: 'Animation Trigger',
|
|
149
|
+
defaultValue: 'view',
|
|
150
|
+
options: [
|
|
151
|
+
{ label: 'In View', value: 'view' },
|
|
152
|
+
{ label: 'Hover', value: 'hover' },
|
|
153
|
+
{ label: 'Click', value: 'click' }
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'splitDelay',
|
|
158
|
+
type: 'number',
|
|
159
|
+
label: 'Character Delay (seconds)',
|
|
160
|
+
defaultValue: 0.05,
|
|
161
|
+
admin: {
|
|
162
|
+
step: 0.01
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'splitDuration',
|
|
167
|
+
type: 'number',
|
|
168
|
+
label: 'Animation Duration (seconds)',
|
|
169
|
+
defaultValue: 0.6,
|
|
170
|
+
admin: {
|
|
171
|
+
step: 0.1
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'splitEase',
|
|
176
|
+
type: 'text',
|
|
177
|
+
label: 'Animation Ease',
|
|
178
|
+
defaultValue: 'back.out(1.7)',
|
|
179
|
+
admin: {
|
|
180
|
+
description: 'GSAP ease string (e.g., "power2.out", "elastic.out(1, 0.3)")'
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'splitYOffset',
|
|
185
|
+
type: 'number',
|
|
186
|
+
label: 'Y Offset (pixels)',
|
|
187
|
+
defaultValue: 80
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'splitOpacity',
|
|
191
|
+
type: 'checkbox',
|
|
192
|
+
label: 'Animate Opacity',
|
|
193
|
+
defaultValue: true
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
// Text Type variant fields
|
|
198
|
+
{
|
|
199
|
+
admin: {
|
|
200
|
+
initCollapsed: true,
|
|
201
|
+
condition: (data, siblingData) => siblingData.variation === 'text-type'
|
|
202
|
+
},
|
|
203
|
+
type: 'collapsible',
|
|
204
|
+
label: 'Text Type Settings',
|
|
205
|
+
fields: [
|
|
206
|
+
{
|
|
207
|
+
name: 'typeSpeed',
|
|
208
|
+
type: 'number',
|
|
209
|
+
label: 'Typing Speed (ms)',
|
|
210
|
+
defaultValue: 100
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'typeDelay',
|
|
214
|
+
type: 'number',
|
|
215
|
+
label: 'Start Delay (ms)',
|
|
216
|
+
defaultValue: 0
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'showCursor',
|
|
220
|
+
type: 'checkbox',
|
|
221
|
+
label: 'Show Cursor',
|
|
222
|
+
defaultValue: true
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'cursorChar',
|
|
226
|
+
type: 'text',
|
|
227
|
+
label: 'Cursor Character',
|
|
228
|
+
defaultValue: '|'
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: 'autoStart',
|
|
232
|
+
type: 'checkbox',
|
|
233
|
+
label: 'Auto Start',
|
|
234
|
+
defaultValue: true,
|
|
235
|
+
admin: {
|
|
236
|
+
description: 'Start typing automatically when component mounts'
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
// Shuffle Text variant fields
|
|
242
|
+
{
|
|
243
|
+
admin: {
|
|
244
|
+
initCollapsed: true,
|
|
245
|
+
condition: (data, siblingData) => siblingData.variation === 'shuffle-text'
|
|
246
|
+
},
|
|
247
|
+
type: 'collapsible',
|
|
248
|
+
label: 'Shuffle Text Settings',
|
|
249
|
+
fields: [
|
|
250
|
+
{
|
|
251
|
+
name: 'shuffleDuration',
|
|
252
|
+
type: 'number',
|
|
253
|
+
label: 'Shuffle Duration (seconds)',
|
|
254
|
+
defaultValue: 0.8,
|
|
255
|
+
admin: {
|
|
256
|
+
step: 0.1,
|
|
257
|
+
description: 'Duration of the shuffle animation'
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
// Shiny Text variant fields
|
|
263
|
+
{
|
|
264
|
+
admin: {
|
|
265
|
+
condition: (data, siblingData) => siblingData.variation === 'shiny-text'
|
|
266
|
+
},
|
|
267
|
+
type: 'row',
|
|
268
|
+
fields: [
|
|
269
|
+
{
|
|
270
|
+
name: 'shinyDuration',
|
|
271
|
+
type: 'number',
|
|
272
|
+
label: 'Animation Speed (seconds)',
|
|
273
|
+
defaultValue: 5,
|
|
274
|
+
admin: {
|
|
275
|
+
width: '50%',
|
|
276
|
+
step: 0.5,
|
|
277
|
+
description: 'Speed of the shine animation (higher = slower)'
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: 'shinyColor',
|
|
282
|
+
type: 'text',
|
|
283
|
+
label: 'Shine Color (hex or rgba)',
|
|
284
|
+
defaultValue: 'rgba(255, 255, 255, 0.6)',
|
|
285
|
+
admin: {
|
|
286
|
+
width: '50%',
|
|
287
|
+
description: 'CSS color for the shine effect (e.g., #ffffff, rgba(255, 255, 255, 0.6))'
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export default DDAnimText
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "block",
|
|
3
|
+
"name": "DD-AnimText",
|
|
4
|
+
"label": "Animated Text",
|
|
5
|
+
"sourceName": "AnimatedText",
|
|
6
|
+
"portableName": "DD-AnimText",
|
|
7
|
+
"slug": "DD-AnimText",
|
|
8
|
+
"version": "0.0.1",
|
|
9
|
+
"source": {
|
|
10
|
+
"repo": "Hadizainal/DesignsDustedv3",
|
|
11
|
+
"originalPath": "src/blocks/AnimatedText",
|
|
12
|
+
"originalSlug": "animatedText",
|
|
13
|
+
"originalConfigExport": "AnimatedText",
|
|
14
|
+
"originalComponentExport": "AnimatedText",
|
|
15
|
+
"originalInterfaceName": "DDAnimText"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
{
|
|
19
|
+
"from": "Component.tsx",
|
|
20
|
+
"to": "src/blocks/DD-AnimText/Component.tsx"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"from": "config.ts",
|
|
24
|
+
"to": "src/blocks/DD-AnimText/config.ts"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"dependencies": [
|
|
28
|
+
{
|
|
29
|
+
"name": "framer-motion"
|
|
30
|
+
},
|
|
31
|
+
"@gsap/react",
|
|
32
|
+
"gsap"
|
|
33
|
+
],
|
|
34
|
+
"sharedFiles": [
|
|
35
|
+
{
|
|
36
|
+
"from": "templates/shared/src/components/ui/anims",
|
|
37
|
+
"to": "src/components/ui/anims",
|
|
38
|
+
"required": true,
|
|
39
|
+
"safeToCopy": true
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"requiredProjectFiles": [],
|
|
43
|
+
"optionalProjectFiles": [],
|
|
44
|
+
"collectionRegistration": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"collections": [
|
|
47
|
+
"Pages",
|
|
48
|
+
"Posts"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"renderBlocksRegistration": {
|
|
52
|
+
"enabled": true
|
|
53
|
+
},
|
|
54
|
+
"renderBlocksBehavior": {
|
|
55
|
+
"wrapperless": false
|
|
56
|
+
},
|
|
57
|
+
"pageRouteIntegration": {
|
|
58
|
+
"required": false,
|
|
59
|
+
"manualSteps": []
|
|
60
|
+
},
|
|
61
|
+
"manual": [
|
|
62
|
+
"Register DDAnimText in Pages/Posts blocks arrays if automatic registration was skipped.",
|
|
63
|
+
"Register DD-AnimText in RenderBlocks if automatic registration was skipped.",
|
|
64
|
+
"Run payload generate:types after schema changes."
|
|
65
|
+
],
|
|
66
|
+
"manualSteps": [
|
|
67
|
+
"Register DDAnimText in Pages/Posts blocks arrays if automatic registration was skipped.",
|
|
68
|
+
"Register DD-AnimText in RenderBlocks if automatic registration was skipped.",
|
|
69
|
+
"Run payload generate:types after schema changes."
|
|
70
|
+
],
|
|
71
|
+
"patchTargets": {
|
|
72
|
+
"blockConfigRegistration": {
|
|
73
|
+
"description": "Installer can add import { DDAnimText } from '@/blocks/DD-AnimText/config' and add DDAnimText to clear Pages/Posts block arrays."
|
|
74
|
+
},
|
|
75
|
+
"renderBlocksRegistration": {
|
|
76
|
+
"description": "Installer can register DD-AnimText in RenderBlocks."
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"notes": [
|
|
80
|
+
"Portable conversion keeps framer-motion animation. Raw GSAP SplitText modes are not bundled in this first pass.",
|
|
81
|
+
"Manifest includes shared local support files required by original DesignsDusted source imports."
|
|
82
|
+
],
|
|
83
|
+
"exportName": "DDAnimText",
|
|
84
|
+
"interfaceName": "DDAnimText"
|
|
85
|
+
}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
5
|
+
import { createPortal } from 'react-dom'
|
|
6
|
+
import { motion } from 'framer-motion'
|
|
7
|
+
import { ArrowDownWideNarrow } from 'lucide-react'
|
|
8
|
+
import { extractCustomCSS } from '@/utilities/renderCustomCSS'
|
|
9
|
+
|
|
10
|
+
const Divider: React.FC = () => (
|
|
11
|
+
<span className="block h-px w-4 shrink-0 bg-white/55 dark:bg-white/55" />
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
const FadeEdges: React.FC = () => (
|
|
15
|
+
<div className="sticky top-0 z-[100]">
|
|
16
|
+
<div
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
className="pointer-events-none absolute -left-1 -top-1 h-24 w-screen bg-gradient-to-b from-[var(--color-muted,transparent)] to-transparent blur-[6px]"
|
|
19
|
+
/>
|
|
20
|
+
<div
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
className="pointer-events-none absolute -bottom-1 -left-1 h-24 w-screen bg-gradient-to-t from-[var(--color-muted,transparent)] to-transparent"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const rowVariants = {
|
|
28
|
+
hidden: { opacity: 0, y: 10 },
|
|
29
|
+
show: {
|
|
30
|
+
opacity: 1,
|
|
31
|
+
y: 0,
|
|
32
|
+
transition: {
|
|
33
|
+
type: 'spring' as const,
|
|
34
|
+
stiffness: 200,
|
|
35
|
+
damping: 20,
|
|
36
|
+
staggerChildren: 0.1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} as const
|
|
40
|
+
|
|
41
|
+
const childBarVariants = (w = 55) => ({
|
|
42
|
+
rest: { width: 36, backgroundColor: 'rgba(255,255,255,0.65)' },
|
|
43
|
+
hover: { width: w, backgroundColor: 'var(--accent)' }
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const childTextVariants = {
|
|
47
|
+
rest: { opacity: 1, color: 'inherit', filter: 'brightness(1.1)' },
|
|
48
|
+
hover: { opacity: 1, color: 'var(--accent)' }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const ParentRow: React.FC<{ label: string; index: number }> = ({ label, index }) => (
|
|
52
|
+
<motion.div
|
|
53
|
+
initial="hidden"
|
|
54
|
+
animate="show"
|
|
55
|
+
variants={rowVariants}
|
|
56
|
+
custom={index}
|
|
57
|
+
className="relative color-alt will-change-[transform,opacity]"
|
|
58
|
+
transition={{
|
|
59
|
+
delay: index * 0.025,
|
|
60
|
+
type: 'spring',
|
|
61
|
+
stiffness: 200,
|
|
62
|
+
damping: 20
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<div className="group relative flex h-px items-center gap-3 py-2">
|
|
66
|
+
<span className="inline-block h-px w-9 shrink-0 bg-white/65 text-sm opacity-100 dark:bg-white/65" />
|
|
67
|
+
<span className="color-text whitespace-nowrap text-md font-semibold uppercase opacity-100">
|
|
68
|
+
{label}
|
|
69
|
+
</span>
|
|
70
|
+
</div>
|
|
71
|
+
</motion.div>
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
const ChildRow: React.FC<{
|
|
75
|
+
targetSection?: string
|
|
76
|
+
label: string
|
|
77
|
+
index: number
|
|
78
|
+
wideOnHover?: number
|
|
79
|
+
scrollOffset?: number
|
|
80
|
+
}> = ({ targetSection, label, index, wideOnHover = 55, scrollOffset = -100 }) => {
|
|
81
|
+
const handleScrollTo = (e: React.MouseEvent) => {
|
|
82
|
+
e.preventDefault()
|
|
83
|
+
|
|
84
|
+
if (!targetSection) return
|
|
85
|
+
|
|
86
|
+
const el = document.getElementById(targetSection)
|
|
87
|
+
|
|
88
|
+
if (!el) {
|
|
89
|
+
console.warn(`Target element with id "${targetSection}" not found`)
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const elementTop = el.getBoundingClientRect().top + window.pageYOffset
|
|
94
|
+
const targetTop = elementTop + scrollOffset
|
|
95
|
+
|
|
96
|
+
window.scrollTo({ top: targetTop, behavior: 'smooth' })
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<motion.div
|
|
101
|
+
initial="hidden"
|
|
102
|
+
animate="show"
|
|
103
|
+
variants={rowVariants}
|
|
104
|
+
custom={index}
|
|
105
|
+
transition={{
|
|
106
|
+
delay: index * 0.025,
|
|
107
|
+
type: 'spring',
|
|
108
|
+
stiffness: 200,
|
|
109
|
+
damping: 20
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<motion.button
|
|
113
|
+
onClick={handleScrollTo}
|
|
114
|
+
initial="rest"
|
|
115
|
+
whileHover="hover"
|
|
116
|
+
animate="rest"
|
|
117
|
+
disabled={!targetSection}
|
|
118
|
+
className="group relative flex h-px cursor-pointer items-center gap-4 border-0 bg-transparent py-0 text-left text-sm opacity-50 hover:opacity-100 will-change-[transform,opacity] after:absolute after:left-0 after:top-1/2 after:size-full after:-translate-y-1/2 after:p-[12px] disabled:cursor-not-allowed disabled:opacity-50 disabled:[&_*]:opacity-30 focus-visible:rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--dd-accent,#9803e2)]"
|
|
119
|
+
>
|
|
120
|
+
<motion.span
|
|
121
|
+
className="inline-block h-px shrink-0 text-sm opacity-100 will-change-[width,background-color]"
|
|
122
|
+
variants={childBarVariants(wideOnHover)}
|
|
123
|
+
transition={{ type: 'spring', stiffness: 500, damping: 35 }}
|
|
124
|
+
/>
|
|
125
|
+
|
|
126
|
+
<motion.span
|
|
127
|
+
className="whitespace-nowrap text-sm !font-medium text-stone-400 transition-all ease-out will-change-[color,opacity] group-hover:!font-semibold group-hover:text-[var(--dd-accent,#9803e2)]"
|
|
128
|
+
variants={childTextVariants}
|
|
129
|
+
transition={{ type: 'spring', stiffness: 500, damping: 35 }}
|
|
130
|
+
>
|
|
131
|
+
{label}
|
|
132
|
+
</motion.span>
|
|
133
|
+
</motion.button>
|
|
134
|
+
</motion.div>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface AsideScrollLinksProps {
|
|
139
|
+
parentSections?: Array<{
|
|
140
|
+
sectionId?: string
|
|
141
|
+
label: string
|
|
142
|
+
children?: Array<{
|
|
143
|
+
linkId?: string
|
|
144
|
+
label: string
|
|
145
|
+
targetSection?: string
|
|
146
|
+
scrollOffset?: number
|
|
147
|
+
wideOnHover?: number
|
|
148
|
+
}>
|
|
149
|
+
}>
|
|
150
|
+
position?: 'left' | 'right'
|
|
151
|
+
zIndex?: number
|
|
152
|
+
offsetFromEdge?: number
|
|
153
|
+
className?: string
|
|
154
|
+
blockName?: string
|
|
155
|
+
enableCustomCSS?: boolean
|
|
156
|
+
customCSS?: any[]
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function AsideNav({
|
|
160
|
+
parentSections = [
|
|
161
|
+
{
|
|
162
|
+
label: 'Out of the box',
|
|
163
|
+
children: [{ label: 'Aside PageLinks', targetSection: 's1' }]
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
position = 'left',
|
|
167
|
+
offsetFromEdge = 8,
|
|
168
|
+
enableCustomCSS = false,
|
|
169
|
+
customCSS = []
|
|
170
|
+
}: AsideScrollLinksProps) {
|
|
171
|
+
const [mounted, setMounted] = useState(false)
|
|
172
|
+
const styleIdRef = useRef(`aside-nav-css-${Math.random().toString(36).slice(2)}`)
|
|
173
|
+
|
|
174
|
+
const extractedCSS = enableCustomCSS && customCSS?.length > 0 ? extractCustomCSS(customCSS) : ''
|
|
175
|
+
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
setMounted(true)
|
|
178
|
+
}, [])
|
|
179
|
+
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (!extractedCSS) return
|
|
182
|
+
|
|
183
|
+
const styleId = styleIdRef.current
|
|
184
|
+
const existingStyle = document.getElementById(styleId)
|
|
185
|
+
|
|
186
|
+
if (existingStyle) {
|
|
187
|
+
existingStyle.textContent = extractedCSS
|
|
188
|
+
} else {
|
|
189
|
+
const style = document.createElement('style')
|
|
190
|
+
style.id = styleId
|
|
191
|
+
style.textContent = extractedCSS
|
|
192
|
+
document.head.appendChild(style)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return () => {
|
|
196
|
+
document.getElementById(styleId)?.remove()
|
|
197
|
+
}
|
|
198
|
+
}, [extractedCSS])
|
|
199
|
+
|
|
200
|
+
const items = useMemo(() => {
|
|
201
|
+
const flat: Array<{
|
|
202
|
+
type: 'parent' | 'child'
|
|
203
|
+
label: string
|
|
204
|
+
targetSection?: string
|
|
205
|
+
scrollOffset?: number
|
|
206
|
+
wideOnHover?: number
|
|
207
|
+
}> = []
|
|
208
|
+
|
|
209
|
+
parentSections.forEach((p) => {
|
|
210
|
+
flat.push({ type: 'parent', label: p.label })
|
|
211
|
+
|
|
212
|
+
p.children?.forEach((c) =>
|
|
213
|
+
flat.push({
|
|
214
|
+
type: 'child',
|
|
215
|
+
label: c.label,
|
|
216
|
+
targetSection: c.targetSection,
|
|
217
|
+
scrollOffset: c.scrollOffset,
|
|
218
|
+
wideOnHover: c.wideOnHover
|
|
219
|
+
})
|
|
220
|
+
)
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
return flat
|
|
224
|
+
}, [parentSections])
|
|
225
|
+
|
|
226
|
+
const positionClass = position === 'left' ? 'left-2' : 'right-2'
|
|
227
|
+
|
|
228
|
+
const asideContent = (
|
|
229
|
+
<aside
|
|
230
|
+
className={[
|
|
231
|
+
'aside-scroll-block group fixed top-16 z-[200] flex items-start overflow-hidden opacity-100 shadow-lg transition-[width,height,max-width,max-height,border-radius,padding] duration-300 delay-50 hover:delay-0 focus-within:delay-0',
|
|
232
|
+
'h-[2.3rem] w-[2.3rem] max-w-[12rem] max-h-[30vh] p-px',
|
|
233
|
+
'rounded-2xl backdrop-blur-[10px]',
|
|
234
|
+
'bg-[var(--border)] border-[2px] border-ridge border-[#edededf0] shadow-[inset_0_0_20px_0px_rgb(255_255_255_/_80%)]',
|
|
235
|
+
'dark:bg-[var(--background)] dark:border-[rgba(245,245,245,0.5)] dark:shadow-[inset_0_0_20px_#ffffff70]',
|
|
236
|
+
'hover:h-auto hover:w-[calc(100%+1rem)] hover:max-w-[15rem] hover:max-h-[40vh] hover:rounded-2xl hover:p-1 hover:duration-200 focus-within:h-auto focus-within:w-[calc(100%+1rem)] focus-within:max-w-[15rem] focus-within:max-h-[40vh] focus-within:rounded-2xl focus-within:p-1',
|
|
237
|
+
positionClass
|
|
238
|
+
].join(' ')}
|
|
239
|
+
style={{
|
|
240
|
+
opacity: 1,
|
|
241
|
+
transform: 'none',
|
|
242
|
+
[position]: `${offsetFromEdge}px`
|
|
243
|
+
}}
|
|
244
|
+
>
|
|
245
|
+
<div
|
|
246
|
+
data-lenis-prevent
|
|
247
|
+
className={[
|
|
248
|
+
'aside-inner-box relative flex h-full w-full overflow-hidden p-1 text-[14px] tracking-tight backdrop-blur-md transition-all duration-300',
|
|
249
|
+
'rounded-2xl bg-[rgba(5,5,5,0.5)] border border-[rgba(152,3,226,0.1)]',
|
|
250
|
+
'dark:bg-[rgba(22,20,34,0.9)] dark:border-[rgba(152,3,226,0.15)]',
|
|
251
|
+
'group-hover:rounded-xl group-hover:p-0.5 group-focus-within:rounded-xl group-focus-within:p-0.5'
|
|
252
|
+
].join(' ')}
|
|
253
|
+
>
|
|
254
|
+
<div className="w-full overflow-hidden">
|
|
255
|
+
<ArrowDownWideNarrow className="icon-arrow-down-wide-narrow color-alt sticky left-0 top-1 z-[100] h-auto w-6 shrink-0 p-1" />
|
|
256
|
+
|
|
257
|
+
<FadeEdges />
|
|
258
|
+
|
|
259
|
+
<nav
|
|
260
|
+
data-lenis-prevent
|
|
261
|
+
className="aside-nav-list pointer-events-none relative m-0 flex h-fit max-h-[40vh] w-full flex-col gap-2 overflow-x-clip overflow-y-auto px-0 pb-24 pt-2 text-stone-200 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&::-webkit-scrollbar]:h-0 [&::-webkit-scrollbar]:w-0 dark:text-stone-200"
|
|
262
|
+
>
|
|
263
|
+
{items.map((it, i) => {
|
|
264
|
+
if (it.type === 'parent') {
|
|
265
|
+
return (
|
|
266
|
+
<React.Fragment key={`p-${i}`}>
|
|
267
|
+
<ParentRow label={it.label} index={i} />
|
|
268
|
+
<Divider />
|
|
269
|
+
<Divider />
|
|
270
|
+
</React.Fragment>
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return (
|
|
275
|
+
<React.Fragment key={`c-${i}`}>
|
|
276
|
+
<ChildRow
|
|
277
|
+
targetSection={it.targetSection}
|
|
278
|
+
label={it.label}
|
|
279
|
+
index={i}
|
|
280
|
+
wideOnHover={it.wideOnHover ?? 55}
|
|
281
|
+
scrollOffset={it.scrollOffset ?? -100}
|
|
282
|
+
/>
|
|
283
|
+
<Divider />
|
|
284
|
+
<Divider />
|
|
285
|
+
<Divider />
|
|
286
|
+
</React.Fragment>
|
|
287
|
+
)
|
|
288
|
+
})}
|
|
289
|
+
</nav>
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
|
|
293
|
+
<style jsx global>{`
|
|
294
|
+
.aside-nav-list {
|
|
295
|
+
-ms-overflow-style: none !important;
|
|
296
|
+
scrollbar-width: none !important;
|
|
297
|
+
overscroll-behavior: contain;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.aside-nav-list::-webkit-scrollbar,
|
|
301
|
+
.aside-nav-list *::-webkit-scrollbar {
|
|
302
|
+
display: none !important;
|
|
303
|
+
width: 0 !important;
|
|
304
|
+
height: 0 !important;
|
|
305
|
+
background: transparent !important;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.aside-scroll-block {
|
|
309
|
+
border-style: ridge;
|
|
310
|
+
}
|
|
311
|
+
`}</style>
|
|
312
|
+
</aside>
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
if (!mounted || typeof window === 'undefined') return null
|
|
316
|
+
|
|
317
|
+
return createPortal(asideContent, document.body)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export { AsideNav as DDAsideNav }
|
|
321
|
+
export default AsideNav
|