mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
Update AnimatedBackground.tsx
This commit is contained in:
@@ -4,16 +4,11 @@ import { brandingApi } from '../api/branding'
|
|||||||
|
|
||||||
const ANIMATION_CACHE_KEY = 'cabinet_animation_enabled'
|
const ANIMATION_CACHE_KEY = 'cabinet_animation_enabled'
|
||||||
|
|
||||||
// Detect low-performance device (mobile in Telegram WebApp)
|
// Detect if user prefers reduced motion
|
||||||
const isLowPerformance = (): boolean => {
|
const isLowPerformance = (): boolean => {
|
||||||
// Check if running in Telegram WebApp
|
// Only check for reduced motion preference - let animation run everywhere else
|
||||||
const isTelegramWebApp = !!(window as unknown as { Telegram?: { WebApp?: unknown } }).Telegram?.WebApp
|
|
||||||
// Check if mobile
|
|
||||||
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
|
|
||||||
// Check for reduced motion preference
|
|
||||||
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||||
|
return prefersReducedMotion
|
||||||
return prefersReducedMotion || (isTelegramWebApp && isMobile)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get cached value from localStorage
|
// Get cached value from localStorage
|
||||||
|
|||||||
Reference in New Issue
Block a user