From e494ce01ab6fb9604a8638e36f31921c0f493546 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Mon, 23 Feb 2026 16:21:54 +0530 Subject: [PATCH] feat: automatically enable low cpu mode on mobiles - linked /root discord --- src/App.tsx | 15 +++++++++++++++ src/components/HeroTitle.tsx | 2 +- src/components/NavigationBar.tsx | 12 +++++++++--- src/components/ThemeMapperModal.tsx | 4 ++-- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 75034d3..c0c441c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -100,6 +100,21 @@ export default function App() { return () => window.clearTimeout(t); }, [showThemePillTooltip]); + useEffect(() => { + const mediaQuery = window.matchMedia('(max-width: 639px)'); + + const enforceCpuMode = () => { + setCpuModeEnabled(mediaQuery.matches); + }; + + enforceCpuMode(); + mediaQuery.addEventListener('change', enforceCpuMode); + + return () => { + mediaQuery.removeEventListener('change', enforceCpuMode); + }; + }, []); + return (
diff --git a/src/components/HeroTitle.tsx b/src/components/HeroTitle.tsx index c3219d6..b34f01b 100644 --- a/src/components/HeroTitle.tsx +++ b/src/components/HeroTitle.tsx @@ -4,7 +4,7 @@ export function HeroTitle() { I overdesign controllable systems - ,
deconstruct black boxes, and build tools. +
deconstruct black boxes and build tools. ); } diff --git a/src/components/NavigationBar.tsx b/src/components/NavigationBar.tsx index 58fc7c3..9ee96a8 100644 --- a/src/components/NavigationBar.tsx +++ b/src/components/NavigationBar.tsx @@ -12,17 +12,23 @@ export function NavigationBar({ cpuModeEnabled, onCpuModeToggle }: NavigationBar aditya_gupta // sortedcord -
+ root -
+
- (hashing function) + fnv1a function
@@ -71,7 +71,7 @@ export function ThemeMapperModal({ {deterministicIndex ?? '—'}
- (theme select) + theme select