mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 11:03:50 +00:00
mobile optimizations
This commit is contained in:
@@ -25,8 +25,9 @@ export function AnimateIn({ children, delay = 0, threshold = 0.15 }: AnimateInPr
|
||||
const rect = el.getBoundingClientRect();
|
||||
const inView = rect.top < window.innerHeight && rect.bottom > 0;
|
||||
const isReload = (performance.getEntriesByType?.("navigation")?.[0] as PerformanceNavigationTiming)?.type === "reload";
|
||||
const isSpaNav = !!(window as any).__astroNavigation;
|
||||
|
||||
if (inView && isReload) {
|
||||
if (inView && (isReload || isSpaNav)) {
|
||||
setSkip(true);
|
||||
setVisible(true);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user