|
|
@ -17,6 +17,9 @@ public final class HUDOverlayController { |
|
|
private var orbView: SiriOrbView? |
|
|
private var orbView: SiriOrbView? |
|
|
private var isVisible = false |
|
|
private var isVisible = false |
|
|
|
|
|
|
|
|
|
|
|
// Large canvas so shadows/halos NEVER clip at window boundaries |
|
|
|
|
|
private let canvasSize: CGFloat = 260 |
|
|
|
|
|
|
|
|
private init() { |
|
|
private init() { |
|
|
DispatchQueue.main.async { |
|
|
DispatchQueue.main.async { |
|
|
self.setupWindow() |
|
|
self.setupWindow() |
|
|
@ -24,9 +27,8 @@ public final class HUDOverlayController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private func setupWindow() { |
|
|
private func setupWindow() { |
|
|
let size: CGFloat = 84 |
|
|
|
|
|
let panel = NSPanel( |
|
|
let panel = NSPanel( |
|
|
contentRect: NSRect(x: 0, y: 0, width: size, height: size), |
|
|
|
|
|
|
|
|
contentRect: NSRect(x: 0, y: 0, width: canvasSize, height: canvasSize), |
|
|
styleMask: [.borderless, .nonactivatingPanel], |
|
|
styleMask: [.borderless, .nonactivatingPanel], |
|
|
backing: .buffered, |
|
|
backing: .buffered, |
|
|
defer: false |
|
|
defer: false |
|
|
@ -42,8 +44,10 @@ public final class HUDOverlayController { |
|
|
let container = NSView(frame: panel.contentView!.bounds) |
|
|
let container = NSView(frame: panel.contentView!.bounds) |
|
|
container.wantsLayer = true |
|
|
container.wantsLayer = true |
|
|
|
|
|
|
|
|
// Pure Apple Siri-like Circular Orb (Centered, no bottom text) |
|
|
|
|
|
let orb = SiriOrbView(frame: NSRect(x: 12, y: 12, width: 60, height: 60)) |
|
|
|
|
|
|
|
|
// Siri-like Circular Orb centered with plenty of breathing room for glowing halos |
|
|
|
|
|
let orbSize: CGFloat = 64 |
|
|
|
|
|
let orbOrigin = (canvasSize - orbSize) / 2.0 |
|
|
|
|
|
let orb = SiriOrbView(frame: NSRect(x: orbOrigin, y: orbOrigin, width: orbSize, height: orbSize)) |
|
|
container.addSubview(orb) |
|
|
container.addSubview(orb) |
|
|
self.orbView = orb |
|
|
self.orbView = orb |
|
|
|
|
|
|
|
|
@ -55,8 +59,9 @@ public final class HUDOverlayController { |
|
|
private func reposition() { |
|
|
private func reposition() { |
|
|
guard let window = self.window, let screen = NSScreen.main else { return } |
|
|
guard let window = self.window, let screen = NSScreen.main else { return } |
|
|
let screenRect = screen.visibleFrame |
|
|
let screenRect = screen.visibleFrame |
|
|
let x = screenRect.midX - (window.frame.width / 2) |
|
|
|
|
|
let y = screenRect.minY + 36 |
|
|
|
|
|
|
|
|
// Center horizontally, position near bottom of screen |
|
|
|
|
|
let x = screenRect.midX - (canvasSize / 2.0) |
|
|
|
|
|
let y = screenRect.minY + 12 |
|
|
window.setFrameOrigin(NSPoint(x: x, y: y)) |
|
|
window.setFrameOrigin(NSPoint(x: x, y: y)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -100,7 +105,7 @@ public final class HUDOverlayController { |
|
|
|
|
|
|
|
|
case .error: |
|
|
case .error: |
|
|
orb.showErrorState() |
|
|
orb.showErrorState() |
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) { |
|
|
|
|
|
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.75) { |
|
|
self.hide() |
|
|
self.hide() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -111,7 +116,7 @@ public final class HUDOverlayController { |
|
|
DispatchQueue.main.async { [weak self] in |
|
|
DispatchQueue.main.async { [weak self] in |
|
|
guard let self = self, let window = self.window, self.isVisible else { return } |
|
|
guard let self = self, let window = self.window, self.isVisible else { return } |
|
|
NSAnimationContext.runAnimationGroup({ context in |
|
|
NSAnimationContext.runAnimationGroup({ context in |
|
|
context.duration = 0.22 |
|
|
|
|
|
|
|
|
context.duration = 0.20 |
|
|
window.animator().alphaValue = 0.0 |
|
|
window.animator().alphaValue = 0.0 |
|
|
}, completionHandler: { |
|
|
}, completionHandler: { |
|
|
window.orderOut(nil) |
|
|
window.orderOut(nil) |
|
|
@ -122,13 +127,15 @@ public final class HUDOverlayController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// MARK: - Dynamic Siri Gradient Orb View with Expanded Audio Reactivity |
|
|
|
|
|
|
|
|
// MARK: - Premium Apple Intelligence / Siri Multilayer Glowing Orb |
|
|
|
|
|
|
|
|
final class SiriOrbView: NSView { |
|
|
final class SiriOrbView: NSView { |
|
|
private let gradientLayer = CAGradientLayer() |
|
|
|
|
|
private let glowLayer = CALayer() |
|
|
|
|
|
private let backdropLayer = CALayer() |
|
|
|
|
|
private var baseRadius: CGFloat = 30 |
|
|
|
|
|
|
|
|
private let ambientAuraLayer = CALayer() |
|
|
|
|
|
private let haloLayer = CALayer() |
|
|
|
|
|
private let acousticRippleLayer = CALayer() |
|
|
|
|
|
private let glassBackdrop = CALayer() |
|
|
|
|
|
private let siriGradientLayer = CAGradientLayer() |
|
|
|
|
|
private let specularHighlight = CAGradientLayer() |
|
|
|
|
|
|
|
|
override init(frame frameRect: NSRect) { |
|
|
override init(frame frameRect: NSRect) { |
|
|
super.init(frame: frameRect) |
|
|
super.init(frame: frameRect) |
|
|
@ -147,39 +154,69 @@ final class SiriOrbView: NSView { |
|
|
layer.masksToBounds = false |
|
|
layer.masksToBounds = false |
|
|
|
|
|
|
|
|
let bounds = self.bounds |
|
|
let bounds = self.bounds |
|
|
baseRadius = bounds.width / 2.0 |
|
|
|
|
|
|
|
|
|
|
|
// 1. Expanded Halo Outer Glow |
|
|
|
|
|
glowLayer.frame = bounds.insetBy(dx: -16, dy: -16) |
|
|
|
|
|
glowLayer.cornerRadius = (bounds.width + 32) / 2.0 |
|
|
|
|
|
glowLayer.backgroundColor = NSColor(red: 0.0, green: 0.75, blue: 1.0, alpha: 0.45).cgColor |
|
|
|
|
|
glowLayer.shadowColor = NSColor(red: 0.5, green: 0.0, blue: 1.0, alpha: 0.85).cgColor |
|
|
|
|
|
glowLayer.shadowRadius = 18 |
|
|
|
|
|
glowLayer.shadowOpacity = 0.9 |
|
|
|
|
|
glowLayer.shadowOffset = .zero |
|
|
|
|
|
layer.addSublayer(glowLayer) |
|
|
|
|
|
|
|
|
|
|
|
// 2. Dark Glass Backdrop |
|
|
|
|
|
backdropLayer.frame = bounds |
|
|
|
|
|
backdropLayer.cornerRadius = baseRadius |
|
|
|
|
|
backdropLayer.backgroundColor = NSColor.black.withAlphaComponent(0.70).cgColor |
|
|
|
|
|
backdropLayer.borderColor = NSColor.white.withAlphaComponent(0.25).cgColor |
|
|
|
|
|
backdropLayer.borderWidth = 1.0 |
|
|
|
|
|
layer.addSublayer(backdropLayer) |
|
|
|
|
|
|
|
|
|
|
|
// 3. Siri Multicolored Gradient Core |
|
|
|
|
|
gradientLayer.frame = bounds.insetBy(dx: 4, dy: 4) |
|
|
|
|
|
gradientLayer.cornerRadius = (bounds.width - 8) / 2.0 |
|
|
|
|
|
gradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 0.0, green: 0.90, blue: 1.0, alpha: 0.95).cgColor, // Electric Cyan |
|
|
|
|
|
NSColor(red: 0.50, green: 0.15, blue: 1.0, alpha: 0.95).cgColor, // Royal Violet |
|
|
|
|
|
NSColor(red: 1.0, green: 0.05, blue: 0.65, alpha: 0.95).cgColor // Hot Magenta |
|
|
|
|
|
|
|
|
let radius = bounds.width / 2.0 |
|
|
|
|
|
|
|
|
|
|
|
// 1. Deep Ambient Soft Aura (Diffused outer glow) |
|
|
|
|
|
ambientAuraLayer.frame = bounds.insetBy(dx: -32, dy: -32) |
|
|
|
|
|
ambientAuraLayer.cornerRadius = (bounds.width + 64) / 2.0 |
|
|
|
|
|
ambientAuraLayer.backgroundColor = NSColor(red: 0.0, green: 0.65, blue: 1.0, alpha: 0.22).cgColor |
|
|
|
|
|
ambientAuraLayer.shadowColor = NSColor(red: 0.55, green: 0.0, blue: 1.0, alpha: 0.85).cgColor |
|
|
|
|
|
ambientAuraLayer.shadowRadius = 38 |
|
|
|
|
|
ambientAuraLayer.shadowOpacity = 0.95 |
|
|
|
|
|
ambientAuraLayer.shadowOffset = .zero |
|
|
|
|
|
layer.addSublayer(ambientAuraLayer) |
|
|
|
|
|
|
|
|
|
|
|
// 2. Focused Neon Halo |
|
|
|
|
|
haloLayer.frame = bounds.insetBy(dx: -14, dy: -14) |
|
|
|
|
|
haloLayer.cornerRadius = (bounds.width + 28) / 2.0 |
|
|
|
|
|
haloLayer.backgroundColor = NSColor(red: 0.1, green: 0.8, blue: 1.0, alpha: 0.40).cgColor |
|
|
|
|
|
haloLayer.shadowColor = NSColor(red: 0.0, green: 0.9, blue: 1.0, alpha: 0.85).cgColor |
|
|
|
|
|
haloLayer.shadowRadius = 18 |
|
|
|
|
|
haloLayer.shadowOpacity = 0.9 |
|
|
|
|
|
haloLayer.shadowOffset = .zero |
|
|
|
|
|
layer.addSublayer(haloLayer) |
|
|
|
|
|
|
|
|
|
|
|
// 3. Acoustic Ripple Ring |
|
|
|
|
|
acousticRippleLayer.frame = bounds.insetBy(dx: -4, dy: -4) |
|
|
|
|
|
acousticRippleLayer.cornerRadius = (bounds.width + 8) / 2.0 |
|
|
|
|
|
acousticRippleLayer.borderColor = NSColor(red: 0.0, green: 0.95, blue: 1.0, alpha: 0.35).cgColor |
|
|
|
|
|
acousticRippleLayer.borderWidth = 1.5 |
|
|
|
|
|
layer.addSublayer(acousticRippleLayer) |
|
|
|
|
|
|
|
|
|
|
|
// 4. Dark Glass Spherical Backdrop |
|
|
|
|
|
glassBackdrop.frame = bounds |
|
|
|
|
|
glassBackdrop.cornerRadius = radius |
|
|
|
|
|
glassBackdrop.backgroundColor = NSColor.black.withAlphaComponent(0.85).cgColor |
|
|
|
|
|
glassBackdrop.borderColor = NSColor.white.withAlphaComponent(0.35).cgColor |
|
|
|
|
|
glassBackdrop.borderWidth = 1.0 |
|
|
|
|
|
layer.addSublayer(glassBackdrop) |
|
|
|
|
|
|
|
|
|
|
|
// 5. Multi-Color Liquid Siri Gradient Core |
|
|
|
|
|
siriGradientLayer.frame = bounds.insetBy(dx: 3, dy: 3) |
|
|
|
|
|
siriGradientLayer.cornerRadius = (bounds.width - 6) / 2.0 |
|
|
|
|
|
siriGradientLayer.type = .radial |
|
|
|
|
|
siriGradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 0.0, green: 0.95, blue: 1.0, alpha: 1.0).cgColor, // Electric Cyan Center |
|
|
|
|
|
NSColor(red: 0.50, green: 0.12, blue: 1.0, alpha: 0.95).cgColor, // Royal Violet |
|
|
|
|
|
NSColor(red: 0.98, green: 0.08, blue: 0.65, alpha: 0.90).cgColor, // Hot Magenta |
|
|
|
|
|
NSColor(red: 0.10, green: 0.20, blue: 0.95, alpha: 0.85).cgColor // Deep Blue |
|
|
|
|
|
] |
|
|
|
|
|
siriGradientLayer.startPoint = CGPoint(x: 0.35, y: 0.35) |
|
|
|
|
|
siriGradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0) |
|
|
|
|
|
layer.addSublayer(siriGradientLayer) |
|
|
|
|
|
|
|
|
|
|
|
// 6. 3D Curved Specular Glass Crescent Highlight (Apple Intelligence style) |
|
|
|
|
|
specularHighlight.frame = NSRect(x: bounds.midX - 18, y: bounds.maxY - 18, width: 36, height: 12) |
|
|
|
|
|
specularHighlight.cornerRadius = 6 |
|
|
|
|
|
specularHighlight.colors = [ |
|
|
|
|
|
NSColor.white.withAlphaComponent(0.65).cgColor, |
|
|
|
|
|
NSColor.white.withAlphaComponent(0.0).cgColor |
|
|
] |
|
|
] |
|
|
gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0) |
|
|
|
|
|
gradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0) |
|
|
|
|
|
layer.addSublayer(gradientLayer) |
|
|
|
|
|
|
|
|
specularHighlight.startPoint = CGPoint(x: 0.5, y: 1.0) |
|
|
|
|
|
specularHighlight.endPoint = CGPoint(x: 0.5, y: 0.0) |
|
|
|
|
|
layer.addSublayer(specularHighlight) |
|
|
|
|
|
|
|
|
// Continuous smooth rotation |
|
|
|
|
|
|
|
|
// Start fluid rotation |
|
|
startOrbRotation() |
|
|
startOrbRotation() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -187,10 +224,10 @@ final class SiriOrbView: NSView { |
|
|
let rotate = CABasicAnimation(keyPath: "transform.rotation.z") |
|
|
let rotate = CABasicAnimation(keyPath: "transform.rotation.z") |
|
|
rotate.fromValue = 0.0 |
|
|
rotate.fromValue = 0.0 |
|
|
rotate.toValue = 2 * Double.pi |
|
|
rotate.toValue = 2 * Double.pi |
|
|
rotate.duration = 3.5 |
|
|
|
|
|
|
|
|
rotate.duration = 4.0 |
|
|
rotate.repeatCount = .infinity |
|
|
rotate.repeatCount = .infinity |
|
|
rotate.isRemovedOnCompletion = false |
|
|
rotate.isRemovedOnCompletion = false |
|
|
gradientLayer.add(rotate, forKey: "siriRotate") |
|
|
|
|
|
|
|
|
siriGradientLayer.add(rotate, forKey: "siriFluidRotate") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func updateAudioLevel(_ level: Float, isLagging: Bool) { |
|
|
func updateAudioLevel(_ level: Float, isLagging: Bool) { |
|
|
@ -201,32 +238,40 @@ final class SiriOrbView: NSView { |
|
|
|
|
|
|
|
|
if isLagging { |
|
|
if isLagging { |
|
|
// Warm amber pulse for weak internet |
|
|
// Warm amber pulse for weak internet |
|
|
gradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 1.0, green: 0.65, blue: 0.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 1.0, green: 0.30, blue: 0.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.95, green: 0.85, blue: 0.1, alpha: 0.9).cgColor |
|
|
|
|
|
|
|
|
siriGradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 1.0, green: 0.85, blue: 0.2, alpha: 1.0).cgColor, |
|
|
|
|
|
NSColor(red: 1.0, green: 0.55, blue: 0.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.95, green: 0.25, blue: 0.0, alpha: 0.90).cgColor |
|
|
] |
|
|
] |
|
|
glowLayer.backgroundColor = NSColor(red: 1.0, green: 0.5, blue: 0.0, alpha: 0.5).cgColor |
|
|
|
|
|
glowLayer.shadowColor = NSColor(red: 1.0, green: 0.4, blue: 0.0, alpha: 0.85).cgColor |
|
|
|
|
|
|
|
|
haloLayer.backgroundColor = NSColor(red: 1.0, green: 0.5, blue: 0.0, alpha: 0.5).cgColor |
|
|
|
|
|
haloLayer.shadowColor = NSColor(red: 1.0, green: 0.4, blue: 0.0, alpha: 0.9).cgColor |
|
|
|
|
|
ambientAuraLayer.shadowColor = NSColor(red: 1.0, green: 0.3, blue: 0.0, alpha: 0.7).cgColor |
|
|
} else { |
|
|
} else { |
|
|
// Standard vibrant Siri gradient |
|
|
|
|
|
gradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 0.0, green: 0.90, blue: 1.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.50, green: 0.15, blue: 1.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 1.0, green: 0.05, blue: 0.65, alpha: 0.95).cgColor |
|
|
|
|
|
|
|
|
// High-fidelity Siri electric gradient |
|
|
|
|
|
siriGradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 0.0, green: 0.95, blue: 1.0, alpha: 1.0).cgColor, |
|
|
|
|
|
NSColor(red: 0.50, green: 0.12, blue: 1.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.98, green: 0.08, blue: 0.65, alpha: 0.90).cgColor, |
|
|
|
|
|
NSColor(red: 0.10, green: 0.20, blue: 0.95, alpha: 0.85).cgColor |
|
|
] |
|
|
] |
|
|
glowLayer.backgroundColor = NSColor(red: 0.0, green: 0.75, blue: 1.0, alpha: 0.45).cgColor |
|
|
|
|
|
glowLayer.shadowColor = NSColor(red: 0.5, green: 0.0, blue: 1.0, alpha: 0.85).cgColor |
|
|
|
|
|
|
|
|
haloLayer.backgroundColor = NSColor(red: 0.1, green: 0.8, blue: 1.0, alpha: 0.40).cgColor |
|
|
|
|
|
haloLayer.shadowColor = NSColor(red: 0.0, green: 0.9, blue: 1.0, alpha: 0.85).cgColor |
|
|
|
|
|
ambientAuraLayer.shadowColor = NSColor(red: 0.55, green: 0.0, blue: 1.0, alpha: 0.85).cgColor |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// High-sensitivity Audio Reactive Dynamics (Significantly boosted impact) |
|
|
|
|
|
// Scale expands from 1.0 up to 1.70x with microphone volume |
|
|
|
|
|
let scale = 1.0 + (clamped * 0.70) |
|
|
|
|
|
|
|
|
// Massive Audio Dynamic Scaling (Orb expands up to 1.65x with voice) |
|
|
|
|
|
let scale = 1.0 + (clamped * 0.65) |
|
|
self.layer?.sublayerTransform = CATransform3DMakeScale(scale, scale, 1.0) |
|
|
self.layer?.sublayerTransform = CATransform3DMakeScale(scale, scale, 1.0) |
|
|
|
|
|
|
|
|
// Halo shadow radius and intensity expand dramatically |
|
|
|
|
|
glowLayer.shadowRadius = 18 + (clamped * 36) |
|
|
|
|
|
glowLayer.shadowOpacity = Float(0.70 + (clamped * 0.30)) |
|
|
|
|
|
|
|
|
// Dynamic Halo bloom (Expands smoothly up to 55px radius) |
|
|
|
|
|
haloLayer.shadowRadius = 18 + (clamped * 36) |
|
|
|
|
|
haloLayer.shadowOpacity = Float(0.75 + (clamped * 0.25)) |
|
|
|
|
|
ambientAuraLayer.shadowRadius = 38 + (clamped * 42) |
|
|
|
|
|
|
|
|
|
|
|
// Acoustic ripple expands outward |
|
|
|
|
|
let rippleScale = 1.0 + (clamped * 0.35) |
|
|
|
|
|
acousticRippleLayer.transform = CATransform3DMakeScale(rippleScale, rippleScale, 1.0) |
|
|
|
|
|
acousticRippleLayer.opacity = Float(0.3 + (clamped * 0.7)) |
|
|
|
|
|
|
|
|
CATransaction.commit() |
|
|
CATransaction.commit() |
|
|
} |
|
|
} |
|
|
@ -235,20 +280,20 @@ final class SiriOrbView: NSView { |
|
|
CATransaction.begin() |
|
|
CATransaction.begin() |
|
|
CATransaction.setDisableActions(false) |
|
|
CATransaction.setDisableActions(false) |
|
|
CATransaction.setAnimationDuration(0.3) |
|
|
CATransaction.setAnimationDuration(0.3) |
|
|
gradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 1.0, green: 0.60, blue: 0.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 1.0, green: 0.25, blue: 0.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.95, green: 0.85, blue: 0.2, alpha: 0.9).cgColor |
|
|
|
|
|
|
|
|
siriGradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 1.0, green: 0.85, blue: 0.2, alpha: 1.0).cgColor, |
|
|
|
|
|
NSColor(red: 1.0, green: 0.50, blue: 0.0, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.95, green: 0.20, blue: 0.0, alpha: 0.90).cgColor |
|
|
] |
|
|
] |
|
|
glowLayer.shadowColor = NSColor.orange.cgColor |
|
|
|
|
|
glowLayer.shadowRadius = 28 |
|
|
|
|
|
|
|
|
haloLayer.shadowColor = NSColor.orange.cgColor |
|
|
|
|
|
ambientAuraLayer.shadowColor = NSColor.orange.cgColor |
|
|
CATransaction.commit() |
|
|
CATransaction.commit() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func showTranscribingState() { |
|
|
func showTranscribingState() { |
|
|
CATransaction.begin() |
|
|
CATransaction.begin() |
|
|
CATransaction.setDisableActions(true) |
|
|
CATransaction.setDisableActions(true) |
|
|
self.layer?.sublayerTransform = CATransform3DMakeScale(1.05, 1.05, 1.0) |
|
|
|
|
|
|
|
|
self.layer?.sublayerTransform = CATransform3DMakeScale(1.08, 1.08, 1.0) |
|
|
CATransaction.commit() |
|
|
CATransaction.commit() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -256,12 +301,12 @@ final class SiriOrbView: NSView { |
|
|
CATransaction.begin() |
|
|
CATransaction.begin() |
|
|
CATransaction.setDisableActions(false) |
|
|
CATransaction.setDisableActions(false) |
|
|
CATransaction.setAnimationDuration(0.2) |
|
|
CATransaction.setAnimationDuration(0.2) |
|
|
gradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 0.1, green: 0.95, blue: 0.45, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.0, green: 0.80, blue: 0.90, alpha: 0.95).cgColor |
|
|
|
|
|
|
|
|
siriGradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 0.2, green: 1.0, blue: 0.5, alpha: 1.0).cgColor, |
|
|
|
|
|
NSColor(red: 0.0, green: 0.85, blue: 0.8, alpha: 0.95).cgColor |
|
|
] |
|
|
] |
|
|
glowLayer.shadowColor = NSColor.green.cgColor |
|
|
|
|
|
glowLayer.shadowRadius = 24 |
|
|
|
|
|
|
|
|
haloLayer.shadowColor = NSColor.green.cgColor |
|
|
|
|
|
ambientAuraLayer.shadowColor = NSColor.green.cgColor |
|
|
CATransaction.commit() |
|
|
CATransaction.commit() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -269,12 +314,12 @@ final class SiriOrbView: NSView { |
|
|
CATransaction.begin() |
|
|
CATransaction.begin() |
|
|
CATransaction.setDisableActions(false) |
|
|
CATransaction.setDisableActions(false) |
|
|
CATransaction.setAnimationDuration(0.2) |
|
|
CATransaction.setAnimationDuration(0.2) |
|
|
gradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 1.0, green: 0.2, blue: 0.2, alpha: 0.95).cgColor, |
|
|
|
|
|
NSColor(red: 0.8, green: 0.0, blue: 0.3, alpha: 0.95).cgColor |
|
|
|
|
|
|
|
|
siriGradientLayer.colors = [ |
|
|
|
|
|
NSColor(red: 1.0, green: 0.2, blue: 0.2, alpha: 1.0).cgColor, |
|
|
|
|
|
NSColor(red: 0.8, green: 0.0, blue: 0.4, alpha: 0.95).cgColor |
|
|
] |
|
|
] |
|
|
glowLayer.shadowColor = NSColor.red.cgColor |
|
|
|
|
|
glowLayer.shadowRadius = 24 |
|
|
|
|
|
|
|
|
haloLayer.shadowColor = NSColor.red.cgColor |
|
|
|
|
|
ambientAuraLayer.shadowColor = NSColor.red.cgColor |
|
|
CATransaction.commit() |
|
|
CATransaction.commit() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -282,7 +327,10 @@ final class SiriOrbView: NSView { |
|
|
CATransaction.begin() |
|
|
CATransaction.begin() |
|
|
CATransaction.setDisableActions(true) |
|
|
CATransaction.setDisableActions(true) |
|
|
self.layer?.sublayerTransform = CATransform3DIdentity |
|
|
self.layer?.sublayerTransform = CATransform3DIdentity |
|
|
glowLayer.shadowRadius = 18 |
|
|
|
|
|
|
|
|
haloLayer.shadowRadius = 18 |
|
|
|
|
|
ambientAuraLayer.shadowRadius = 38 |
|
|
|
|
|
acousticRippleLayer.transform = CATransform3DIdentity |
|
|
|
|
|
acousticRippleLayer.opacity = 0.3 |
|
|
CATransaction.commit() |
|
|
CATransaction.commit() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |