Skip to content

Commit

Permalink
adjusted drafts page
Browse files Browse the repository at this point in the history
  • Loading branch information
chuma-beep committed Dec 9, 2024
1 parent 9101aa9 commit 86e1e4c
Show file tree
Hide file tree
Showing 3 changed files with 275 additions and 6 deletions.
110 changes: 110 additions & 0 deletions app/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import DeployButton from "../components/LogoButton";
import AuthButton from "../components/AuthButton";
import MainFooter from "@/components/main-footer";
import { WriteIcon } from '@/components/WriteIcon';
import Search from '@/components/Search/Search'
import { ModeToggle } from "@/components/toggle-theme";
import { HeroParallax } from "@/components/ui/heroparallax";


export default function LandingPage(){
return <HeroParallax products={products} />
}

export const products = [
{
title: "Moonbeam",
link: "https://gomoonbeam.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/moonbeam.png",
},
{
title: "Cursor",
link: "https://cursor.so",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/cursor.png",
},
{
title: "Rogue",
link: "https://userogue.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/rogue.png",
},

{
title: "Editorially",
link: "https://editorially.org",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/editorially.png",
},
{
title: "Editrix AI",
link: "https://editrix.ai",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/editrix.png",
},
{
title: "Pixel Perfect",
link: "https://app.pixelperfect.quest",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/pixelperfect.png",
},

{
title: "Algochurn",
link: "https://algochurn.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/algochurn.png",
},
{
title: "Aceternity UI",
link: "https://ui.aceternity.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/aceternityui.png",
},
{
title: "Tailwind Master Kit",
link: "https://tailwindmasterkit.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/tailwindmasterkit.png",
},
{
title: "SmartBridge",
link: "https://smartbridgetech.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/smartbridge.png",
},
{
title: "Renderwork Studio",
link: "https://renderwork.studio",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/renderwork.png",
},

{
title: "Creme Digital",
link: "https://cremedigital.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/cremedigital.png",
},
{
title: "Golden Bells Academy",
link: "https://goldenbellsacademy.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/goldenbellsacademy.png",
},
{
title: "Invoker Labs",
link: "https://invoker.lol",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/invoker.png",
},
{
title: "E Free Invoice",
link: "https://efreeinvoice.com",
thumbnail:
"https://aceternity.com/images/products/thumbnails/new/efreeinvoice.png",
},
];


12 changes: 6 additions & 6 deletions app/protected/account/drafts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ export default function Drafts() {
return (
<div className="w-full max-w-4xl mx-auto py-8 px-4 md:px-6">
<ToastContainer />
<Card className="flex flex-col p-2 pt-4 w-full">
<div className="flex items-center justify-between mb-6">
<h1 className="text-2xl font-bold">Drafts</h1>
<h1 className="text-2xl font-bold ml-6">Your Drafts</h1>
{/* <Button size="sm">Add New</Button> */}
</div>
<div className="grid gap-4">
{drafts.map((draft) => (
<Card
<CardContent
key={draft.id}
className="transition-transform transform hover:scale-105 hover:shadow-lg"
>
Expand All @@ -153,7 +153,7 @@ export default function Drafts() {
<img
src={draft.cover_image_url}
alt={draft.title || "Cover Image"}
className="object-cover w-full h-full"
className="object-cover w-full h-full rounded-md"
/>
</div>
)}
Expand Down Expand Up @@ -197,9 +197,9 @@ export default function Drafts() {
Delete
</Button>
</CardFooter>
</Card>
</CardContent>
))}
</div>
</Card>
</div>
);
}
Expand Down
159 changes: 159 additions & 0 deletions components/ui/heroparallax.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
"use client";
import React from "react";
import {
motion,
useScroll,
useTransform,
useSpring,
MotionValue,
} from "framer-motion";
import Image from "next/image";
import Link from "next/link";

export const HeroParallax = ({
products,
}: {
products: {
title: string;
link: string;
thumbnail: string;
}[];
}) => {
const firstRow = products.slice(0, 5);
const secondRow = products.slice(5, 10);
const thirdRow = products.slice(10, 15);
const ref = React.useRef(null);
const { scrollYProgress } = useScroll({
target: ref,
offset: ["start start", "end start"],
});

const springConfig = { stiffness: 300, damping: 30, bounce: 100 };

const translateX = useSpring(
useTransform(scrollYProgress, [0, 1], [0, 1000]),
springConfig
);
const translateXReverse = useSpring(
useTransform(scrollYProgress, [0, 1], [0, -1000]),
springConfig
);
const rotateX = useSpring(
useTransform(scrollYProgress, [0, 0.2], [15, 0]),
springConfig
);
const opacity = useSpring(
useTransform(scrollYProgress, [0, 0.2], [0.2, 1]),
springConfig
);
const rotateZ = useSpring(
useTransform(scrollYProgress, [0, 0.2], [20, 0]),
springConfig
);
const translateY = useSpring(
useTransform(scrollYProgress, [0, 0.2], [-700, 500]),
springConfig
);
return (
<div
ref={ref}
className="h-[300vh] py-40 overflow-hidden antialiased relative flex flex-col self-auto [perspective:1000px] [transform-style:preserve-3d]"
>
<Header />
<motion.div
style={{
rotateX,
rotateZ,
translateY,
opacity,
}}
className=""
>
<motion.div className="flex flex-row-reverse space-x-reverse space-x-20 mb-20">
{firstRow.map((product) => (
<ProductCard
product={product}
translate={translateX}
key={product.title}
/>
))}
</motion.div>
<motion.div className="flex flex-row mb-20 space-x-20 ">
{secondRow.map((product) => (
<ProductCard
product={product}
translate={translateXReverse}
key={product.title}
/>
))}
</motion.div>
<motion.div className="flex flex-row-reverse space-x-reverse space-x-20">
{thirdRow.map((product) => (
<ProductCard
product={product}
translate={translateX}
key={product.title}
/>
))}
</motion.div>
</motion.div>
</div>
);
};

export const Header = () => {
return (
<div className="max-w-7xl relative mx-auto py-20 md:py-40 px-4 w-full left-0 top-0">
<h1 className="text-2xl md:text-7xl font-bold dark:text-white">
The Ultimate <br /> development studio
</h1>
<p className="max-w-2xl text-base md:text-xl mt-8 dark:text-neutral-200">
We build beautiful products with the latest technologies and frameworks.
We are a team of passionate developers and designers that love to build
amazing products.
</p>
</div>
);
};

export const ProductCard = ({
product,
translate,
}: {
product: {
title: string;
link: string;
thumbnail: string;
};
translate: MotionValue<number>;
}) => {
return (
<motion.div
style={{
x: translate,
}}
whileHover={{
y: -20,
}}
key={product.title}
className="group/product h-96 w-[30rem] relative flex-shrink-0"
>
<Link
href={product.link}
className="block group-hover/product:shadow-2xl "
>
<Image
src={product.thumbnail}
height="600"
width="600"
className="object-cover object-left-top absolute h-full w-full inset-0"
alt={product.title}
/>
</Link>
<div className="absolute inset-0 h-full w-full opacity-0 group-hover/product:opacity-80 bg-black pointer-events-none"></div>
<h2 className="absolute bottom-4 left-4 opacity-0 group-hover/product:opacity-100 text-white">
{product.title}
</h2>
</motion.div>
);
};

0 comments on commit 86e1e4c

Please sign in to comment.