Skip to content

Commit

Permalink
khkjh
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Aug 11, 2024
1 parent b3e4675 commit 9f2fb2d
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .breakpoints
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"id": "e48f555d-1d43-4c65-9f76-39c5531c4d0b",
"line": 4,
"version": 25,
"version": 1,
"index": 82
}
]
Expand Down
2 changes: 1 addition & 1 deletion app/components/BackgroundAurra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function AuroraBackgroundDemo() {
</motion.p>

<motion.div className="text-secondaryText gap-2 mt-10 max-w-fit flex justify-center items-center">
<Link href={"https://30aa5c6f-6042-4c2c-81d7-31c35b2645cc-00-3ar3cv14cwkdk.pike.replit.dev/"} rel="preload" className="relative z-10 ">
<Link href={"https://9ee5869e-fad4-4ad2-964a-e146d6cf6d4d-00-26iczlozr3pya.sisko.replit.dev/about"} rel="preload" className="relative z-10 ">
<motion.button
whileHover={{ scale: 1.1 }}
whileFocus={{ scale: 1.1 }}
Expand Down
69 changes: 69 additions & 0 deletions app/components/BusinessCatalog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { useState } from 'react';
import { motion } from 'framer-motion';

interface BusinessStats {
label: string;
value: number;
}

const stats: BusinessStats[] = [
{ label: 'Clients', value: 120 },
{ label: 'Global Projects', value: 50 },
{ label: 'Satisfied Customers', value: 300 },
{ label: 'Years of Experience', value: 10 },
];

const BusinessCatalog = () => {
return (
<motion.div
className="grid border grid-cols-2 sm:flew-wrap md:flex text-four justify-around items-center">
{stats.map((stat) => (
<motion.div
key={stat.label}
variants={item}
className="text-center m-4 p-4 shadow-md rounded-lg"
whileInView={{ opacity: 1 }}
initial={{ opacity: 0 }}
viewport={{ once: true, amount: 0.5 }} // Trigger when 50% in view
>
<Counter targetValue={stat.value} />
<p className="text-sm">{stat.label}</p>
</motion.div>
))}
</motion.div>
);
};



const Counter = ({ targetValue }: { targetValue: number }) => {
const [count, setCount] = useState(0);

const startCounting = () => {
let currentValue = 0;
const increment = Math.ceil(targetValue / 100);
const interval = setInterval(() => {
currentValue += increment;
if (currentValue >= targetValue) {
currentValue = targetValue;
clearInterval(interval);
}
setCount(currentValue);
}, 20);
};

return (
<motion.h3

className="text-xl font-bold"
whileInView={{ opacity: 1 }}
initial={{ opacity: 0 }}
viewport={{ once: true }}
onViewportEnter={startCounting}
>
{count}
</motion.h3>
);
};

export default BusinessCatalog;
30 changes: 17 additions & 13 deletions app/components/ShootingVsStarts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import Link from "next/link";
import { ShootingStars } from "./ui/shooting-stars";
import { StarsBackground } from "./ui/stars-background";
import AutoTyper from "./AutoTyper";
import BusinessCatalog from "./BusinessCatalog";

export function ShootingStarsAndStarsBackgroundDemo() {
return (
<div className="bg-black flex flex-col items-center justify-center relative w-full">
<figure className="w-auto z-10 min-h-screen justify-center border-blue-500 sm:justify-evenly items-center sm:flex md:flex-row-reverse sm:border-green-500">
<div className="bg-black min-h-screen flex flex-col items-center justify-center relative w-full">
<figure className="w-auto z-10 lg:flex-col justify-center border-blue-500 sm:justify-evenly items-center sm:flex md:flex-row-reverse sm:border-green-500">
<div className=" md:flex md:flex-row-reverse max-w-6xl ">
<motion.div
initial={{ opacity: 0, scale: 0.2, x: -200, y: -200 }}
Expand Down Expand Up @@ -41,7 +42,7 @@ export function ShootingStarsAndStarsBackgroundDemo() {
delay: 0.5,
ease: [0, 0.71, 0.2, 1.01],
}}
className="text-xl text-[#E0F2E9] m-2 mx-8 md:text-3xl">
className="text-xl bg-clip-text text-transparent bg-gradient-to-br from-pink-200 from-10% via-purple-300 from-10% to-blue-500 from-10%m-2 px-8 py-4 md:text-3xl">
<p className="font-normal">Hello, World!</p>
<div className="text-2xl md:text-4xl lg:text-5xl flex">
<p className="pr-2">I am</p>
Expand All @@ -55,7 +56,7 @@ export function ShootingStarsAndStarsBackgroundDemo() {
</div>
<div className="text-base text-[#E0F2E9] md:mt-10 flex gap-2 md:text-xl m-2 mx-8 ">
<motion.button
className="box"
className="box p-2 px-4 rounded-full shadow-[inset_4px_10px_7px_2px_#e8c8ff4a] bg-seven"
initial={{ opacity: 0, scale: 0.2, x: -200, y: -200 }}
animate={{ opacity: 1, scale: 1, x: 0, y: 0 }}
transition={{
Expand All @@ -69,14 +70,14 @@ export function ShootingStarsAndStarsBackgroundDemo() {
>
<Link
href="/contact"
className="p-2 px-4 rounded-full
bg-five text-primary"
className="p-2 px-4 rounded-full
bg-clip-text text-transparent bg-gradient-to-br from-pink-200 from-10% via-purple-300 from-10% to-blue-500 from-10% "
>
Let&apos;s talk
</Link>
</motion.button>
<motion.button
className="box"
className=" box p-2 px-4 rounded-full shadow-[inset_4px_10px_7px_2px_#e8c8ff4a] bg-seven"
initial={{ opacity: 0, scale: 0.2, x: -200, y: -200 }}
animate={{ opacity: 1, scale: 1, x: 0, y: 0 }}
transition={{
Expand All @@ -89,8 +90,8 @@ export function ShootingStarsAndStarsBackgroundDemo() {
>
<Link
href="/contact"
className="p-2 px-4 rounded-full
bg-five text-primary"
className=" rounded-full
bg-clip-text text-transparent bg-gradient-to-br from-pink-200 from-10% via-purple-300 from-10% to-blue-500 from-10% "
>
Cantact{" "}
</Link>
Expand All @@ -108,7 +109,7 @@ export function ShootingStarsAndStarsBackgroundDemo() {
delay: 2,
duration: 5,
}}
className=" p-2 m-1 bg-seven rounded-full flex justify-center items-center"
className=" p-2 m-1 shadow-[inset_1px_4px_7px_2px_var(--four)] bg-seven rounded-full flex justify-center items-center"
>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -141,7 +142,7 @@ export function ShootingStarsAndStarsBackgroundDemo() {
duration: 5,
}}

className="p-2 m-1 bg-seven rounded-full flex justify-center items-center"
className="p-2 m-1 shadow-[inset_2px_4px_7px_2px_var(--four)] bg-seven rounded-full flex justify-center items-center"
>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -172,7 +173,7 @@ export function ShootingStarsAndStarsBackgroundDemo() {
delay: 4,
duration: 5,
}}
className="p-2 m-1 bg-seven rounded-full flex justify-center items-center"
className="p-2 m-1 shadow-[inset_2px_4px_7px_2px_var(--four)] bg-seven rounded-full flex justify-center items-center"
>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -202,7 +203,7 @@ export function ShootingStarsAndStarsBackgroundDemo() {
delay: 5,
duration: 5,
}}
className="p-2 m-1 bg-seven rounded-full flex justify-center items-center"
className="p-2 m-1 shadow-[inset_2px_4px_7px_2px_var(--four)] bg-seven rounded-full flex justify-center items-center"
>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -230,6 +231,9 @@ export function ShootingStarsAndStarsBackgroundDemo() {
</div>

</div>
<div className="border flex justify-center items-center">
<BusinessCatalog />
</div>
</figure>
<ShootingStars />
<StarsBackground />
Expand Down

0 comments on commit 9f2fb2d

Please sign in to comment.