Skip to content

Commit 7dd3dd1

Browse files
author
Dinesh7899
committed
fix loading page and optimize
1 parent 3e3e93e commit 7dd3dd1

File tree

15 files changed

+403
-304
lines changed

15 files changed

+403
-304
lines changed

app.rar

1.53 KB
Binary file not shown.

app/Intro.tsx

Lines changed: 0 additions & 130 deletions
This file was deleted.

app/Loading.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import useGsapReveal from './useGsapReveal';
3-
import Work from './Work';
4-
import './globals.css';
2+
import useGsapReveal from '../useGsapReveal';
3+
import Work from '../Work';
4+
// import './globals.css';
55

66
interface WorkItem {
77
id: string;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useRef, useEffect } from 'react';
22
import Image from 'next/image';
3-
import Work from './Work';
4-
import './globals.css';
5-
import useGsapReveal from './useGsapReveal';
3+
import Work from '../Work';
4+
// import './globals.css';
5+
import useGsapReveal from '../useGsapReveal';
66
import gsap from 'gsap';
77

88
interface WorkItem {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import useGsapReveal from './useGsapReveal';
2+
import useGsapReveal from '../useGsapReveal';
33

44
interface ExperienceItemProps {
55
startDate: string;

app/components/IntroServer.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import React, { useEffect, useRef } from "react";
2+
import { gsap } from "gsap";
3+
import OptimizedSVG from './OptimizedSVG';
4+
5+
export const IntroServer: React.FC = () => {
6+
const introRef = useRef<HTMLDivElement>(null);
7+
const experience = 1; // years of experience
8+
9+
useEffect(() => {
10+
// Animate the intro text after a delay to sync with SVG animation
11+
if (introRef.current) {
12+
gsap.to(introRef.current, {
13+
opacity: 1,
14+
delay: 1.5,
15+
ease: 'power3.out',
16+
duration: 2
17+
});
18+
}
19+
}, []);
20+
21+
return (
22+
<section id="svgintro" className="intro-section w-full m-0 p-4 sm:p-0">
23+
<div className="svg-container mb-8">
24+
<OptimizedSVG />
25+
</div>
26+
27+
<div className="intro text-left mt-4 max-sm:mt-0 font-matter" ref={introRef} style={{ opacity: 0 }}>
28+
<strong className="pb-8 font-matter font-extrabold">Hey.. My Self S Dinesh Kumar : Code Meets Creativity. <br /></strong>
29+
<p className="leading-relaxed max-sm:text-3xl max-sm:leading-loose font-matter font-medium text-4xl">
30+
I&apos;m a{' '}
31+
<span className="bg-green-100 px-4 py-1 pb-2">
32+
Multidisciplinary
33+
</span>{' '}
34+
full-stack developer from India with {experience} year{experience > 1 ? 's' : ''} of experience who loves building websites that look Modern and work&apos;s{' '}
35+
<span className="bg-sky-100 px-4 py-1 pb-2">
36+
Awesome
37+
</span>. <br />
38+
I enjoy learning new skills and using different tools to create simple,{' '}
39+
<span className="bg-purple-100 px-4 py-1 pb-2">
40+
Creative
41+
</span>{' '}
42+
solutions. <br />
43+
I also love working with others to build the{' '}
44+
<span className="bg-orange-100 px-4 py-1 pb-2">
45+
future
46+
</span>{' '}
47+
together.
48+
</p>
49+
</div>
50+
</section>
51+
);
52+
};

app/components/Loading.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React, { useState, useEffect } from 'react';
2+
import './globals.css';
3+
4+
export const Loading: React.FC = () => {
5+
const [number, setNumber] = useState(1);
6+
const [loading, setLoading] = useState(true);
7+
8+
useEffect(() => {
9+
const interval = setInterval(() => {
10+
setNumber(prevNumber => (prevNumber < 100 ? prevNumber + 5 : 100)); // Faster increment
11+
}, 20); // Faster interval
12+
13+
// Much faster loading completion - 300ms maximum
14+
const timeout = setTimeout(() => {
15+
setLoading(false);
16+
}, 300); // Reduced from 2000ms to 300ms
17+
18+
return () => {
19+
clearInterval(interval);
20+
clearTimeout(timeout);
21+
};
22+
}, []);
23+
24+
if (!loading) {
25+
return null;
26+
}
27+
28+
return (
29+
<div className="loading-container">
30+
<div className="number">{number}</div>
31+
</div>
32+
);
33+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
// import './globals.css';
3+
4+
export const OptimizedLoading: React.FC = () => {
5+
return (
6+
<div className="optimized-loading-container">
7+
<div className="loading-content">
8+
<div className="loading-spinner"></div>
9+
<p className="loading-text">Loading...</p>
10+
</div>
11+
</div>
12+
);
13+
};

0 commit comments

Comments
 (0)