From f622dd550006166fba6dc8be9db70d8d3a220bfb Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Tue, 1 Apr 2025 12:31:21 +0200 Subject: [PATCH] Add smooth scroll --- app/pages/portfolio/[slug].vue | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/app/pages/portfolio/[slug].vue b/app/pages/portfolio/[slug].vue index 37685d0..d490588 100644 --- a/app/pages/portfolio/[slug].vue +++ b/app/pages/portfolio/[slug].vue @@ -56,6 +56,13 @@ async function handleLike() { await refresh() likeCookie.value = true } + +function scrollToSection(id: string) { + const element = document.getElementById(id) + if (element) { + element.scrollIntoView({ behavior: 'smooth' }) + } +} @@ -236,9 +231,17 @@ async function handleLike() { @apply no-underline; } +.prose img { + margin: 0; +} + .katex-html { display: none; } + +html { + scroll-behavior: smooth; +}