Skip to content

Commit 3c9a153

Browse files
committed
feat: add scroll-to-top functionality on view change and enhance logo filter transition
1 parent 070b8a7 commit 3c9a153

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@ export function App() {
695695
setShowPrivacy(true);
696696
}, []);
697697

698+
/** Scroll to top whenever the view changes. */
699+
// eslint-disable-next-line react-hooks/exhaustive-deps -- activeTool and showPrivacy are intentional trigger deps
700+
useEffect(() => {
701+
window.scrollTo(0, 0);
702+
}, [activeTool, showPrivacy]);
703+
698704
/** Metadata for the active tool (memoised to avoid redundant lookups). */
699705
const activeMeta = useMemo(
700706
() => (activeTool ? (tools.find((t) => t.id === activeTool) ?? null) : null),

src/components/Layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ export function Layout({ children, onHome, showBack, onPrivacy, badgeAccent }: L
102102
<div className="max-w-6xl mx-auto px-4 sm:px-6 py-4 flex flex-col sm:flex-row items-center justify-between gap-3">
103103
{/* Brand + copyright */}
104104
<div className="flex items-center gap-2">
105-
<img src="/icons/logo.svg" alt="" aria-hidden="true" className="w-5 h-5 opacity-60" />
105+
<img
106+
src="/icons/logo.svg"
107+
alt=""
108+
aria-hidden="true"
109+
className="w-5 h-5 opacity-60 transition-[filter] duration-300"
110+
style={badgeAccent?.logoFilter ? { filter: badgeAccent.logoFilter } : undefined}
111+
/>
106112
<span className="text-xs font-medium text-slate-500 dark:text-dark-text-muted">
107113
CloakPDF
108114
</span>

0 commit comments

Comments
 (0)