@shohojdhara/atomix 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomix.css +117 -38
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/atomix.umd.js +1 -1
- package/dist/atomix.umd.js.map +1 -1
- package/dist/atomix.umd.min.js +1 -1
- package/dist/charts.d.ts +30 -1
- package/dist/charts.js +625 -846
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +30 -1
- package/dist/core.js +659 -873
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +30 -1
- package/dist/forms.js +1171 -1402
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +31 -89
- package/dist/heavy.js +975 -1195
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +383 -140
- package/dist/index.esm.js +1567 -1679
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1556 -1667
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +2 -5
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +14 -16
- package/src/components/AtomixGlass/AtomixGlass.tsx +137 -364
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +32 -251
- package/src/components/AtomixGlass/GlassFilter.tsx +62 -68
- package/src/components/AtomixGlass/README.md +2 -1
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +19 -18
- package/src/components/AtomixGlass/glass-border-styles.test.ts +58 -0
- package/src/components/AtomixGlass/glass-border-styles.ts +136 -0
- package/src/components/AtomixGlass/glass-utils.ts +456 -22
- package/src/components/AtomixGlass/shader-utils.ts +19 -77
- package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +158 -537
- package/src/components/AtomixGlass/stories/Border.stories.tsx +149 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +229 -89
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +29 -340
- package/src/components/AtomixGlass/stories/argTypes.ts +30 -13
- package/src/components/AtomixGlass/stories/premium-presets.ts +206 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +52 -8
- package/src/components/Badge/Badge.tsx +4 -4
- package/src/components/Button/Button.tsx +2 -6
- package/src/components/Callout/Callout.test.tsx +4 -3
- package/src/components/Callout/Callout.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +3 -7
- package/src/components/Form/Checkbox.tsx +2 -8
- package/src/components/Form/Input.tsx +2 -9
- package/src/components/Form/Radio.tsx +2 -9
- package/src/components/Form/Select.test.tsx +6 -6
- package/src/components/Form/Select.tsx +2 -7
- package/src/components/Form/Textarea.stories.tsx +5 -5
- package/src/components/Form/Textarea.tsx +2 -9
- package/src/components/Messages/Messages.tsx +2 -8
- package/src/components/Modal/Modal.tsx +4 -5
- package/src/components/Navigation/Nav/Nav.tsx +2 -6
- package/src/components/Navigation/Navbar/Navbar.tsx +2 -9
- package/src/components/Navigation/SideMenu/SideMenu.tsx +2 -6
- package/src/components/Pagination/Pagination.tsx +2 -10
- package/src/components/Popover/Popover.tsx +2 -9
- package/src/components/Progress/Progress.tsx +2 -7
- package/src/components/Rating/Rating.tsx +2 -10
- package/src/components/Spinner/Spinner.tsx +2 -7
- package/src/components/Steps/Steps.tsx +2 -10
- package/src/components/Tabs/Tabs.tsx +2 -9
- package/src/components/Toggle/Toggle.tsx +2 -10
- package/src/components/Tooltip/Tooltip.tsx +2 -5
- package/src/lib/composables/useAtomixGlass.ts +42 -143
- package/src/lib/composables/useAtomixGlassStyles.ts +61 -77
- package/src/lib/composables/usePerformanceMonitor.ts +5 -66
- package/src/lib/constants/components.ts +363 -46
- package/src/lib/types/components.ts +33 -1
- package/src/styles/01-settings/_settings.atomix-glass.scss +66 -28
- package/src/styles/02-tools/_tools.button.scss +51 -42
- package/src/styles/02-tools/_tools.glass.scss +45 -3
- package/src/styles/06-components/_components.atomix-glass.scss +116 -79
- package/src/components/AtomixGlass/PerformanceDashboard.tsx +0 -171
- package/src/components/AtomixGlass/animation-system.ts +0 -578
- package/src/components/AtomixGlass/deprecated/AtomixGlass.deprecated.tsx +0 -390
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { ATOMIX_GLASS } from '../constants/components';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
buildGlassBorderCssVars,
|
|
4
|
+
computeBorderTensionFactor,
|
|
5
|
+
} from '../../components/AtomixGlass/glass-border-styles';
|
|
6
|
+
import {
|
|
4
7
|
calculateMouseInfluence,
|
|
8
|
+
getInteractionIntensity,
|
|
5
9
|
validateGlassSize,
|
|
6
10
|
clampBlur,
|
|
7
11
|
smoothstep,
|
|
8
12
|
softClamp,
|
|
9
13
|
} from '../../components/AtomixGlass/glass-utils';
|
|
10
|
-
import type { GlassSize, MousePosition
|
|
14
|
+
import type { GlassSize, MousePosition } from '../types/components';
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
* Updates the styles of the AtomixGlass wrapper and container elements imperatively
|
|
@@ -44,8 +48,10 @@ export const updateAtomixGlassStyles = (
|
|
|
44
48
|
withLiquidBlur?: boolean;
|
|
45
49
|
blurAmount?: number;
|
|
46
50
|
saturation?: number;
|
|
47
|
-
|
|
51
|
+
|
|
48
52
|
isFixedOrSticky?: boolean;
|
|
53
|
+
borderAnimated?: boolean;
|
|
54
|
+
borderOpacityMultiplier?: number;
|
|
49
55
|
}
|
|
50
56
|
) => {
|
|
51
57
|
if (!wrapperElement && !containerElement) return;
|
|
@@ -71,14 +77,15 @@ export const updateAtomixGlassStyles = (
|
|
|
71
77
|
withLiquidBlur,
|
|
72
78
|
blurAmount = ATOMIX_GLASS.DEFAULTS.BLUR_AMOUNT,
|
|
73
79
|
saturation = ATOMIX_GLASS.DEFAULTS.SATURATION,
|
|
74
|
-
|
|
80
|
+
|
|
75
81
|
isFixedOrSticky = false,
|
|
82
|
+
borderAnimated = true,
|
|
83
|
+
borderOpacityMultiplier = 1,
|
|
76
84
|
} = params;
|
|
77
85
|
|
|
78
86
|
// Calculate mouse influence
|
|
79
87
|
const mouseInfluence = calculateMouseInfluence(mouseOffset);
|
|
80
|
-
const hoverIntensity = isHovered
|
|
81
|
-
const activeIntensity = isActive ? 1.6 : 1;
|
|
88
|
+
const { hoverIntensity, activeIntensity } = getInteractionIntensity(isHovered, isActive);
|
|
82
89
|
|
|
83
90
|
// Calculate dynamic OverLight config
|
|
84
91
|
const overLightConfig = {
|
|
@@ -104,8 +111,7 @@ export const updateAtomixGlassStyles = (
|
|
|
104
111
|
: `translate(${elasticTranslation.x}px, ${elasticTranslation.y}px) scaleX(${scaleX}) scaleY(${scaleY})`;
|
|
105
112
|
|
|
106
113
|
// ── Apple Liquid Depth Refinements ───────────────────────────────
|
|
107
|
-
const
|
|
108
|
-
const tensionFactor = smoothstep(stretchMagnitude / 80);
|
|
114
|
+
const tensionFactor = computeBorderTensionFactor(elasticTranslation);
|
|
109
115
|
|
|
110
116
|
// Subtle lighting boost on stretch
|
|
111
117
|
const lightingContrast = Math.min(1.8, overLightConfig.contrast + tensionFactor * 0.2);
|
|
@@ -118,42 +124,6 @@ export const updateAtomixGlassStyles = (
|
|
|
118
124
|
const absMx = Math.abs(mx);
|
|
119
125
|
const absMy = Math.abs(my);
|
|
120
126
|
const GRADIENT = ATOMIX_GLASS.CONSTANTS.GRADIENT;
|
|
121
|
-
|
|
122
|
-
// ── Velocity-Based Rotation ─────────────────────────────────────
|
|
123
|
-
// Combine mouse offset with velocity for dynamic rotation
|
|
124
|
-
const velocityRotation =
|
|
125
|
-
(mouseVelocity.x + elasticVelocity.x) * (GRADIENT.VELOCITY_ANGLE_MULTIPLIER || 2.5);
|
|
126
|
-
const borderGradientAngle =
|
|
127
|
-
GRADIENT.BASE_ANGLE + mx * GRADIENT.ANGLE_MULTIPLIER + velocityRotation;
|
|
128
|
-
|
|
129
|
-
// Chromatic offsets for depth
|
|
130
|
-
const chromaticOffset = GRADIENT.CHROMATIC_OFFSET || 1.5;
|
|
131
|
-
const angleR = borderGradientAngle - chromaticOffset;
|
|
132
|
-
const angleB = borderGradientAngle + chromaticOffset;
|
|
133
|
-
|
|
134
|
-
const borderStop1 = Math.max(
|
|
135
|
-
GRADIENT.BORDER_STOP_1.MIN,
|
|
136
|
-
GRADIENT.BORDER_STOP_1.BASE + my * GRADIENT.BORDER_STOP_1.MULTIPLIER
|
|
137
|
-
);
|
|
138
|
-
const borderStop2 = Math.min(
|
|
139
|
-
GRADIENT.BORDER_STOP_2.MAX,
|
|
140
|
-
GRADIENT.BORDER_STOP_2.BASE + my * GRADIENT.BORDER_STOP_2.MULTIPLIER
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
// Modulate border opacity by tension (glow on stretch)
|
|
144
|
-
const tensionGlow = 1 + tensionFactor * 0.5;
|
|
145
|
-
const borderOpacities = [
|
|
146
|
-
(GRADIENT.BORDER_OPACITY.BASE_1 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_LOW) *
|
|
147
|
-
tensionGlow,
|
|
148
|
-
(GRADIENT.BORDER_OPACITY.BASE_2 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_HIGH) *
|
|
149
|
-
tensionGlow,
|
|
150
|
-
(GRADIENT.BORDER_OPACITY.BASE_3 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_LOW) *
|
|
151
|
-
tensionGlow,
|
|
152
|
-
(GRADIENT.BORDER_OPACITY.BASE_4 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_HIGH) *
|
|
153
|
-
tensionGlow,
|
|
154
|
-
];
|
|
155
|
-
|
|
156
|
-
const configBorderOpacity = overLightConfig.borderOpacity;
|
|
157
127
|
const whiteColor = ATOMIX_GLASS.CONSTANTS.PALETTE.WHITE;
|
|
158
128
|
const blackColor = ATOMIX_GLASS.CONSTANTS.PALETTE.BLACK;
|
|
159
129
|
|
|
@@ -177,12 +147,19 @@ export const updateAtomixGlassStyles = (
|
|
|
177
147
|
y: GRADIENT.CENTER_POSITION + my * GRADIENT.BASE_LAYER_MULTIPLIER,
|
|
178
148
|
};
|
|
179
149
|
|
|
150
|
+
// Opacity is either 0 (hidden) or 1 (visible) — actual visual intensity is
|
|
151
|
+
// encoded in each gradient's rgba alpha. The typed @property CSS vars
|
|
152
|
+
// transition these 0→1 values smoothly via CSS (no JS animation needed).
|
|
180
153
|
const opacityValues = {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
154
|
+
// hover-1: ambient highlight glow — present on hover and during press
|
|
155
|
+
hover1: isHovered || isActive ? 1 : 0,
|
|
156
|
+
// hover-2: press depth shadow — only fires on active (mousedown)
|
|
157
|
+
hover2: isActive ? 1 : 0,
|
|
158
|
+
// hover-3: global soft-light surface shift — half-strength on hover, full on press
|
|
159
|
+
hover3: isActive ? 1 : isHovered ? 0.55 : 0,
|
|
160
|
+
// Dark chrome: faint smoky tint; over-light keeps stronger fill
|
|
161
|
+
base: isOverLight ? overLightConfig.opacity : 0.14,
|
|
162
|
+
over: isOverLight ? overLightConfig.opacity * 1.1 : 0.1,
|
|
186
163
|
};
|
|
187
164
|
|
|
188
165
|
const style = wrapperElement.style;
|
|
@@ -199,51 +176,56 @@ export const updateAtomixGlassStyles = (
|
|
|
199
176
|
style.setProperty('--atomix-glass-brightness', lightingBrightness.toString());
|
|
200
177
|
|
|
201
178
|
// ── Chromatic Rim Lighting ──────────────────────────────────────
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
179
|
+
const borderVars = ATOMIX_GLASS.BORDER.GRADIENT_CSS_VARS;
|
|
180
|
+
if (borderAnimated && !effectiveWithoutEffects) {
|
|
181
|
+
const borderCssVars = buildGlassBorderCssVars({
|
|
182
|
+
mouseOffset,
|
|
183
|
+
mouseVelocity,
|
|
184
|
+
elasticVelocity,
|
|
185
|
+
borderOpacity: overLightConfig.borderOpacity,
|
|
186
|
+
opacityMultiplier: borderOpacityMultiplier,
|
|
187
|
+
tensionFactor,
|
|
188
|
+
});
|
|
189
|
+
style.setProperty(borderVars.GRADIENT_1, borderCssVars[borderVars.GRADIENT_1] ?? '');
|
|
190
|
+
style.setProperty(borderVars.GRADIENT_2, borderCssVars[borderVars.GRADIENT_2] ?? '');
|
|
191
|
+
} else {
|
|
192
|
+
style.removeProperty(borderVars.GRADIENT_1);
|
|
193
|
+
style.removeProperty(borderVars.GRADIENT_2);
|
|
194
|
+
}
|
|
212
195
|
|
|
213
|
-
// Hover gradients
|
|
196
|
+
// Hover gradients — cursor-relative radial positions for realistic light tracking.
|
|
197
|
+
// hover-1: white overlay highlight following cursor (works on both dark + light)
|
|
214
198
|
style.setProperty(
|
|
215
199
|
'--atomix-glass-hover-1-gradient',
|
|
216
|
-
|
|
217
|
-
? `radial-gradient(circle at ${hoverPositions.hover1.x}% ${hoverPositions.hover1.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_START}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_STOP}%, rgba(${blackColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_END}%)`
|
|
218
|
-
: `radial-gradient(circle at ${hoverPositions.hover1.x}% ${hoverPositions.hover1.y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.WHITE_STOP}%)`
|
|
200
|
+
`radial-gradient(65% 55% at ${hoverPositions.hover1.x}% ${hoverPositions.hover1.y}%, rgba(${whiteColor}, 0.24) 0%, rgba(${whiteColor}, 0.06) 45%, rgba(${whiteColor}, 0) 72%)`
|
|
219
201
|
);
|
|
220
202
|
|
|
203
|
+
// hover-2: press depth — darkens at cursor with multiply blend, isOverLight uses stronger black
|
|
221
204
|
style.setProperty(
|
|
222
205
|
'--atomix-glass-hover-2-gradient',
|
|
223
206
|
isOverLight
|
|
224
|
-
? `radial-gradient(
|
|
225
|
-
: `radial-gradient(
|
|
207
|
+
? `radial-gradient(60% 50% at ${hoverPositions.hover2.x}% ${hoverPositions.hover2.y}%, rgba(${blackColor}, 0.22) 0%, rgba(${blackColor}, 0.06) 50%, rgba(${blackColor}, 0) 72%)`
|
|
208
|
+
: `radial-gradient(60% 50% at ${hoverPositions.hover2.x}% ${hoverPositions.hover2.y}%, rgba(${blackColor}, 0.18) 0%, rgba(${blackColor}, 0.04) 50%, rgba(${blackColor}, 0) 72%)`
|
|
226
209
|
);
|
|
227
210
|
|
|
211
|
+
// hover-3: full-surface soft-light tint; linear gradient angled with cursor X
|
|
228
212
|
style.setProperty(
|
|
229
213
|
'--atomix-glass-hover-3-gradient',
|
|
230
|
-
isOverLight
|
|
231
|
-
? `radial-gradient(circle at ${hoverPositions.hover3.x}% ${hoverPositions.hover3.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_START}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_STOP}%, rgba(${blackColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_END}%)`
|
|
232
|
-
: `radial-gradient(circle at ${hoverPositions.hover3.x}% ${hoverPositions.hover3.y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.WHITE_STOP}%)`
|
|
214
|
+
`linear-gradient(${150 + mx * 0.3}deg, rgba(${whiteColor}, ${isOverLight ? 0.08 : 0.12}) 0%, rgba(${whiteColor}, 0.04) 55%, rgba(${whiteColor}, 0) 100%)`
|
|
233
215
|
);
|
|
234
216
|
|
|
235
217
|
style.setProperty(
|
|
236
218
|
'--atomix-glass-base-gradient',
|
|
237
219
|
isOverLight
|
|
238
220
|
? `linear-gradient(${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.ANGLE}deg, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_BASE + mx * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_BASE + my * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_MULTIPLIER}) ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_STOP}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_END_BASE + absMx * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_END_MULTIPLIER}) 100%)`
|
|
239
|
-
: `rgba(${
|
|
221
|
+
: `linear-gradient(180deg, rgba(${blackColor}, 0.42) 0%, rgba(${blackColor}, 0.22) 55%, rgba(${blackColor}, 0.12) 100%)`
|
|
240
222
|
);
|
|
241
223
|
|
|
242
224
|
style.setProperty(
|
|
243
225
|
'--atomix-glass-overlay-gradient',
|
|
244
226
|
isOverLight
|
|
245
227
|
? `radial-gradient(circle at ${basePosition.x}% ${basePosition.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_BASE + absMx * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID_STOP}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_END_BASE + absMy * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_END_MULTIPLIER}) 100%)`
|
|
246
|
-
: `rgba(${whiteColor}, ${
|
|
228
|
+
: `radial-gradient(120% 80% at 50% 0%, rgba(${whiteColor}, 0.14) 0%, rgba(${whiteColor}, 0) 55%)`
|
|
247
229
|
);
|
|
248
230
|
|
|
249
231
|
// Opacities
|
|
@@ -339,7 +321,7 @@ export const updateAtomixGlassStyles = (
|
|
|
339
321
|
// Container variables
|
|
340
322
|
const style = containerElement.style;
|
|
341
323
|
|
|
342
|
-
|
|
324
|
+
|
|
343
325
|
style.setProperty('--atomix-glass-container-radius', `${effectiveBorderRadius}px`);
|
|
344
326
|
|
|
345
327
|
style.setProperty('--atomix-glass-container-backdrop', backdropFilterString);
|
|
@@ -349,12 +331,12 @@ export const updateAtomixGlassStyles = (
|
|
|
349
331
|
'--atomix-glass-container-shadow',
|
|
350
332
|
isOverLight
|
|
351
333
|
? [
|
|
352
|
-
`inset 0 1px 0 rgba(255, 255, 255, ${(0.
|
|
353
|
-
`inset 0 -1px 0 rgba(0, 0, 0, ${(0.
|
|
354
|
-
`inset 0 0 20px rgba(0, 0, 0, ${(0.
|
|
355
|
-
`0 2px 12px rgba(0, 0, 0, ${(0.
|
|
334
|
+
`inset 0 1px 0 rgba(255, 255, 255, ${(0.35 + mx * 0.002) * (overLightConfig.shadowIntensity || 1)})`,
|
|
335
|
+
`inset 0 -1px 0 rgba(0, 0, 0, ${(0.15 + Math.abs(my) * 0.001) * (overLightConfig.shadowIntensity || 1)})`,
|
|
336
|
+
`inset 0 0 20px rgba(0, 0, 0, ${(0.06 + Math.abs(mx + my) * 0.001) * (overLightConfig.shadowIntensity || 1)})`,
|
|
337
|
+
`0 2px 12px rgba(0, 0, 0, ${(0.08 + Math.abs(my) * 0.002) * (overLightConfig.shadowIntensity || 1)})`,
|
|
356
338
|
].join(', ')
|
|
357
|
-
:
|
|
339
|
+
: ATOMIX_GLASS.CONSTANTS.CONTAINER_SHADOW.LIGHT
|
|
358
340
|
);
|
|
359
341
|
|
|
360
342
|
style.setProperty(
|
|
@@ -376,7 +358,9 @@ export const updateAtomixGlassStyles = (
|
|
|
376
358
|
|
|
377
359
|
style.setProperty(
|
|
378
360
|
'--atomix-glass-container-box-shadow',
|
|
379
|
-
isOverLight
|
|
361
|
+
isOverLight
|
|
362
|
+
? '0px 16px 70px rgba(0, 0, 0, 0.75)'
|
|
363
|
+
: '0 4px 16px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.10)'
|
|
380
364
|
);
|
|
381
365
|
}
|
|
382
366
|
};
|
|
@@ -181,6 +181,11 @@ export function usePerformanceMonitor(
|
|
|
181
181
|
const [manualOverride, setManualOverride] = useState(false);
|
|
182
182
|
const [isEnabled, setIsEnabled] = useState(enabled);
|
|
183
183
|
|
|
184
|
+
// Sync external `enabled` prop changes into internal state
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
setIsEnabled(enabled ?? true);
|
|
187
|
+
}, [enabled]);
|
|
188
|
+
|
|
184
189
|
// Refs for frame tracking
|
|
185
190
|
const frameCountRef = useRef(0);
|
|
186
191
|
const lastFpsUpdateRef = useRef(0);
|
|
@@ -380,69 +385,3 @@ export function usePerformanceMonitor(
|
|
|
380
385
|
toggleMonitoring,
|
|
381
386
|
};
|
|
382
387
|
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Debug Overlay Component (Optional)
|
|
386
|
-
*
|
|
387
|
-
* Shows real-time performance metrics on screen.
|
|
388
|
-
* Only rendered when showOverlay is enabled.
|
|
389
|
-
*/
|
|
390
|
-
export function PerformanceOverlay({ metrics }: { metrics: PerformanceMetrics }) {
|
|
391
|
-
if (typeof window === 'undefined') return null;
|
|
392
|
-
|
|
393
|
-
const overlayStyle: React.CSSProperties = {
|
|
394
|
-
position: 'fixed',
|
|
395
|
-
top: '10px',
|
|
396
|
-
right: '10px',
|
|
397
|
-
padding: '10px',
|
|
398
|
-
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
|
399
|
-
color: '#fff',
|
|
400
|
-
fontFamily: 'monospace',
|
|
401
|
-
fontSize: '12px',
|
|
402
|
-
borderRadius: '4px',
|
|
403
|
-
zIndex: 9999,
|
|
404
|
-
pointerEvents: 'none',
|
|
405
|
-
minWidth: '150px',
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
const getFpsColor = (fps: number) => {
|
|
409
|
-
if (fps >= 58) return '#4ade80'; // Green
|
|
410
|
-
if (fps >= 45) return '#fbbf24'; // Yellow
|
|
411
|
-
return '#ef4444'; // Red
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
// Performance overlay removed - will be implemented as separate component
|
|
415
|
-
return null;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Utility to get quality multipliers for glass parameters
|
|
420
|
-
*/
|
|
421
|
-
export function getQualityMultipliers(quality: 'low' | 'medium' | 'high') {
|
|
422
|
-
switch (quality) {
|
|
423
|
-
case 'low':
|
|
424
|
-
return {
|
|
425
|
-
distortionOctaves: 2,
|
|
426
|
-
displacementScale: 0.6,
|
|
427
|
-
blurAmount: 0.7,
|
|
428
|
-
animationSpeed: 0.8,
|
|
429
|
-
chromaticIntensity: 0.5,
|
|
430
|
-
};
|
|
431
|
-
case 'medium':
|
|
432
|
-
return {
|
|
433
|
-
distortionOctaves: 4,
|
|
434
|
-
displacementScale: 0.85,
|
|
435
|
-
blurAmount: 0.9,
|
|
436
|
-
animationSpeed: 0.95,
|
|
437
|
-
chromaticIntensity: 0.75,
|
|
438
|
-
};
|
|
439
|
-
case 'high':
|
|
440
|
-
return {
|
|
441
|
-
distortionOctaves: 5,
|
|
442
|
-
displacementScale: 1.0,
|
|
443
|
-
blurAmount: 1.0,
|
|
444
|
-
animationSpeed: 1.0,
|
|
445
|
-
chromaticIntensity: 1.0,
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
}
|