-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add transitions to Sections bg and line
- Loading branch information
1 parent
e09f747
commit b9b8c86
Showing
3 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/gitbook/src/components/TableOfContents/AnimatedBackground.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use client'; | ||
|
||
import { motion } from 'framer-motion'; | ||
import React from 'react'; | ||
|
||
import { springCurve } from '../PageAside/ScrollSectionsList'; | ||
|
||
export function AnimatedBackground() { | ||
return ( | ||
<motion.div | ||
layout | ||
layoutId="sections-item" | ||
className="absolute left-0 top-0 z-0 h-full w-full bg-primary-50" | ||
transition={springCurve} | ||
/> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/gitbook/src/components/TableOfContents/AnimatedLine.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client'; | ||
|
||
import { motion } from 'framer-motion'; | ||
import React from 'react'; | ||
|
||
import { tcls } from '@/lib/tailwind'; | ||
|
||
import { springCurve } from '../PageAside/ScrollSectionsList'; | ||
|
||
export function AnimatedLine() { | ||
return ( | ||
<motion.div | ||
layout | ||
layoutId="sections-line" | ||
className={tcls([ | ||
'border-primary', | ||
'border-l', | ||
'dark:border-primary-400', | ||
'h-full', | ||
'absolute', | ||
'z-20', | ||
])} | ||
transition={springCurve} | ||
/> | ||
); | ||
} |