Skip to content

Commit

Permalink
knjkl
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Jun 17, 2024
1 parent d24e206 commit e96d8ff
Show file tree
Hide file tree
Showing 21 changed files with 914 additions and 70 deletions.
30 changes: 27 additions & 3 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
// `app/page.tsx` is the UI for the `/` URL
export default function Page() {
return <h1>Hello, about page!</h1>;
import Image from "next/image";
import FlipperComponent from "../components/FlipComponent";
import React from "react";
import { FlipWordsDemo } from "../components/FlipWords";
import { AuroraBackgroundHeroSection } from "../components/BackgroundAurra";

export default function Home() {
return (
<main className="antialiased overflow-hidden">
<div className=""></div>
<AuroraBackgroundHeroSection />
<div className="">
<FlipWordsDemo />
</div>
<section className=" m-2 bg-white dark:bg-black dark:text-white">
<div className="">
<div className="flex justify-center items-center min-h-screen bg-gray-100">
<FlipperComponent />
</div>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Nemo dolorem
exercitationem quam ad reiciendis perspiciatis dignissimos ea
assumenda ducimus quasi, non vel quidem, suscipit eius, illo
voluptatibus eaque inventore. Veritatis.
</div>
</section>
</main>
);
}
2 changes: 2 additions & 0 deletions app/components/BackgroundAurra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { motion } from "framer-motion";
import React from "react";
import { AuroraBackground } from "./ui/aurora-background";
import HeroSection from "./heroSection";
import DarkModeToggle from "./DarkModeToggle";

export function AuroraBackgroundHeroSection() {
return (
Expand All @@ -21,6 +22,7 @@ export function AuroraBackgroundHeroSection() {
<div>
<HeroSection />
</div>
<DarkModeToggle />
{/* <div className="text-3xl md:text-7xl font-bold dark:text-white text-center">
Background lights are cool you know.
</div>
Expand Down
18 changes: 18 additions & 0 deletions app/components/DarkModeToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// components/DarkModeToggle.tsx
"use client";
import { useTheme } from "../context/ThemeContext";

const DarkModeToggle = () => {
const { theme, toggleTheme } = useTheme();

return (
<button
onClick={toggleTheme}
className="bg-black dark:bg-white rounded-full w-fit text-white dark:text-black px-4 py-2"
>
Toggle {theme === "light" ? "Dark" : "Light"} Mode
</button>
);
};

export default DarkModeToggle;
10 changes: 4 additions & 6 deletions app/components/FlipComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ const FlipperComponent: React.FC = () => {
}, []);

return (
<div className="flex-col justify-center items-center min-h-screen bg-gray-100">
<h1 className="font-bold text-center text-gray-900 ">
How much should I charge for my
</h1>
<div className="flex-col justify-center items-center">
<h1>hi, I&apos;m</h1>
<div
id="flipper"
className="flipper relative w-40 h-8 perspective-500 flex-1 text-left transform-style-preserve font-bold text-gray-900 "
className="flipper flex border-2 relative bg-transparent h-8 perspective-500 text-left transform-style-preserve font-bold text-gray-900 "
ref={flipperRef}
>
<div
className={`step step0 ${currentStep === 0 ? "set" : "down"} text-gray-900`}
>
template?
Neeraj
</div>
<div
className={`step step1 ${currentStep === 1 ? "set" : "down"} text-gray-900`}
Expand Down
2 changes: 1 addition & 1 deletion app/components/FlipWords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function FlipWordsDemo() {
const words = ["best", "creative", "beautiful", "modern"];

return (
<div className="h-[40rem] flex justify-center items-center bg-white dark:bg-slate-800 px-4">
<div className="h-[40rem] flex justify-center items-center sm:bg-white dark:bg-slate-800 px-4">
<div className="sm:text-4xl text-xl mx-auto font-normal text-neutral-600 dark:bg-white">
Build
<FlipWords words={words} /> <br />
Expand Down
31 changes: 31 additions & 0 deletions app/components/LinkPreview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client";
import React from "react";
import { motion } from "framer-motion";
import { LinkPreview } from "@/components/ui/link-preview";

export function LinkPreviewDemo() {
return (
<div className="flex justify-center items-center h-[40rem] flex-col px-4">
<p className="text-neutral-500 dark:text-neutral-400 text-xl md:text-3xl max-w-3xl mx-auto mb-10">
<LinkPreview url="https://tailwindcss.com" className="font-bold">
Tailwind CSS
</LinkPreview>{" "}
and{" "}
<LinkPreview url="https://framer.com/motion" className="font-bold">
Framer Motion
</LinkPreview>{" "}
are a great way to build modern websites.
</p>
<p className="text-neutral-500 dark:text-neutral-400 text-xl md:text-3xl max-w-3xl mx-auto">
Visit{" "}
<LinkPreview
url="https://ui.aceternity.com"
className="font-bold bg-clip-text text-transparent bg-gradient-to-br from-purple-500 to-pink-500"
>
Aceternity UI
</LinkPreview>{" "}
for amazing Tailwind and Framer Motion components.
</p>
</div>
);
}
5 changes: 5 additions & 0 deletions app/components/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// `app/page.tsx` is the UI for the `/` URL
export function Footer() {
return <h1>Hello, footer page!</h1>;
}
export default Footer;
15 changes: 8 additions & 7 deletions app/components/heroSection.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import FlipperComponent from "./FlipComponent";
import { TextGenerateEffectDemo } from "./textGenerate";
import Image from "next/image";

export function HeroSection() {
return (
<>
<section className="bg-transparent ">
<section className="bg-transparent border-lime-600 h-screen">
<div className="p-1 ">
<figure className="w-auto flex-1 border-blue-500 sm:justify-between sm:flex ">
<div className="md:w-[25vw] h-[18rem] border-lime-600 grid items-center sm:justify-items-end justify-items-center">
<figure className="w-auto flex-1 border-blue-500 sm:justify-between sm:flex sm:border-green-500 ">
<div className="aspact-sqaure md:w-[40vw] h-[18rem] sm:h-[30rem] grid items-center h-atuo border-lime-600 justify-items-center sm:justify-items-end md:justify-items-center">
<Image
src="/me.jpg"
width={350}
height={350}
alt="Picture of the author"
className="rounded h-[8rem] w-[8rem] sm:w-[16rem] sm:h-[16rem] shadow-[0_2.8px_2.2px_rgba(0,_0,_0,_0.034),_0_6.7px_5.3px_rgba(0,_0,_0,_0.048),_0_12.5px_10px_rgba(0,_0,_0,_0.06),_0_22.3px_17.9px_rgba(0,_0,_0,_0.072),_0_41.8px_33.4px_rgba(0,_0,_0,_0.086),_0_100px_80px_rgba(0,_0,_0,_0.12)]"
className="rounded md:h-[18rem] aspact-sqaure boreder-2 sm:w-[18rem] sm:h-[rem] h-[8rem] w-[8rem] shadow-[0_2.8px_2.2px_rgba(0,_0,_0,_0.034),_0_6.7px_5.3px_rgba(0,_0,_0,_0.048),_0_12.5px_10px_rgba(0,_0,_0,_0.06),_0_22.3px_17.9px_rgba(0,_0,_0,_0.072),_0_41.8px_33.4px_rgba(0,_0,_0,_0.086),_0_100px_80px_rgba(0,_0,_0,_0.12)]"
/>
</div>
<div className="m-2 md:w-[70vw] self-end">
<h2 className="font-bold text-[#212121] text-3xl pt-4 pb-2 md:text-4xl lg:text-4xl">
Neeraj Rekwar
<div className="m-2 border-yellow-600 self-end">
<h2 className="font-bold text-[#353535] text-xl pt-4 pb-2 md:text-4xl lg:text-4xl">
<FlipperComponent />
</h2>
<figcaption className="mb-4 md:pb-8 antialiased">
<TextGenerateEffectDemo />
Expand Down
157 changes: 157 additions & 0 deletions app/components/linkPreview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
"use client";
import React from "react";
import { motion } from "framer-motion";
import { LinkPreview } from "@/components/ui/link-preview";

export function LinkPreviewDemo() {
return (
<div className="flex justify-center items-center h-[40rem] flex-col px-4">
<p className="text-neutral-500 dark:text-neutral-400 text-xl md:text-3xl max-w-3xl mx-auto mb-10">
<LinkPreview url="https://tailwindcss.com" className="font-bold">
Tailwind CSS
</LinkPreview>{" "}
and{" "}
<LinkPreview url="https://framer.com/motion" className="font-bold">
Framer Motion
</LinkPreview>{" "}
are a great way to build modern websites.
</p>
<p className="text-neutral-500 dark:text-neutral-400 text-xl md:text-3xl max-w-3xl mx-auto">
Visit{" "}
<LinkPreview
url="https://ui.aceternity.com"
className="font-bold bg-clip-text text-transparent bg-gradient-to-br from-purple-500 to-pink-500"
>
Aceternity UI
</LinkPreview>{" "}
for amazing Tailwind and Framer Motion components.
</p>
</div>
);
}
width = 200,
height = 125,
quality = 50,
layout = "fixed",
isStatic = false,
imageSrc = "",
}: LinkPreviewProps) => {
let src;
if (!isStatic) {
const params = encode({
url,
screenshot: true,
meta: false,
embed: "screenshot.url",
colorScheme: "dark",
"viewport.isMobile": true,
"viewport.deviceScaleFactor": 1,
"viewport.width": width * 3,
"viewport.height": height * 3,
});
src = `https://api.microlink.io/?${params}`;
} else {
src = imageSrc;
}

const [isOpen, setOpen] = React.useState(false);

const [isMounted, setIsMounted] = React.useState(false);

React.useEffect(() => {
setIsMounted(true);
}, []);

const springConfig = { stiffness: 100, damping: 15 };
const x = useMotionValue(0);

const translateX = useSpring(x, springConfig);

const handleMouseMove = (event: any) => {
const targetRect = event.target.getBoundingClientRect();
const eventOffsetX = event.clientX - targetRect.left;
const offsetFromCenter = (eventOffsetX - targetRect.width / 2) / 2; // Reduce the effect to make it subtle
x.set(offsetFromCenter);
};

return (
<>
{isMounted ? (
<div className="hidden">
<Image
src={src}
width={width}
height={height}
quality={quality}
layout={layout}
priority={true}
alt="hidden image"
/>
</div>
) : null}

<HoverCardPrimitive.Root
openDelay={50}
closeDelay={100}
onOpenChange={(open) => {
setOpen(open);
}}
>
<HoverCardPrimitive.Trigger
onMouseMove={handleMouseMove}
className={cn("text-black dark:text-white", className)}
href={url}
>
{children}
</HoverCardPrimitive.Trigger>

<HoverCardPrimitive.Content
className="[transform-origin:var(--radix-hover-card-content-transform-origin)]"
side="top"
align="center"
sideOffset={10}
>
<AnimatePresence>
{isOpen && (
<motion.div
initial={{ opacity: 0, y: 20, scale: 0.6 }}
animate={{
opacity: 1,
y: 0,
scale: 1,
transition: {
type: "spring",
stiffness: 260,
damping: 20,
},
}}
exit={{ opacity: 0, y: 20, scale: 0.6 }}
className="shadow-xl rounded-xl"
style={{
x: translateX,
}}
>
<Link
href={url}
className="block p-1 bg-white border-2 border-transparent shadow rounded-xl hover:border-neutral-200 dark:hover:border-neutral-800"
style={{ fontSize: 0 }}
>
<Image
src={isStatic ? imageSrc : src}
width={width}
height={height}
quality={quality}
layout={layout}
priority={true}
className="rounded-lg"
alt="preview image"
/>
</Link>
</motion.div>
)}
</AnimatePresence>
</HoverCardPrimitive.Content>
</HoverCardPrimitive.Root>
</>
);
};
3 changes: 1 addition & 2 deletions app/components/textGenerate.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use client";
import { TextGenerateEffect } from "./ui/text-generate-effect";

const words = `Oxygen gets you high. In a catastrophic emergency, we're taking giant, panicked breaths. Suddenly you become euphoric, docile. You accept your fate. It's all right here. Emergency water landing, six hundred miles an hour. Blank faces, calm as Hindu cows
`;
const words = `Oxygen gets you high. In a catastrophic emergency, we're taking giant, panicked breaths. Suddenly you become euphoric, docile. You accept your fate. It's all right here. Emergency water landing.`;

export function TextGenerateEffectDemo() {
return <TextGenerateEffect words={words} />;
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/flip-words.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const FlipWords = ({
position: "absolute",
}}
className={cn(
"z-10 inline-block relative text-left text-neutral-900 dark:bg-white px-2",
"z-10 inline-block relative text-left text-neutral-900 sm:text-[#5e716a] dark:bg-white px-2",
className,
)}
key={currentWord}
Expand Down
4 changes: 3 additions & 1 deletion app/components/ui/floating-navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export const FloatingNav = ({
</Link>
))}
<button className="border text-sm font-medium relative border-neutral-200 dark:border-white/[0.2] text-black dark:text-white px-4 py-2 rounded-full">
<span>blog</span>
<span>
<Link href="/blog">blog</Link>
</span>
<span className="absolute inset-x-0 w-1/2 mx-auto -bottom-px bg-gradient-to-r from-transparent via-blue-500 to-transparent h-px" />
</button>
</motion.div>
Expand Down
6 changes: 3 additions & 3 deletions app/components/ui/lamp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const LampContainer = ({
return (
<div
className={cn(
"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-slate-950 w-full rounded-md z-0",
"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-slate-950 w-full z-0",
className,
)}
>
Expand All @@ -48,7 +48,7 @@ export const LampContainer = ({
style={{
backgroundImage: `conic-gradient(var(--conic-position), var(--tw-gradient-stops))`,
}}
className="absolute inset-auto right-1/2 h-56 overflow-visible w-[30rem] bg-gradient-conic from-cyan-500 via-transparent to-transparent text-white [--conic-position:from_70deg_at_center_top]"
className="absolute inset-auto right-1/2 h-56 overflow-visible w-[30rem] bg-gradient-conic from-[#3C6E71] via-transparent to-transparent text-white [--conic-position:from_70deg_at_center_top]"
>
<div className="absolute w-[100%] left-0 bg-slate-950 h-40 bottom-0 z-20 [mask-image:linear-gradient(to_top,white,transparent)]" />
<div className="absolute w-40 h-[100%] left-0 bg-slate-950 bottom-0 z-20 [mask-image:linear-gradient(to_right,white,transparent)]" />
Expand All @@ -64,7 +64,7 @@ export const LampContainer = ({
style={{
backgroundImage: `conic-gradient(var(--conic-position), var(--tw-gradient-stops))`,
}}
className="absolute inset-auto left-1/2 h-56 w-[30rem] bg-gradient-conic from-transparent via-transparent to-cyan-500 text-white [--conic-position:from_290deg_at_center_top]"
className="absolute inset-auto left-1/2 h-56 w-[30rem] bg-gradient-conic from-transparent via-transparent to-[#3C6E71] text-white [--conic-position:from_290deg_at_center_top]"
>
<div className="absolute w-40 h-[100%] right-0 bg-slate-950 bottom-0 z-20 [mask-image:linear-gradient(to_left,white,transparent)]" />
<div className="absolute w-[100%] right-0 bg-slate-950 h-40 bottom-0 z-20 [mask-image:linear-gradient(to_top,white,transparent)]" />
Expand Down
Loading

0 comments on commit e96d8ff

Please sign in to comment.