diff --git a/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx b/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx index 509c1a02c..df91a7a75 100644 --- a/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx +++ b/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx @@ -1,5 +1,5 @@ 'use client'; - +import { motion } from 'framer-motion'; import React from 'react'; import { useScrollActiveId } from '@/components/hooks'; @@ -7,13 +7,23 @@ import { DocumentSection } from '@/lib/document'; import { tcls } from '@/lib/tailwind'; import { HEADER_HEIGHT_DESKTOP } from '../layout'; +import { AnimatedBackground } from '../TableOfContents/AnimatedBackground'; +import { AnimatedLine } from '../TableOfContents/AnimatedLine'; /** * The threshold at which we consider a section as intersecting the viewport. */ const SECTION_INTERSECTING_THRESHOLD = 0.9; +export const springCurve = { + type: 'spring', + stiffness: 700, + damping: 50, + mass: 0.8, +}; + export function ScrollSectionsList(props: { sections: DocumentSection[] }) { + const [hoveredId, setHoveredId] = React.useState(null); const { sections } = props; const ids = React.useMemo(() => { @@ -28,31 +38,39 @@ export function ScrollSectionsList(props: { sections: DocumentSection[] }) { }); return ( -