forked from subhadipbhowmik/30-Days-Of-CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Back To Top Navigation (subhadipbhowmik#139)
* added hover card effect * aligned footer to center * modified tablet view of the footer * add scroollToTop button --------- Co-authored-by: Shubhadip Bhowmik <[email protected]>
- Loading branch information
1 parent
77762e5
commit 6510d3a
Showing
4 changed files
with
50 additions
and
1 deletion.
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
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,21 @@ | ||
import React from 'react'; | ||
import styles from './ScrollToTopButton.module.css'; | ||
|
||
const ScrollToTopButton = () => { | ||
const scrollToTop = () => { | ||
window.scrollTo({ | ||
top: 0, | ||
behavior: 'smooth', | ||
}); | ||
}; | ||
|
||
return ( | ||
<div className={styles.scrollToTop}> | ||
<button onClick={scrollToTop} className={styles.button}> | ||
↑ | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ScrollToTopButton; |
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 @@ | ||
.scrollToTop { | ||
position: absolute; | ||
bottom: 20px; | ||
right: 20px; | ||
z-index: 1; | ||
} | ||
|
||
.button { | ||
background-color: rgb(0, 191, 166); | ||
border: none; | ||
color: white; | ||
padding: 10px 15px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 16px; | ||
margin: 4px 2px 0px; | ||
cursor: pointer; | ||
border-radius: 50%; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.button:hover { | ||
background-color: #0056b3; | ||
} |
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