Skip to content

Commit e6cd277

Browse files
committed
Adding a Scroll-To-top Button
1 parent cf769f5 commit e6cd277

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/components/Layout/Toc.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,7 @@ function ScrollToTop() {
4040
{isVisible && (
4141
<div
4242
onClick={scrollToTop}
43-
style={{
44-
position: 'fixed',
45-
bottom: '40px',
46-
right: '40px',
47-
cursor: 'pointer',
48-
backgroundColor: '#007bff',
49-
borderRadius: '50%',
50-
width: '40px',
51-
height: '40px',
52-
display: 'flex',
53-
justifyContent: 'center',
54-
alignItems: 'center',
55-
boxShadow: '0 2px 10px rgba(0,0,0,0.2)',
56-
transition: 'all 0.3s ease',
57-
opacity: '0.8',
58-
zIndex: 1000,
59-
'&:hover': {
60-
opacity: 1,
61-
transform: 'translateY(-2px)',
62-
},
63-
}}>
43+
className="fixed bottom-10 right-10 cursor-pointer bg-blue-500 rounded-full w-10 h-10 flex justify-center items-center shadow-lg transition-all duration-300 opacity-80 hover:opacity-100 hover:-translate-y-0.5 z-50">
6444
<svg
6545
width="20"
6646
height="20"

0 commit comments

Comments
 (0)