From 9b963b40191a6521fc4c1df2567a41b90a81acbe Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Wed, 15 Oct 2025 12:57:05 -0700 Subject: [PATCH] feat: glass views --- apps/toolbox/src/pages/glass-effects.ts | 26 ++++++- apps/toolbox/src/pages/glass-effects.xml | 46 ++++++----- packages/core/ui/core/view/view-common.ts | 4 + .../liquid-glass-container/index.ios.ts | 54 ++++++++++--- .../core/ui/layouts/liquid-glass/index.ios.ts | 76 ++++++++++++++++--- 5 files changed, 158 insertions(+), 48 deletions(-) diff --git a/apps/toolbox/src/pages/glass-effects.ts b/apps/toolbox/src/pages/glass-effects.ts index a1ca9c0e6..d2d7075e8 100644 --- a/apps/toolbox/src/pages/glass-effects.ts +++ b/apps/toolbox/src/pages/glass-effects.ts @@ -10,7 +10,7 @@ export function navigatingTo(args: EventData) { export class GlassEffectModel extends Observable { iosGlassEffectInteractive: GlassEffectConfig = { interactive: true, - tint: '#faabab', + // tint: '#faabab', variant: 'clear', }; currentEffect: GlassEffectConfig = { @@ -71,5 +71,29 @@ export class GlassEffectModel extends Observable { this.glassTargetLabels['share'].animate({ opacity: this.glassMerged ? 1 : 0, duration: 300, curve: CoreTypes.AnimationCurve.easeInOut }).catch(() => {}); this.glassTargetLabels['like'].text = this.glassMerged ? 'Done' : 'Like'; + + // for testing, on tap, can see glass effect changes animating differences + this.testGlassBindingChanges(); + } + + testGlassBindingChanges() { + setTimeout(() => { + this.iosGlassEffectInteractive = { + interactive: false, + variant: 'regular', + // can even animate tint changes (requires starting of transparent tint) + // tint: '#faabab', + }; + this.notifyPropertyChange('iosGlassEffectInteractive', this.iosGlassEffectInteractive); + setTimeout(() => { + this.iosGlassEffectInteractive = { + interactive: true, + variant: 'clear', + // by setting tint to transparent, it will animate on next change + // tint: '#00000000', + }; + this.notifyPropertyChange('iosGlassEffectInteractive', this.iosGlassEffectInteractive); + }, 1500); + }, 1500); } } diff --git a/apps/toolbox/src/pages/glass-effects.xml b/apps/toolbox/src/pages/glass-effects.xml index 60f44ca96..303c29e74 100644 --- a/apps/toolbox/src/pages/glass-effects.xml +++ b/apps/toolbox/src/pages/glass-effects.xml @@ -7,22 +7,23 @@ - - + + - + -