-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
164 additions
and
70 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
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
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
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
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,25 @@ | ||
import React, { useState } from 'react' | ||
import Styles from './ScrollToTop.module.css' | ||
import { TbArrowBigUpLineFilled } from "react-icons/tb"; | ||
|
||
function ScrollToTop() { | ||
|
||
const [isHover,setIsHover]=useState(false); | ||
|
||
function handleClick(e) { | ||
window.scrollTo( | ||
{ | ||
top: 0, | ||
behavior: 'smooth', | ||
} | ||
) | ||
} | ||
|
||
return ( | ||
<div className={Styles['btn']} onMouseEnter={()=>setIsHover(true)} onMouseLeave={()=>setIsHover(false)}> | ||
<button className={Styles['scroll-btn']} onClick={handleClick}><TbArrowBigUpLineFilled size={25} color={isHover?'white':'#8400ff'} /></button> | ||
</div> | ||
) | ||
} | ||
|
||
export default ScrollToTop |
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,25 @@ | ||
|
||
.btn{ | ||
position: fixed; | ||
right: 20px; | ||
bottom: 100px; | ||
border-radius: 50%; | ||
} | ||
|
||
.scroll-btn{ | ||
background-color: white; | ||
border:none; | ||
outline: none; | ||
border-radius: 50%; | ||
padding: 10px; | ||
transition: all 0.5s ease-in-out; | ||
} | ||
|
||
.scroll-btn:hover,.btn:hover{ | ||
background-color: #40019a; | ||
color: white; | ||
transform: scale(1.1); | ||
box-shadow: 0 0 15px white; | ||
cursor: pointer; | ||
color: white; | ||
} |
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
Oops, something went wrong.