Skip to content

Added scroll to top button #20

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion frontend-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions frontend-react/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
import { PieChart } from 'lucide-react'
import React from 'react'
import { Link } from 'react-router-dom'
import { useState, useEffect } from 'react'
import { ArrowUp } from "lucide-react";


const Footer: React.FC = () => {

const [isVisible, setIsVisible] = useState(false);

const handleScroll = () => {
setIsVisible(window.scrollY > 300);
};

const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};

useEffect(() => {
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);


return (
<>
<footer className="border-t bg-background py-12">
Expand Down Expand Up @@ -35,6 +55,19 @@ const Footer: React.FC = () => {
<div className="text-sm text-muted-foreground">Β© 2025 FinTechForge. All rights reserved.</div>
</div>
</div>
<button
onClick={scrollToTop}
className={`fixed bottom-6 right-6 z-50 p-4 rounded-full
bg-gradient-to-br from-blue-500 to-indigo-600 text-white
shadow-xl hover:shadow-2xl hover:scale-110
hover:from-blue-600 hover:to-indigo-700
transition-all duration-300 ease-in-out border border-white/20
backdrop-blur-sm hover:ring-2 hover:ring-blue-300
${isVisible ? "opacity-100" : "opacity-0 pointer-events-none"}`}
aria-label="Scroll to top"
>
<ArrowUp size={22} strokeWidth={2.5} />
</button>
</footer>
</>
)
Expand Down