@shohojdhara/atomix 0.2.1 → 0.2.3
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 +1 -28
- package/dist/atomix.css +1500 -241
- package/dist/atomix.min.css +6 -6
- package/dist/index.d.ts +1052 -194
- package/dist/index.esm.js +12201 -6066
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5481 -2827
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +1500 -301
- package/dist/themes/boomdevs.min.css +60 -8
- package/dist/themes/esrar.css +1500 -241
- package/dist/themes/esrar.min.css +6 -6
- package/dist/themes/mashroom.css +1496 -237
- package/dist/themes/mashroom.min.css +8 -8
- package/dist/themes/shaj-default.css +1451 -192
- package/dist/themes/shaj-default.min.css +6 -6
- package/package.json +66 -15
- package/src/components/Accordion/Accordion.stories.tsx +137 -0
- package/src/components/Accordion/Accordion.tsx +33 -3
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +3011 -0
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +199 -0
- package/src/components/AtomixGlass/AtomixGlass.tsx +1281 -0
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +1369 -0
- package/src/components/AtomixGlass/README.md +134 -0
- package/src/components/AtomixGlass/index.ts +10 -0
- package/src/components/AtomixGlass/shader-utils.ts +140 -0
- package/src/components/AtomixGlass/utils.ts +8 -0
- package/src/components/Badge/Badge.stories.tsx +169 -0
- package/src/components/Badge/Badge.tsx +27 -2
- package/src/components/Button/Button.stories.tsx +345 -0
- package/src/components/Button/Button.tsx +35 -3
- package/src/components/Button/README.md +216 -0
- package/src/components/Callout/Callout.stories.tsx +813 -78
- package/src/components/Callout/Callout.test.tsx +368 -0
- package/src/components/Callout/Callout.tsx +26 -7
- package/src/components/Callout/README.md +409 -0
- package/src/components/Card/Card.stories.tsx +140 -0
- package/src/components/Card/Card.tsx +19 -3
- package/src/components/DatePicker/DatePicker copy.tsx +551 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +188 -0
- package/src/components/DatePicker/DatePicker.tsx +379 -332
- package/src/components/DatePicker/readme.md +110 -1
- package/src/components/DatePicker/types.ts +8 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +145 -0
- package/src/components/Dropdown/Dropdown.tsx +34 -5
- package/src/components/Footer/Footer.stories.tsx +388 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/FooterLink.tsx +72 -0
- package/src/components/Footer/FooterSection.tsx +87 -0
- package/src/components/Footer/FooterSocialLink.tsx +117 -0
- package/src/components/Footer/README.md +261 -0
- package/src/components/Footer/index.ts +13 -0
- package/src/components/Form/Checkbox.stories.tsx +101 -0
- package/src/components/Form/Checkbox.tsx +26 -2
- package/src/components/Form/Input.stories.tsx +124 -0
- package/src/components/Form/Input.tsx +36 -7
- package/src/components/Form/Radio.stories.tsx +139 -0
- package/src/components/Form/Radio.tsx +26 -2
- package/src/components/Form/Select.stories.tsx +110 -0
- package/src/components/Form/Select.tsx +26 -2
- package/src/components/Form/Textarea.stories.tsx +104 -0
- package/src/components/Form/Textarea.tsx +36 -7
- package/src/components/Hero/Hero.stories.tsx +54 -1
- package/src/components/Hero/Hero.tsx +70 -11
- package/src/components/Modal/Modal.stories.tsx +235 -0
- package/src/components/Modal/Modal.tsx +64 -35
- package/src/components/Pagination/Pagination.stories.tsx +101 -0
- package/src/components/Pagination/Pagination.tsx +25 -1
- package/src/components/Popover/Popover.stories.tsx +94 -0
- package/src/components/Popover/Popover.tsx +30 -4
- package/src/components/Rating/Rating.stories.tsx +112 -0
- package/src/components/Rating/Rating.tsx +25 -1
- package/src/components/SectionIntro/SectionIntro.tsx +9 -11
- package/src/components/Slider/Slider.stories.tsx +634 -50
- package/src/components/Slider/Slider.tsx +5 -3
- package/src/components/Steps/Steps.stories.tsx +119 -0
- package/src/components/Steps/Steps.tsx +32 -1
- package/src/components/Tab/Tab.stories.tsx +88 -0
- package/src/components/Tab/Tab.tsx +32 -1
- package/src/components/Toggle/Toggle.stories.tsx +92 -0
- package/src/components/Toggle/Toggle.tsx +32 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +131 -0
- package/src/components/Tooltip/Tooltip.tsx +43 -7
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +1002 -196
- package/src/components/VideoPlayer/VideoPlayer.tsx +161 -4
- package/src/components/index.ts +14 -0
- package/src/layouts/Grid/Grid.stories.tsx +226 -159
- package/src/lib/composables/index.ts +4 -0
- package/src/lib/composables/useAtomixGlass.ts +71 -0
- package/src/lib/composables/useButton.ts +3 -1
- package/src/lib/composables/useCallout.ts +4 -1
- package/src/lib/composables/useFooter.ts +85 -0
- package/src/lib/composables/useGlassContainer.ts +168 -0
- package/src/lib/composables/useSlider.ts +191 -4
- package/src/lib/constants/components.ts +173 -0
- package/src/lib/types/components.ts +622 -0
- package/src/lib/utils/displacement-generator.ts +86 -0
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.accordion.scss +20 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
- package/src/styles/01-settings/_settings.avatar.scss +17 -18
- package/src/styles/01-settings/_settings.background.scss +10 -0
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +8 -2
- package/src/styles/01-settings/_settings.callout.scss +7 -7
- package/src/styles/01-settings/_settings.card.scss +2 -2
- package/src/styles/01-settings/_settings.chart.scss +7 -7
- package/src/styles/01-settings/_settings.checkbox-group.scss +5 -2
- package/src/styles/01-settings/_settings.checkbox.scss +10 -4
- package/src/styles/01-settings/_settings.countdown.scss +6 -4
- package/src/styles/01-settings/_settings.dropdown.scss +9 -7
- package/src/styles/01-settings/_settings.edge-panel.scss +3 -2
- package/src/styles/01-settings/_settings.footer.scss +125 -0
- package/src/styles/01-settings/_settings.form-group.scss +3 -1
- package/src/styles/01-settings/_settings.form.scss +4 -2
- package/src/styles/01-settings/_settings.hero.scss +9 -7
- package/src/styles/01-settings/_settings.input.scss +9 -7
- package/src/styles/01-settings/_settings.list-group.scss +4 -2
- package/src/styles/01-settings/_settings.list.scss +4 -2
- package/src/styles/01-settings/_settings.menu.scss +10 -8
- package/src/styles/01-settings/_settings.messages.scss +19 -17
- package/src/styles/01-settings/_settings.modal.scss +6 -4
- package/src/styles/01-settings/_settings.nav.scss +6 -4
- package/src/styles/01-settings/_settings.navbar.scss +8 -5
- package/src/styles/01-settings/_settings.pagination.scss +5 -3
- package/src/styles/01-settings/_settings.popover.scss +6 -4
- package/src/styles/01-settings/_settings.rating.scss +5 -3
- package/src/styles/01-settings/_settings.river.scss +8 -6
- package/src/styles/01-settings/_settings.sectionintro.scss +8 -6
- package/src/styles/01-settings/_settings.select.scss +7 -5
- package/src/styles/01-settings/_settings.side-menu.scss +15 -13
- package/src/styles/01-settings/_settings.spacing.scss +4 -0
- package/src/styles/01-settings/_settings.steps.scss +7 -5
- package/src/styles/01-settings/_settings.tabs.scss +7 -5
- package/src/styles/01-settings/_settings.testimonials.scss +6 -4
- package/src/styles/01-settings/_settings.toggle.scss +3 -1
- package/src/styles/01-settings/_settings.tooltip.scss +5 -3
- package/src/styles/01-settings/_settings.upload.scss +22 -20
- package/src/styles/02-tools/_tools.animations.scss +19 -0
- package/src/styles/02-tools/_tools.background.scss +87 -0
- package/src/styles/02-tools/_tools.glass.scss +1 -0
- package/src/styles/02-tools/_tools.rem.scss +18 -5
- package/src/styles/02-tools/_tools.utility-api.scss +32 -26
- package/src/styles/03-generic/_generic.root.scss +15 -2
- package/src/styles/04-elements/_elements.body.scss +6 -0
- package/src/styles/06-components/_components.accordion.scss +24 -4
- package/src/styles/06-components/_components.atomix-glass.scss +0 -0
- package/src/styles/06-components/_components.avatar-group.scss +2 -1
- package/src/styles/06-components/_components.avatar.scss +2 -1
- package/src/styles/06-components/_components.badge.scss +36 -1
- package/src/styles/06-components/_components.breadcrumb.scss +2 -1
- package/src/styles/06-components/_components.button.scss +14 -3
- package/src/styles/06-components/_components.callout.scss +44 -4
- package/src/styles/06-components/_components.card.scss +21 -2
- package/src/styles/06-components/_components.chart.scss +3 -2
- package/src/styles/06-components/_components.checkbox.scss +2 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -2
- package/src/styles/06-components/_components.countdown.scss +2 -1
- package/src/styles/06-components/_components.data-table.scss +7 -6
- package/src/styles/06-components/_components.datepicker.scss +20 -1
- package/src/styles/06-components/_components.dropdown.scss +11 -4
- package/src/styles/06-components/_components.edge-panel.scss +4 -3
- package/src/styles/06-components/_components.footer.scss +825 -0
- package/src/styles/06-components/_components.form-group.scss +1 -0
- package/src/styles/06-components/_components.hero.scss +4 -4
- package/src/styles/06-components/_components.image-gallery.scss +1 -0
- package/src/styles/06-components/_components.input.scss +33 -2
- package/src/styles/06-components/_components.list-group.scss +3 -2
- package/src/styles/06-components/_components.list.scss +2 -1
- package/src/styles/06-components/_components.menu.scss +5 -4
- package/src/styles/06-components/_components.messages.scss +8 -7
- package/src/styles/06-components/_components.modal.scss +3 -2
- package/src/styles/06-components/_components.nav.scss +6 -5
- package/src/styles/06-components/_components.navbar.scss +4 -3
- package/src/styles/06-components/_components.pagination.scss +2 -1
- package/src/styles/06-components/_components.photoviewer.scss +4 -3
- package/src/styles/06-components/_components.popover.scss +3 -2
- package/src/styles/06-components/_components.product-review.scss +3 -2
- package/src/styles/06-components/_components.progress.scss +3 -2
- package/src/styles/06-components/_components.river.scss +3 -2
- package/src/styles/06-components/_components.sectionintro.scss +2 -1
- package/src/styles/06-components/_components.select.scss +5 -4
- package/src/styles/06-components/_components.side-menu.scss +8 -7
- package/src/styles/06-components/_components.skeleton.scss +3 -2
- package/src/styles/06-components/_components.slider.scss +7 -6
- package/src/styles/06-components/_components.spinner.scss +1 -0
- package/src/styles/06-components/_components.steps.scss +3 -2
- package/src/styles/06-components/_components.tabs.scss +4 -3
- package/src/styles/06-components/_components.testimonials.scss +2 -1
- package/src/styles/06-components/_components.todo.scss +3 -2
- package/src/styles/06-components/_components.toggle.scss +5 -4
- package/src/styles/06-components/_components.tooltip.scss +3 -2
- package/src/styles/06-components/_components.upload.scss +4 -3
- package/src/styles/06-components/_components.video-player.scss +50 -27
- package/src/styles/06-components/_index.scss +2 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +48 -0
- package/dist/themes/yabai.css +0 -13711
- package/dist/themes/yabai.min.css +0 -189
|
@@ -0,0 +1,1369 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AtomixGlassComprehensivePreview.stories.tsx
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive showcase of the AtomixGlass component combining the best elements
|
|
5
|
+
* from both existing stories files. This preview demonstrates the full range of
|
|
6
|
+
* capabilities, use cases, and configuration options available in AtomixGlass.
|
|
7
|
+
*
|
|
8
|
+
* @package Atomix
|
|
9
|
+
* @component AtomixGlass
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
13
|
+
import AtomixGlass from './AtomixGlass';
|
|
14
|
+
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import type { RefObject } from 'react';
|
|
17
|
+
import { Button } from '../Button/Button';
|
|
18
|
+
import { Card } from '../Card/Card';
|
|
19
|
+
import { Callout } from '../Callout/Callout';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Comprehensive meta configuration combining features from both stories
|
|
23
|
+
*/
|
|
24
|
+
const meta: Meta<typeof AtomixGlass> = {
|
|
25
|
+
title: 'Components/AtomixGlass/Comprehensive Preview',
|
|
26
|
+
component: AtomixGlass,
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: 'fullscreen',
|
|
29
|
+
docs: {
|
|
30
|
+
description: {
|
|
31
|
+
component: `
|
|
32
|
+
# AtomixGlass Comprehensive Preview
|
|
33
|
+
|
|
34
|
+
This comprehensive showcase demonstrates the full range of AtomixGlass capabilities, combining the best elements from multiple story implementations. Explore different modes, interactive features, real-world applications, and optimization techniques.
|
|
35
|
+
|
|
36
|
+
## Key Features Demonstrated:
|
|
37
|
+
- **4 Glass Effect Modes**: Standard, Polar, Prominent, and Shader
|
|
38
|
+
- **Interactive Mouse Tracking**: Real-time displacement based on mouse movement
|
|
39
|
+
- **Performance Optimizations**: Mobile-friendly configurations and optimization techniques
|
|
40
|
+
- **Real-world Applications**: UI examples including mobile interfaces, Apple-inspired designs, and accessibility features
|
|
41
|
+
- **Customization Options**: Comprehensive controls for all visual parameters
|
|
42
|
+
`,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
viewport: {
|
|
46
|
+
defaultViewport: 'responsive',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
tags: ['autodocs'],
|
|
50
|
+
argTypes: {
|
|
51
|
+
children: {
|
|
52
|
+
control: 'text',
|
|
53
|
+
description: 'Content to display inside the glass effect',
|
|
54
|
+
},
|
|
55
|
+
displacementScale: {
|
|
56
|
+
control: { type: 'range', min: 0, max: 200, step: 1 },
|
|
57
|
+
description: 'Intensity of the displacement effect (0-200)',
|
|
58
|
+
},
|
|
59
|
+
blurAmount: {
|
|
60
|
+
control: { type: 'range', min: -1, max: 1, step: 0.001 },
|
|
61
|
+
description: 'Blur amount for the backdrop effect',
|
|
62
|
+
},
|
|
63
|
+
saturation: {
|
|
64
|
+
control: { type: 'range', min: 100, max: 300, step: 5 },
|
|
65
|
+
description: 'Color saturation percentage (100 = normal)',
|
|
66
|
+
},
|
|
67
|
+
aberrationIntensity: {
|
|
68
|
+
control: { type: 'range', min: 0, max: 10, step: 0.1 },
|
|
69
|
+
description: 'Chromatic aberration effect intensity',
|
|
70
|
+
},
|
|
71
|
+
elasticity: {
|
|
72
|
+
control: { type: 'range', min: 0, max: 1, step: 0.05 },
|
|
73
|
+
description: 'Mouse interaction responsiveness (0-1)',
|
|
74
|
+
},
|
|
75
|
+
cornerRadius: {
|
|
76
|
+
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
77
|
+
description: 'Border radius in pixels',
|
|
78
|
+
},
|
|
79
|
+
overLight: {
|
|
80
|
+
control: 'boolean',
|
|
81
|
+
description: 'Optimize appearance for light backgrounds',
|
|
82
|
+
},
|
|
83
|
+
mode: {
|
|
84
|
+
control: 'select',
|
|
85
|
+
options: ['standard', 'polar', 'prominent', 'shader'],
|
|
86
|
+
description: 'Glass effect rendering mode',
|
|
87
|
+
},
|
|
88
|
+
onClick: {
|
|
89
|
+
action: 'clicked',
|
|
90
|
+
description: 'Click event handler',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default meta;
|
|
96
|
+
type Story = StoryObj<typeof AtomixGlass>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Enhanced Background Wrapper with dynamic background support
|
|
100
|
+
*/
|
|
101
|
+
interface BackgroundWrapperProps {
|
|
102
|
+
children: React.ReactNode;
|
|
103
|
+
backgroundImage?: string;
|
|
104
|
+
backgroundIndex?: number;
|
|
105
|
+
height?: string;
|
|
106
|
+
width?: string;
|
|
107
|
+
style?: React.CSSProperties;
|
|
108
|
+
interactive?: boolean;
|
|
109
|
+
overlay?: boolean;
|
|
110
|
+
overlayColor?: string;
|
|
111
|
+
overlayOpacity?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Interactive Container for mouse tracking across the entire viewport
|
|
116
|
+
*/
|
|
117
|
+
interface InteractiveContainerProps {
|
|
118
|
+
children: (
|
|
119
|
+
mousePos: { x: number; y: number },
|
|
120
|
+
mouseOffset: { x: number; y: number },
|
|
121
|
+
containerRef: RefObject<HTMLDivElement>
|
|
122
|
+
) => React.ReactNode;
|
|
123
|
+
backgroundImage?: string;
|
|
124
|
+
style?: React.CSSProperties;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Collection of high-quality backgrounds optimized for glass effects
|
|
129
|
+
*/
|
|
130
|
+
const backgroundImages = [
|
|
131
|
+
// Tech/Digital
|
|
132
|
+
'https://images.unsplash.com/photo-1636630636968-4568d7e94fe7?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
133
|
+
// Purple Nebula
|
|
134
|
+
'https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?q=80&w=2071&auto=format&fit=crop',
|
|
135
|
+
// Urban Night
|
|
136
|
+
'https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?q=80&w=2144&auto=format&fit=crop',
|
|
137
|
+
// Abstract Waves
|
|
138
|
+
'https://images.unsplash.com/photo-1614850715649-1d0106293bd1?q=80&w=2070&auto=format&fit=crop',
|
|
139
|
+
// Natural Mountain
|
|
140
|
+
'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2070&auto=format&fit=crop',
|
|
141
|
+
// Light Gradient
|
|
142
|
+
'https://images.unsplash.com/photo-1579546929518-9e396f3cc809?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
143
|
+
// Interactive Space
|
|
144
|
+
'https://images.unsplash.com/photo-1663882658055-40f1d4249867?q=80&w=3807&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Enhanced Background Wrapper Component
|
|
149
|
+
*/
|
|
150
|
+
const BackgroundWrapper = ({
|
|
151
|
+
children,
|
|
152
|
+
backgroundImage,
|
|
153
|
+
backgroundIndex,
|
|
154
|
+
height = '100vh',
|
|
155
|
+
width = '100vw',
|
|
156
|
+
style = {},
|
|
157
|
+
interactive = false,
|
|
158
|
+
overlay = false,
|
|
159
|
+
overlayColor = 'rgba(0,0,0,0.3)',
|
|
160
|
+
overlayOpacity = 0.3,
|
|
161
|
+
}: BackgroundWrapperProps) => {
|
|
162
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
163
|
+
const [backgroundPosition, setBackgroundPosition] = useState({ x: 0, y: 0 });
|
|
164
|
+
|
|
165
|
+
const bgImage =
|
|
166
|
+
backgroundIndex !== undefined ? backgroundImages[backgroundIndex] : backgroundImage;
|
|
167
|
+
|
|
168
|
+
const handleMouseMove = useCallback(
|
|
169
|
+
(e: MouseEvent) => {
|
|
170
|
+
if (containerRef.current && interactive) {
|
|
171
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
172
|
+
const centerX = rect.left + rect.width / 2;
|
|
173
|
+
const centerY = rect.top + rect.height / 2;
|
|
174
|
+
|
|
175
|
+
const offsetX = ((e.clientX - centerX) / rect.width) * 50;
|
|
176
|
+
const offsetY = ((e.clientY - centerY) / rect.height) * 50;
|
|
177
|
+
|
|
178
|
+
setBackgroundPosition({ x: offsetX, y: offsetY });
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
[interactive]
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
const currentRef = containerRef.current;
|
|
186
|
+
if (currentRef && interactive) {
|
|
187
|
+
currentRef.addEventListener('mousemove', handleMouseMove);
|
|
188
|
+
return () => currentRef.removeEventListener('mousemove', handleMouseMove);
|
|
189
|
+
}
|
|
190
|
+
}, [handleMouseMove, interactive]);
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<div
|
|
194
|
+
ref={containerRef}
|
|
195
|
+
style={{
|
|
196
|
+
position: 'relative',
|
|
197
|
+
width,
|
|
198
|
+
minHeight: height,
|
|
199
|
+
backgroundImage: bgImage ? `url(${bgImage})` : undefined,
|
|
200
|
+
backgroundColor: !bgImage ? '#1a1a2e' : undefined,
|
|
201
|
+
backgroundSize: interactive ? '120%' : 'cover',
|
|
202
|
+
backgroundPosition: interactive
|
|
203
|
+
? `calc(50% + ${backgroundPosition.x}px) calc(50% + ${backgroundPosition.y}px)`
|
|
204
|
+
: 'center',
|
|
205
|
+
backgroundAttachment: 'fixed',
|
|
206
|
+
overflowY: 'auto',
|
|
207
|
+
overflowX: 'hidden',
|
|
208
|
+
...style,
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
{/* Overlay */}
|
|
212
|
+
{(overlay || overlayOpacity > 0) && (
|
|
213
|
+
<div
|
|
214
|
+
style={{
|
|
215
|
+
position: 'absolute',
|
|
216
|
+
top: 0,
|
|
217
|
+
left: 0,
|
|
218
|
+
right: 0,
|
|
219
|
+
bottom: 0,
|
|
220
|
+
backgroundColor: overlay ? overlayColor : 'transparent',
|
|
221
|
+
opacity: overlay ? overlayOpacity : 0,
|
|
222
|
+
zIndex: 1,
|
|
223
|
+
pointerEvents: 'none',
|
|
224
|
+
}}
|
|
225
|
+
/>
|
|
226
|
+
)}
|
|
227
|
+
|
|
228
|
+
{/* Content */}
|
|
229
|
+
<div style={{ position: 'relative', width: '100%', minHeight: '100%' }}>{children}</div>
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Interactive Container with mouse tracking
|
|
236
|
+
*/
|
|
237
|
+
const InteractiveContainer = ({
|
|
238
|
+
children,
|
|
239
|
+
backgroundImage = backgroundImages[6],
|
|
240
|
+
style = {},
|
|
241
|
+
}: InteractiveContainerProps) => {
|
|
242
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
243
|
+
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
|
|
244
|
+
const [mouseOffset, setMouseOffset] = useState({ x: 0, y: 0 });
|
|
245
|
+
|
|
246
|
+
const handleMouseMove = useCallback((e: MouseEvent) => {
|
|
247
|
+
if (containerRef.current) {
|
|
248
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
249
|
+
const centerX = rect.left + rect.width / 2;
|
|
250
|
+
const centerY = rect.top + rect.height / 2;
|
|
251
|
+
|
|
252
|
+
setMouseOffset({
|
|
253
|
+
x: ((e.clientX - centerX) / rect.width) * 100,
|
|
254
|
+
y: ((e.clientY - centerY) / rect.height) * 100,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
setMousePos({ x: e.clientX, y: e.clientY });
|
|
258
|
+
}, []);
|
|
259
|
+
|
|
260
|
+
useEffect(() => {
|
|
261
|
+
const currentRef = containerRef.current;
|
|
262
|
+
currentRef?.addEventListener('mousemove', handleMouseMove);
|
|
263
|
+
return () => currentRef?.removeEventListener('mousemove', handleMouseMove);
|
|
264
|
+
}, [handleMouseMove]);
|
|
265
|
+
|
|
266
|
+
return (
|
|
267
|
+
<div
|
|
268
|
+
ref={containerRef}
|
|
269
|
+
style={{
|
|
270
|
+
width: '100vw',
|
|
271
|
+
height: '100vh',
|
|
272
|
+
display: 'flex',
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
justifyContent: 'center',
|
|
275
|
+
backgroundImage: `url(${backgroundImage})`,
|
|
276
|
+
backgroundSize: '160%',
|
|
277
|
+
backgroundPosition: `calc(50% + ${mouseOffset.x}px) calc(50% + ${mouseOffset.y}px)`,
|
|
278
|
+
...style,
|
|
279
|
+
}}
|
|
280
|
+
>
|
|
281
|
+
{children(mousePos, mouseOffset, containerRef)}
|
|
282
|
+
</div>
|
|
283
|
+
);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* COMPREHENSIVE SHOWCASE STORY
|
|
288
|
+
*
|
|
289
|
+
* This is the main showcase that demonstrates all AtomixGlass capabilities
|
|
290
|
+
* in a single, comprehensive interface with multiple sections.
|
|
291
|
+
*/
|
|
292
|
+
export const ComprehensiveShowcase: Story = {
|
|
293
|
+
render: () => {
|
|
294
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
295
|
+
const [activeSection, setActiveSection] = useState('overview');
|
|
296
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
297
|
+
const [selectedMode, setSelectedMode] = useState<'standard' | 'polar' | 'prominent' | 'shader'>(
|
|
298
|
+
'standard'
|
|
299
|
+
);
|
|
300
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
301
|
+
const [settings, setSettings] = useState({
|
|
302
|
+
displacementScale: 15,
|
|
303
|
+
blurAmount: 0,
|
|
304
|
+
saturation: 140,
|
|
305
|
+
aberrationIntensity: 2,
|
|
306
|
+
elasticity: 0.15,
|
|
307
|
+
cornerRadius: 20,
|
|
308
|
+
overLight: false,
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
const sections = [
|
|
312
|
+
{ id: 'overview', label: '🏠 Overview', desc: 'Introduction and basic features' },
|
|
313
|
+
{ id: 'modes', label: '🎨 Modes', desc: 'All 4 glass effect modes' },
|
|
314
|
+
{ id: 'interactive', label: '🖱️ Interactive', desc: 'Mouse tracking effects' },
|
|
315
|
+
{ id: 'applications', label: '📱 Applications', desc: 'Real-world examples' },
|
|
316
|
+
{ id: 'playground', label: '🎮 Playground', desc: 'Live customization' },
|
|
317
|
+
{ id: 'performance', label: '⚡ Performance', desc: 'Optimization guide' },
|
|
318
|
+
];
|
|
319
|
+
|
|
320
|
+
const modes = [
|
|
321
|
+
{
|
|
322
|
+
id: 'standard',
|
|
323
|
+
name: 'Standard',
|
|
324
|
+
desc: 'Balanced glass effect with uniform displacement',
|
|
325
|
+
settings: { displacementScale: 120, aberrationIntensity: 2, saturation: 140 },
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
id: 'polar',
|
|
329
|
+
name: 'Polar',
|
|
330
|
+
desc: 'Radial distortion creating circular patterns',
|
|
331
|
+
settings: { displacementScale: 100, aberrationIntensity: 1.5, saturation: 160 },
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: 'prominent',
|
|
335
|
+
name: 'Prominent',
|
|
336
|
+
desc: 'Enhanced effects for important UI elements',
|
|
337
|
+
settings: { displacementScale: 150, aberrationIntensity: 3, saturation: 180 },
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
id: 'shader',
|
|
341
|
+
name: 'Shader',
|
|
342
|
+
desc: 'Advanced WebGL-based liquid animations',
|
|
343
|
+
settings: { displacementScale: 200, aberrationIntensity: 4, saturation: 200 },
|
|
344
|
+
},
|
|
345
|
+
];
|
|
346
|
+
|
|
347
|
+
const renderSection = () => {
|
|
348
|
+
switch (activeSection) {
|
|
349
|
+
case 'overview':
|
|
350
|
+
return (
|
|
351
|
+
<div
|
|
352
|
+
style={{
|
|
353
|
+
paddingTop: '5rem',
|
|
354
|
+
paddingBottom: '4rem',
|
|
355
|
+
paddingLeft: '1.25rem',
|
|
356
|
+
paddingRight: '1.25rem',
|
|
357
|
+
}}
|
|
358
|
+
>
|
|
359
|
+
<div className="o-container">
|
|
360
|
+
{/* Hero Section */}
|
|
361
|
+
<div className="u-mb-12 u-text-center">
|
|
362
|
+
<AtomixGlass
|
|
363
|
+
displacementScale={120}
|
|
364
|
+
blurAmount={0}
|
|
365
|
+
saturation={140}
|
|
366
|
+
aberrationIntensity={2}
|
|
367
|
+
cornerRadius={30}
|
|
368
|
+
>
|
|
369
|
+
<div style={{ padding: '3rem 4rem' }}>
|
|
370
|
+
<h1
|
|
371
|
+
className="u-mb-5 u-fw-semibold"
|
|
372
|
+
style={{
|
|
373
|
+
fontSize: '3rem',
|
|
374
|
+
background: 'linear-gradient(135deg, #007AFF, #5AC8FA)',
|
|
375
|
+
WebkitBackgroundClip: 'text',
|
|
376
|
+
WebkitTextFillColor: 'transparent',
|
|
377
|
+
}}
|
|
378
|
+
>
|
|
379
|
+
AtomixGlass
|
|
380
|
+
</h1>
|
|
381
|
+
<p
|
|
382
|
+
className="u-mb-8"
|
|
383
|
+
style={{
|
|
384
|
+
fontSize: '1.25rem',
|
|
385
|
+
lineHeight: 1.6,
|
|
386
|
+
color: 'rgba(255,255,255,0.9)',
|
|
387
|
+
}}
|
|
388
|
+
>
|
|
389
|
+
Create stunning glass morphism effects with realistic light refraction,
|
|
390
|
+
chromatic aberration, and interactive animations.
|
|
391
|
+
</p>
|
|
392
|
+
<div
|
|
393
|
+
className="u-d-flex u-justify-content-center u-flex-wrap"
|
|
394
|
+
style={{ gap: '1.25rem' }}
|
|
395
|
+
>
|
|
396
|
+
<Button variant="primary" size="lg">
|
|
397
|
+
Explore Features
|
|
398
|
+
</Button>
|
|
399
|
+
<Button variant="outline-light" size="lg">
|
|
400
|
+
View Documentation
|
|
401
|
+
</Button>
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
</AtomixGlass>
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
{/* Feature Grid */}
|
|
408
|
+
<div className="o-grid">
|
|
409
|
+
{[
|
|
410
|
+
{
|
|
411
|
+
icon: '🎨',
|
|
412
|
+
title: '4 Glass Modes',
|
|
413
|
+
desc: 'Standard, Polar, Prominent, and Shader modes for different visual effects',
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
icon: '🖱️',
|
|
417
|
+
title: 'Interactive Effects',
|
|
418
|
+
desc: 'Real-time mouse tracking with customizable elasticity and responsiveness',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
icon: '⚡',
|
|
422
|
+
title: 'Performance Optimized',
|
|
423
|
+
desc: 'Hardware-accelerated rendering with mobile-friendly configurations',
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
icon: '♿',
|
|
427
|
+
title: 'Accessible Design',
|
|
428
|
+
desc: 'WCAG 2.1 AA compliant with reduced motion and contrast support',
|
|
429
|
+
},
|
|
430
|
+
].map((feature, index) => (
|
|
431
|
+
<div key={index} className="o-grid__col o-grid__col--3">
|
|
432
|
+
<Card
|
|
433
|
+
glass={{
|
|
434
|
+
displacementScale: 80,
|
|
435
|
+
blurAmount: 0,
|
|
436
|
+
saturation: 120,
|
|
437
|
+
aberrationIntensity: 1,
|
|
438
|
+
cornerRadius: 20,
|
|
439
|
+
}}
|
|
440
|
+
styles={{ height: '100%' }}
|
|
441
|
+
>
|
|
442
|
+
<div className="u-text-center" style={{ padding: '1.75rem' }}>
|
|
443
|
+
<div className="u-mb-4" style={{ fontSize: '3rem' }}>
|
|
444
|
+
{feature.icon}
|
|
445
|
+
</div>
|
|
446
|
+
<h3 className="u-mb-3 u-fw-medium" style={{ fontSize: '1.25rem' }}>
|
|
447
|
+
{feature.title}
|
|
448
|
+
</h3>
|
|
449
|
+
<p style={{ lineHeight: 1.5, opacity: 0.8 }}>{feature.desc}</p>
|
|
450
|
+
</div>
|
|
451
|
+
</Card>
|
|
452
|
+
</div>
|
|
453
|
+
))}
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
case 'modes':
|
|
460
|
+
return (
|
|
461
|
+
<div
|
|
462
|
+
style={{
|
|
463
|
+
paddingTop: '5rem',
|
|
464
|
+
paddingBottom: '4rem',
|
|
465
|
+
paddingLeft: '1.25rem',
|
|
466
|
+
paddingRight: '1.25rem',
|
|
467
|
+
}}
|
|
468
|
+
>
|
|
469
|
+
<div className="o-container">
|
|
470
|
+
<div className="u-text-center u-mb-12">
|
|
471
|
+
<h2 className="u-mb-5 u-fw-semibold u-text-white" style={{ fontSize: '2.5rem' }}>
|
|
472
|
+
Glass Effect Modes
|
|
473
|
+
</h2>
|
|
474
|
+
<p
|
|
475
|
+
className="u-text-white u-mx-auto"
|
|
476
|
+
style={{ fontSize: '1.2rem', opacity: 0.8, maxWidth: '600px' }}
|
|
477
|
+
>
|
|
478
|
+
Each mode provides unique visual characteristics optimized for different use
|
|
479
|
+
cases
|
|
480
|
+
</p>
|
|
481
|
+
</div>
|
|
482
|
+
|
|
483
|
+
<div className="o-grid">
|
|
484
|
+
{modes.map(mode => (
|
|
485
|
+
<div
|
|
486
|
+
key={mode.id}
|
|
487
|
+
className="o-grid__col o-grid__col--3"
|
|
488
|
+
style={{ marginBottom: '2rem' }}
|
|
489
|
+
>
|
|
490
|
+
<Card
|
|
491
|
+
glass={{
|
|
492
|
+
mode: mode.id as any,
|
|
493
|
+
displacementScale: mode.settings.displacementScale,
|
|
494
|
+
aberrationIntensity: mode.settings.aberrationIntensity,
|
|
495
|
+
saturation: mode.settings.saturation,
|
|
496
|
+
cornerRadius: 20,
|
|
497
|
+
}}
|
|
498
|
+
onClick={() => setSelectedMode(mode.id as any)}
|
|
499
|
+
styles={{
|
|
500
|
+
height: '100%',
|
|
501
|
+
cursor: 'pointer',
|
|
502
|
+
transform: selectedMode === mode.id ? 'scale(1.02)' : 'scale(1)',
|
|
503
|
+
transition: 'transform 0.3s ease',
|
|
504
|
+
}}
|
|
505
|
+
>
|
|
506
|
+
<div className="u-text-center" style={{ padding: '2.5rem' }}>
|
|
507
|
+
<h3
|
|
508
|
+
className="u-mb-4 u-fw-medium"
|
|
509
|
+
style={{
|
|
510
|
+
fontSize: '1.25rem',
|
|
511
|
+
color: selectedMode === mode.id ? '#7c3aed' : '#ffffff',
|
|
512
|
+
}}
|
|
513
|
+
>
|
|
514
|
+
{mode.name} Mode
|
|
515
|
+
</h3>
|
|
516
|
+
<p
|
|
517
|
+
className="u-mb-5"
|
|
518
|
+
style={{ fontSize: '1rem', lineHeight: 1.5, opacity: 0.8 }}
|
|
519
|
+
>
|
|
520
|
+
{mode.desc}
|
|
521
|
+
</p>
|
|
522
|
+
|
|
523
|
+
{/* Settings Display */}
|
|
524
|
+
<div
|
|
525
|
+
className="u-d-flex u-justify-content-center u-flex-wrap"
|
|
526
|
+
style={{ gap: '0.5rem' }}
|
|
527
|
+
>
|
|
528
|
+
<span
|
|
529
|
+
className="u-fs-xs"
|
|
530
|
+
style={{
|
|
531
|
+
padding: '0.25rem 0.5rem',
|
|
532
|
+
borderRadius: '50rem',
|
|
533
|
+
background: 'rgba(255,255,255,0.15)',
|
|
534
|
+
}}
|
|
535
|
+
>
|
|
536
|
+
Displacement: {mode.settings.displacementScale}
|
|
537
|
+
</span>
|
|
538
|
+
<span
|
|
539
|
+
className="u-fs-xs"
|
|
540
|
+
style={{
|
|
541
|
+
padding: '0.25rem 0.5rem',
|
|
542
|
+
borderRadius: '50rem',
|
|
543
|
+
background: 'rgba(255,255,255,0.15)',
|
|
544
|
+
}}
|
|
545
|
+
>
|
|
546
|
+
Aberration: {mode.settings.aberrationIntensity}
|
|
547
|
+
</span>
|
|
548
|
+
</div>
|
|
549
|
+
|
|
550
|
+
{selectedMode === mode.id && (
|
|
551
|
+
<div className="u-mt-4">
|
|
552
|
+
<Callout variant="success" oneLine>
|
|
553
|
+
✨ Active Mode
|
|
554
|
+
</Callout>
|
|
555
|
+
</div>
|
|
556
|
+
)}
|
|
557
|
+
</div>
|
|
558
|
+
</Card>
|
|
559
|
+
</div>
|
|
560
|
+
))}
|
|
561
|
+
</div>
|
|
562
|
+
</div>
|
|
563
|
+
</div>
|
|
564
|
+
);
|
|
565
|
+
|
|
566
|
+
case 'interactive':
|
|
567
|
+
return (
|
|
568
|
+
<InteractiveContainer>
|
|
569
|
+
{(mousePos, mouseOffset, containerRef) => (
|
|
570
|
+
<div
|
|
571
|
+
className="u-d-flex u-flex-column u-align-items-center"
|
|
572
|
+
style={{ gap: '2.5rem', padding: '2.5rem' }}
|
|
573
|
+
>
|
|
574
|
+
<h2
|
|
575
|
+
className="u-text-center u-text-white u-fw-semibold u-mb-8"
|
|
576
|
+
style={{
|
|
577
|
+
fontSize: '2.5rem',
|
|
578
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
579
|
+
}}
|
|
580
|
+
>
|
|
581
|
+
Interactive Mouse Tracking
|
|
582
|
+
</h2>
|
|
583
|
+
|
|
584
|
+
<AtomixGlass
|
|
585
|
+
globalMousePos={mousePos}
|
|
586
|
+
mouseOffset={mouseOffset}
|
|
587
|
+
mouseContainer={containerRef}
|
|
588
|
+
displacementScale={150}
|
|
589
|
+
blurAmount={0}
|
|
590
|
+
saturation={160}
|
|
591
|
+
aberrationIntensity={3}
|
|
592
|
+
elasticity={0.3}
|
|
593
|
+
cornerRadius={25}
|
|
594
|
+
mode={selectedMode}
|
|
595
|
+
>
|
|
596
|
+
<div className="u-text-center" style={{ padding: '3rem 4rem' }}>
|
|
597
|
+
<h3
|
|
598
|
+
className="u-mb-5 u-text-white u-fw-medium"
|
|
599
|
+
style={{ fontSize: '1.8rem' }}
|
|
600
|
+
>
|
|
601
|
+
Move Your Mouse
|
|
602
|
+
</h3>
|
|
603
|
+
<p
|
|
604
|
+
className="u-mb-5"
|
|
605
|
+
style={{ fontSize: '1.1rem', lineHeight: 1.5, opacity: 0.9 }}
|
|
606
|
+
>
|
|
607
|
+
Watch the glass effect respond to your mouse movement with real-time
|
|
608
|
+
displacement and distortion effects.
|
|
609
|
+
</p>
|
|
610
|
+
<div className="o-grid">
|
|
611
|
+
<div className="o-grid__col o-grid__col--6">
|
|
612
|
+
<div className="u-fs-sm">
|
|
613
|
+
Mode: <strong>{selectedMode}</strong>
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
<div className="o-grid__col o-grid__col--6">
|
|
617
|
+
<div className="u-fs-sm">
|
|
618
|
+
Elasticity: <strong>{settings.elasticity}</strong>
|
|
619
|
+
</div>
|
|
620
|
+
</div>
|
|
621
|
+
<div className="o-grid__col o-grid__col--6">
|
|
622
|
+
<div className="u-fs-sm">
|
|
623
|
+
Mouse X: <strong>{Math.round(mouseOffset.x)}</strong>
|
|
624
|
+
</div>
|
|
625
|
+
</div>
|
|
626
|
+
<div className="o-grid__col o-grid__col--6">
|
|
627
|
+
<div className="u-fs-sm">
|
|
628
|
+
Mouse Y: <strong>{Math.round(mouseOffset.y)}</strong>
|
|
629
|
+
</div>
|
|
630
|
+
</div>
|
|
631
|
+
</div>
|
|
632
|
+
</div>
|
|
633
|
+
</AtomixGlass>
|
|
634
|
+
|
|
635
|
+
{/* Mode Selector */}
|
|
636
|
+
<div
|
|
637
|
+
className="u-d-flex u-flex-wrap u-justify-content-center"
|
|
638
|
+
style={{ gap: '1rem' }}
|
|
639
|
+
>
|
|
640
|
+
{modes.map(mode => (
|
|
641
|
+
<Button
|
|
642
|
+
key={mode.id}
|
|
643
|
+
variant={selectedMode === mode.id ? 'primary' : 'outline-light'}
|
|
644
|
+
rounded
|
|
645
|
+
onClick={() => setSelectedMode(mode.id as any)}
|
|
646
|
+
>
|
|
647
|
+
{mode.name}
|
|
648
|
+
</Button>
|
|
649
|
+
))}
|
|
650
|
+
</div>
|
|
651
|
+
</div>
|
|
652
|
+
)}
|
|
653
|
+
</InteractiveContainer>
|
|
654
|
+
);
|
|
655
|
+
|
|
656
|
+
case 'applications':
|
|
657
|
+
return (
|
|
658
|
+
<div className="u-pt-20 u-pb-16 u-px-5">
|
|
659
|
+
<div className="o-container">
|
|
660
|
+
<div className="u-text-center u-mb-12">
|
|
661
|
+
<h2 className="u-mb-5 u-fw-semibold u-text-white" style={{ fontSize: '2.5rem' }}>
|
|
662
|
+
Real-World Applications
|
|
663
|
+
</h2>
|
|
664
|
+
<p
|
|
665
|
+
className="u-text-lg u-opacity-80 u-text-white u-mx-auto"
|
|
666
|
+
style={{ maxWidth: '600px' }}
|
|
667
|
+
>
|
|
668
|
+
See how AtomixGlass transforms user interfaces across different platforms
|
|
669
|
+
</p>
|
|
670
|
+
</div>
|
|
671
|
+
|
|
672
|
+
<div className="o-grid">
|
|
673
|
+
<div className="o-grid__row">
|
|
674
|
+
{/* Mobile UI Example */}
|
|
675
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg u-mb-8">
|
|
676
|
+
<Card
|
|
677
|
+
glass={{
|
|
678
|
+
displacementScale: 100,
|
|
679
|
+
blurAmount: 0,
|
|
680
|
+
saturation: 130,
|
|
681
|
+
aberrationIntensity: 1.5,
|
|
682
|
+
cornerRadius: 20,
|
|
683
|
+
}}
|
|
684
|
+
className="u-h-full"
|
|
685
|
+
>
|
|
686
|
+
<div className="u-p-7">
|
|
687
|
+
<h3 className="u-mb-5 u-text-xl u-fw-medium u-flex u-items-center u-gap-2">
|
|
688
|
+
📱 Mobile Interface
|
|
689
|
+
</h3>
|
|
690
|
+
<div
|
|
691
|
+
className="u-mx-auto u-mb-5 u-relative u-overflow-hidden"
|
|
692
|
+
style={{
|
|
693
|
+
width: '200px',
|
|
694
|
+
height: '300px',
|
|
695
|
+
borderRadius: '25px',
|
|
696
|
+
background: 'rgba(0,0,0,0.3)',
|
|
697
|
+
}}
|
|
698
|
+
>
|
|
699
|
+
<AtomixGlass
|
|
700
|
+
displacementScale={60}
|
|
701
|
+
blurAmount={0}
|
|
702
|
+
saturation={120}
|
|
703
|
+
aberrationIntensity={1}
|
|
704
|
+
cornerRadius={15}
|
|
705
|
+
style={{ margin: '20px 15px' }}
|
|
706
|
+
>
|
|
707
|
+
<div className="u-p-4 u-text-center">
|
|
708
|
+
<div className="u-text-sm u-fw-medium">Navigation</div>
|
|
709
|
+
</div>
|
|
710
|
+
</AtomixGlass>
|
|
711
|
+
</div>
|
|
712
|
+
<p className="u-text-sm u-opacity-80" style={{ lineHeight: 1.5 }}>
|
|
713
|
+
Touch-optimized glass effects for mobile applications with reduced
|
|
714
|
+
complexity for better performance.
|
|
715
|
+
</p>
|
|
716
|
+
</div>
|
|
717
|
+
</Card>
|
|
718
|
+
</div>
|
|
719
|
+
|
|
720
|
+
{/* Desktop UI Example */}
|
|
721
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg u-mb-8">
|
|
722
|
+
<Card
|
|
723
|
+
glass={{
|
|
724
|
+
displacementScale: 120,
|
|
725
|
+
blurAmount: 0,
|
|
726
|
+
saturation: 150,
|
|
727
|
+
aberrationIntensity: 2,
|
|
728
|
+
cornerRadius: 20,
|
|
729
|
+
}}
|
|
730
|
+
className="u-h-full"
|
|
731
|
+
>
|
|
732
|
+
<div className="u-p-7">
|
|
733
|
+
<h3 className="u-mb-5 u-text-xl u-fw-medium u-flex u-items-center u-gap-2">
|
|
734
|
+
🖥️ Desktop Application
|
|
735
|
+
</h3>
|
|
736
|
+
<div
|
|
737
|
+
className="u-p-5 u-mb-5 u-rounded-md"
|
|
738
|
+
style={{ background: 'rgba(0,0,0,0.2)' }}
|
|
739
|
+
>
|
|
740
|
+
<div className="u-flex u-gap-2 u-mb-4">
|
|
741
|
+
{['🔴', '🟡', '🟢'].map((dot, i) => (
|
|
742
|
+
<div key={i} className="u-text-xs">
|
|
743
|
+
{dot}
|
|
744
|
+
</div>
|
|
745
|
+
))}
|
|
746
|
+
</div>
|
|
747
|
+
<div className="u-text-xs u-opacity-70">
|
|
748
|
+
Advanced glass effects with full mouse tracking and complex
|
|
749
|
+
interactions
|
|
750
|
+
</div>
|
|
751
|
+
</div>
|
|
752
|
+
<p className="u-text-sm u-opacity-80" style={{ lineHeight: 1.5 }}>
|
|
753
|
+
Rich desktop experiences with advanced shader effects and interactive
|
|
754
|
+
animations.
|
|
755
|
+
</p>
|
|
756
|
+
</div>
|
|
757
|
+
</Card>
|
|
758
|
+
</div>
|
|
759
|
+
|
|
760
|
+
{/* Apple-style UI Example */}
|
|
761
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg u-mb-8">
|
|
762
|
+
<Card
|
|
763
|
+
glass={{
|
|
764
|
+
displacementScale: 140,
|
|
765
|
+
blurAmount: 0,
|
|
766
|
+
saturation: 160,
|
|
767
|
+
aberrationIntensity: 2.5,
|
|
768
|
+
cornerRadius: 20,
|
|
769
|
+
}}
|
|
770
|
+
className="u-h-full"
|
|
771
|
+
>
|
|
772
|
+
<div className="u-p-7">
|
|
773
|
+
<h3 className="u-mb-5 u-text-xl u-fw-medium u-flex u-items-center u-gap-2">
|
|
774
|
+
🍎 Apple-inspired Design
|
|
775
|
+
</h3>
|
|
776
|
+
<div
|
|
777
|
+
className="u-mb-5"
|
|
778
|
+
style={{
|
|
779
|
+
display: 'grid',
|
|
780
|
+
gridTemplateColumns: 'repeat(3, 1fr)',
|
|
781
|
+
gap: '10px',
|
|
782
|
+
}}
|
|
783
|
+
>
|
|
784
|
+
{Array.from({ length: 6 }).map((_, i) => (
|
|
785
|
+
<div
|
|
786
|
+
key={i}
|
|
787
|
+
className="u-flex u-items-center u-justify-center u-rounded-md"
|
|
788
|
+
style={{
|
|
789
|
+
width: '40px',
|
|
790
|
+
height: '40px',
|
|
791
|
+
background: `linear-gradient(135deg, hsl(${i * 60}, 70%, 60%), hsl(${i * 60 + 30}, 70%, 50%))`,
|
|
792
|
+
fontSize: '1.2rem',
|
|
793
|
+
}}
|
|
794
|
+
>
|
|
795
|
+
{['📱', '🎵', '📧', '🗺️', '☀️', '📝'][i]}
|
|
796
|
+
</div>
|
|
797
|
+
))}
|
|
798
|
+
</div>
|
|
799
|
+
<p className="u-text-sm u-opacity-80" style={{ lineHeight: 1.5 }}>
|
|
800
|
+
macOS and iOS-style frosted glass effects with realistic light
|
|
801
|
+
refraction.
|
|
802
|
+
</p>
|
|
803
|
+
</div>
|
|
804
|
+
</Card>
|
|
805
|
+
</div>
|
|
806
|
+
</div>
|
|
807
|
+
</div>
|
|
808
|
+
</div>
|
|
809
|
+
</div>
|
|
810
|
+
);
|
|
811
|
+
|
|
812
|
+
case 'playground':
|
|
813
|
+
return (
|
|
814
|
+
<div
|
|
815
|
+
className="u-d-flex u-vh-100"
|
|
816
|
+
style={{
|
|
817
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
818
|
+
}}
|
|
819
|
+
>
|
|
820
|
+
{/* Control Panel */}
|
|
821
|
+
<div
|
|
822
|
+
className="u-p-8 u-overflow-y-auto"
|
|
823
|
+
style={{
|
|
824
|
+
width: '400px',
|
|
825
|
+
background: 'rgba(0,0,0,0.8)',
|
|
826
|
+
}}
|
|
827
|
+
>
|
|
828
|
+
<h3
|
|
829
|
+
className="u-mb-8 u-text-center u-text-white u-fw-medium"
|
|
830
|
+
style={{ fontSize: '1.5rem' }}
|
|
831
|
+
>
|
|
832
|
+
Playground Controls
|
|
833
|
+
</h3>
|
|
834
|
+
|
|
835
|
+
{/* Settings Controls */}
|
|
836
|
+
{Object.entries(settings).map(([key, value]) => (
|
|
837
|
+
<div key={key} className="u-mb-6">
|
|
838
|
+
<div className="u-d-flex u-justify-content-between u-mb-2 u-text-white">
|
|
839
|
+
<label className="u-fs-sm u-fw-medium">
|
|
840
|
+
{key.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase())}
|
|
841
|
+
</label>
|
|
842
|
+
<span className="u-fs-sm">
|
|
843
|
+
{typeof value === 'boolean' ? (value ? 'On' : 'Off') : value}
|
|
844
|
+
</span>
|
|
845
|
+
</div>
|
|
846
|
+
|
|
847
|
+
{typeof value === 'boolean' ? (
|
|
848
|
+
<input
|
|
849
|
+
type="checkbox"
|
|
850
|
+
checked={value}
|
|
851
|
+
onChange={e => setSettings(prev => ({ ...prev, [key]: e.target.checked }))}
|
|
852
|
+
style={{ width: '1.25rem', height: '1.25rem' }}
|
|
853
|
+
/>
|
|
854
|
+
) : (
|
|
855
|
+
<input
|
|
856
|
+
type="range"
|
|
857
|
+
min={key === 'blurAmount' ? -1 : 0}
|
|
858
|
+
max={
|
|
859
|
+
key === 'displacementScale'
|
|
860
|
+
? 200
|
|
861
|
+
: key === 'saturation'
|
|
862
|
+
? 300
|
|
863
|
+
: key === 'aberrationIntensity'
|
|
864
|
+
? 10
|
|
865
|
+
: key === 'cornerRadius'
|
|
866
|
+
? 100
|
|
867
|
+
: 1
|
|
868
|
+
}
|
|
869
|
+
step={key === 'aberrationIntensity' || key === 'elasticity' ? 0.1 : 1}
|
|
870
|
+
value={value as number}
|
|
871
|
+
onChange={e =>
|
|
872
|
+
setSettings(prev => ({
|
|
873
|
+
...prev,
|
|
874
|
+
[key]: parseFloat(e.target.value),
|
|
875
|
+
}))
|
|
876
|
+
}
|
|
877
|
+
className="u-w-100"
|
|
878
|
+
style={{
|
|
879
|
+
accentColor: '#7AFFD7',
|
|
880
|
+
height: '6px',
|
|
881
|
+
}}
|
|
882
|
+
/>
|
|
883
|
+
)}
|
|
884
|
+
</div>
|
|
885
|
+
))}
|
|
886
|
+
|
|
887
|
+
{/* Mode Selector */}
|
|
888
|
+
<div className="u-mb-6">
|
|
889
|
+
<label className="u-d-block u-mb-2 u-text-white u-fs-sm u-fw-medium">
|
|
890
|
+
Glass Mode
|
|
891
|
+
</label>
|
|
892
|
+
<select
|
|
893
|
+
value={selectedMode}
|
|
894
|
+
onChange={e => setSelectedMode(e.target.value as any)}
|
|
895
|
+
className="u-w-100 u-p-2 u-rounded u-text-white"
|
|
896
|
+
style={{
|
|
897
|
+
background: 'rgba(255,255,255,0.1)',
|
|
898
|
+
border: 'none',
|
|
899
|
+
fontSize: '1rem',
|
|
900
|
+
}}
|
|
901
|
+
>
|
|
902
|
+
{modes.map(mode => (
|
|
903
|
+
<option key={mode.id} value={mode.id} style={{ background: '#333' }}>
|
|
904
|
+
{mode.name}
|
|
905
|
+
</option>
|
|
906
|
+
))}
|
|
907
|
+
</select>
|
|
908
|
+
</div>
|
|
909
|
+
|
|
910
|
+
{/* Reset Button */}
|
|
911
|
+
<Button
|
|
912
|
+
variant="primary"
|
|
913
|
+
size="md"
|
|
914
|
+
style={{ width: '100%' }}
|
|
915
|
+
onClick={() => {
|
|
916
|
+
setSettings({
|
|
917
|
+
displacementScale: 120,
|
|
918
|
+
blurAmount: 0,
|
|
919
|
+
saturation: 140,
|
|
920
|
+
aberrationIntensity: 2,
|
|
921
|
+
elasticity: 0.15,
|
|
922
|
+
cornerRadius: 20,
|
|
923
|
+
overLight: false,
|
|
924
|
+
});
|
|
925
|
+
setSelectedMode('standard');
|
|
926
|
+
}}
|
|
927
|
+
>
|
|
928
|
+
Reset to Defaults
|
|
929
|
+
</Button>
|
|
930
|
+
</div>
|
|
931
|
+
|
|
932
|
+
{/* Preview Area */}
|
|
933
|
+
<div
|
|
934
|
+
className="u-flex-fill u-d-flex u-align-items-center u-justify-content-center"
|
|
935
|
+
style={{ padding: '2.5rem' }}
|
|
936
|
+
>
|
|
937
|
+
<AtomixGlass {...settings} mode={selectedMode} style={{ maxWidth: '500px' }}>
|
|
938
|
+
<div className="u-text-center" style={{ padding: '3rem' }}>
|
|
939
|
+
<h3 className="u-mb-5 u-text-white u-fw-medium" style={{ fontSize: '1.8rem' }}>
|
|
940
|
+
Live Preview
|
|
941
|
+
</h3>
|
|
942
|
+
<p
|
|
943
|
+
className="u-mb-6"
|
|
944
|
+
style={{ fontSize: '1.1rem', lineHeight: 1.5, opacity: 0.9 }}
|
|
945
|
+
>
|
|
946
|
+
Adjust the controls on the left to see real-time changes to the glass effect.
|
|
947
|
+
Experiment with different modes and settings to find your perfect
|
|
948
|
+
configuration.
|
|
949
|
+
</p>
|
|
950
|
+
<div
|
|
951
|
+
className="u-d-flex u-justify-content-center u-flex-wrap"
|
|
952
|
+
style={{ gap: '1rem' }}
|
|
953
|
+
>
|
|
954
|
+
<Button variant="primary">Primary Action</Button>
|
|
955
|
+
<Button variant="outline-light">Secondary</Button>
|
|
956
|
+
</div>
|
|
957
|
+
</div>
|
|
958
|
+
</AtomixGlass>
|
|
959
|
+
</div>
|
|
960
|
+
</div>
|
|
961
|
+
);
|
|
962
|
+
|
|
963
|
+
case 'performance':
|
|
964
|
+
return (
|
|
965
|
+
<div className="u-pt-20 u-pb-16 u-px-5">
|
|
966
|
+
<div className="o-container">
|
|
967
|
+
<div className="u-text-center u-mb-12">
|
|
968
|
+
<h2 className="u-mb-5 u-fw-semibold u-text-white" style={{ fontSize: '2.5rem' }}>
|
|
969
|
+
Performance Optimization
|
|
970
|
+
</h2>
|
|
971
|
+
<p
|
|
972
|
+
className="u-text-lg u-opacity-80 u-text-white u-mx-auto"
|
|
973
|
+
style={{ maxWidth: '600px' }}
|
|
974
|
+
>
|
|
975
|
+
Learn how to optimize AtomixGlass for different performance requirements
|
|
976
|
+
</p>
|
|
977
|
+
</div>
|
|
978
|
+
|
|
979
|
+
<div className="o-grid u-mb-12">
|
|
980
|
+
<div className="o-grid__row">
|
|
981
|
+
{/* High Performance */}
|
|
982
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg u-mb-8">
|
|
983
|
+
<Card
|
|
984
|
+
glass={{
|
|
985
|
+
displacementScale: 60,
|
|
986
|
+
blurAmount: 0,
|
|
987
|
+
saturation: 120,
|
|
988
|
+
aberrationIntensity: 0.5,
|
|
989
|
+
cornerRadius: 15,
|
|
990
|
+
}}
|
|
991
|
+
className="u-h-full"
|
|
992
|
+
>
|
|
993
|
+
<div className="u-p-7">
|
|
994
|
+
<h3 className="u-mb-4 u-text-xl u-fw-medium" style={{ color: '#00FF88' }}>
|
|
995
|
+
⚡ High Performance
|
|
996
|
+
</h3>
|
|
997
|
+
<p className="u-mb-5 u-text-base" style={{ lineHeight: 1.5 }}>
|
|
998
|
+
Optimized for mobile devices and low-end hardware
|
|
999
|
+
</p>
|
|
1000
|
+
<ul className="u-text-sm u-ps-5" style={{ lineHeight: 1.6 }}>
|
|
1001
|
+
<li>Displacement Scale: 60</li>
|
|
1002
|
+
<li>Blur Amount: 0</li>
|
|
1003
|
+
<li>Aberration: 0.5</li>
|
|
1004
|
+
<li>Mode: Standard</li>
|
|
1005
|
+
<li>Best for: Mobile, multiple instances</li>
|
|
1006
|
+
</ul>
|
|
1007
|
+
</div>
|
|
1008
|
+
</Card>
|
|
1009
|
+
</div>
|
|
1010
|
+
|
|
1011
|
+
{/* Balanced */}
|
|
1012
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg u-mb-8">
|
|
1013
|
+
<Card
|
|
1014
|
+
glass={{
|
|
1015
|
+
displacementScale: 120,
|
|
1016
|
+
blurAmount: 0,
|
|
1017
|
+
saturation: 140,
|
|
1018
|
+
aberrationIntensity: 2,
|
|
1019
|
+
cornerRadius: 20,
|
|
1020
|
+
}}
|
|
1021
|
+
className="u-h-full"
|
|
1022
|
+
>
|
|
1023
|
+
<div className="u-p-7">
|
|
1024
|
+
<h3 className="u-mb-4 u-text-xl u-fw-medium" style={{ color: '#FFD700' }}>
|
|
1025
|
+
⚖️ Balanced
|
|
1026
|
+
</h3>
|
|
1027
|
+
<p className="u-mb-5 u-text-base" style={{ lineHeight: 1.5 }}>
|
|
1028
|
+
Good balance of performance and visual quality
|
|
1029
|
+
</p>
|
|
1030
|
+
<ul className="u-text-sm u-ps-5" style={{ lineHeight: 1.6 }}>
|
|
1031
|
+
<li>Displacement Scale: 120</li>
|
|
1032
|
+
<li>Blur Amount: 0</li>
|
|
1033
|
+
<li>Aberration: 2</li>
|
|
1034
|
+
<li>Mode: Standard/Polar</li>
|
|
1035
|
+
<li>Best for: Desktop apps, modern devices</li>
|
|
1036
|
+
</ul>
|
|
1037
|
+
</div>
|
|
1038
|
+
</Card>
|
|
1039
|
+
</div>
|
|
1040
|
+
|
|
1041
|
+
{/* High Quality */}
|
|
1042
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg u-mb-8">
|
|
1043
|
+
<Card
|
|
1044
|
+
glass={{
|
|
1045
|
+
displacementScale: 200,
|
|
1046
|
+
blurAmount: 0,
|
|
1047
|
+
saturation: 180,
|
|
1048
|
+
aberrationIntensity: 4,
|
|
1049
|
+
cornerRadius: 25,
|
|
1050
|
+
mode: 'shader',
|
|
1051
|
+
}}
|
|
1052
|
+
className="u-h-full"
|
|
1053
|
+
>
|
|
1054
|
+
<div className="u-p-7">
|
|
1055
|
+
<h3 className="u-mb-4 u-text-xl u-fw-medium" style={{ color: '#FF6B6B' }}>
|
|
1056
|
+
✨ High Quality
|
|
1057
|
+
</h3>
|
|
1058
|
+
<p className="u-mb-5 u-text-base" style={{ lineHeight: 1.5 }}>
|
|
1059
|
+
Maximum visual impact for hero sections
|
|
1060
|
+
</p>
|
|
1061
|
+
<ul className="u-text-sm u-ps-5" style={{ lineHeight: 1.6 }}>
|
|
1062
|
+
<li>Displacement Scale: 200</li>
|
|
1063
|
+
<li>Blur Amount: 0</li>
|
|
1064
|
+
<li>Aberration: 4</li>
|
|
1065
|
+
<li>Mode: Shader/Prominent</li>
|
|
1066
|
+
<li>Best for: Hero sections, high-end devices</li>
|
|
1067
|
+
</ul>
|
|
1068
|
+
</div>
|
|
1069
|
+
</Card>
|
|
1070
|
+
</div>
|
|
1071
|
+
</div>
|
|
1072
|
+
</div>
|
|
1073
|
+
|
|
1074
|
+
{/* Performance Tips */}
|
|
1075
|
+
<Card
|
|
1076
|
+
glass={{
|
|
1077
|
+
displacementScale: 100,
|
|
1078
|
+
blurAmount: 0,
|
|
1079
|
+
saturation: 130,
|
|
1080
|
+
aberrationIntensity: 1.5,
|
|
1081
|
+
cornerRadius: 20,
|
|
1082
|
+
}}
|
|
1083
|
+
>
|
|
1084
|
+
<div className="u-p-10">
|
|
1085
|
+
<h3 className="u-mb-6 u-text-center u-fw-medium" style={{ fontSize: '1.5rem' }}>
|
|
1086
|
+
💡 Performance Best Practices
|
|
1087
|
+
</h3>
|
|
1088
|
+
|
|
1089
|
+
<div className="o-grid">
|
|
1090
|
+
<div className="o-grid__row">
|
|
1091
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg">
|
|
1092
|
+
<h4 className="u-mb-4 u-fw-medium" style={{ color: '#7AFFD7' }}>
|
|
1093
|
+
Mobile Optimization
|
|
1094
|
+
</h4>
|
|
1095
|
+
<ul className="u-text-sm u-ps-5" style={{ lineHeight: 1.6 }}>
|
|
1096
|
+
<li>Reduce displacement scale below 100</li>
|
|
1097
|
+
<li>Use minimal blur amounts</li>
|
|
1098
|
+
<li>Prefer standard mode</li>
|
|
1099
|
+
<li>Limit to 2-3 instances per page</li>
|
|
1100
|
+
</ul>
|
|
1101
|
+
</div>
|
|
1102
|
+
|
|
1103
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg">
|
|
1104
|
+
<h4 className="u-mb-4 u-fw-medium" style={{ color: '#7AFFD7' }}>
|
|
1105
|
+
Memory Management
|
|
1106
|
+
</h4>
|
|
1107
|
+
<ul className="u-text-sm u-ps-5" style={{ lineHeight: 1.6 }}>
|
|
1108
|
+
<li>Use React.memo for static content</li>
|
|
1109
|
+
<li>Debounce mouse tracking</li>
|
|
1110
|
+
<li>Clean up event listeners</li>
|
|
1111
|
+
<li>Monitor GPU usage</li>
|
|
1112
|
+
</ul>
|
|
1113
|
+
</div>
|
|
1114
|
+
|
|
1115
|
+
<div className="o-grid__col o-grid__col--12 o-grid__col--4@lg">
|
|
1116
|
+
<h4 className="u-mb-4 u-fw-medium" style={{ color: '#7AFFD7' }}>
|
|
1117
|
+
Accessibility
|
|
1118
|
+
</h4>
|
|
1119
|
+
<ul className="u-text-sm u-ps-5" style={{ lineHeight: 1.6 }}>
|
|
1120
|
+
<li>Respect prefers-reduced-motion</li>
|
|
1121
|
+
<li>Ensure sufficient contrast</li>
|
|
1122
|
+
<li>Provide fallback styles</li>
|
|
1123
|
+
<li>Test with screen readers</li>
|
|
1124
|
+
</ul>
|
|
1125
|
+
</div>
|
|
1126
|
+
</div>
|
|
1127
|
+
</div>
|
|
1128
|
+
</div>
|
|
1129
|
+
</Card>
|
|
1130
|
+
</div>
|
|
1131
|
+
</div>
|
|
1132
|
+
);
|
|
1133
|
+
|
|
1134
|
+
default:
|
|
1135
|
+
return null;
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
return (
|
|
1140
|
+
<BackgroundWrapper
|
|
1141
|
+
backgroundIndex={6}
|
|
1142
|
+
interactive={activeSection === 'interactive'}
|
|
1143
|
+
height="auto"
|
|
1144
|
+
style={{
|
|
1145
|
+
position: 'relative',
|
|
1146
|
+
fontFamily: 'Inter, system-ui, sans-serif',
|
|
1147
|
+
minHeight: '100vh',
|
|
1148
|
+
}}
|
|
1149
|
+
>
|
|
1150
|
+
{/* Navigation */}
|
|
1151
|
+
<div
|
|
1152
|
+
className="u-position-fixed u-top-0 u-start-0 u-end-0 u-z-dropdown u-d-flex u-justify-content-center"
|
|
1153
|
+
style={{ top: '20px', left: '20px', right: '20px' }}
|
|
1154
|
+
>
|
|
1155
|
+
<AtomixGlass
|
|
1156
|
+
displacementScale={60}
|
|
1157
|
+
blurAmount={0}
|
|
1158
|
+
saturation={120}
|
|
1159
|
+
aberrationIntensity={1}
|
|
1160
|
+
cornerRadius={50}
|
|
1161
|
+
>
|
|
1162
|
+
<div className="u-d-flex u-gap-1 u-p-2 u-px-4 u-flex-wrap u-justify-content-center">
|
|
1163
|
+
{sections.map(section => (
|
|
1164
|
+
<Button
|
|
1165
|
+
key={section.id}
|
|
1166
|
+
variant={activeSection === section.id ? 'primary' : 'ghost'}
|
|
1167
|
+
size="sm"
|
|
1168
|
+
rounded
|
|
1169
|
+
onClick={() => setActiveSection(section.id)}
|
|
1170
|
+
className="u-fs-xs u-text-nowrap"
|
|
1171
|
+
title={section.desc}
|
|
1172
|
+
>
|
|
1173
|
+
{section.label}
|
|
1174
|
+
</Button>
|
|
1175
|
+
))}
|
|
1176
|
+
</div>
|
|
1177
|
+
</AtomixGlass>
|
|
1178
|
+
</div>
|
|
1179
|
+
|
|
1180
|
+
{/* Content Area */}
|
|
1181
|
+
<div
|
|
1182
|
+
className="u-w-100"
|
|
1183
|
+
style={{
|
|
1184
|
+
paddingTop: activeSection === 'playground' ? '0' : '100px',
|
|
1185
|
+
minHeight: '100vh',
|
|
1186
|
+
}}
|
|
1187
|
+
>
|
|
1188
|
+
{renderSection()}
|
|
1189
|
+
</div>
|
|
1190
|
+
</BackgroundWrapper>
|
|
1191
|
+
);
|
|
1192
|
+
},
|
|
1193
|
+
parameters: {
|
|
1194
|
+
docs: {
|
|
1195
|
+
description: {
|
|
1196
|
+
story: `
|
|
1197
|
+
# Comprehensive AtomixGlass Showcase
|
|
1198
|
+
|
|
1199
|
+
This comprehensive preview combines the best features from multiple AtomixGlass story implementations, providing:
|
|
1200
|
+
|
|
1201
|
+
## 🏠 Overview Section
|
|
1202
|
+
- Hero introduction with feature highlights
|
|
1203
|
+
- Key capabilities grid showcase
|
|
1204
|
+
- Visual feature demonstration
|
|
1205
|
+
|
|
1206
|
+
## 🎨 Modes Section
|
|
1207
|
+
- All 4 glass modes side-by-side
|
|
1208
|
+
- Interactive mode selection
|
|
1209
|
+
- Settings comparison
|
|
1210
|
+
|
|
1211
|
+
## 🖱️ Interactive Section
|
|
1212
|
+
- Real-time mouse tracking
|
|
1213
|
+
- Dynamic displacement effects
|
|
1214
|
+
- Live parameter display
|
|
1215
|
+
|
|
1216
|
+
## 📱 Applications Section
|
|
1217
|
+
- Mobile interface examples
|
|
1218
|
+
- Desktop application demos
|
|
1219
|
+
- Apple-inspired designs
|
|
1220
|
+
|
|
1221
|
+
## 🎮 Playground Section
|
|
1222
|
+
- Live customization controls
|
|
1223
|
+
- Real-time preview updates
|
|
1224
|
+
- Reset to defaults functionality
|
|
1225
|
+
|
|
1226
|
+
## ⚡ Performance Section
|
|
1227
|
+
- Optimization configurations
|
|
1228
|
+
- Best practices guide
|
|
1229
|
+
- Accessibility considerations
|
|
1230
|
+
|
|
1231
|
+
Navigate between sections using the floating navigation bar to explore all AtomixGlass capabilities.
|
|
1232
|
+
`,
|
|
1233
|
+
},
|
|
1234
|
+
},
|
|
1235
|
+
layout: 'fullscreen',
|
|
1236
|
+
},
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Quick Mode Comparison - Side-by-side view of all modes
|
|
1241
|
+
*/
|
|
1242
|
+
export const ModeComparison: Story = {
|
|
1243
|
+
render: () => (
|
|
1244
|
+
<BackgroundWrapper backgroundIndex={1} height="auto" style={{ minHeight: '80vh' }}>
|
|
1245
|
+
<div className="u-pt-20 u-pb-16 u-px-5">
|
|
1246
|
+
<div className="o-container">
|
|
1247
|
+
<h2
|
|
1248
|
+
className="u-mb-8 u-text-center u-text-white u-fw-semibold"
|
|
1249
|
+
style={{ fontSize: '2.5rem' }}
|
|
1250
|
+
>
|
|
1251
|
+
Mode Comparison
|
|
1252
|
+
</h2>
|
|
1253
|
+
|
|
1254
|
+
<div className="o-grid">
|
|
1255
|
+
<div className="o-grid__row">
|
|
1256
|
+
{[
|
|
1257
|
+
{ mode: 'standard', name: 'Standard', displacement: 120, aberration: 2 },
|
|
1258
|
+
{ mode: 'polar', name: 'Polar', displacement: 100, aberration: 1.5 },
|
|
1259
|
+
{ mode: 'prominent', name: 'Prominent', displacement: 150, aberration: 3 },
|
|
1260
|
+
{ mode: 'shader', name: 'Shader', displacement: 200, aberration: 4 },
|
|
1261
|
+
].map(config => (
|
|
1262
|
+
<div
|
|
1263
|
+
key={config.mode}
|
|
1264
|
+
className="o-grid__col o-grid__col--12 o-grid__col--6@md o-grid__col--3@lg u-mb-8"
|
|
1265
|
+
>
|
|
1266
|
+
<Card
|
|
1267
|
+
glass={{
|
|
1268
|
+
mode: config.mode as any,
|
|
1269
|
+
displacementScale: config.displacement,
|
|
1270
|
+
aberrationIntensity: config.aberration,
|
|
1271
|
+
saturation: 140,
|
|
1272
|
+
cornerRadius: 20,
|
|
1273
|
+
}}
|
|
1274
|
+
className="u-h-full"
|
|
1275
|
+
>
|
|
1276
|
+
<div className="u-p-7 u-text-center">
|
|
1277
|
+
<h3 className="u-mb-3 u-text-xl u-fw-medium u-text-white">{config.name}</h3>
|
|
1278
|
+
<p className="u-mb-4 u-text-sm u-opacity-80">Mode: {config.mode}</p>
|
|
1279
|
+
<div className="u-text-xs u-flex u-flex-column u-gap-1">
|
|
1280
|
+
<div>Displacement: {config.displacement}</div>
|
|
1281
|
+
<div>Aberration: {config.aberration}</div>
|
|
1282
|
+
</div>
|
|
1283
|
+
</div>
|
|
1284
|
+
</Card>
|
|
1285
|
+
</div>
|
|
1286
|
+
))}
|
|
1287
|
+
</div>
|
|
1288
|
+
</div>
|
|
1289
|
+
</div>
|
|
1290
|
+
</div>
|
|
1291
|
+
</BackgroundWrapper>
|
|
1292
|
+
),
|
|
1293
|
+
parameters: {
|
|
1294
|
+
docs: {
|
|
1295
|
+
description: {
|
|
1296
|
+
story:
|
|
1297
|
+
'Quick side-by-side comparison of all four AtomixGlass modes with their optimal settings.',
|
|
1298
|
+
},
|
|
1299
|
+
},
|
|
1300
|
+
},
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Interactive Demo - Enhanced mouse tracking example
|
|
1305
|
+
*/
|
|
1306
|
+
export const InteractiveDemo: Story = {
|
|
1307
|
+
render: () => (
|
|
1308
|
+
<InteractiveContainer>
|
|
1309
|
+
{(mousePos, mouseOffset, containerRef) => (
|
|
1310
|
+
<div className="u-flex u-flex-column u-items-center u-gap-8">
|
|
1311
|
+
<AtomixGlass
|
|
1312
|
+
globalMousePos={mousePos}
|
|
1313
|
+
mouseOffset={mouseOffset}
|
|
1314
|
+
mouseContainer={containerRef}
|
|
1315
|
+
displacementScale={150}
|
|
1316
|
+
blurAmount={0}
|
|
1317
|
+
saturation={160}
|
|
1318
|
+
aberrationIntensity={3}
|
|
1319
|
+
elasticity={0.3}
|
|
1320
|
+
cornerRadius={25}
|
|
1321
|
+
mode="shader"
|
|
1322
|
+
>
|
|
1323
|
+
<div className="u-p-12 u-px-18 u-text-center">
|
|
1324
|
+
<h2 className="u-mb-5 u-text-white u-fw-semibold" style={{ fontSize: '2rem' }}>
|
|
1325
|
+
Interactive Glass Effect
|
|
1326
|
+
</h2>
|
|
1327
|
+
<p className="u-mb-6 u-text-lg u-opacity-90" style={{ lineHeight: 1.5 }}>
|
|
1328
|
+
Move your mouse to see real-time displacement and distortion effects
|
|
1329
|
+
</p>
|
|
1330
|
+
<div className="u-p-4 u-rounded-md" style={{ background: 'rgba(255,255,255,0.1)' }}>
|
|
1331
|
+
<div className="o-grid">
|
|
1332
|
+
<div className="o-grid__row">
|
|
1333
|
+
<div className="o-grid__col o-grid__col--6">
|
|
1334
|
+
<div className="u-text-sm">
|
|
1335
|
+
Mouse X: <strong>{Math.round(mouseOffset.x)}</strong>
|
|
1336
|
+
</div>
|
|
1337
|
+
</div>
|
|
1338
|
+
<div className="o-grid__col o-grid__col--6">
|
|
1339
|
+
<div className="u-text-sm">
|
|
1340
|
+
Mouse Y: <strong>{Math.round(mouseOffset.y)}</strong>
|
|
1341
|
+
</div>
|
|
1342
|
+
</div>
|
|
1343
|
+
<div className="o-grid__col o-grid__col--6">
|
|
1344
|
+
<div className="u-text-sm">
|
|
1345
|
+
Position X: <strong>{mousePos.x}</strong>
|
|
1346
|
+
</div>
|
|
1347
|
+
</div>
|
|
1348
|
+
<div className="o-grid__col o-grid__col--6">
|
|
1349
|
+
<div className="u-text-sm">
|
|
1350
|
+
Position Y: <strong>{mousePos.y}</strong>
|
|
1351
|
+
</div>
|
|
1352
|
+
</div>
|
|
1353
|
+
</div>
|
|
1354
|
+
</div>
|
|
1355
|
+
</div>
|
|
1356
|
+
</div>
|
|
1357
|
+
</AtomixGlass>
|
|
1358
|
+
</div>
|
|
1359
|
+
)}
|
|
1360
|
+
</InteractiveContainer>
|
|
1361
|
+
),
|
|
1362
|
+
parameters: {
|
|
1363
|
+
docs: {
|
|
1364
|
+
description: {
|
|
1365
|
+
story: 'Interactive demonstration with real-time mouse tracking and live position display.',
|
|
1366
|
+
},
|
|
1367
|
+
},
|
|
1368
|
+
},
|
|
1369
|
+
};
|