Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"axios": "^1.13.2",
"clsx": "^2.1.1",
"framer-motion": "^12.23.26",
"pretendard": "^1.3.9",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-router-dom": "^7.11.0",
Expand Down
Binary file added src/assets/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 0 additions & 30 deletions src/assets/icons/logo.svg

This file was deleted.

Binary file added src/assets/icons/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 30 additions & 1 deletion src/components/Splash/Splash.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
import { useEffect, useState } from 'react';
import SplashIn from './SplashIn';
import SplashOut from './SplashOut';
import useNavigation from '../../hooks/useNavigation';

const Splash = () => {
return <></>;
const [showIn, setShowIn] = useState(true);
const [showOut, setShowOut] = useState(false);
const { goTo } = useNavigation();

useEffect(() => {
const timers: number[] = [];

timers.push(setTimeout(() => setShowOut(true), 350));
timers.push(setTimeout(() => setShowIn(false), 1200));

return () => timers.forEach(clearTimeout);
}, []);

return (
<div className="relative w-full min-h-dvh overflow-hidden">
{showIn && <SplashIn />}
{showOut && (
<SplashOut
onFinish={() => {
goTo('/home');
}}
/>
)}
</div>
);
};

export default Splash;
11 changes: 11 additions & 0 deletions src/components/Splash/SplashIn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Logo from '../../assets/icons/logo.png';

const SplashIn = () => {
return (
<div className="w-full min-h-dvh flex justify-center items-center overflow-hidden">
<img src={Logo} alt="logo" className="w-[11.2rem] animate-logo-tilt" />
</div>
);
};

export default SplashIn;
52 changes: 52 additions & 0 deletions src/components/Splash/SplashOut.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { useEffect, useState } from 'react';
import clsx from 'clsx';
import Logo2 from '../../assets/icons/logo2.png';

const SplashOut = ({ onFinish }: { onFinish: () => void }) => {
const [show, setShow] = useState(false);
const [fadeOut, setFadeOut] = useState(false);

useEffect(() => {
requestAnimationFrame(() => setShow(true));

const fadeTimer = setTimeout(() => {
setFadeOut(true);
}, 800);

const endTimer = setTimeout(() => {
onFinish();
}, 1200);

return () => {
clearTimeout(fadeTimer);
clearTimeout(endTimer);
};
}, [onFinish]);

return (
<div className="absolute top-0 left-0 w-full min-h-dvh z-40 pointer-events-none">
<div
className={clsx(
'absolute top-0 left-0 w-full min-h-dvh bg-main opacity-0 transition-opacity duration-700',
show && !fadeOut && 'opacity-100',
fadeOut && 'opacity-0',
)}
/>

<div className="relative w-full min-h-dvh flex items-center justify-center">
<div
className={clsx(
'flex items-center gap-[1.4rem] opacity-0',
show && !fadeOut && 'animate-splash-fade',
fadeOut && 'opacity-0',
)}
>
<img src={Logo2} alt="logo" className="w-20" />
<p className="text-white font-bold text-[5rem]">Cotatus</p>
</div>
</div>
</div>
);
};

export default SplashOut;
4 changes: 2 additions & 2 deletions src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import Chart from './components/Chart/Chart';

const Home = () => {
return (
<>
<div className="px-[1.6rem]">
<Navbar />
<Banner />
<ListFilter />
<Chart />
<ListSite />
<Alert />
</>
</div>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/notFound/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Logo from '../../assets/icons/logo.svg';
import Logo from '../../assets/icons/logo.png';
import useNavigation from '../../hooks/useNavigation';

const NotFound = () => {
Expand Down
5 changes: 4 additions & 1 deletion src/styles/base.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@layer base {
:root {
--vh: 100%;
--font-family: 'Pretendard-Regular';
--font-family:
'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Apple SD Gothic Neo', 'Noto Sans KR', Arial, sans-serif;
}

html {
Expand Down Expand Up @@ -67,6 +69,7 @@

button {
@apply cursor-pointer p-0;
font-family: inherit;
}

textarea {
Expand Down
8 changes: 1 addition & 7 deletions src/styles/fonts.css
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
@font-face {
font-family: 'Pretendard-Regular';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Regular.woff')
format('woff');
font-weight: 400;
font-style: normal;
}
@import 'pretendard/dist/web/static/pretendard.css';
Loading