mobile optimizations

This commit is contained in:
2026-04-06 14:37:07 -07:00
parent 16f271c1c9
commit 3f103c3e15
6 changed files with 18 additions and 8 deletions

View File

@@ -13,13 +13,13 @@ export default function Intro() {
const inView = rect.top < window.innerHeight && rect.bottom > 0;
const isReload = performance.getEntriesByType?.("navigation")?.[0]?.type === "reload";
const isSpaNav = !!(window as any).__astroNavigation;
const mobile = window.innerWidth < 1024;
if (inView && (isReload || isSpaNav)) {
if (inView && (mobile || isReload || isSpaNav)) {
setVisible(true);
return;
}
if (inView) {
// Fresh navigation — animate in
requestAnimationFrame(() => setVisible(true));
return;
}

View File

@@ -29,8 +29,9 @@ const Stats = () => {
const inView = rect.top < window.innerHeight && rect.bottom > 0;
const isReload = performance.getEntriesByType?.("navigation")?.[0]?.type === "reload";
const isSpaNav = !!(window as any).__astroNavigation;
const mobile = window.innerWidth < 1024;
if (inView && (isReload || isSpaNav)) {
if (inView && (mobile || isReload || isSpaNav)) {
setSkipAnim(true);
setIsVisible(true);
return;

View File

@@ -36,8 +36,9 @@ const DetailedStats = () => {
const inView = rect.top < window.innerHeight && rect.bottom > 0;
const isReload = performance.getEntriesByType?.("navigation")?.[0]?.type === "reload";
const isSpaNav = !!(window as any).__astroNavigation;
const mobile = window.innerWidth < 1024;
if (inView && (isReload || isSpaNav)) {
if (inView && (mobile || isReload || isSpaNav)) {
setSkipAnim(true);
setVisible(true);
return;

View File

@@ -53,7 +53,9 @@ function TimelineCard({ item, index }: { item: (typeof timelineItems)[number]; i
const isReload = performance.getEntriesByType?.("navigation")?.[0]?.type === "reload";
const isSpaNav = !!(window as any).__astroNavigation;
if (inView && (isReload || isSpaNav)) {
const mobile = window.innerWidth < 1024;
if (inView && (mobile || isReload || isSpaNav)) {
setSkip(true);
setVisible(true);
return;