Skip to content

Commit

Permalink
add: banner ; change: logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Shobhit-Nagpal committed Nov 4, 2024
1 parent 945fd9e commit c10c163
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 9 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"canvas": "^2.11.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^11.11.11",
"lucide-react": "^0.427.0",
"next": "14.2.5",
"next-themes": "^0.3.0",
Expand Down
Binary file added public/images/gssoc-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Toaster } from "@/components/ui/toaster";
import "./globals.css";
import Navbar from "@/components/navbar";
import { ThemeProvider } from "@/components/theme-provider";
import StarBanner from "@/components/star-banner";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -27,7 +28,10 @@ export default function RootLayout({
disableTransitionOnChange
>
<Navbar />
<div className="pt-16">{children}</div>
<div className="pt-16">
<StarBanner />
{children}
</div>
<Toaster />
</ThemeProvider>
</body>
Expand Down
7 changes: 3 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"use client";
import ImageTextForm from '@/components/image-text-form'
import Navbar from '@/components/navbar';
import ImageTextForm from "@/components/image-text-form";

export default function Home() {
return (
<main className="p-4 flex flex-col items-center">
<main className="mt-8 p-4 flex flex-col items-center">
<h1 className="text-2xl font-bold mb-4">GSSoC Stats Generator</h1>
<ImageTextForm />
</main>
)
);
}
8 changes: 4 additions & 4 deletions src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default function Navbar() {
>
<Image
alt="GSSoC Logo"
src="/images/logo.png"
width={10}
height={10}
className="h-12 w-12 text-white"
src="/images/gssoc-logo.png"
width={130}
height={130}
className="h-full w-full text-white"
/>
</Link>
<div className="ml-auto flex items-center justify-center gap-4">
Expand Down
24 changes: 24 additions & 0 deletions src/components/star-banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import StarRepoButton from "./star-repo-button";

const StarBanner = () => {
return (
<>
<div
className={`w-full left-0 right-0 top-0 z-50 transition-all duration-300 ease-in-out`}
>
<div className="flex w-full items-center justify-center gap-x-6 bg-orange-500 px-6 py-3 sm:px-3.5">
<div className="flex flex-col md:flex-row gap-y-4 items-center gap-x-4 text-sm font-medium leading-6 text-white">
<p className="font-bold md:text-lg text-center">
Generate your GSSoC certificate and support us with a star!
</p>
<StarRepoButton />
</div>
</div>
</div>
</>
);
};

export default StarBanner;
52 changes: 52 additions & 0 deletions src/components/star-repo-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { motion } from "framer-motion";
import { Star } from "lucide-react";
import Link from "next/link";

const StarRepoButton = () => {
return (
<motion.button
className="inline-flex overflow-hidden rounded-lg bg-[linear-gradient(120deg,#FF7F50_calc(var(--shimmer-button-x)-25%),#f6f6f6_var(--shimmer-button-x),#FF7F50_calc(var(--shimmer-button-x)+25%))] [--shimmer-button-x:0%]"
initial={
{
scale: 1,
"--shimmer-button-x": "-100%",
} as any
}
animate={
{
"--shimmer-button-x": "200%",
} as any
}
transition={{
stiffness: 500,
damping: 20,
type: "spring",
"--shimmer-button-x": {
duration: 3,
repeat: Infinity,
ease: [0.445, 0.05, 0.55, 0.95],
},
}}
whileTap={{
scale: 0.95,
}}
whileHover={{
scale: 1.05,
}}
>
<span className="m-[0.125rem] rounded-[calc(0.5rem-0.125rem)] bg-gray-500 px-4 py-1 text-xs text-white backdrop-blur-sm">
<Link
href="https://github.com/Shobhit-Nagpal/gssoc-stats-gen"
target="_blank"
>
<div className="flex items-center justify-center">
<Star className="h-5 w-5 mr-2" />
<span className="font-bold md:text-base">Star Repo</span>
</div>
</Link>
</span>
</motion.button>
);
};

export default StarRepoButton;

0 comments on commit c10c163

Please sign in to comment.