Skip to content

Commit e005967

Browse files
committed
Remove loading text
1 parent 18b67f5 commit e005967

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

frontend/src/components/Animations/Loading.tsx

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,16 @@ import React from 'react'
22
import { motion } from 'framer-motion';
33

44
const Loading = () => {
5-
const [isLoading, setIsLoading] = React.useState(false);
5+
const [isLoading, setIsLoading] = React.useState(true);
66

77
// Toggling the animation durations
88
const loadDuration = 3;
9-
const loadStart = 1;
9+
const loadStart = 0.1;
1010
const loadEnd = 0.5;
1111

12-
// Loading dots animation
13-
const [dots, setDots] = React.useState('');
14-
React.useEffect(() => {
15-
if (!isLoading) return;
16-
17-
const interval = setInterval(() => {
18-
setDots(prev => {
19-
if (prev === '...') return '';
20-
return prev + '.';
21-
});
22-
}, 800);
23-
24-
return () => clearInterval(interval);
25-
}, [isLoading]);
26-
2712
React.useLayoutEffect(() => {
2813

29-
// Only show loading on hard refresh
14+
// Only show loading on initial load
3015
if (!window || !window.sessionStorage) {
3116
setIsLoading(true);
3217
} else {
@@ -64,7 +49,7 @@ const Loading = () => {
6449

6550
return (
6651
<motion.div
67-
initial={{ opacity: 1}}
52+
initial={{ opacity: 1 }}
6853
animate={{ opacity: 0 }}
6954
transition={{
7055
duration: loadEnd,
@@ -75,9 +60,6 @@ const Loading = () => {
7560
willChange: 'opacity',
7661
}}
7762
>
78-
<div className="text-white text-xl mb-4 font-mono pb-5">
79-
Loading{dots}
80-
</div>
8163
<div className="w-80 h-3 bg-gray-700 rounded-full overflow-hidden">
8264
<motion.div
8365
className="h-full bg-gradient-to-r from-blue-400 to-blue-500 rounded-full"

frontend/src/components/Background.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Background = () => {
88
useEffect(() => {
99
const timer = setTimeout(() => {
1010
setShouldLoad(true);
11-
}, 800);
11+
}, 900);
1212

1313
return () => clearTimeout(timer);
1414
}, []);

frontend/src/components/Landing/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import Background from '@/components/Background';
2-
import Navbar from '@/components/Navbar';
32
import Loading from '../Animations/Loading';
43
import FadeInAnimation from '../Animations/FadeInAnimation';
4+
import React from 'react';
55

66
const Landing = () => {
77
const animationSequence = {
8-
navbar: 0.1,
9-
h1: 0.3,
10-
h2: 0.4,
11-
background: 2.2,
8+
h1: 0.1,
9+
h2: 0.2,
10+
background: 2.5,
1211
};
1312

1413
return (
@@ -17,9 +16,6 @@ const Landing = () => {
1716
id="landing"
1817
>
1918
<Loading />
20-
<FadeInAnimation delay={animationSequence.navbar} yInitial={-30}>
21-
<Navbar />
22-
</FadeInAnimation>
2319
<FadeInAnimation
2420
delay={animationSequence.background}
2521
yInitial={0}

0 commit comments

Comments
 (0)