perf(thermal): eradicate thermal heating, CPU throttling, and excessive power draw across mobile and low-end devices

This commit is contained in:
2026-11-05 15:44:10 +05:30
parent 8715e23be0
commit fcd716463b
13 changed files with 396 additions and 321 deletions
+9 -1
View File
@@ -29,8 +29,16 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
const pathname = usePathname();
useEffect(() => {
let lastScrolled = window.scrollY > 20;
if (lastScrolled !== isScrolled) {
setIsScrolled(lastScrolled);
}
const handleScroll = () => {
setIsScrolled(window.scrollY > 20);
const nextScrolled = window.scrollY > 20;
if (nextScrolled !== lastScrolled) {
lastScrolled = nextScrolled;
setIsScrolled(nextScrolled);
}
};
window.addEventListener('scroll', handleScroll, { passive: true });
return () => window.removeEventListener('scroll', handleScroll);