Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll To Top widget improved #655

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/Dashboard/Dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
text-align: center;
background-color: #CAE7FE;
}
.scroll{
z-index: 10000;
padding: 1rem 1rem!important;
align-items: center !important;
justify-items: center !important;
right:20px !important;
margin-top: -2rem;
position: absolute;
box-shadow: 0 0 4px grey !important;
cursor: pointer;
}

.navbar {
display: flex;
Expand Down
15 changes: 14 additions & 1 deletion src/components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ const Dashboard = () => {
setActiveIndex(null);
};




const [fix, setFix]= useState(false)
//function for appearance of background for nav menu
function setFixed(){
Expand All @@ -97,7 +100,17 @@ window.addEventListener("scroll", setFixed)
//scrolltotop is for scroll to top widget
//Then the navbar code begins
<main>
<ScrollToTop color="white" style={{ backgroundColor: "#5CB6F9" }} />
<div className="scroll">
<ScrollToTop
smooth
viewBox="0 0 24 24"
svgPath="M16 13a1 1 0 0 1-.707-.293L12 9.414l-3.293 3.293a1 1 0 1 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4A1 1 0 0 1 16 13z M16 17a1 1 0 0 1-.707-.293L12 13.414l-3.293 3.293a1 1 0 1 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4A1 1 0 0 1 16 17z"

color="white"
style={{ backgroundColor: "#5CB6F9" }}
/>
{/* <ScrollToTop color="white" style={{ backgroundColor: "#5CB6F9" }} /> */}
</div>
<nav className={`navbar ${fix ? 'fixed' : ''}`}>
<div className="logo">
<img src={Logo} alt="Logo" />
Expand Down
8 changes: 8 additions & 0 deletions src/components/Dashboard/chevron-up-double-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading