Skip to content

Commit

Permalink
fda
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Jul 5, 2024
1 parent eabf860 commit 2f62f0d
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ run = ["sh", "-c", "npm run dev"]
[[ports]]
localPort = 3000
externalPort = 80

[[ports]]
localPort = 3001
externalPort = 3001
42 changes: 42 additions & 0 deletions app/components/AutoPlayAudio.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use client'
import { useEffect, useRef, useState } from 'react';

const AutoPlayAudio = () => {
const audioRef = useRef<HTMLAudioElement>(null);
const [isPlaying, setIsPlaying] = useState(false);

const handlePlay = async () => {
if (audioRef.current) {
try {
await audioRef.current.play();
setIsPlaying(true);
} catch (err) {
console.error('Failed to play audio:', err);
}
}
};

const handlePause = () => {
if (audioRef.current) {
audioRef.current.pause();
setIsPlaying(false);
}
};

useEffect(() => {
handlePlay();
}, []);

return (
<div>
<audio ref={audioRef} src="/background-audio.mp3" />
{isPlaying ? (
<button onClick={handlePause}>Pause</button>
) : (
<button onClick={handlePlay}>Play</button>
)}
</div>
);
};

export default AutoPlayAudio;
43 changes: 29 additions & 14 deletions app/components/CurrentTime.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
'use client'
import { useEffect, useState } from 'react';
"use client";
import { useEffect, useState } from "react";

const CurrentTime: React.FC = () => {
const [currentTime, setCurrentTime] = useState<string>('');
const [currentTime, setCurrentTime] = useState<string>("");
const [curDay, setCurDay] = useState<string>("");

useEffect(() => {
const updateTime = () => {
const now = new Date();
const formattedTime = new Intl.DateTimeFormat('en-US', {
weekday: 'short',
era: 'long',
hour: 'numeric',
minute:"numeric",
hour12: true ,
dayPeriod: 'short',
const formattedTime = new Intl.DateTimeFormat("en-US", {
hour: "2-digit",
hour12: true,
dayPeriod: "short",

}).format(now);
setCurrentTime(formattedTime);
};

updateTime(); // Initial call to set the time immediately
const intervalId = setInterval(updateTime, 1000); // Update time every second

return () => clearInterval(intervalId); // Cleanup interval on component unmount
}, []);

return <div
className='font-bold'
>{currentTime}</div>;
useEffect(() => {
const updateDay = () => {
const now = new Date();
const formattedDay = new Intl.DateTimeFormat("en-US", {
weekday: 'short',
}).format(now);
setCurDay(formattedDay);
};
updateDay(); // Initial call to set the day immediately
const intervalId = setInterval(updateDay, 1000); // Update day every second
return () => clearInterval(intervalId); // Cleanup interval on component unmount
}, []);
return (
<>
<div className="flex gap-1">
<div className="font-bold sm:text-2xl">{curDay}</div>
<div className="font-bold sm:text-4xl">{currentTime}</div>
</div>
</>
);
};

export default CurrentTime;
113 changes: 103 additions & 10 deletions app/components/StickyRelativeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
import { NextPage } from "next";
import Image from "next/image";
import DotCircle from "./acceries/DotCircle";
import Link from "next/link";

const StickyRelativeDemo: NextPage = () => {
return (
<div className="m-auto justify-between p-2 max-h-fit max-w-6xl border-green-500">
<div className="m-auto justify-between p-2 max-h-fit max-w-6xl border-green-500">
<div className="jutify-start flex items-center border-rose-500 py-4 font-semibold text-[#242424] sm:text-4xl">
<DotCircle />
Recent projects
</div>
<div className="relative text-primary m-auto min-h-full max-w-7xl flex-col justify-evenly border-blue-400 sm:flex sm:flex-row">
<div className="b 1 relative top-0 flex min-h-full basis-1/2 flex-col justify-between border-rose-500 sm:gap-10">
<div className="sticky top-0 pt-10 items-center justify-center border-green-500">
<div className="relative visible top-0 flex min-h-full basis-1/2 flex-col justify-between border-rose-500 sm:gap-10">
<div className="sticky top-0 will-change-transform overflow-hidden z-10 pt-10 items-center justify-center border-green-500">
<div className="flex flex-wrap border-yellow-400">
<div className=" mb-4 max-w-fit rounded-full border-blue-500 bg-blue-200 px-3 py-1 text-sm">
2021
</div>
</div>
<div className="border-yellow-400">
<div className="border-yellow-400 sm:pr-10">
<div className="max-w-2xl border-green-600">
<h2 className="text-2xl font-semibold">
<h2 className="text-2xl font-semibold text-gray-light">
Craft &amp; Code: Building the Future, One Line at a Time
</h2>
<p>
Expand All @@ -31,11 +32,103 @@ const StickyRelativeDemo: NextPage = () => {
inventore porro?
</p>
</div>
Sticky Div
<div className="text-xs">
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Role</li>
<li>Digital Marketing</li>
</ul>
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Deliverables</li>
<li>Survey checks</li>
</ul>
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Company</li>
<li>Veecrew Market Research pvt. ltd.</li>
</ul>
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Visit Site</li>
<li>
<Link href="https://veecrew.com"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-arrow-right"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /><path d="M13 18l6 -6" /><path d="M13 6l6 6" /></svg></Link>
</li>
</ul>
</div>
</div>
</div>
</div>
<div className="relative basis-1/2 pt-10 overflow-hidden border-rose-500">
<div className=" mb-4 max-w-fit rounded-full border-blue-500 bg-blue-200 px-3 py-1 text-sm">
showcase
</div>
<div className="grid gap-4 p-2 pt-4 sm:gap-10">
<Image
src={"/projects/mypro.png"}
alt={"My Profile Picture"}
width={300}
height={300}
className="min-w-full min-h-full rounded-2xl "
/>
<Image
src={"/projects/mypro.png"}
alt={"My Profile Picture"}
width={300}
height={300}
className="min-w-full min-h-full rounded-2xl "
/>
<Image
src={"/projects/mypro.png"}
alt={"My Profile Picture"}
width={300}
height={300}
className="min-w-full min-h-full rounded-2xl "
/>
</div>
</div>
</div>
<div className="relative text-primary m-auto min-h-full max-w-7xl flex-col justify-evenly border-blue-400 sm:flex sm:flex-row">
<div className="relative visible top-0 flex min-h-full basis-1/2 flex-col justify-between border-rose-500 sm:gap-10">
<div className="sticky top-0 will-change-transform overflow-hidden z-10 pt-10 items-center justify-center border-green-500">
<div className="flex flex-wrap border-yellow-400">
<div className=" mb-4 max-w-fit rounded-full grid justify-center px-3 py-1 text-sm">
2021
</div>
</div>
<div className="border-yellow-400 sm:pr-10">
<div className="max-w-2xl border-green-600">
<h2 className="text-2xl font-semibold text-gray-light">
Craft &amp; Code: Building the Future, One Line at a Time
</h2>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Repudiandae quo natus accusantium eius molestiae expedita
possimus accusamus, aspernatur, quia quae asperiores
inventore. Quod, officia vel aliquam exercitationem est
inventore porro?
</p>
</div>
<div className="text-xs">
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Role</li>
<li>Digital Marketing</li>
</ul>
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Deliverables</li>
<li>Survey checks</li>
</ul>
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Company</li>
<li>Veecrew Market Research pvt. ltd.</li>
</ul>
<ul className="font-semibold flex justify-between text-gray-light py-6 border-b-2 border-dark">
<li>Visit Site</li>
<li>
<Link href="https://veecrew.com"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-arrow-right"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /><path d="M13 18l6 -6" /><path d="M13 6l6 6" /></svg></Link>
</li>
</ul>
</div>
</div>
</div>
</div>
<div className="relative basis-1/2 pt-10 border-rose-500">
<div className="relative basis-1/2 pt-10 overflow-hidden border-rose-500">
<div className=" mb-4 max-w-fit rounded-full border-blue-500 bg-blue-200 px-3 py-1 text-sm">
showcase
</div>
Expand All @@ -46,21 +139,21 @@ const StickyRelativeDemo: NextPage = () => {
width={300}
height={300}
className="min-w-full min-h-full rounded-2xl "
/>
/>
<Image
src={"/projects/mypro.png"}
alt={"My Profile Picture"}
width={300}
height={300}
className="min-w-full min-h-full rounded-2xl "
/>
/>
<Image
src={"/projects/mypro.png"}
alt={"My Profile Picture"}
width={300}
height={300}
className="min-w-full min-h-full rounded-2xl "
/>
/>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/TextFlipper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const TextFlipper: React.FC = () => {
}, []);

return (
<div className="inline-flex text-left lg:h-24 font-bold ">
<div className="inline-flex text-left md:h-20 lg:h-24 font-bold ">
<motion.div
key={index}
initial={{ opacity: 0, y: -20 }}
Expand Down
2 changes: 1 addition & 1 deletion app/components/homeTextFlip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const HomeTextFlip: React.FC = () => {
return (
<div className="">
<div
id="flipper"

className="flipper text-white relative bg-transparent perspective-500 text-left transform-style-preserve w-full dark:text-white text-gray-900 "
ref={flipperRef}
>
Expand Down
2 changes: 2 additions & 0 deletions app/components/introSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import AutoPlayAudio from "./AutoPlayAudio";
import StickyRelativeDemo from "./StickyRelativeDemo";
import { TypewriterEffectSmoothDemo } from "./typeWriter";

Expand All @@ -8,6 +9,7 @@ export default function IntroSection() {
return (
<>
<TypewriterEffectSmoothDemo />

<StickyRelativeDemo />
</>
);
Expand Down
2 changes: 1 addition & 1 deletion app/components/typeWriter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function TypewriterEffectSmoothDemo() {
},
{
text: "neeraj rekwar.",
className: "text-[#5e716a] dark:text-[#5e716a] ",
className: "text-dark",
},
];
return (
Expand Down
4 changes: 2 additions & 2 deletions app/components/ui/typewriter-effect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const TypewriterEffect = ({
repeatType: "reverse",
}}
className={cn(
"inline-block rounded-sm w-[4px] h-4 md:h-6 lg:h-10 bg-[#5e716a]",
"inline-block rounded-sm w-[4px] h-4 md:h-6 lg:h-10 bg-dark",
cursorClassName,
)}
></motion.span>
Expand Down Expand Up @@ -176,7 +176,7 @@ export const TypewriterEffectSmooth = ({
repeatType: "reverse",
}}
className={cn(
"block rounded-sm w-[4px] h-4 sm:h-6 xl:h-12 bg-[#5e716a]",
"block rounded-sm w-[4px] h-4 sm:h-6 xl:h-12 bg-dark ",
cursorClassName,
)}
></motion.span>
Expand Down
10 changes: 5 additions & 5 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
@tailwind utilities;
@import './add.css';
:root {
--color-primary: #242424;
--color-secondary: #182e2f3c;
--color-white: #ffffff;
--color-gray-light: #d9d9d9;
--color-dark: #ffdd00;
--color-primary: #0B3948;
--color-secondary: #416165;
--color-white: #B3FFB3;
--color-gray-light: #D1FFD7;
--color-dark: #FFC800;
}


Expand Down
9 changes: 6 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

import { Inter } from "next/font/google";
import { Alata } from "next/font/google";
import "./globals.css";
import "./add.css";
import { FloatingNavDemo } from "./components/floatingNavBar";
import { ThemeProvider } from "./context/ThemeContext";
import Footer from "./components/footer";
const inter = Inter({ subsets: ["latin"] });
const alata = Alata({
weight: '400',
subsets: ['latin'],
});


export default function RootLayout({
Expand All @@ -16,7 +19,7 @@ export default function RootLayout({

return (
<html lang="en">
<body className={inter.className}>
<body className={alata.className}>
<FloatingNavDemo />
<ThemeProvider>{children}</ThemeProvider>

Expand Down
Loading

0 comments on commit 2f62f0d

Please sign in to comment.