@shohojdhara/atomix 0.3.14 → 0.3.15

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.
Files changed (173) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build-tools/EXAMPLES.md +372 -0
  3. package/build-tools/README.md +242 -0
  4. package/build-tools/__tests__/error-handler.test.js +230 -0
  5. package/build-tools/__tests__/index.test.js +141 -0
  6. package/build-tools/__tests__/rollup-plugin.test.js +194 -0
  7. package/build-tools/__tests__/utils.test.js +161 -0
  8. package/build-tools/__tests__/vite-plugin.test.js +129 -0
  9. package/build-tools/__tests__/webpack-loader.test.js +190 -0
  10. package/build-tools/error-handler.js +308 -0
  11. package/build-tools/index.d.ts +43 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +67 -0
  14. package/build-tools/rollup-plugin.js +236 -0
  15. package/build-tools/types.d.ts +163 -0
  16. package/build-tools/utils.js +203 -0
  17. package/build-tools/vite-plugin.js +161 -0
  18. package/build-tools/webpack-loader.js +123 -0
  19. package/dist/atomix.css +203 -90
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +3 -3
  22. package/dist/atomix.min.css.map +1 -1
  23. package/dist/build-tools/EXAMPLES.md +372 -0
  24. package/dist/build-tools/README.md +242 -0
  25. package/dist/build-tools/__tests__/error-handler.test.js +230 -0
  26. package/dist/build-tools/__tests__/index.test.js +141 -0
  27. package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
  28. package/dist/build-tools/__tests__/utils.test.js +161 -0
  29. package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
  30. package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
  31. package/dist/build-tools/error-handler.js +308 -0
  32. package/dist/build-tools/index.d.ts +43 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +67 -0
  35. package/dist/build-tools/rollup-plugin.js +236 -0
  36. package/dist/build-tools/types.d.ts +163 -0
  37. package/dist/build-tools/utils.js +203 -0
  38. package/dist/build-tools/vite-plugin.js +161 -0
  39. package/dist/build-tools/webpack-loader.js +123 -0
  40. package/dist/charts.d.ts +1 -1
  41. package/dist/charts.js +86 -57
  42. package/dist/charts.js.map +1 -1
  43. package/dist/core.d.ts +1 -1
  44. package/dist/core.js +136 -112
  45. package/dist/core.js.map +1 -1
  46. package/dist/forms.d.ts +2 -5
  47. package/dist/forms.js +140 -128
  48. package/dist/forms.js.map +1 -1
  49. package/dist/heavy.d.ts +1 -1
  50. package/dist/heavy.js +136 -112
  51. package/dist/heavy.js.map +1 -1
  52. package/dist/index.d.ts +9 -61
  53. package/dist/index.esm.js +237 -286
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +250 -299
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.min.js +1 -1
  58. package/dist/index.min.js.map +1 -1
  59. package/package.json +23 -8
  60. package/scripts/atomix-cli.js +170 -73
  61. package/scripts/cli/__tests__/README.md +81 -0
  62. package/scripts/cli/__tests__/basic.test.js +115 -0
  63. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  64. package/scripts/cli/__tests__/integration.test.js +327 -0
  65. package/scripts/cli/__tests__/test-setup.js +133 -0
  66. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  67. package/scripts/cli/__tests__/utils.test.js +161 -0
  68. package/scripts/cli/component-generator.js +253 -299
  69. package/scripts/cli/dependency-checker.js +355 -0
  70. package/scripts/cli/interactive-init.js +46 -5
  71. package/scripts/cli/template-manager.js +0 -2
  72. package/scripts/cli/templates/common-templates.js +636 -0
  73. package/scripts/cli/templates/composable-templates.js +148 -126
  74. package/scripts/cli/templates/index.js +23 -16
  75. package/scripts/cli/templates/project-templates.js +151 -23
  76. package/scripts/cli/templates/react-templates.js +280 -210
  77. package/scripts/cli/templates/scss-templates.js +90 -91
  78. package/scripts/cli/templates/testing-templates.js +206 -27
  79. package/scripts/cli/templates/testing-utils.js +278 -0
  80. package/scripts/cli/templates/types-templates.js +70 -56
  81. package/scripts/cli/theme-bridge.js +8 -2
  82. package/scripts/cli/token-manager.js +318 -206
  83. package/scripts/cli/utils.js +0 -1
  84. package/src/components/Accordion/Accordion.stories.tsx +369 -870
  85. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  86. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  87. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  88. package/src/components/AtomixGlass/glass-utils.ts +2 -2
  89. package/src/components/AtomixGlass/shader-utils.ts +5 -0
  90. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  91. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  92. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  93. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  94. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  95. package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -35
  96. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +1 -1
  97. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  98. package/src/components/Avatar/Avatar.stories.tsx +213 -1
  99. package/src/components/Badge/Badge.stories.tsx +121 -362
  100. package/src/components/Block/Block.stories.tsx +21 -12
  101. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +141 -23
  102. package/src/components/Button/Button.stories.tsx +463 -1126
  103. package/src/components/Button/Button.test.tsx +107 -0
  104. package/src/components/Button/Button.tsx +46 -50
  105. package/src/components/Button/ButtonGroup.stories.tsx +373 -217
  106. package/src/components/Callout/Callout.stories.tsx +289 -634
  107. package/src/components/Card/Card.stories.tsx +248 -68
  108. package/src/components/Chart/Chart.stories.tsx +150 -8
  109. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +151 -69
  110. package/src/components/Countdown/Countdown.stories.tsx +115 -8
  111. package/src/components/DataTable/DataTable.stories.tsx +346 -146
  112. package/src/components/DatePicker/DatePicker.stories.tsx +325 -1066
  113. package/src/components/Dropdown/Dropdown.stories.tsx +153 -33
  114. package/src/components/EdgePanel/EdgePanel.stories.tsx +230 -21
  115. package/src/components/Footer/Footer.stories.tsx +392 -328
  116. package/src/components/Form/Checkbox.stories.tsx +140 -6
  117. package/src/components/Form/Checkbox.test.tsx +63 -0
  118. package/src/components/Form/Checkbox.tsx +87 -51
  119. package/src/components/Form/Form.stories.tsx +119 -20
  120. package/src/components/Form/FormGroup.stories.tsx +127 -4
  121. package/src/components/Form/Radio.stories.tsx +140 -5
  122. package/src/components/Form/Select.stories.tsx +140 -8
  123. package/src/components/Form/Textarea.stories.tsx +149 -6
  124. package/src/components/Hero/Hero.stories.tsx +333 -32
  125. package/src/components/List/List.stories.tsx +141 -3
  126. package/src/components/Modal/Modal.stories.tsx +181 -42
  127. package/src/components/Popover/Popover.stories.tsx +448 -98
  128. package/src/components/Progress/Progress.stories.tsx +167 -5
  129. package/src/components/River/River.stories.tsx +1 -1
  130. package/src/components/SectionIntro/SectionIntro.stories.tsx +240 -48
  131. package/src/components/Spinner/Spinner.stories.tsx +102 -8
  132. package/src/components/Steps/Steps.stories.tsx +172 -43
  133. package/src/components/Tabs/Tabs.stories.tsx +136 -10
  134. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  135. package/src/components/Todo/Todo.stories.tsx +198 -9
  136. package/src/components/Toggle/Toggle.stories.tsx +126 -39
  137. package/src/components/Tooltip/Tooltip.stories.tsx +194 -104
  138. package/src/components/Upload/Upload.stories.tsx +113 -24
  139. package/src/lib/README.md +2 -2
  140. package/src/lib/__tests__/theme-tools.test.ts +193 -0
  141. package/src/lib/composables/index.ts +2 -2
  142. package/src/lib/composables/useAtomixGlass.ts +28 -56
  143. package/src/lib/composables/useChartExport.ts +2 -7
  144. package/src/lib/composables/useDataTable.ts +46 -29
  145. package/src/lib/constants/components.ts +9 -32
  146. package/src/lib/theme/devtools/CLI.ts +1 -1
  147. package/src/lib/types/components.ts +1 -1
  148. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  149. package/src/lib/utils/csv.ts +17 -0
  150. package/src/lib/utils/dataTableExport.ts +1 -10
  151. package/src/styles/01-settings/_index.scss +2 -1
  152. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  153. package/src/styles/01-settings/_settings.colors.scss +11 -11
  154. package/src/styles/01-settings/_settings.typography.scss +5 -5
  155. package/src/styles/02-tools/_tools.utility-api.scss +14 -0
  156. package/src/styles/06-components/_components.accordion.scss +56 -14
  157. package/src/styles/06-components/_components.checkbox.scss +23 -17
  158. package/src/styles/99-utilities/_index.scss +2 -0
  159. package/src/styles/99-utilities/_utilities.scss +3 -1
  160. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  161. package/themes/dark-complementary/README.md +98 -0
  162. package/themes/dark-complementary/index.scss +158 -0
  163. package/themes/default-light/README.md +81 -0
  164. package/themes/default-light/index.scss +154 -0
  165. package/themes/high-contrast/README.md +105 -0
  166. package/themes/high-contrast/index.scss +172 -0
  167. package/themes/test-theme/README.md +38 -0
  168. package/themes/test-theme/index.scss +47 -0
  169. package/scripts/cli/templates-original-backup.js +0 -1655
  170. package/scripts/cli/templates_backup.js +0 -684
  171. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  172. package/src/lib/composables/useButton.ts +0 -93
  173. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -1,1438 +0,0 @@
1
- /**
2
- * AtomixGlass.stories.tsx
3
- *
4
- * This file contains comprehensive Storybook stories for the AtomixGlass component, showcasing
5
- * various use cases, configurations, and best practices. The stories demonstrate
6
- * the component's versatility and provide examples for developers to reference.
7
- *\
8
- * @package Atomix
9
- * @component AtomixGlass
10
- */
11
-
12
- import { Meta, StoryObj } from '@storybook/react';
13
- import AtomixGlass from '../AtomixGlass';
14
- import Button from '../../Button/Button';
15
- import Badge from '../../Badge/Badge';
16
- import { useState, useEffect, useCallback, useMemo, useRef } from 'react';
17
- import React from 'react';
18
- import type { RefObject } from 'react';
19
- import { BoxArrowDownIcon } from '@phosphor-icons/react';
20
-
21
- /**
22
- * Storybook meta configuration for AtomixGlass component
23
- *
24
- * This defines the component's metadata, documentation, and controls
25
- * for the Storybook interface.
26
- */
27
- const meta: Meta<typeof AtomixGlass> = {
28
- title: 'Components/AtomixGlass',
29
- component: AtomixGlass,
30
- parameters: {
31
- layout: 'centered',
32
- docs: {
33
- description: {
34
- component:
35
- 'A glass-like component with chromatic aberration and displacement effects. The component provides a modern, frosted glass aesthetic with interactive hover effects. This component is ideal for creating modern UI elements with depth and visual interest.',
36
- },
37
- },
38
- },
39
- tags: ['autodocs'],
40
- argTypes: {
41
- children: {
42
- control: 'text',
43
- description: 'Content to display inside the glass effect',
44
- },
45
- displacementScale: {
46
- control: { type: 'range', min: 0, max: 100, step: 1 },
47
- description: 'Displacement scale for the glass effect (default: 70)',
48
- table: { defaultValue: { summary: '70' } },
49
- },
50
- blurAmount: {
51
- control: { type: 'range', min: 0, max: 10, step: 0.5 },
52
- description: 'Blur amount for the backdrop (default: 0.0625)',
53
- table: { defaultValue: { summary: '0.0625' } },
54
- },
55
- saturation: {
56
- control: { type: 'range', min: 100, max: 300, step: 5 },
57
- description: 'Saturation percentage for the backdrop (default: 140)',
58
- table: { defaultValue: { summary: '140' } },
59
- },
60
- aberrationIntensity: {
61
- control: { type: 'range', min: 0, max: 10, step: 0.1 },
62
- description: 'Chromatic aberration intensity (default: 2)',
63
- table: { defaultValue: { summary: '2' } },
64
- },
65
- elasticity: {
66
- control: { type: 'range', min: 0, max: 1, step: 0.01 },
67
- description: 'Elasticity factor for mouse interactions (default: 0.15)',
68
- table: { defaultValue: { summary: '0.15' } },
69
- },
70
- cornerRadius: {
71
- control: { type: 'range', min: 0, max: 50, step: 1 },
72
- description: 'Corner radius in pixels (default: 20)',
73
- table: { defaultValue: { summary: '20' } },
74
- },
75
- globalMousePosition: {
76
- control: 'object',
77
- description: 'External global mouse position { x: number; y: number }',
78
- },
79
- mouseOffset: {
80
- control: 'object',
81
- description: 'External mouse offset { x: number; y: number }',
82
- },
83
- mouseContainer: {
84
- control: false,
85
- description: 'React ref object for mouse container element',
86
- },
87
- padding: {
88
- control: 'text',
89
- description: 'Padding for the glass container (default: "0 0")',
90
- table: { defaultValue: { summary: '"0 0"' } },
91
- },
92
- overLight: {
93
- control: {
94
- type: 'select',
95
- labels: {
96
- false: 'false (Dark Background)',
97
- true: 'true (Light Background)',
98
- auto: 'auto (Auto-detect)',
99
- object: 'object (Custom Config)',
100
- },
101
- },
102
- options: [false, true, 'auto', 'object'],
103
- description: `OverLight configuration mode. Can be:
104
- - **boolean**: Explicit control (true/false)
105
- - **'auto'**: Auto-detect background brightness
106
- - **object**: Auto-detect with custom settings (threshold, opacity, contrast, brightness, saturationBoost)
107
-
108
- See documentation for detailed examples of each mode.`,
109
- table: {
110
- defaultValue: { summary: '"auto"' },
111
- type: { summary: 'boolean | "auto" | OverLightObjectConfig' },
112
- },
113
- mapping: {
114
- false: false,
115
- true: true,
116
- auto: 'auto',
117
- object: {
118
- threshold: 0.75,
119
- opacity: 0.6,
120
- contrast: 1.8,
121
- brightness: 1.0,
122
- saturationBoost: 1.5,
123
- },
124
- },
125
- },
126
- mode: {
127
- control: { type: 'select' },
128
- options: ['standard', 'polar', 'prominent', 'shader'],
129
- description: 'Glass effect mode (default: "standard")',
130
- table: { defaultValue: { summary: '"standard"' } },
131
- },
132
- onClick: {
133
- action: 'clicked',
134
- description: 'Click event handler',
135
- },
136
- className: {
137
- control: 'text',
138
- description: 'Additional CSS class names',
139
- },
140
- style: {
141
- control: 'object',
142
- description: 'CSS style object',
143
- },
144
- 'aria-label': {
145
- control: 'text',
146
- description: 'ARIA label for accessibility',
147
- },
148
- 'aria-describedby': {
149
- control: 'text',
150
- description: 'ARIA describedby attribute for accessibility',
151
- },
152
- role: {
153
- control: 'text',
154
- description: 'ARIA role attribute',
155
- },
156
- tabIndex: {
157
- control: 'number',
158
- description: 'Tab index for keyboard navigation',
159
- },
160
- reducedMotion: {
161
- control: 'boolean',
162
- description: 'Override for reduced motion preference (default: false)',
163
- table: { defaultValue: { summary: 'false' } },
164
- },
165
- highContrast: {
166
- control: 'boolean',
167
- description: 'Override for high contrast preference (default: false)',
168
- table: { defaultValue: { summary: 'false' } },
169
- },
170
- disableEffects: {
171
- control: 'boolean',
172
- description: 'Disable all visual effects (default: false)',
173
- table: { defaultValue: { summary: 'false' } },
174
- },
175
- enablePerformanceMonitoring: {
176
- control: 'boolean',
177
- description: 'Enable performance monitoring (default: false)',
178
- table: { defaultValue: { summary: 'false' } },
179
- },
180
- debugOverLight: {
181
- control: 'boolean',
182
- description: 'Enable debug logging for overLight detection and configuration (default: false). Logs detailed information to console about auto-detection results and final config values.',
183
- table: { defaultValue: { summary: 'false' } },
184
- },
185
- },
186
- };
187
-
188
- export default meta;
189
- type Story = StoryObj<typeof AtomixGlass>;
190
-
191
- /**
192
- * Enhanced BackgroundWrapper Component
193
- *
194
- * A utility component used throughout the stories to provide consistent background
195
- * styling and overlay effects. This wrapper creates a visually appealing container
196
- * for showcasing the AtomixGlass component in various scenarios.
197
- *
198
- * @component BackgroundWrapper
199
- */
200
- interface BackgroundWrapperProps {
201
- /** Child elements to render inside the wrapper */
202
- children: React.ReactNode;
203
- /** Background image URL or index from the backgroundImages array */
204
- backgroundImage?: string;
205
- /** Background index to use from the predefined array */
206
- backgroundIndex?: number;
207
- /** Optional overlay flag for quick overlay application */
208
- overlay?: boolean;
209
- /** Custom overlay color in CSS format */
210
- overlayColor?: string;
211
- /** Overlay opacity (0-1) */
212
- overlayOpacity?: number;
213
- /** Container height */
214
- height?: string;
215
- /** Container width */
216
- width?: string;
217
- /** Container border radius */
218
- borderRadius?: string;
219
- /** Container padding */
220
- padding?: string;
221
- /** Additional CSS class names */
222
- className?: string;
223
- /** Additional inline styles */
224
- style?: React.CSSProperties;
225
- /** Enable interactive background movement */
226
- interactive?: boolean;
227
- }
228
-
229
- /**
230
- * Interactive Story Container
231
- *
232
- * A container that provides mouse tracking and interactive background effects
233
- * for enhanced storytelling and demonstration purposes.
234
- */
235
- interface StoryContainerProps {
236
- children: React.ReactNode;
237
- style?: React.CSSProperties;
238
- interactive?: boolean;
239
- }
240
-
241
- /**
242
- * Interactive Wrapper Component
243
- *
244
- * Provides mouse position tracking and offset calculations for interactive stories
245
- */
246
- interface InteractiveWrapperProps {
247
- children: (
248
- mousePos: { x: number; y: number },
249
- mouseOffset: { x: number; y: number },
250
- containerRef: RefObject<HTMLDivElement>
251
- ) => React.ReactNode;
252
- }
253
-
254
- /**
255
- * BackgroundWrapper Component Implementation
256
- *
257
- * Renders a container with a background image and optional overlay,
258
- * providing a consistent environment for showcasing the AtomixGlass component.
259
- *
260
- * @param props - BackgroundWrapperProps
261
- * @returns JSX.Element
262
- */
263
- const BackgroundWrapper = ({
264
- children,
265
- backgroundImage,
266
- backgroundIndex,
267
- height = '90vh',
268
- width = '90vw',
269
- borderRadius = '12px',
270
- padding = '24px',
271
- className = '',
272
- style = {},
273
- }: BackgroundWrapperProps) => {
274
- // If backgroundIndex is provided, use it to select from the backgroundImages array
275
- const bgImage =
276
- backgroundIndex !== undefined ? backgroundImages[backgroundIndex] : backgroundImage;
277
-
278
- // Apply default overlay settings if overlay flag is true using nullish coalescing
279
-
280
- return (
281
- <div
282
- className={`c-atomix-glass-background ${className}`}
283
- style={{
284
- position: 'relative',
285
- width: width,
286
- minHeight: height,
287
- height: '100%',
288
- backgroundColor: !bgImage ? '#1a1a2e' : undefined, // Fallback color if no image
289
- background: bgImage
290
- ? `url(${bgImage})`
291
- : undefined,
292
- backgroundSize: 'cover',
293
- backgroundPosition: 'center',
294
- backgroundAttachment: 'fixed',
295
- display: 'flex',
296
- alignItems: 'center',
297
- justifyContent: 'center',
298
- borderRadius: borderRadius,
299
- padding: padding,
300
- ...style,
301
- }}
302
- >
303
- <div
304
- style={{
305
- position: 'relative',
306
- width: '100%',
307
- height: '100%',
308
- display: 'flex',
309
- alignItems: 'center',
310
- justifyContent: 'center',
311
- color: 'white',
312
- }}
313
- >
314
- {children}
315
- </div>
316
- </div>
317
- );
318
- };
319
-
320
- /**
321
- * Interactive Story Container Component
322
- *
323
- * A container that provides mouse tracking and interactive background effects
324
- * for enhanced storytelling and demonstration purposes.
325
- */
326
- const StoryContainer = ({ children, style = {}, interactive = false }: StoryContainerProps) => {
327
- const containerRef = useRef<HTMLDivElement>(null);
328
- const [backgroundPosition, setBackgroundPosition] = useState({ x: 0, y: 0 });
329
-
330
- const handleMouseMove = useCallback(
331
- (e: MouseEvent) => {
332
- if (containerRef.current && interactive) {
333
- const rect = containerRef.current.getBoundingClientRect();
334
- const centerX = rect.left + rect.width / 2;
335
- const centerY = rect.top + rect.height / 2;
336
-
337
- // Calculate offset as a percentage
338
- const offsetX = ((e.clientX - centerX) / rect.width) * 100;
339
- const offsetY = ((e.clientY - centerY) / rect.height) * 100;
340
-
341
- setBackgroundPosition({ x: offsetX, y: offsetY });
342
- }
343
- },
344
- [interactive]
345
- );
346
-
347
- useEffect(() => {
348
- const currentRef = containerRef.current;
349
- if (currentRef && interactive) {
350
- currentRef.addEventListener('mousemove', handleMouseMove);
351
- return () => {
352
- currentRef.removeEventListener('mousemove', handleMouseMove);
353
- };
354
- }
355
- }, [handleMouseMove, interactive]);
356
-
357
- return (
358
- <div
359
- ref={containerRef}
360
- style={{
361
- width: '100vw',
362
- height: '100vh',
363
- display: 'flex',
364
- alignItems: 'center',
365
- justifyContent: 'center',
366
- backgroundImage: interactive
367
- ? 'url(https://images.unsplash.com/photo-1497366216548-37526070297c?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)'
368
- : undefined,
369
- backgroundSize: interactive ? '160%' : 'cover',
370
- backgroundPosition: interactive
371
- ? `calc(50% + ${backgroundPosition.x}px) calc(50% + ${backgroundPosition.y}px)`
372
- : 'center',
373
- ...style,
374
- }}
375
- >
376
- {children}
377
- </div>
378
- );
379
- };
380
-
381
- /**
382
- * Interactive Wrapper Component
383
- *
384
- * Provides mouse position tracking and offset calculations for interactive stories
385
- */
386
- const InteractiveWrapper = ({ children }: InteractiveWrapperProps) => {
387
- const containerRef = useRef<HTMLDivElement>(null);
388
- const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
389
- const [mouseOffset, setMouseOffset] = useState({ x: 0, y: 0 });
390
-
391
- const handleMouseMove = useCallback((e: MouseEvent) => {
392
- if (containerRef.current) {
393
- const rect = containerRef.current.getBoundingClientRect();
394
- const centerX = rect.left + rect.width / 2;
395
- const centerY = rect.top + rect.height / 2;
396
-
397
- setMouseOffset({
398
- x: ((e.clientX - centerX) / rect.width) * 100,
399
- y: ((e.clientY - centerY) / rect.height) * 100,
400
- });
401
- }
402
- setMousePos({ x: e.clientX, y: e.clientY });
403
- }, []);
404
-
405
- useEffect(() => {
406
- const currentRef = containerRef.current;
407
- currentRef?.addEventListener('mousemove', handleMouseMove);
408
- return () => {
409
- currentRef?.removeEventListener('mousemove', handleMouseMove);
410
- };
411
- }, [handleMouseMove]);
412
-
413
- return (
414
- <div ref={containerRef} style={{ width: '100%', height: '100%' }}>
415
- {children(mousePos, mouseOffset, containerRef)}
416
- </div>
417
- );
418
- };
419
-
420
- /**
421
- * Collection of high-quality background images for different moods and scenarios
422
- *
423
- * This array provides a variety of background options that work well with the
424
- * AtomixGlass component, showcasing different visual styles and contexts.
425
- */
426
- const backgroundImages = [
427
- // 0: Modern office interior with natural lighting
428
- 'https://images.unsplash.com/photo-1637825891028-564f672aa42c?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670',
429
- // 1: Beautiful natural landscape - mountains and lake
430
- 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
431
- // 2: Urban cityscape with modern buildings
432
- 'https://images.unsplash.com/photo-1519681393784-d120267933ba?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670',
433
- // 3: Forest path with sunlight filtering through trees
434
- 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
435
- // 4: Ocean waves and beach scene
436
- 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
437
- // 5: Modern architecture with glass facades
438
- 'https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
439
- // 6: Cozy café interior with warm lighting
440
- 'https://images.unsplash.com/photo-1554118811-1e0d58224f24?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
441
- // 7: Desert landscape with dramatic sky
442
- 'https://images.unsplash.com/photo-1509316785289-025f5b846b35?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
443
- // 8: Tropical paradise with palm trees and ocean
444
- 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
445
- // 9: Modern library or workspace with natural light
446
- 'https://images.unsplash.com/photo-1521587760476-6c12a4b040da?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
447
- ];
448
-
449
- /**
450
- * Default showcase of the AtomixGlass component
451
- *
452
- * This story demonstrates the default configuration of the AtomixGlass component
453
- * with carefully selected parameters to achieve an optimal glass effect. It serves
454
- * as a reference implementation with balanced settings suitable for most use cases.
455
- *
456
- * Key features demonstrated:
457
- * - Balanced displacement scale for subtle distortion
458
- * - Moderate blur amount for the frosted glass effect
459
- * - Enhanced saturation for visual appeal
460
- * - Subtle chromatic aberration for depth
461
- * - Interactive hover effects for engagement
462
- */
463
- export const Default: Story = {
464
- args: {
465
- children: (
466
- <div style={{ padding: '40px', textAlign: 'center', maxWidth: '500px' }}>
467
- <div
468
- style={{
469
- width: '80px',
470
- height: '80px',
471
- margin: '0 auto 24px',
472
- borderRadius: '20px',
473
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
474
- display: 'flex',
475
- alignItems: 'center',
476
- justifyContent: 'center',
477
- fontSize: '40px',
478
- boxShadow: '0 12px 32px rgba(102, 126, 234, 0.4)',
479
- }}
480
- >
481
-
482
- </div>
483
- <h2
484
- style={{
485
- margin: '0 0 16px 0',
486
- fontSize: '32px',
487
- fontWeight: 700,
488
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
489
- WebkitBackgroundClip: 'text',
490
- WebkitTextFillColor: 'transparent',
491
- backgroundClip: 'text',
492
- letterSpacing: '-0.5px',
493
- }}
494
- >
495
- AtomixGlass
496
- </h2>
497
- <p
498
- style={{
499
- margin: '0 0 28px 0',
500
- fontSize: '17px',
501
- lineHeight: 1.7,
502
- color: 'rgba(255, 255, 255, 0.9)',
503
- }}
504
- >
505
- A premium glass morphism component with realistic light refraction, chromatic aberration,
506
- and interactive effects. Perfect for modern, elegant UI designs.
507
- </p>
508
- <div
509
- style={{
510
- display: 'flex',
511
- justifyContent: 'center',
512
- gap: '12px',
513
- flexWrap: 'wrap',
514
- marginBottom: '24px',
515
- }}
516
- >
517
- <Button variant="primary" glass>
518
- Get Started
519
- </Button>
520
- <Button variant="outline-primary" glass>
521
- View Docs
522
- </Button>
523
- </div>
524
- <div
525
- style={{
526
- display: 'flex',
527
- justifyContent: 'center',
528
- gap: '16px',
529
- flexWrap: 'wrap',
530
- marginTop: '24px',
531
- paddingTop: '24px',
532
- borderTop: '1px solid rgba(255,255,255,0.1)',
533
- }}
534
- >
535
- {[
536
- { label: 'Performance', value: '⚡ Optimized' },
537
- { label: 'Quality', value: '💎 Premium' },
538
- { label: 'Compatibility', value: '🌐 Universal' },
539
- ].map((item, idx) => (
540
- <div
541
- key={idx}
542
- style={{
543
- textAlign: 'center',
544
- padding: '8px 16px',
545
- borderRadius: '12px',
546
- background: 'rgba(255,255,255,0.08)',
547
- backdropFilter: 'blur(8px)',
548
- }}
549
- >
550
- <div style={{ fontSize: '12px', opacity: 0.7, marginBottom: '4px' }}>{item.label}</div>
551
- <div style={{ fontSize: '14px', fontWeight: 600 }}>{item.value}</div>
552
- </div>
553
- ))}
554
- </div>
555
- </div>
556
- ),
557
- },
558
- decorators: [
559
- Story => (
560
- <BackgroundWrapper backgroundImage={backgroundImages[0]}>
561
- <Story />
562
- </BackgroundWrapper>
563
- ),
564
- ],
565
- parameters: {
566
- docs: {
567
- description: {
568
- story:
569
- 'The default configuration of AtomixGlass with optimal parameters for a realistic glass effect. This component mimics the Apple-style liquid glass UI with chromatic aberration and displacement effects. Perfect for cards, modals, and premium UI elements.',
570
- },
571
- },
572
- },
573
- };
574
-
575
- /**
576
- * Mode Showcase - Demonstrates the visual differences between the various modes
577
- *
578
- * This story showcases all available modes of the AtomixGlass component with
579
- * optimized settings for each mode to highlight their unique characteristics.
580
- */
581
- /**
582
- * Modes Story
583
- *
584
- * This story demonstrates the different modes available in the AtomixGlass component.
585
- * Each mode provides a unique visual effect with different displacement patterns,
586
- * blur amounts, and aberration intensities. This showcase allows users to compare
587
- * the different modes side by side and understand their visual characteristics.
588
- *
589
- * Modes demonstrated:
590
- * - standard: Balanced displacement and aberration
591
- * - polar: Circular refraction pattern
592
- * - prominent: Enhanced displacement with stronger edge effects
593
- * - shader: Advanced shader-based displacement for maximum visual impact
594
- */
595
- export const Modes: Story = {
596
- parameters: {
597
- docs: {
598
- description: {
599
- story:
600
- 'Showcases the different modes available in the AtomixGlass component, highlighting their unique visual characteristics.',
601
- },
602
- },
603
- },
604
- render: () => {
605
- // eslint-disable-next-line react-hooks/rules-of-hooks
606
- const [activeMode, setActiveMode] = useState<string | null>(null);
607
- const modes = ['standard', 'polar', 'prominent', 'shader'] as const;
608
-
609
- // Different settings for each mode to highlight their unique characteristics
610
- const modeSettings = {
611
- standard: {
612
- displacementScale: 150,
613
- blurAmount: 0,
614
- shaderVariant: 'premiumGlass',
615
- saturation: 140,
616
- aberrationIntensity: 'default',
617
- description: 'Standard glass effect with balanced displacement and aberration',
618
- color: '#ffffff',
619
- },
620
- polar: {
621
- displacementScale: 120,
622
- blurAmount: 0,
623
- shaderVariant: 'premiumGlass',
624
- saturation: 140,
625
- aberrationIntensity: 'default',
626
- description: 'Polar displacement creates a circular refraction pattern',
627
- color: '#f0f8ff',
628
- },
629
- prominent: {
630
- shaderVariant: 'premiumGlass',
631
- displacementScale: 100,
632
- blurAmount: 0,
633
- saturation: 140,
634
- aberrationIntensity: 'default',
635
- description: 'Enhanced displacement with stronger edge effects',
636
- color: '#ffffff',
637
- },
638
- shader: {
639
- displacementScale: 190,
640
- shaderVariant: 'premiumGlass',
641
- blurAmount: 0,
642
- saturation: 140,
643
- aberrationIntensity: 'default',
644
- description: 'Advanced shader-based displacement for maximum visual impact',
645
- color: '#e6f7ff',
646
- },
647
- };
648
-
649
- // Handle mouse enter/leave for cards
650
- const handleMouseEnter = (mode: string) => {
651
- setActiveMode(mode);
652
- };
653
-
654
- const handleMouseLeave = () => {
655
- setActiveMode(null);
656
- };
657
-
658
- return (
659
- <BackgroundWrapper
660
- backgroundImage="https://plus.unsplash.com/premium_photo-1728613098996-af5b4ee51be8?q=80&w=3269&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
661
- >
662
- <div>
663
- <div
664
- style={{
665
- padding: '40px 20px',
666
- textAlign: 'center',
667
- marginBottom: '60px',
668
- }}
669
- >
670
- <AtomixGlass
671
- mode="standard"
672
- displacementScale={60}
673
- blurAmount={1}
674
- saturation={130}
675
- cornerRadius={24}
676
- elasticity={0.1}
677
- style={{ marginBottom: '24px', display: 'inline-block' }}
678
- >
679
- <div
680
- style={{
681
- padding: '12px 24px',
682
- display: 'inline-flex',
683
- alignItems: 'center',
684
- gap: '8px',
685
- fontSize: '13px',
686
- fontWeight: 700,
687
- letterSpacing: '1px',
688
- textTransform: 'uppercase',
689
- color: 'rgba(255, 255, 255, 0.9)',
690
- }}
691
- >
692
- <span>🎨</span>
693
- <span>Four Rendering Modes</span>
694
- </div>
695
- </AtomixGlass>
696
- <h1
697
- style={{
698
- margin: '0 0 20px 0',
699
- fontSize: '56px',
700
- fontWeight: 700,
701
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%)',
702
- WebkitBackgroundClip: 'text',
703
- WebkitTextFillColor: 'transparent',
704
- backgroundClip: 'text',
705
- letterSpacing: '-1.5px',
706
- textShadow: '0 4px 12px rgba(0,0,0,0.1)',
707
- }}
708
- >
709
- AtomixGlass Modes
710
- </h1>
711
- <p
712
- style={{
713
- fontSize: '18px',
714
- maxWidth: '680px',
715
- margin: '0 auto',
716
- color: 'rgba(255, 255, 255, 0.9)',
717
- lineHeight: 1.7,
718
- textShadow: '0 2px 4px rgba(0,0,0,0.2)',
719
- }}
720
- >
721
- Explore four distinct rendering modes, each optimized for different visual styles and
722
- performance requirements. Click or hover over each card to see the mode in action.
723
- </p>
724
- </div>
725
-
726
- <div
727
- style={{
728
- display: 'grid',
729
- gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
730
- gap: '28px',
731
- width: '100%',
732
- maxWidth: '1400px',
733
- }}
734
- >
735
- {modes.map(mode => {
736
- const settings = modeSettings[mode];
737
- const isActive = activeMode === mode;
738
- const modeIcons = {
739
- standard: '✨',
740
- polar: '🌀',
741
- prominent: '💫',
742
- shader: '🔮',
743
- };
744
-
745
- return (
746
- <div
747
- key={mode}
748
- onMouseEnter={() => handleMouseEnter(mode)}
749
- onMouseLeave={handleMouseLeave}
750
- style={{ cursor: 'pointer' }}
751
- >
752
- <AtomixGlass
753
- mode={mode}
754
- displacementScale={isActive ? settings.displacementScale * 1.2 : settings.displacementScale}
755
- blurAmount={settings.blurAmount}
756
- saturation={isActive ? settings.saturation + 20 : settings.saturation}
757
- shaderVariant={settings.shaderVariant as any}
758
- elasticity={0.2}
759
- cornerRadius={32}
760
- onClick={() => handleMouseEnter(mode)}
761
- overLight={false}
762
- style={{
763
- transition: 'all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)',
764
- transform: isActive ? 'scale(1.05) translateY(-8px)' : 'scale(1)',
765
- boxShadow: isActive
766
- ? '0 20px 60px rgba(0,0,0,0.4)'
767
- : '0 8px 24px rgba(0,0,0,0.2)',
768
- }}
769
- >
770
- <div
771
- style={{
772
- padding: '32px 28px',
773
- textAlign: 'center',
774
- minHeight: '320px',
775
- display: 'flex',
776
- flexDirection: 'column',
777
- justifyContent: 'space-between',
778
- }}
779
- >
780
- <div>
781
- <div
782
- style={{
783
- width: '72px',
784
- height: '72px',
785
- margin: '0 auto 20px',
786
- borderRadius: '20px',
787
- background: `linear-gradient(135deg, ${
788
- mode === 'standard'
789
- ? '#667eea, #764ba2'
790
- : mode === 'polar'
791
- ? '#f093fb, #f5576c'
792
- : mode === 'prominent'
793
- ? '#4facfe, #00f2fe'
794
- : '#fa709a, #fee140'
795
- })`,
796
- display: 'flex',
797
- alignItems: 'center',
798
- justifyContent: 'center',
799
- fontSize: '36px',
800
- boxShadow: `0 12px 32px ${
801
- mode === 'standard'
802
- ? 'rgba(102, 126, 234, 0.4)'
803
- : mode === 'polar'
804
- ? 'rgba(245, 87, 108, 0.4)'
805
- : mode === 'prominent'
806
- ? 'rgba(79, 172, 254, 0.4)'
807
- : 'rgba(250, 112, 154, 0.4)'
808
- }`,
809
- position: 'relative',
810
- transition: 'transform 0.3s ease',
811
- transform: isActive ? 'scale(1.1) rotate(5deg)' : 'scale(1) rotate(0deg)',
812
- }}
813
- >
814
- <div
815
- style={{
816
- position: 'absolute',
817
- inset: '-4px',
818
- borderRadius: '24px',
819
- background: `linear-gradient(135deg, ${
820
- mode === 'standard'
821
- ? '#667eea, #764ba2'
822
- : mode === 'polar'
823
- ? '#f093fb, #f5576c'
824
- : mode === 'prominent'
825
- ? '#4facfe, #00f2fe'
826
- : '#fa709a, #fee140'
827
- })`,
828
- opacity: 0.4,
829
- filter: 'blur(16px)',
830
- }}
831
- />
832
- <span style={{ position: 'relative', zIndex: 1 }}>
833
- {modeIcons[mode as keyof typeof modeIcons]}
834
- </span>
835
- </div>
836
- <h3
837
- style={{
838
- margin: '0 0 12px 0',
839
- fontSize: '24px',
840
- fontWeight: 700,
841
- color: '#fff',
842
- letterSpacing: '-0.5px',
843
- }}
844
- >
845
- {mode.charAt(0).toUpperCase() + mode.slice(1)}
846
- </h3>
847
- <p
848
- style={{
849
- margin: '0 0 20px 0',
850
- fontSize: '15px',
851
- lineHeight: 1.6,
852
- color: 'rgba(255, 255, 255, 0.85)',
853
- }}
854
- >
855
- {settings.description}
856
- </p>
857
- </div>
858
- <div
859
- style={{
860
- display: 'flex',
861
- justifyContent: 'center',
862
- alignItems: 'center',
863
- gap: '8px',
864
- flexWrap: 'wrap',
865
- paddingTop: '20px',
866
- borderTop: '1px solid rgba(255,255,255,0.1)',
867
- }}
868
- >
869
- <span
870
- style={{
871
- fontSize: '11px',
872
- padding: '6px 12px',
873
- borderRadius: '8px',
874
- backdropFilter: 'blur(8px)',
875
- background: 'rgba(255,255,255,0.15)',
876
- border: '1px solid rgba(255,255,255,0.2)',
877
- fontFamily: 'monospace',
878
- fontWeight: 600,
879
- }}
880
- >
881
- Disp: {settings.displacementScale}
882
- </span>
883
- <span
884
- style={{
885
- fontSize: '11px',
886
- padding: '6px 12px',
887
- borderRadius: '8px',
888
- background: 'rgba(255,255,255,0.15)',
889
- backdropFilter: 'blur(8px)',
890
- border: '1px solid rgba(255,255,255,0.2)',
891
- fontFamily: 'monospace',
892
- fontWeight: 600,
893
- }}
894
- >
895
- Blur: {settings.blurAmount}
896
- </span>
897
- <span
898
- style={{
899
- fontSize: '11px',
900
- padding: '6px 12px',
901
- borderRadius: '8px',
902
- backdropFilter: 'blur(8px)',
903
- background: 'rgba(255,255,255,0.15)',
904
- border: '1px solid rgba(255,255,255,0.2)',
905
- fontFamily: 'monospace',
906
- fontWeight: 600,
907
- }}
908
- >
909
- Aber: {settings.aberrationIntensity}
910
- </span>
911
- </div>
912
- </div>
913
- </AtomixGlass>
914
- </div>
915
- );
916
- })}
917
- </div>
918
- </div>
919
- </BackgroundWrapper>
920
- );
921
- },
922
- };
923
-
924
- /**
925
- * Performance Optimization Dashboard
926
- *
927
- * Demonstrates enterprise-grade performance optimization techniques with side-by-side
928
- * comparisons of different configuration strategies and their impact on rendering efficiency.
929
- */
930
- export const PerformanceOptimization: Story = {
931
- parameters: {
932
- docs: {
933
- description: {
934
- story:
935
- 'A comprehensive performance optimization guide showcasing three distinct configuration profiles: High Performance (mobile-optimized), Balanced (desktop standard), and Premium (high-end hardware). Each profile demonstrates the trade-offs between visual fidelity and rendering performance.',
936
- },
937
- },
938
- },
939
- render: () => (
940
- <BackgroundWrapper
941
- backgroundImage={
942
- 'https://images.unsplash.com/photo-1706705618478-505e088180c4?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2532'
943
- }
944
- padding="60px 20px"
945
- >
946
- <div style={{ margin: '0 auto', width: '100%' }}>
947
- {/* Header Section */}
948
- <div style={{ textAlign: 'center', marginBottom: '60px' }}>
949
- <Badge variant="primary" label="Performance Guide" glass={{className: 'u-inline-block', children:<></>}} />
950
- <h1
951
- style={{
952
- color: '#fff',
953
- fontSize: '3.5rem',
954
- fontWeight: '800',
955
- marginBottom: '20px',
956
- letterSpacing: '-0.02em',
957
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
958
- WebkitBackgroundClip: 'text',
959
- WebkitTextFillColor: 'transparent',
960
- backgroundClip: 'text',
961
- }}
962
- >
963
- Performance Optimization
964
- </h1>
965
- <p
966
- style={{
967
- color: 'rgba(255,255,255,0.9)',
968
- fontSize: '1.25rem',
969
- maxWidth: '720px',
970
- margin: '0 auto',
971
- lineHeight: '1.7',
972
- }}
973
- >
974
- Fine-tune AtomixGlass for optimal performance across different device capabilities and
975
- use cases
976
- </p>
977
- </div>
978
-
979
- {/* Performance Guidelines */}
980
- <AtomixGlass
981
- displacementScale={60}
982
- blurAmount={3}
983
- saturation={130}
984
- aberrationIntensity={1.2}
985
- elasticity={0}
986
- cornerRadius={16}
987
- mode="prominent"
988
- style={{ marginBottom: '48px' }}
989
- >
990
- <div style={{ padding: '32px' }}>
991
- <div style={{ display: 'flex', alignItems: 'center', gap: '12px', marginBottom: '24px' }}>
992
- <div
993
- style={{
994
- width: '48px',
995
- height: '48px',
996
- borderRadius: '14px',
997
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
998
- display: 'flex',
999
- alignItems: 'center',
1000
- justifyContent: 'center',
1001
- fontSize: '24px',
1002
- boxShadow: '0 8px 24px rgba(102, 126, 234, 0.4)',
1003
- }}
1004
- >
1005
- 💡
1006
- </div>
1007
- <h2
1008
- style={{
1009
- color: '#fff',
1010
- fontSize: '1.75rem',
1011
- fontWeight: '700',
1012
- margin: 0,
1013
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.9) 100%)',
1014
- WebkitBackgroundClip: 'text',
1015
- WebkitTextFillColor: 'transparent',
1016
- backgroundClip: 'text',
1017
- }}
1018
- >
1019
- Best Practices & Guidelines
1020
- </h2>
1021
- </div>
1022
- <div
1023
- style={{
1024
- display: 'grid',
1025
- gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
1026
- gap: '24px',
1027
- color: '#fff',
1028
- }}
1029
- >
1030
- <div>
1031
- <div
1032
- style={{
1033
- fontSize: '2rem',
1034
- marginBottom: '12px',
1035
- opacity: 0.9,
1036
- }}
1037
- >
1038
-
1039
- </div>
1040
- <h3 style={{ fontSize: '1.125rem', fontWeight: '600', marginBottom: '8px' }}>
1041
- Limit Instances
1042
- </h3>
1043
- <p style={{ fontSize: '0.9375rem', lineHeight: '1.6', opacity: 0.85, margin: 0 }}>
1044
- Use 3-5 glass components maximum per view to maintain optimal frame rates
1045
- </p>
1046
- </div>
1047
- <div>
1048
- <div
1049
- style={{
1050
- fontSize: '2rem',
1051
- marginBottom: '12px',
1052
- opacity: 0.9,
1053
- }}
1054
- >
1055
- 📱
1056
- </div>
1057
- <h3 style={{ fontSize: '1.125rem', fontWeight: '600', marginBottom: '8px' }}>
1058
- Mobile Optimization
1059
- </h3>
1060
- <p style={{ fontSize: '0.9375rem', lineHeight: '1.6', opacity: 0.85, margin: 0 }}>
1061
- Reduce complexity on mobile: lower displacement scale and disable hover effects
1062
- </p>
1063
- </div>
1064
- <div>
1065
- <div
1066
- style={{
1067
- fontSize: '2rem',
1068
- marginBottom: '12px',
1069
- opacity: 0.9,
1070
- }}
1071
- >
1072
- 🎯
1073
- </div>
1074
- <h3 style={{ fontSize: '1.125rem', fontWeight: '600', marginBottom: '8px' }}>
1075
- Strategic Placement
1076
- </h3>
1077
- <p style={{ fontSize: '0.9375rem', lineHeight: '1.6', opacity: 0.85, margin: 0 }}>
1078
- Apply glass effects to focal points only—cards, modals, and navigation elements
1079
- </p>
1080
- </div>
1081
- </div>
1082
- </div>
1083
- </AtomixGlass>
1084
-
1085
- {/* Configuration Comparison Grid */}
1086
- <div
1087
- style={{
1088
- display: 'grid',
1089
- gridTemplateColumns: 'repeat(auto-fit, minmax(350px, 1fr))',
1090
- gap: '32px',
1091
- }}
1092
- >
1093
- {/* High Performance Profile */}
1094
- <div>
1095
- <div
1096
- style={{
1097
- marginBottom: '16px',
1098
- display: 'flex',
1099
- alignItems: 'center',
1100
- gap: '12px',
1101
- }}
1102
- >
1103
- <div
1104
- style={{
1105
- width: '8px',
1106
- height: '8px',
1107
- borderRadius: '50%',
1108
- backgroundColor: '#34C759',
1109
- boxShadow: '0 0 12px rgba(52, 199, 89, 0.6)',
1110
- }}
1111
- />
1112
- <h3 style={{ color: '#fff', fontSize: '1.5rem', fontWeight: '600', margin: 0 }}>
1113
- High Performance
1114
- </h3>
1115
- </div>
1116
- <AtomixGlass
1117
- displacementScale={25}
1118
- blurAmount={0.2}
1119
- saturation={120}
1120
- aberrationIntensity={0.8}
1121
- elasticity={0.8}
1122
- cornerRadius={12}
1123
- mode="standard"
1124
- style={{ height: '100%', minHeight: '400px' }}
1125
- >
1126
- <div
1127
- style={{
1128
- padding: '28px',
1129
- height: '100%',
1130
- display: 'flex',
1131
- flexDirection: 'column',
1132
- }}
1133
- >
1134
- <div
1135
- style={{
1136
- display: 'inline-flex',
1137
- alignItems: 'center',
1138
- gap: '8px',
1139
- padding: '6px 12px',
1140
- borderRadius: '20px',
1141
- backgroundColor: 'rgba(52, 199, 89, 0.2)',
1142
- color: '#34C759',
1143
- fontSize: '0.875rem',
1144
- fontWeight: '600',
1145
- marginBottom: '20px',
1146
- alignSelf: 'flex-start',
1147
- }}
1148
- >
1149
- <span>🚀</span>
1150
- <span>OPTIMIZED</span>
1151
- </div>
1152
- <h4
1153
- style={{
1154
- marginTop: 0,
1155
- marginBottom: '16px',
1156
- fontSize: '1.25rem',
1157
- fontWeight: '600',
1158
- }}
1159
- >
1160
- Mobile-First Configuration
1161
- </h4>
1162
- <div style={{ flex: 1 }}>
1163
- <div style={{ marginBottom: '24px' }}>
1164
- <div
1165
- style={{
1166
- display: 'grid',
1167
- gridTemplateColumns: '1fr auto',
1168
- gap: '12px',
1169
- fontSize: '0.9375rem',
1170
- lineHeight: '1.8',
1171
- }}
1172
- >
1173
- <span style={{ opacity: 0.85 }}>Displacement Scale:</span>
1174
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>25</span>
1175
- <span style={{ opacity: 0.85 }}>Blur Amount:</span>
1176
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.2</span>
1177
- <span style={{ opacity: 0.85 }}>Saturation:</span>
1178
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>120%</span>
1179
- <span style={{ opacity: 0.85 }}>Aberration:</span>
1180
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.8</span>
1181
- <span style={{ opacity: 0.85 }}>Elasticity:</span>
1182
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.8</span>
1183
- </div>
1184
- </div>
1185
- <div
1186
- style={{
1187
- padding: '16px',
1188
- borderRadius: '8px',
1189
- backgroundColor: 'rgba(255, 255, 255, 0.08)',
1190
- fontSize: '0.875rem',
1191
- lineHeight: '1.6',
1192
- }}
1193
- >
1194
- <strong style={{ display: 'block', marginBottom: '8px' }}>Best For:</strong>
1195
- <ul style={{ margin: 0, paddingLeft: '20px', opacity: 0.85 }}>
1196
- <li>Mobile devices & tablets</li>
1197
- <li>Multiple glass instances</li>
1198
- <li>Battery-constrained devices</li>
1199
- <li>Background animations</li>
1200
- </ul>
1201
- </div>
1202
- </div>
1203
- </div>
1204
- </AtomixGlass>
1205
- </div>
1206
-
1207
- {/* Balanced Profile */}
1208
- <div>
1209
- <div
1210
- style={{
1211
- marginBottom: '16px',
1212
- display: 'flex',
1213
- alignItems: 'center',
1214
- gap: '12px',
1215
- }}
1216
- >
1217
- <div
1218
- style={{
1219
- width: '8px',
1220
- height: '8px',
1221
- borderRadius: '50%',
1222
- backgroundColor: '#FF9500',
1223
- boxShadow: '0 0 12px rgba(255, 149, 0, 0.6)',
1224
- }}
1225
- />
1226
- <h3 style={{ color: '#fff', fontSize: '1.5rem', fontWeight: '600', margin: 0 }}>
1227
- Balanced
1228
- </h3>
1229
- </div>
1230
- <AtomixGlass
1231
- displacementScale={55}
1232
- blurAmount={0.4}
1233
- saturation={150}
1234
- aberrationIntensity={1.8}
1235
- elasticity={0.15}
1236
- cornerRadius={12}
1237
- mode="standard"
1238
- style={{ height: '100%', minHeight: '400px' }}
1239
- >
1240
- <div
1241
- style={{
1242
- padding: '28px',
1243
- height: '100%',
1244
- display: 'flex',
1245
- flexDirection: 'column',
1246
- }}
1247
- >
1248
- <div
1249
- style={{
1250
- display: 'inline-flex',
1251
- alignItems: 'center',
1252
- gap: '8px',
1253
- padding: '6px 12px',
1254
- borderRadius: '20px',
1255
- backgroundColor: 'rgba(255, 149, 0, 0.2)',
1256
- color: '#FF9500',
1257
- fontSize: '0.875rem',
1258
- fontWeight: '600',
1259
- marginBottom: '20px',
1260
- alignSelf: 'flex-start',
1261
- }}
1262
- >
1263
- <span>⚖️</span>
1264
- <span>RECOMMENDED</span>
1265
- </div>
1266
- <h4
1267
- style={{
1268
- marginTop: 0,
1269
- marginBottom: '16px',
1270
- fontSize: '1.25rem',
1271
- fontWeight: '600',
1272
- }}
1273
- >
1274
- Production Standard
1275
- </h4>
1276
- <div style={{ flex: 1 }}>
1277
- <div style={{ marginBottom: '24px' }}>
1278
- <div
1279
- style={{
1280
- display: 'grid',
1281
- gridTemplateColumns: '1fr auto',
1282
- gap: '12px',
1283
- fontSize: '0.9375rem',
1284
- lineHeight: '1.8',
1285
- }}
1286
- >
1287
- <span style={{ opacity: 0.85 }}>Displacement Scale:</span>
1288
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>55</span>
1289
- <span style={{ opacity: 0.85 }}>Blur Amount:</span>
1290
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.4</span>
1291
- <span style={{ opacity: 0.85 }}>Saturation:</span>
1292
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>150%</span>
1293
- <span style={{ opacity: 0.85 }}>Aberration:</span>
1294
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>1.8</span>
1295
- <span style={{ opacity: 0.85 }}>Elasticity:</span>
1296
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.15</span>
1297
- </div>
1298
- </div>
1299
- <div
1300
- style={{
1301
- padding: '16px',
1302
- borderRadius: '8px',
1303
- backgroundColor: 'rgba(255, 255, 255, 0.08)',
1304
- fontSize: '0.875rem',
1305
- lineHeight: '1.6',
1306
- }}
1307
- >
1308
- <strong style={{ display: 'block', marginBottom: '8px' }}>Best For:</strong>
1309
- <ul style={{ margin: 0, paddingLeft: '20px', opacity: 0.85 }}>
1310
- <li>Desktop applications</li>
1311
- <li>Modern web browsers</li>
1312
- <li>Mid-range devices</li>
1313
- <li>General use cases</li>
1314
- </ul>
1315
- </div>
1316
- </div>
1317
- </div>
1318
- </AtomixGlass>
1319
- </div>
1320
-
1321
- {/* Premium Profile */}
1322
- <div>
1323
- <div
1324
- style={{
1325
- marginBottom: '16px',
1326
- display: 'flex',
1327
- alignItems: 'center',
1328
- gap: '12px',
1329
- }}
1330
- >
1331
- <div
1332
- style={{
1333
- width: '8px',
1334
- height: '8px',
1335
- borderRadius: '50%',
1336
- backgroundColor: '#AF52DE',
1337
- boxShadow: '0 0 12px rgba(175, 82, 222, 0.6)',
1338
- }}
1339
- />
1340
- <h3 style={{ color: '#fff', fontSize: '1.5rem', fontWeight: '600', margin: 0 }}>
1341
- Premium
1342
- </h3>
1343
- </div>
1344
- <AtomixGlass
1345
- displacementScale={85}
1346
- blurAmount={0.8}
1347
- saturation={180}
1348
- aberrationIntensity={3.2}
1349
- elasticity={0.22}
1350
- cornerRadius={12}
1351
- mode="standard"
1352
- style={{ height: '100%', minHeight: '400px' }}
1353
- >
1354
- <div
1355
- style={{
1356
- padding: '28px',
1357
- height: '100%',
1358
- display: 'flex',
1359
- flexDirection: 'column',
1360
- }}
1361
- >
1362
- <div
1363
- style={{
1364
- display: 'inline-flex',
1365
- alignItems: 'center',
1366
- gap: '8px',
1367
- padding: '6px 12px',
1368
- borderRadius: '20px',
1369
- backgroundColor: 'rgba(175, 82, 222, 0.2)',
1370
- color: '#AF52DE',
1371
- fontSize: '0.875rem',
1372
- fontWeight: '600',
1373
- marginBottom: '20px',
1374
- alignSelf: 'flex-start',
1375
- }}
1376
- >
1377
- <span>✨</span>
1378
- <span>PREMIUM</span>
1379
- </div>
1380
- <h4
1381
- style={{
1382
- marginTop: 0,
1383
- marginBottom: '16px',
1384
- fontSize: '1.25rem',
1385
- fontWeight: '600',
1386
- }}
1387
- >
1388
- High-Fidelity Visual
1389
- </h4>
1390
- <div style={{ flex: 1 }}>
1391
- <div style={{ marginBottom: '24px' }}>
1392
- <div
1393
- style={{
1394
- display: 'grid',
1395
- gridTemplateColumns: '1fr auto',
1396
- gap: '12px',
1397
- fontSize: '0.9375rem',
1398
- lineHeight: '1.8',
1399
- }}
1400
- >
1401
- <span style={{ opacity: 0.85 }}>Displacement Scale:</span>
1402
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>85</span>
1403
- <span style={{ opacity: 0.85 }}>Blur Amount:</span>
1404
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.8</span>
1405
- <span style={{ opacity: 0.85 }}>Saturation:</span>
1406
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>180%</span>
1407
- <span style={{ opacity: 0.85 }}>Aberration:</span>
1408
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>3.2</span>
1409
- <span style={{ opacity: 0.85 }}>Elasticity:</span>
1410
- <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.22</span>
1411
- </div>
1412
- </div>
1413
- <div
1414
- style={{
1415
- padding: '16px',
1416
- borderRadius: '8px',
1417
- backgroundColor: 'rgba(255, 255, 255, 0.08)',
1418
- fontSize: '0.875rem',
1419
- lineHeight: '1.6',
1420
- }}
1421
- >
1422
- <strong style={{ display: 'block', marginBottom: '8px' }}>Best For:</strong>
1423
- <ul style={{ margin: 0, paddingLeft: '20px', opacity: 0.85 }}>
1424
- <li>High-end hardware</li>
1425
- <li>Hero sections & CTAs</li>
1426
- <li>Premium experiences</li>
1427
- <li>Single focal elements</li>
1428
- </ul>
1429
- </div>
1430
- </div>
1431
- </div>
1432
- </AtomixGlass>
1433
- </div>
1434
- </div>
1435
- </div>
1436
- </BackgroundWrapper>
1437
- ),
1438
- };