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

Smooth footer reveal #29

Merged
merged 1 commit into from
Jan 8, 2025
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
173 changes: 81 additions & 92 deletions app/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
"use client";

import Image from "next/image";
import { useRef } from "react";
import { Montserrat_Alternates as Montserrat } from "next/font/google";
import { Github, Star } from "lucide-react";
import { motion, useScroll, useSpring, useTransform } from "framer-motion";

import logo from "@/public/logo.svg";

Expand All @@ -14,101 +10,94 @@ const roboto = Montserrat({
subsets: ["cyrillic"],
});
export default function Footer() {
const footerRef = useRef(null);

const { scrollYProgress } = useScroll({
target: footerRef,
offset: ["0 1", "1 1"],
});
return (
<footer className="relative h-[400px] z-[-10]">
<div className="fixed bottom-0 h-[400px] w-full">

const footerProgress = useTransform(scrollYProgress, [0, 1], ["-100%", "0%"]);
<div className="flex justify-between py-20 px-4 md:px-6 lg:px-6 2xl:px-20">
<div>
<div className="flex gap-2 items-end mb-2">
<Image src={logo} alt="logo" width={40} />
<p
className={`${roboto.className} hidden sm:block text-lg text-neutral-600 `}
>
DocX
</p>
</div>
<p className="text-sm text-muted-foreground">
Copyright &copy; 2025 DocX. <br /> All rights reserved.
</p>
</div>

return (
<motion.footer
ref={footerRef}
style={{ y: footerProgress }}
className="flex z-0 justify-between py-20 px-4 md:px-6 lg:px-6 2xl:px-20"
>
<div>
<div className="flex gap-2 items-end mb-2">
<Image src={logo} alt="logo" width={40} />
<p
className={`${roboto.className} hidden sm:block text-lg text-neutral-600 `}
>
DocX
</p>
</div>
<p className="text-sm text-muted-foreground">
Copyright &copy; 2025 DocX. <br /> All rights reserved.
</p>
</div>
<div className="grid grid-cols-3 gap-10 items-start mt-10">
<div className="flex justify-center space-y-4 flex-col">
<a
href="#"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Home
</a>
<a
href="#features"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Features
</a>
<a
href="https://github.com/git-init-priyanshu/Docx"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Open Source
</a>
</div>

<div className="grid grid-cols-3 gap-10 items-start mt-10">
<div className="flex justify-center space-y-4 flex-col">
<a
href="#"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Home
</a>
<a
href="#features"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Features
</a>
<a
href="https://github.com/git-init-priyanshu/Docx"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Open Source
</a>
</div>
<div className="flex justify-center space-y-4 flex-col">
<a className="text-sm text-muted-foreground hover:text-black no-underline">
Privacy Policy
</a>
<a className="text-sm text-muted-foreground hover:text-black no-underline">
Terms of Service
</a>
</div>

<div className="flex justify-center space-y-4 flex-col">
<a className="text-sm text-muted-foreground hover:text-black no-underline">
Privacy Policy
</a>
<a className="text-sm text-muted-foreground hover:text-black no-underline">
Terms of Service
</a>
</div>
<div className="flex justify-center space-y-4 flex-col">
<a
href="https://github.com/git-init-priyanshu"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Github
</a>
<a
href="https://x.com/PriyanshuBartw5"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
X ( Twitter )
</a>
<a
href="https://www.linkedin.com/in/priyanshu-bartwal/"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
LinkedIn
</a>
</div>

<div className="flex justify-center space-y-4 flex-col">
<a
href="https://github.com/git-init-priyanshu"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
Github
</a>
<a
href="https://x.com/PriyanshuBartw5"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
X ( Twitter )
</a>
<a
href="https://www.linkedin.com/in/priyanshu-bartwal/"
target="_blank"
className="text-sm text-muted-foreground hover:text-black no-underline"
>
LinkedIn
</a>
<a
href="https://github.com/git-init-priyanshu/Docx"
target="_blank"
className=" col-span-3 z-10 flex cursor-pointer gap-2 h-10 items-center justify-center rounded-md border bg-background px-4 sm:px-8 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground hover:border-blue-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-muted-foreground"
>
<Star size={18} strokeWidth={2} />
<p>Star us on</p>
<Github size={18} strokeWidth={2} />
</a>
</div>
</div>

<a
href="https://github.com/git-init-priyanshu/Docx"
target="_blank"
className=" col-span-3 z-10 flex cursor-pointer gap-2 h-10 items-center justify-center rounded-md border bg-background px-4 sm:px-8 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground hover:border-blue-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-muted-foreground"
>
<Star size={18} strokeWidth={2} />
<p>Star us on</p>
<Github size={18} strokeWidth={2} />
</a>
</div>
</motion.footer>
</footer>
);
}
16 changes: 7 additions & 9 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import Footer from "./components/Footer";

export default function Component() {
return (
<div className="flex flex-col min-h-[100dvh] overflow-hidden">
<main className="flex-1">
<HeroSection />
<FeaturesSection />
{/* <AboutSection /> */}
{/* <ContactSection /> */}
<Footer />
</main>
</div>
<main className="flex flex-col min-h-[100dvh] overflow-hidden">
<HeroSection />
<FeaturesSection />
{/* <AboutSection /> */}
{/* <ContactSection /> */}
<Footer />
</main>
);
}
2 changes: 1 addition & 1 deletion components/HeroImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function HeroImage() {
});

return (
<div ref={containerRef} className="flex flex-col items-center">
<div ref={containerRef} className="flex flex-col items-center bg-slate-50">
<GridBg
isCursorMaskEnabled={false}
cursorMaskSize={300}
Expand Down
Loading