@shohojdhara/atomix 0.2.3 → 0.2.5

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 (225) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1703 -1544
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/index.d.ts +1465 -963
  5. package/dist/index.esm.js +16289 -25908
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15650 -21780
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.js +1 -1
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/themes/applemix.css +15008 -0
  12. package/dist/themes/applemix.min.css +72 -0
  13. package/dist/themes/boomdevs.css +1608 -1450
  14. package/dist/themes/boomdevs.min.css +5 -5
  15. package/dist/themes/esrar.css +1702 -1543
  16. package/dist/themes/esrar.min.css +4 -4
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1699 -1540
  20. package/dist/themes/mashroom.min.css +7 -7
  21. package/dist/themes/shaj-default.css +1693 -1534
  22. package/dist/themes/shaj-default.min.css +4 -4
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +662 -21
  25. package/src/components/Accordion/Accordion.tsx +21 -14
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
  29. package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
  30. package/src/components/AtomixGlass/README.md +124 -2
  31. package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
  32. package/src/components/AtomixGlass/glass-utils.ts +263 -0
  33. package/src/components/AtomixGlass/shader-utils.ts +792 -68
  34. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
  40. package/src/components/AtomixGlass/utils.ts +3 -3
  41. package/src/components/Avatar/Avatar.tsx +3 -0
  42. package/src/components/Avatar/AvatarGroup.tsx +2 -1
  43. package/src/components/Badge/Badge.stories.tsx +76 -55
  44. package/src/components/Badge/Badge.tsx +12 -14
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.stories.tsx +501 -20
  47. package/src/components/Button/Button.tsx +5 -8
  48. package/src/components/Callout/Callout.stories.tsx +86 -35
  49. package/src/components/Callout/Callout.tsx +31 -9
  50. package/src/components/Card/Card.stories.tsx +565 -2
  51. package/src/components/Card/Card.tsx +15 -4
  52. package/src/components/Card/ElevationCard.tsx +2 -0
  53. package/src/components/Chart/AnimatedChart.tsx +179 -156
  54. package/src/components/Chart/AreaChart.tsx +123 -12
  55. package/src/components/Chart/BarChart.tsx +91 -100
  56. package/src/components/Chart/BaseChart.tsx +80 -0
  57. package/src/components/Chart/BubbleChart.tsx +114 -290
  58. package/src/components/Chart/CandlestickChart.tsx +282 -622
  59. package/src/components/Chart/Chart.stories.tsx +576 -179
  60. package/src/components/Chart/Chart.tsx +374 -75
  61. package/src/components/Chart/ChartRenderer.tsx +371 -220
  62. package/src/components/Chart/ChartToolbar.tsx +372 -61
  63. package/src/components/Chart/ChartTooltip.tsx +33 -18
  64. package/src/components/Chart/DonutChart.tsx +172 -254
  65. package/src/components/Chart/FunnelChart.tsx +169 -240
  66. package/src/components/Chart/GaugeChart.tsx +224 -392
  67. package/src/components/Chart/HeatmapChart.tsx +302 -440
  68. package/src/components/Chart/LineChart.tsx +148 -103
  69. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  70. package/src/components/Chart/PieChart.tsx +114 -64
  71. package/src/components/Chart/RadarChart.tsx +202 -218
  72. package/src/components/Chart/ScatterChart.tsx +111 -97
  73. package/src/components/Chart/TreemapChart.tsx +147 -222
  74. package/src/components/Chart/WaterfallChart.tsx +253 -291
  75. package/src/components/Chart/index.ts +11 -9
  76. package/src/components/Chart/types.ts +85 -9
  77. package/src/components/Chart/utils.ts +66 -0
  78. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  79. package/src/components/Countdown/Countdown.tsx +4 -0
  80. package/src/components/DataTable/DataTable.tsx +2 -1
  81. package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
  82. package/src/components/DatePicker/DatePicker.tsx +3 -9
  83. package/src/components/DatePicker/types.ts +5 -0
  84. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  85. package/src/components/Dropdown/Dropdown.tsx +26 -28
  86. package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
  87. package/src/components/EdgePanel/EdgePanel.tsx +101 -13
  88. package/src/components/Footer/Footer.stories.tsx +187 -60
  89. package/src/components/Footer/Footer.test.tsx +134 -0
  90. package/src/components/Footer/Footer.tsx +133 -34
  91. package/src/components/Footer/FooterLink.tsx +1 -1
  92. package/src/components/Footer/FooterSection.tsx +53 -36
  93. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  94. package/src/components/Footer/README.md +82 -3
  95. package/src/components/Footer/index.ts +1 -1
  96. package/src/components/Form/Checkbox.stories.tsx +13 -5
  97. package/src/components/Form/Checkbox.tsx +3 -6
  98. package/src/components/Form/Form.stories.tsx +10 -3
  99. package/src/components/Form/Form.tsx +2 -0
  100. package/src/components/Form/FormGroup.tsx +2 -1
  101. package/src/components/Form/Input.stories.tsx +12 -11
  102. package/src/components/Form/Input.tsx +97 -95
  103. package/src/components/Form/Radio.stories.tsx +22 -7
  104. package/src/components/Form/Radio.tsx +3 -6
  105. package/src/components/Form/Select.stories.tsx +21 -6
  106. package/src/components/Form/Select.tsx +3 -5
  107. package/src/components/Form/Textarea.stories.tsx +13 -11
  108. package/src/components/Form/Textarea.tsx +88 -86
  109. package/src/components/Hero/Hero.stories.tsx +2 -3
  110. package/src/components/Hero/Hero.tsx +5 -6
  111. package/src/components/Icon/Icon.tsx +12 -1
  112. package/src/components/List/List.tsx +2 -1
  113. package/src/components/List/ListGroup.tsx +2 -1
  114. package/src/components/Messages/Messages.stories.tsx +113 -0
  115. package/src/components/Messages/Messages.tsx +52 -9
  116. package/src/components/Modal/Modal.stories.tsx +48 -32
  117. package/src/components/Modal/Modal.tsx +19 -24
  118. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  119. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  120. package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
  121. package/src/components/Navigation/Nav/Nav.tsx +22 -4
  122. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  123. package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
  124. package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
  125. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
  126. package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
  127. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  128. package/src/components/Pagination/Pagination.tsx +7 -6
  129. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  130. package/src/components/Popover/Popover.stories.tsx +32 -24
  131. package/src/components/Popover/Popover.tsx +4 -1
  132. package/src/components/ProductReview/ProductReview.tsx +8 -2
  133. package/src/components/Progress/Progress.tsx +19 -3
  134. package/src/components/Rating/Rating.stories.tsx +11 -6
  135. package/src/components/Rating/Rating.tsx +3 -5
  136. package/src/components/River/River.tsx +5 -5
  137. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  138. package/src/components/Slider/Slider.stories.tsx +4 -4
  139. package/src/components/Slider/Slider.tsx +4 -3
  140. package/src/components/Spinner/Spinner.tsx +19 -3
  141. package/src/components/Steps/Steps.stories.tsx +5 -4
  142. package/src/components/Steps/Steps.tsx +8 -5
  143. package/src/components/Tab/Tab.stories.tsx +4 -3
  144. package/src/components/Tab/Tab.tsx +8 -6
  145. package/src/components/Testimonial/Testimonial.tsx +8 -2
  146. package/src/components/Todo/Todo.tsx +2 -1
  147. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  148. package/src/components/Toggle/Toggle.tsx +8 -5
  149. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  150. package/src/components/Tooltip/Tooltip.tsx +9 -2
  151. package/src/components/Upload/Upload.stories.tsx +252 -0
  152. package/src/components/Upload/Upload.tsx +92 -53
  153. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  154. package/src/components/index.ts +0 -4
  155. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  156. package/src/layouts/Grid/Grid.tsx +20 -1
  157. package/src/layouts/Grid/GridCol.tsx +76 -48
  158. package/src/lib/composables/useAtomixGlass.ts +861 -44
  159. package/src/lib/composables/useBarChart.ts +21 -4
  160. package/src/lib/composables/useChart.ts +227 -370
  161. package/src/lib/composables/useChartExport.ts +19 -78
  162. package/src/lib/composables/useChartToolbar.ts +11 -21
  163. package/src/lib/composables/useEdgePanel.ts +125 -71
  164. package/src/lib/composables/useFooter.ts +3 -3
  165. package/src/lib/composables/useGlassContainer.ts +16 -7
  166. package/src/lib/composables/useLineChart.ts +11 -2
  167. package/src/lib/composables/usePieChart.ts +4 -14
  168. package/src/lib/composables/useRiver.ts +5 -0
  169. package/src/lib/composables/useSlider.ts +62 -24
  170. package/src/lib/composables/useVideoPlayer.ts +60 -63
  171. package/src/lib/constants/components.ts +147 -32
  172. package/src/lib/types/components.ts +355 -25
  173. package/src/lib/utils/displacement-generator.ts +55 -49
  174. package/src/lib/utils/icons.ts +1 -1
  175. package/src/lib/utils/index.ts +16 -10
  176. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  177. package/src/styles/01-settings/_settings.animations.scss +5 -5
  178. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  179. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  180. package/src/styles/01-settings/_settings.background.scss +0 -3
  181. package/src/styles/01-settings/_settings.badge.scss +1 -1
  182. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  183. package/src/styles/01-settings/_settings.card.scss +1 -1
  184. package/src/styles/01-settings/_settings.chart.scss +65 -2
  185. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  186. package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
  187. package/src/styles/01-settings/_settings.footer.scss +35 -42
  188. package/src/styles/01-settings/_settings.input.scss +1 -1
  189. package/src/styles/01-settings/_settings.list.scss +1 -1
  190. package/src/styles/01-settings/_settings.rating.scss +1 -1
  191. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  192. package/src/styles/01-settings/_settings.upload.scss +6 -5
  193. package/src/styles/02-tools/_tools.animations.scss +4 -5
  194. package/src/styles/02-tools/_tools.background.scss +1 -13
  195. package/src/styles/02-tools/_tools.glass.scss +0 -1
  196. package/src/styles/02-tools/_tools.utility-api.scss +91 -48
  197. package/src/styles/03-generic/_generic.root.scss +1 -4
  198. package/src/styles/04-elements/_elements.body.scss +0 -1
  199. package/src/styles/06-components/_components.atomix-glass.scss +249 -0
  200. package/src/styles/06-components/_components.badge.scss +8 -23
  201. package/src/styles/06-components/_components.button.scss +8 -3
  202. package/src/styles/06-components/_components.callout.scss +10 -5
  203. package/src/styles/06-components/_components.card.scss +2 -14
  204. package/src/styles/06-components/_components.chart.scss +969 -1449
  205. package/src/styles/06-components/_components.dropdown.scss +19 -7
  206. package/src/styles/06-components/_components.edge-panel.scss +103 -0
  207. package/src/styles/06-components/_components.footer.scss +166 -85
  208. package/src/styles/06-components/_components.input.scss +8 -9
  209. package/src/styles/06-components/_components.list.scss +1 -0
  210. package/src/styles/06-components/_components.messages.scss +176 -0
  211. package/src/styles/06-components/_components.modal.scss +16 -4
  212. package/src/styles/06-components/_components.navbar.scss +12 -1
  213. package/src/styles/06-components/_components.side-menu.scss +5 -0
  214. package/src/styles/06-components/_components.skeleton.scss +8 -6
  215. package/src/styles/06-components/_components.upload.scss +219 -4
  216. package/src/styles/06-components/old.chart.styles.scss +1 -30
  217. package/src/styles/99-utilities/_index.scss +1 -0
  218. package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
  219. package/src/styles/99-utilities/_utilities.scss +1 -1
  220. package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
  221. package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
  222. package/src/components/Chart/AdvancedChart.tsx +0 -624
  223. package/src/components/Chart/LineChartNew.tsx +0 -167
  224. package/src/components/Chart/RealTimeChart.tsx +0 -436
  225. package/src/components/DatePicker/DatePicker copy.tsx +0 -551
@@ -0,0 +1,1250 @@
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 { useState, useEffect, useCallback, useMemo, useRef } from 'react';
16
+ import React from 'react';
17
+ import type { RefObject } from 'react';
18
+ import { BoxArrowDownIcon } from '@phosphor-icons/react';
19
+
20
+ /**
21
+ * Storybook meta configuration for AtomixGlass component
22
+ *
23
+ * This defines the component's metadata, documentation, and controls
24
+ * for the Storybook interface.
25
+ */
26
+ const meta: Meta<typeof AtomixGlass> = {
27
+ title: 'Components/AtomixGlass',
28
+ component: AtomixGlass,
29
+ parameters: {
30
+ layout: 'centered',
31
+ docs: {
32
+ description: {
33
+ component:
34
+ '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.',
35
+ },
36
+ },
37
+ },
38
+ tags: ['autodocs'],
39
+ argTypes: {
40
+ children: {
41
+ control: 'text',
42
+ description: 'Content to display inside the glass effect',
43
+ },
44
+ displacementScale: {
45
+ control: { type: 'range', min: 0, max: 100, step: 1 },
46
+ description: 'Displacement scale for the glass effect (default: 70)',
47
+ table: { defaultValue: { summary: '70' } },
48
+ },
49
+ blurAmount: {
50
+ control: { type: 'range', min: 0, max: 10, step: 0.5 },
51
+ description: 'Blur amount for the backdrop (default: 0.0625)',
52
+ table: { defaultValue: { summary: '0.0625' } },
53
+ },
54
+ saturation: {
55
+ control: { type: 'range', min: 100, max: 300, step: 5 },
56
+ description: 'Saturation percentage for the backdrop (default: 140)',
57
+ table: { defaultValue: { summary: '140' } },
58
+ },
59
+ aberrationIntensity: {
60
+ control: { type: 'range', min: 0, max: 10, step: 0.1 },
61
+ description: 'Chromatic aberration intensity (default: 2)',
62
+ table: { defaultValue: { summary: '2' } },
63
+ },
64
+ elasticity: {
65
+ control: { type: 'range', min: 0, max: 1, step: 0.01 },
66
+ description: 'Elasticity factor for mouse interactions (default: 0.15)',
67
+ table: { defaultValue: { summary: '0.15' } },
68
+ },
69
+ cornerRadius: {
70
+ control: { type: 'range', min: 0, max: 50, step: 1 },
71
+ description: 'Corner radius in pixels (default: 20)',
72
+ table: { defaultValue: { summary: '20' } },
73
+ },
74
+ globalMousePosition: {
75
+ control: 'object',
76
+ description: 'External global mouse position { x: number; y: number }',
77
+ },
78
+ mouseOffset: {
79
+ control: 'object',
80
+ description: 'External mouse offset { x: number; y: number }',
81
+ },
82
+ mouseContainer: {
83
+ control: false,
84
+ description: 'React ref object for mouse container element',
85
+ },
86
+ padding: {
87
+ control: 'text',
88
+ description: 'Padding for the glass container (default: "0 0")',
89
+ table: { defaultValue: { summary: '"0 0"' } },
90
+ },
91
+ overLight: {
92
+ control: {
93
+ type: 'select',
94
+ labels: {
95
+ false: 'false (Dark Background)',
96
+ true: 'true (Light Background)',
97
+ auto: 'auto (Auto-detect)',
98
+ object: 'object (Custom Config)',
99
+ },
100
+ },
101
+ options: [false, true, 'auto', 'object'],
102
+ description: `OverLight configuration mode. Can be:
103
+ - **boolean**: Explicit control (true/false)
104
+ - **'auto'**: Auto-detect background brightness
105
+ - **object**: Auto-detect with custom settings (threshold, opacity, contrast, brightness, saturationBoost)
106
+
107
+ See documentation for detailed examples of each mode.`,
108
+ table: {
109
+ defaultValue: { summary: '"auto"' },
110
+ type: { summary: 'boolean | "auto" | OverLightObjectConfig' },
111
+ },
112
+ mapping: {
113
+ false: false,
114
+ true: true,
115
+ auto: 'auto',
116
+ object: {
117
+ threshold: 0.75,
118
+ opacity: 0.6,
119
+ contrast: 1.8,
120
+ brightness: 1.0,
121
+ saturationBoost: 1.5,
122
+ },
123
+ },
124
+ },
125
+ mode: {
126
+ control: 'select',
127
+ options: ['standard', 'polar', 'prominent', 'shader'],
128
+ description: 'Glass effect mode (default: "standard")',
129
+ table: { defaultValue: { summary: '"standard"' } },
130
+ },
131
+ onClick: {
132
+ action: 'clicked',
133
+ description: 'Click event handler',
134
+ },
135
+ className: {
136
+ control: 'text',
137
+ description: 'Additional CSS class names',
138
+ },
139
+ style: {
140
+ control: 'object',
141
+ description: 'CSS style object',
142
+ },
143
+ 'aria-label': {
144
+ control: 'text',
145
+ description: 'ARIA label for accessibility',
146
+ },
147
+ 'aria-describedby': {
148
+ control: 'text',
149
+ description: 'ARIA describedby attribute for accessibility',
150
+ },
151
+ role: {
152
+ control: 'text',
153
+ description: 'ARIA role attribute',
154
+ },
155
+ tabIndex: {
156
+ control: 'number',
157
+ description: 'Tab index for keyboard navigation',
158
+ },
159
+ reducedMotion: {
160
+ control: 'boolean',
161
+ description: 'Override for reduced motion preference (default: false)',
162
+ table: { defaultValue: { summary: 'false' } },
163
+ },
164
+ highContrast: {
165
+ control: 'boolean',
166
+ description: 'Override for high contrast preference (default: false)',
167
+ table: { defaultValue: { summary: 'false' } },
168
+ },
169
+ disableEffects: {
170
+ control: 'boolean',
171
+ description: 'Disable all visual effects (default: false)',
172
+ table: { defaultValue: { summary: 'false' } },
173
+ },
174
+ enablePerformanceMonitoring: {
175
+ control: 'boolean',
176
+ description: 'Enable performance monitoring (default: false)',
177
+ table: { defaultValue: { summary: 'false' } },
178
+ },
179
+ debugOverLight: {
180
+ control: 'boolean',
181
+ description: 'Enable debug logging for overLight detection and configuration (default: false). Logs detailed information to console about auto-detection results and final config values.',
182
+ table: { defaultValue: { summary: 'false' } },
183
+ },
184
+ },
185
+ };
186
+
187
+ export default meta;
188
+ type Story = StoryObj<typeof AtomixGlass>;
189
+
190
+ /**
191
+ * Enhanced BackgroundWrapper Component
192
+ *
193
+ * A utility component used throughout the stories to provide consistent background
194
+ * styling and overlay effects. This wrapper creates a visually appealing container
195
+ * for showcasing the AtomixGlass component in various scenarios.
196
+ *
197
+ * @component BackgroundWrapper
198
+ */
199
+ interface BackgroundWrapperProps {
200
+ /** Child elements to render inside the wrapper */
201
+ children: React.ReactNode;
202
+ /** Background image URL or index from the backgroundImages array */
203
+ backgroundImage?: string;
204
+ /** Background index to use from the predefined array */
205
+ backgroundIndex?: number;
206
+ /** Optional overlay flag for quick overlay application */
207
+ overlay?: boolean;
208
+ /** Custom overlay color in CSS format */
209
+ overlayColor?: string;
210
+ /** Overlay opacity (0-1) */
211
+ overlayOpacity?: number;
212
+ /** Container height */
213
+ height?: string;
214
+ /** Container width */
215
+ width?: string;
216
+ /** Container border radius */
217
+ borderRadius?: string;
218
+ /** Container padding */
219
+ padding?: string;
220
+ /** Additional CSS class names */
221
+ className?: string;
222
+ /** Additional inline styles */
223
+ style?: React.CSSProperties;
224
+ /** Enable interactive background movement */
225
+ interactive?: boolean;
226
+ }
227
+
228
+ /**
229
+ * Interactive Story Container
230
+ *
231
+ * A container that provides mouse tracking and interactive background effects
232
+ * for enhanced storytelling and demonstration purposes.
233
+ */
234
+ interface StoryContainerProps {
235
+ children: React.ReactNode;
236
+ style?: React.CSSProperties;
237
+ interactive?: boolean;
238
+ }
239
+
240
+ /**
241
+ * Interactive Wrapper Component
242
+ *
243
+ * Provides mouse position tracking and offset calculations for interactive stories
244
+ */
245
+ interface InteractiveWrapperProps {
246
+ children: (
247
+ mousePos: { x: number; y: number },
248
+ mouseOffset: { x: number; y: number },
249
+ containerRef: RefObject<HTMLDivElement>
250
+ ) => React.ReactNode;
251
+ }
252
+
253
+ /**
254
+ * BackgroundWrapper Component Implementation
255
+ *
256
+ * Renders a container with a background image and optional overlay,
257
+ * providing a consistent environment for showcasing the AtomixGlass component.
258
+ *
259
+ * @param props - BackgroundWrapperProps
260
+ * @returns JSX.Element
261
+ */
262
+ const BackgroundWrapper = ({
263
+ children,
264
+ backgroundImage,
265
+ backgroundIndex,
266
+ height = '90vh',
267
+ width = '90vw',
268
+ borderRadius = '12px',
269
+ padding = '24px',
270
+ className = '',
271
+ style = {},
272
+ }: BackgroundWrapperProps) => {
273
+ // If backgroundIndex is provided, use it to select from the backgroundImages array
274
+ const bgImage =
275
+ backgroundIndex !== undefined ? backgroundImages[backgroundIndex] : backgroundImage;
276
+
277
+ // Apply default overlay settings if overlay flag is true using nullish coalescing
278
+
279
+ return (
280
+ <div
281
+ className={`c-atomix-glass-background ${className}`}
282
+ style={{
283
+ position: 'relative',
284
+ width: width,
285
+ minHeight: height,
286
+ height: '100%',
287
+ backgroundColor: !bgImage ? '#1a1a2e' : undefined, // Fallback color if no image
288
+ background: bgImage
289
+ ? `url(${bgImage})`
290
+ : undefined,
291
+ backgroundSize: 'cover',
292
+ backgroundPosition: 'center',
293
+ backgroundAttachment: 'fixed',
294
+ display: 'flex',
295
+ alignItems: 'center',
296
+ justifyContent: 'center',
297
+ borderRadius: borderRadius,
298
+ padding: padding,
299
+ ...style,
300
+ }}
301
+ >
302
+ <div
303
+ style={{
304
+ position: 'relative',
305
+ width: '100%',
306
+ height: '100%',
307
+ display: 'flex',
308
+ alignItems: 'center',
309
+ justifyContent: 'center',
310
+ color: 'white',
311
+ }}
312
+ >
313
+ {children}
314
+ </div>
315
+ </div>
316
+ );
317
+ };
318
+
319
+ /**
320
+ * Interactive Story Container Component
321
+ *
322
+ * A container that provides mouse tracking and interactive background effects
323
+ * for enhanced storytelling and demonstration purposes.
324
+ */
325
+ const StoryContainer = ({ children, style = {}, interactive = false }: StoryContainerProps) => {
326
+ const containerRef = useRef<HTMLDivElement>(null);
327
+ const [backgroundPosition, setBackgroundPosition] = useState({ x: 0, y: 0 });
328
+
329
+ const handleMouseMove = useCallback(
330
+ (e: MouseEvent) => {
331
+ if (containerRef.current && interactive) {
332
+ const rect = containerRef.current.getBoundingClientRect();
333
+ const centerX = rect.left + rect.width / 2;
334
+ const centerY = rect.top + rect.height / 2;
335
+
336
+ // Calculate offset as a percentage
337
+ const offsetX = ((e.clientX - centerX) / rect.width) * 100;
338
+ const offsetY = ((e.clientY - centerY) / rect.height) * 100;
339
+
340
+ setBackgroundPosition({ x: offsetX, y: offsetY });
341
+ }
342
+ },
343
+ [interactive]
344
+ );
345
+
346
+ useEffect(() => {
347
+ const currentRef = containerRef.current;
348
+ if (currentRef && interactive) {
349
+ currentRef.addEventListener('mousemove', handleMouseMove);
350
+ return () => {
351
+ currentRef.removeEventListener('mousemove', handleMouseMove);
352
+ };
353
+ }
354
+ }, [handleMouseMove, interactive]);
355
+
356
+ return (
357
+ <div
358
+ ref={containerRef}
359
+ style={{
360
+ width: '100vw',
361
+ height: '100vh',
362
+ display: 'flex',
363
+ alignItems: 'center',
364
+ justifyContent: 'center',
365
+ backgroundImage: interactive
366
+ ? '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)'
367
+ : undefined,
368
+ backgroundSize: interactive ? '160%' : 'cover',
369
+ backgroundPosition: interactive
370
+ ? `calc(50% + ${backgroundPosition.x}px) calc(50% + ${backgroundPosition.y}px)`
371
+ : 'center',
372
+ ...style,
373
+ }}
374
+ >
375
+ {children}
376
+ </div>
377
+ );
378
+ };
379
+
380
+ /**
381
+ * Interactive Wrapper Component
382
+ *
383
+ * Provides mouse position tracking and offset calculations for interactive stories
384
+ */
385
+ const InteractiveWrapper = ({ children }: InteractiveWrapperProps) => {
386
+ const containerRef = useRef<HTMLDivElement>(null);
387
+ const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
388
+ const [mouseOffset, setMouseOffset] = useState({ x: 0, y: 0 });
389
+
390
+ const handleMouseMove = useCallback((e: MouseEvent) => {
391
+ if (containerRef.current) {
392
+ const rect = containerRef.current.getBoundingClientRect();
393
+ const centerX = rect.left + rect.width / 2;
394
+ const centerY = rect.top + rect.height / 2;
395
+
396
+ setMouseOffset({
397
+ x: ((e.clientX - centerX) / rect.width) * 100,
398
+ y: ((e.clientY - centerY) / rect.height) * 100,
399
+ });
400
+ }
401
+ setMousePos({ x: e.clientX, y: e.clientY });
402
+ }, []);
403
+
404
+ useEffect(() => {
405
+ const currentRef = containerRef.current;
406
+ currentRef?.addEventListener('mousemove', handleMouseMove);
407
+ return () => {
408
+ currentRef?.removeEventListener('mousemove', handleMouseMove);
409
+ };
410
+ }, [handleMouseMove]);
411
+
412
+ return (
413
+ <div ref={containerRef} style={{ width: '100%', height: '100%' }}>
414
+ {children(mousePos, mouseOffset, containerRef)}
415
+ </div>
416
+ );
417
+ };
418
+
419
+ /**
420
+ * Collection of high-quality background images for different moods and scenarios
421
+ *
422
+ * This array provides a variety of background options that work well with the
423
+ * AtomixGlass component, showcasing different visual styles and contexts.
424
+ */
425
+ const backgroundImages = [
426
+ // 0: Modern office interior with natural lighting
427
+ 'https://images.unsplash.com/photo-1637825891028-564f672aa42c?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670',
428
+ // 1: Beautiful natural landscape - mountains and lake
429
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
430
+ // 2: Urban cityscape with modern buildings
431
+ 'https://images.unsplash.com/photo-1519681393784-d120267933ba?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670',
432
+ // 3: Forest path with sunlight filtering through trees
433
+ 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
434
+ // 4: Ocean waves and beach scene
435
+ 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
436
+ // 5: Modern architecture with glass facades
437
+ 'https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
438
+ // 6: Cozy café interior with warm lighting
439
+ 'https://images.unsplash.com/photo-1554118811-1e0d58224f24?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
440
+ // 7: Desert landscape with dramatic sky
441
+ 'https://images.unsplash.com/photo-1509316785289-025f5b846b35?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
442
+ // 8: Tropical paradise with palm trees and ocean
443
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
444
+ // 9: Modern library or workspace with natural light
445
+ 'https://images.unsplash.com/photo-1521587760476-6c12a4b040da?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
446
+ ];
447
+
448
+ /**
449
+ * Legacy backgrounds object for backward compatibility
450
+ * @deprecated Use backgroundImages array instead
451
+ */
452
+ const backgrounds = {
453
+ // Office and workspace environments
454
+ blueGradient: backgroundImages[0], // Modern office interior
455
+ purpleGradient: backgroundImages[1], // Mountain landscape
456
+ greenGradient: backgroundImages[3], // Forest path
457
+
458
+ // Apple-inspired natural scenes
459
+ macosWallpaper: backgroundImages[1], // Mountain landscape
460
+ iosWallpaper: backgroundImages[4], // Ocean waves
461
+
462
+ // Nature scenes
463
+ mountains: backgroundImages[1], // Mountain landscape
464
+ ocean: backgroundImages[4], // Ocean waves
465
+
466
+ // Urban environments
467
+ cityNight: backgroundImages[2], // Urban cityscape
468
+ cityDay: backgroundImages[5], // Modern architecture
469
+
470
+ // Interior spaces
471
+ abstract1: backgroundImages[6], // Cozy café interior
472
+ abstract2: backgroundImages[9], // Modern library
473
+
474
+ // Video backgrounds
475
+ videoBackground:
476
+ 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
477
+ };
478
+
479
+ /**
480
+ * Default showcase of the AtomixGlass component
481
+ *
482
+ * This story demonstrates the default configuration of the AtomixGlass component
483
+ * with carefully selected parameters to achieve an optimal glass effect. It serves
484
+ * as a reference implementation with balanced settings suitable for most use cases.
485
+ *
486
+ * Key features demonstrated:
487
+ * - Balanced displacement scale for subtle distortion
488
+ * - Moderate blur amount for the frosted glass effect
489
+ * - Enhanced saturation for visual appeal
490
+ * - Subtle chromatic aberration for depth
491
+ * - Interactive hover effects for engagement
492
+ */
493
+ export const Default: Story = {
494
+ args: {
495
+ children: (
496
+ <div style={{ padding: '30px', textAlign: 'center', maxWidth: '400px' }}>
497
+ <h2 style={{ margin: '0 0 16px 0', fontSize: '24px', fontWeight: 600 }}>AtomixGlass</h2>
498
+ <p style={{ margin: '0 0 20px 0', fontSize: '16px', lineHeight: 1.6 }}>
499
+ A premium glass morphism component with realistic light refraction, chromatic aberration,
500
+ and interactive effects.
501
+ </p>
502
+ <div style={{ display: 'flex', justifyContent: 'center', gap: '12px', flexWrap: 'wrap' }}>
503
+ <Button variant="primary" glass>
504
+ Explore
505
+ </Button>
506
+ <Button variant="outline-primary" glass>
507
+ Learn More
508
+ </Button>
509
+ </div>
510
+ </div>
511
+ ),
512
+ },
513
+ decorators: [
514
+ Story => (
515
+ <BackgroundWrapper backgroundImage={backgroundImages[0]}>
516
+ <Story />
517
+ </BackgroundWrapper>
518
+ ),
519
+ ],
520
+ parameters: {
521
+ docs: {
522
+ description: {
523
+ story:
524
+ '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.',
525
+ },
526
+ },
527
+ },
528
+ };
529
+
530
+ /**
531
+ * Mode Showcase - Demonstrates the visual differences between the various modes
532
+ *
533
+ * This story showcases all available modes of the AtomixGlass component with
534
+ * optimized settings for each mode to highlight their unique characteristics.
535
+ */
536
+ /**
537
+ * Modes Story
538
+ *
539
+ * This story demonstrates the different modes available in the AtomixGlass component.
540
+ * Each mode provides a unique visual effect with different displacement patterns,
541
+ * blur amounts, and aberration intensities. This showcase allows users to compare
542
+ * the different modes side by side and understand their visual characteristics.
543
+ *
544
+ * Modes demonstrated:
545
+ * - standard: Balanced displacement and aberration
546
+ * - polar: Circular refraction pattern
547
+ * - prominent: Enhanced displacement with stronger edge effects
548
+ * - shader: Advanced shader-based displacement for maximum visual impact
549
+ */
550
+ export const Modes: Story = {
551
+ parameters: {
552
+ docs: {
553
+ description: {
554
+ story:
555
+ 'Showcases the different modes available in the AtomixGlass component, highlighting their unique visual characteristics.',
556
+ },
557
+ },
558
+ },
559
+ render: () => {
560
+ // eslint-disable-next-line react-hooks/rules-of-hooks
561
+ const [activeMode, setActiveMode] = useState<string | null>(null);
562
+ const modes = ['standard', 'polar', 'prominent', 'shader'] as const;
563
+
564
+ // Different settings for each mode to highlight their unique characteristics
565
+ const modeSettings = {
566
+ standard: {
567
+ displacementScale: 150,
568
+ blurAmount: 0,
569
+ shaderVariant: 'premiumGlass',
570
+ saturation: 140,
571
+ aberrationIntensity: 'default',
572
+ description: 'Standard glass effect with balanced displacement and aberration',
573
+ color: '#ffffff',
574
+ },
575
+ polar: {
576
+ displacementScale: 120,
577
+ blurAmount: 0,
578
+ shaderVariant: 'premiumGlass',
579
+ saturation: 140,
580
+ aberrationIntensity: 'default',
581
+ description: 'Polar displacement creates a circular refraction pattern',
582
+ color: '#f0f8ff',
583
+ },
584
+ prominent: {
585
+ shaderVariant: 'premiumGlass',
586
+ displacementScale: 100,
587
+ blurAmount: 0,
588
+ saturation: 140,
589
+ aberrationIntensity: 'default',
590
+ description: 'Enhanced displacement with stronger edge effects',
591
+ color: '#ffffff',
592
+ },
593
+ shader: {
594
+ displacementScale: 190,
595
+ shaderVariant: 'premiumGlass',
596
+ blurAmount: 0,
597
+ saturation: 140,
598
+ aberrationIntensity: 'default',
599
+ description: 'Advanced shader-based displacement for maximum visual impact',
600
+ color: '#e6f7ff',
601
+ },
602
+ };
603
+
604
+ // Handle mouse enter/leave for cards
605
+ const handleMouseEnter = (mode: string) => {
606
+ setActiveMode(mode);
607
+ };
608
+
609
+ const handleMouseLeave = () => {
610
+ setActiveMode(null);
611
+ };
612
+
613
+ return (
614
+ <BackgroundWrapper
615
+ 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"
616
+ >
617
+ <div>
618
+ <div
619
+ style={{
620
+ padding: '20px 0',
621
+ textAlign: 'center',
622
+ marginBottom: '20px',
623
+ }}
624
+ >
625
+ <h2
626
+ style={{
627
+ margin: '0 0 10px 0',
628
+ fontSize: '32px',
629
+ fontWeight: 500,
630
+ color: '#ffffff',
631
+ textShadow: '0 2px 4px rgba(0,0,0,0.2)',
632
+ }}
633
+ >
634
+ AtomixGlass Modes
635
+ </h2>
636
+ <p
637
+ style={{
638
+ fontSize: '16px',
639
+ maxWidth: '500px',
640
+ margin: '0 auto',
641
+ color: '#ffffff',
642
+ textShadow: '0 1px 2px rgba(0,0,0,0.2)',
643
+ }}
644
+ >
645
+ Hover over each card to see how different modes affect the appearance and behavior of
646
+ the glass effect.
647
+ </p>
648
+ </div>
649
+
650
+ <div
651
+ style={{
652
+ display: 'flex',
653
+ flexWrap: 'wrap',
654
+ justifyContent: 'center',
655
+ alignContent: 'center',
656
+ gap: '24px',
657
+ width: '70vw',
658
+ }}
659
+ >
660
+ {modes.map(mode => {
661
+ const settings = modeSettings[mode];
662
+ const isActive = activeMode === mode;
663
+
664
+ return (
665
+ <AtomixGlass
666
+ key={mode}
667
+ mode={mode}
668
+ displacementScale={settings.displacementScale}
669
+ blurAmount={settings.blurAmount}
670
+ saturation={settings.saturation}
671
+ shaderVariant={settings.shaderVariant as any}
672
+ elasticity={0.2}
673
+ cornerRadius={40}
674
+ onClick={() => handleMouseEnter(mode)}
675
+ overLight={false}
676
+ >
677
+ <div
678
+ style={{
679
+ padding: '20px 40px',
680
+ textAlign: 'center',
681
+ maxWidth: '350px',
682
+ minHeight: '200px',
683
+ width: '100%',
684
+ textShadow: '1px 2px 6px rgba(0,0,0,0.7)',
685
+ }}
686
+ >
687
+ <h3
688
+ style={{
689
+ margin: '0 0 12px 0',
690
+ fontSize: '20px',
691
+ fontWeight: 500,
692
+ color: settings.color,
693
+ }}
694
+ >
695
+ {mode.charAt(0).toUpperCase() + mode.slice(1)} Mode
696
+ </h3>
697
+ <p
698
+ style={{
699
+ margin: '0 0 16px 0',
700
+ fontSize: '14px',
701
+ lineHeight: 1.5,
702
+ color: settings.color,
703
+ }}
704
+ >
705
+ {settings.description}
706
+ </p>
707
+ <div
708
+ style={{
709
+ display: 'flex',
710
+ justifyContent: 'center',
711
+ alignItems: 'center',
712
+ gap: '8px',
713
+ marginTop: '12px',
714
+ flexWrap: 'wrap',
715
+ }}
716
+ >
717
+ <span
718
+ style={{
719
+ fontSize: '12px',
720
+ padding: '4px 8px',
721
+ borderRadius: '4px',
722
+ backdropFilter: 'blur(2px)',
723
+ background: 'rgba(255,255,255,0.2)',
724
+ }}
725
+ >
726
+ Displacement: {settings.displacementScale}
727
+ </span>
728
+ <span
729
+ style={{
730
+ fontSize: '12px',
731
+ padding: '4px 8px',
732
+ borderRadius: '4px',
733
+ background: 'rgba(255,255,255,0.2)',
734
+ backdropFilter: 'blur(2px)',
735
+ }}
736
+ >
737
+ Blur: {settings.blurAmount}
738
+ </span>
739
+ <span
740
+ style={{
741
+ fontSize: '12px',
742
+ padding: '4px 8px',
743
+ borderRadius: '4px',
744
+ backdropFilter: 'blur(2px)',
745
+ background: 'rgba(255,255,255,0.2)',
746
+ }}
747
+ >
748
+ Aberration: {settings.aberrationIntensity}
749
+ </span>
750
+ </div>
751
+ </div>
752
+ </AtomixGlass>
753
+ );
754
+ })}
755
+ </div>
756
+ </div>
757
+ </BackgroundWrapper>
758
+ );
759
+ },
760
+ };
761
+
762
+ /**
763
+ * Performance Optimization Dashboard
764
+ *
765
+ * Demonstrates enterprise-grade performance optimization techniques with side-by-side
766
+ * comparisons of different configuration strategies and their impact on rendering efficiency.
767
+ */
768
+ export const PerformanceOptimization: Story = {
769
+ parameters: {
770
+ docs: {
771
+ description: {
772
+ story:
773
+ '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.',
774
+ },
775
+ },
776
+ },
777
+ render: () => (
778
+ <BackgroundWrapper
779
+ backgroundImage={
780
+ 'https://images.unsplash.com/photo-1706705618478-505e088180c4?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2532'
781
+ }
782
+ padding="60px 20px"
783
+ >
784
+ <div style={{ margin: '0 auto', width: '100%' }}>
785
+ {/* Header Section */}
786
+ <div style={{ textAlign: 'center', marginBottom: '60px' }}>
787
+ <h1
788
+ style={{
789
+ color: '#fff',
790
+ fontSize: '3rem',
791
+ fontWeight: '700',
792
+ marginBottom: '16px',
793
+ letterSpacing: '-0.02em',
794
+ }}
795
+ >
796
+ Performance Optimization
797
+ </h1>
798
+ <p
799
+ style={{
800
+ color: 'rgba(255,255,255,0.85)',
801
+ fontSize: '1.25rem',
802
+ maxWidth: '700px',
803
+ margin: '0 auto',
804
+ lineHeight: '1.6',
805
+ }}
806
+ >
807
+ Fine-tune AtomixGlass for optimal performance across different device capabilities
808
+ </p>
809
+ </div>
810
+
811
+ {/* Performance Guidelines */}
812
+ <AtomixGlass
813
+ displacementScale={60}
814
+ blurAmount={3}
815
+ saturation={130}
816
+ aberrationIntensity={1.2}
817
+ elasticity={0}
818
+ cornerRadius={16}
819
+ mode="prominent"
820
+ style={{ marginBottom: '48px' }}
821
+ >
822
+ <div style={{ padding: '32px' }}>
823
+ <h2
824
+ style={{
825
+ color: '#fff',
826
+ fontSize: '1.75rem',
827
+ fontWeight: '600',
828
+ marginBottom: '24px',
829
+ marginTop: 0,
830
+ }}
831
+ >
832
+ Best Practices & Guidelines
833
+ </h2>
834
+ <div
835
+ style={{
836
+ display: 'grid',
837
+ gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
838
+ gap: '24px',
839
+ color: '#fff',
840
+ }}
841
+ >
842
+ <div>
843
+ <div
844
+ style={{
845
+ fontSize: '2rem',
846
+ marginBottom: '12px',
847
+ opacity: 0.9,
848
+ }}
849
+ >
850
+
851
+ </div>
852
+ <h3 style={{ fontSize: '1.125rem', fontWeight: '600', marginBottom: '8px' }}>
853
+ Limit Instances
854
+ </h3>
855
+ <p style={{ fontSize: '0.9375rem', lineHeight: '1.6', opacity: 0.85, margin: 0 }}>
856
+ Use 3-5 glass components maximum per view to maintain optimal frame rates
857
+ </p>
858
+ </div>
859
+ <div>
860
+ <div
861
+ style={{
862
+ fontSize: '2rem',
863
+ marginBottom: '12px',
864
+ opacity: 0.9,
865
+ }}
866
+ >
867
+ 📱
868
+ </div>
869
+ <h3 style={{ fontSize: '1.125rem', fontWeight: '600', marginBottom: '8px' }}>
870
+ Mobile Optimization
871
+ </h3>
872
+ <p style={{ fontSize: '0.9375rem', lineHeight: '1.6', opacity: 0.85, margin: 0 }}>
873
+ Reduce complexity on mobile: lower displacement scale and disable hover effects
874
+ </p>
875
+ </div>
876
+ <div>
877
+ <div
878
+ style={{
879
+ fontSize: '2rem',
880
+ marginBottom: '12px',
881
+ opacity: 0.9,
882
+ }}
883
+ >
884
+ 🎯
885
+ </div>
886
+ <h3 style={{ fontSize: '1.125rem', fontWeight: '600', marginBottom: '8px' }}>
887
+ Strategic Placement
888
+ </h3>
889
+ <p style={{ fontSize: '0.9375rem', lineHeight: '1.6', opacity: 0.85, margin: 0 }}>
890
+ Apply glass effects to focal points only—cards, modals, and navigation elements
891
+ </p>
892
+ </div>
893
+ </div>
894
+ </div>
895
+ </AtomixGlass>
896
+
897
+ {/* Configuration Comparison Grid */}
898
+ <div
899
+ style={{
900
+ display: 'grid',
901
+ gridTemplateColumns: 'repeat(auto-fit, minmax(350px, 1fr))',
902
+ gap: '32px',
903
+ }}
904
+ >
905
+ {/* High Performance Profile */}
906
+ <div>
907
+ <div
908
+ style={{
909
+ marginBottom: '16px',
910
+ display: 'flex',
911
+ alignItems: 'center',
912
+ gap: '12px',
913
+ }}
914
+ >
915
+ <div
916
+ style={{
917
+ width: '8px',
918
+ height: '8px',
919
+ borderRadius: '50%',
920
+ backgroundColor: '#34C759',
921
+ boxShadow: '0 0 12px rgba(52, 199, 89, 0.6)',
922
+ }}
923
+ />
924
+ <h3 style={{ color: '#fff', fontSize: '1.5rem', fontWeight: '600', margin: 0 }}>
925
+ High Performance
926
+ </h3>
927
+ </div>
928
+ <AtomixGlass
929
+ displacementScale={25}
930
+ blurAmount={0.2}
931
+ saturation={120}
932
+ aberrationIntensity={0.8}
933
+ elasticity={0.8}
934
+ cornerRadius={12}
935
+ mode="standard"
936
+ style={{ height: '100%', minHeight: '400px' }}
937
+ >
938
+ <div
939
+ style={{
940
+ padding: '28px',
941
+ height: '100%',
942
+ display: 'flex',
943
+ flexDirection: 'column',
944
+ }}
945
+ >
946
+ <div
947
+ style={{
948
+ display: 'inline-flex',
949
+ alignItems: 'center',
950
+ gap: '8px',
951
+ padding: '6px 12px',
952
+ borderRadius: '20px',
953
+ backgroundColor: 'rgba(52, 199, 89, 0.2)',
954
+ color: '#34C759',
955
+ fontSize: '0.875rem',
956
+ fontWeight: '600',
957
+ marginBottom: '20px',
958
+ alignSelf: 'flex-start',
959
+ }}
960
+ >
961
+ <span>🚀</span>
962
+ <span>OPTIMIZED</span>
963
+ </div>
964
+ <h4
965
+ style={{
966
+ marginTop: 0,
967
+ marginBottom: '16px',
968
+ fontSize: '1.25rem',
969
+ fontWeight: '600',
970
+ }}
971
+ >
972
+ Mobile-First Configuration
973
+ </h4>
974
+ <div style={{ flex: 1 }}>
975
+ <div style={{ marginBottom: '24px' }}>
976
+ <div
977
+ style={{
978
+ display: 'grid',
979
+ gridTemplateColumns: '1fr auto',
980
+ gap: '12px',
981
+ fontSize: '0.9375rem',
982
+ lineHeight: '1.8',
983
+ }}
984
+ >
985
+ <span style={{ opacity: 0.85 }}>Displacement Scale:</span>
986
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>25</span>
987
+ <span style={{ opacity: 0.85 }}>Blur Amount:</span>
988
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.2</span>
989
+ <span style={{ opacity: 0.85 }}>Saturation:</span>
990
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>120%</span>
991
+ <span style={{ opacity: 0.85 }}>Aberration:</span>
992
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.8</span>
993
+ <span style={{ opacity: 0.85 }}>Elasticity:</span>
994
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.8</span>
995
+ </div>
996
+ </div>
997
+ <div
998
+ style={{
999
+ padding: '16px',
1000
+ borderRadius: '8px',
1001
+ backgroundColor: 'rgba(255, 255, 255, 0.08)',
1002
+ fontSize: '0.875rem',
1003
+ lineHeight: '1.6',
1004
+ }}
1005
+ >
1006
+ <strong style={{ display: 'block', marginBottom: '8px' }}>Best For:</strong>
1007
+ <ul style={{ margin: 0, paddingLeft: '20px', opacity: 0.85 }}>
1008
+ <li>Mobile devices & tablets</li>
1009
+ <li>Multiple glass instances</li>
1010
+ <li>Battery-constrained devices</li>
1011
+ <li>Background animations</li>
1012
+ </ul>
1013
+ </div>
1014
+ </div>
1015
+ </div>
1016
+ </AtomixGlass>
1017
+ </div>
1018
+
1019
+ {/* Balanced Profile */}
1020
+ <div>
1021
+ <div
1022
+ style={{
1023
+ marginBottom: '16px',
1024
+ display: 'flex',
1025
+ alignItems: 'center',
1026
+ gap: '12px',
1027
+ }}
1028
+ >
1029
+ <div
1030
+ style={{
1031
+ width: '8px',
1032
+ height: '8px',
1033
+ borderRadius: '50%',
1034
+ backgroundColor: '#FF9500',
1035
+ boxShadow: '0 0 12px rgba(255, 149, 0, 0.6)',
1036
+ }}
1037
+ />
1038
+ <h3 style={{ color: '#fff', fontSize: '1.5rem', fontWeight: '600', margin: 0 }}>
1039
+ Balanced
1040
+ </h3>
1041
+ </div>
1042
+ <AtomixGlass
1043
+ displacementScale={55}
1044
+ blurAmount={0.4}
1045
+ saturation={150}
1046
+ aberrationIntensity={1.8}
1047
+ elasticity={0.15}
1048
+ cornerRadius={12}
1049
+ mode="standard"
1050
+ style={{ height: '100%', minHeight: '400px' }}
1051
+ >
1052
+ <div
1053
+ style={{
1054
+ padding: '28px',
1055
+ height: '100%',
1056
+ display: 'flex',
1057
+ flexDirection: 'column',
1058
+ }}
1059
+ >
1060
+ <div
1061
+ style={{
1062
+ display: 'inline-flex',
1063
+ alignItems: 'center',
1064
+ gap: '8px',
1065
+ padding: '6px 12px',
1066
+ borderRadius: '20px',
1067
+ backgroundColor: 'rgba(255, 149, 0, 0.2)',
1068
+ color: '#FF9500',
1069
+ fontSize: '0.875rem',
1070
+ fontWeight: '600',
1071
+ marginBottom: '20px',
1072
+ alignSelf: 'flex-start',
1073
+ }}
1074
+ >
1075
+ <span>⚖️</span>
1076
+ <span>RECOMMENDED</span>
1077
+ </div>
1078
+ <h4
1079
+ style={{
1080
+ marginTop: 0,
1081
+ marginBottom: '16px',
1082
+ fontSize: '1.25rem',
1083
+ fontWeight: '600',
1084
+ }}
1085
+ >
1086
+ Production Standard
1087
+ </h4>
1088
+ <div style={{ flex: 1 }}>
1089
+ <div style={{ marginBottom: '24px' }}>
1090
+ <div
1091
+ style={{
1092
+ display: 'grid',
1093
+ gridTemplateColumns: '1fr auto',
1094
+ gap: '12px',
1095
+ fontSize: '0.9375rem',
1096
+ lineHeight: '1.8',
1097
+ }}
1098
+ >
1099
+ <span style={{ opacity: 0.85 }}>Displacement Scale:</span>
1100
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>55</span>
1101
+ <span style={{ opacity: 0.85 }}>Blur Amount:</span>
1102
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.4</span>
1103
+ <span style={{ opacity: 0.85 }}>Saturation:</span>
1104
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>150%</span>
1105
+ <span style={{ opacity: 0.85 }}>Aberration:</span>
1106
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>1.8</span>
1107
+ <span style={{ opacity: 0.85 }}>Elasticity:</span>
1108
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.15</span>
1109
+ </div>
1110
+ </div>
1111
+ <div
1112
+ style={{
1113
+ padding: '16px',
1114
+ borderRadius: '8px',
1115
+ backgroundColor: 'rgba(255, 255, 255, 0.08)',
1116
+ fontSize: '0.875rem',
1117
+ lineHeight: '1.6',
1118
+ }}
1119
+ >
1120
+ <strong style={{ display: 'block', marginBottom: '8px' }}>Best For:</strong>
1121
+ <ul style={{ margin: 0, paddingLeft: '20px', opacity: 0.85 }}>
1122
+ <li>Desktop applications</li>
1123
+ <li>Modern web browsers</li>
1124
+ <li>Mid-range devices</li>
1125
+ <li>General use cases</li>
1126
+ </ul>
1127
+ </div>
1128
+ </div>
1129
+ </div>
1130
+ </AtomixGlass>
1131
+ </div>
1132
+
1133
+ {/* Premium Profile */}
1134
+ <div>
1135
+ <div
1136
+ style={{
1137
+ marginBottom: '16px',
1138
+ display: 'flex',
1139
+ alignItems: 'center',
1140
+ gap: '12px',
1141
+ }}
1142
+ >
1143
+ <div
1144
+ style={{
1145
+ width: '8px',
1146
+ height: '8px',
1147
+ borderRadius: '50%',
1148
+ backgroundColor: '#AF52DE',
1149
+ boxShadow: '0 0 12px rgba(175, 82, 222, 0.6)',
1150
+ }}
1151
+ />
1152
+ <h3 style={{ color: '#fff', fontSize: '1.5rem', fontWeight: '600', margin: 0 }}>
1153
+ Premium
1154
+ </h3>
1155
+ </div>
1156
+ <AtomixGlass
1157
+ displacementScale={85}
1158
+ blurAmount={0.8}
1159
+ saturation={180}
1160
+ aberrationIntensity={3.2}
1161
+ elasticity={0.22}
1162
+ cornerRadius={12}
1163
+ mode="standard"
1164
+ style={{ height: '100%', minHeight: '400px' }}
1165
+ >
1166
+ <div
1167
+ style={{
1168
+ padding: '28px',
1169
+ height: '100%',
1170
+ display: 'flex',
1171
+ flexDirection: 'column',
1172
+ }}
1173
+ >
1174
+ <div
1175
+ style={{
1176
+ display: 'inline-flex',
1177
+ alignItems: 'center',
1178
+ gap: '8px',
1179
+ padding: '6px 12px',
1180
+ borderRadius: '20px',
1181
+ backgroundColor: 'rgba(175, 82, 222, 0.2)',
1182
+ color: '#AF52DE',
1183
+ fontSize: '0.875rem',
1184
+ fontWeight: '600',
1185
+ marginBottom: '20px',
1186
+ alignSelf: 'flex-start',
1187
+ }}
1188
+ >
1189
+ <span>✨</span>
1190
+ <span>PREMIUM</span>
1191
+ </div>
1192
+ <h4
1193
+ style={{
1194
+ marginTop: 0,
1195
+ marginBottom: '16px',
1196
+ fontSize: '1.25rem',
1197
+ fontWeight: '600',
1198
+ }}
1199
+ >
1200
+ High-Fidelity Visual
1201
+ </h4>
1202
+ <div style={{ flex: 1 }}>
1203
+ <div style={{ marginBottom: '24px' }}>
1204
+ <div
1205
+ style={{
1206
+ display: 'grid',
1207
+ gridTemplateColumns: '1fr auto',
1208
+ gap: '12px',
1209
+ fontSize: '0.9375rem',
1210
+ lineHeight: '1.8',
1211
+ }}
1212
+ >
1213
+ <span style={{ opacity: 0.85 }}>Displacement Scale:</span>
1214
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>85</span>
1215
+ <span style={{ opacity: 0.85 }}>Blur Amount:</span>
1216
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.8</span>
1217
+ <span style={{ opacity: 0.85 }}>Saturation:</span>
1218
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>180%</span>
1219
+ <span style={{ opacity: 0.85 }}>Aberration:</span>
1220
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>3.2</span>
1221
+ <span style={{ opacity: 0.85 }}>Elasticity:</span>
1222
+ <span style={{ fontWeight: '600', fontFamily: 'monospace' }}>0.22</span>
1223
+ </div>
1224
+ </div>
1225
+ <div
1226
+ style={{
1227
+ padding: '16px',
1228
+ borderRadius: '8px',
1229
+ backgroundColor: 'rgba(255, 255, 255, 0.08)',
1230
+ fontSize: '0.875rem',
1231
+ lineHeight: '1.6',
1232
+ }}
1233
+ >
1234
+ <strong style={{ display: 'block', marginBottom: '8px' }}>Best For:</strong>
1235
+ <ul style={{ margin: 0, paddingLeft: '20px', opacity: 0.85 }}>
1236
+ <li>High-end hardware</li>
1237
+ <li>Hero sections & CTAs</li>
1238
+ <li>Premium experiences</li>
1239
+ <li>Single focal elements</li>
1240
+ </ul>
1241
+ </div>
1242
+ </div>
1243
+ </div>
1244
+ </AtomixGlass>
1245
+ </div>
1246
+ </div>
1247
+ </div>
1248
+ </BackgroundWrapper>
1249
+ ),
1250
+ };