Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
73 changes: 73 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import Link from 'next/link';

export default function NotFound() {
return (
<div className="flex h-screen items-center justify-center">
<div className="relative">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
width="567"
height="300"
className="w-full"
viewBox="0 0 567 300"
>
<defs>
<path
id="wave"
d="m-115,50q38-30 75,0t75,0 75,0 75,0
75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0 75,0
v20 h-1540 v-20"
className="translate-y-[110px]"
/>
<clipPath id="wave-clip-front">
<use className="animate-wave" href="#wave" />
<rect x="0" y="0" width="100%" height="180" />
</clipPath>
<clipPath id="wave-clip-middle">
<use className="animate-wave" href="#wave" />
<rect x="0" y="180" width="100%" height="150" />
</clipPath>
<linearGradient id="grad-front" x1="-22%" y1="0" x2="122%" y2="100%">
<stop offset="0%" stop-color="#60A5FA" stop-opacity="1" />
<stop offset="100%" stop-color="#3388FF" stop-opacity="1" />
</linearGradient>
<text
id="clipped-wave"
x="0"
y="260"
font-family="Helvetica"
font-weight="bold"
font-size="18.75rem"
>
404
</text>
</defs>
<use
href="#clipped-wave"
clip-path="url(#wave-clip-middle)"
fill="url(#grad-front)"
fill-opacity="0.88"
/>
<use
href="#clipped-wave"
clip-path="url(#wave-clip-front)"
fill="url(#grad-front)"
fill-opacity="0.77"
/>
</svg>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

SVG 반응형 처리 개선이 필요합니다.

현재 구현에서 몇 가지 개선이 필요한 부분이 있습니다:

  1. SVG 크기가 고정값으로 설정되어 있어 작은 화면에서 문제가 될 수 있습니다.
  2. 폰트 크기가 하드코딩되어 있어 반응형 처리가 어렵습니다.

다음과 같이 개선해보시는 것은 어떨까요?

-          width="567"
-          height="300"
+          width="100%"
+          height="100%"
+          preserveAspectRatio="xMidYMid meet"
-          font-size="18.75rem"
+          className="text-[18.75rem] md:text-[12rem] sm:text-[8rem]"

Committable suggestion skipped: line range outside the PR's diff.

<div className="absolute -bottom-10 flex w-full translate-y-full flex-col items-center gap-9">
<p className="text-2xl font-semibold text-gray-900">
&quot;페이지를 찾을 수 없습니다. 😢&quot;
</p>
<Link
href="/"
className="btn-filled flex h-11 items-center rounded-xl px-16 text-base font-semibold"
>
홈으로 가기
</Link>
</div>
</div>
</div>
);
}
6 changes: 6 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const config: Config = {
base: ['1rem', { lineHeight: '1.5rem' }],
sm: ['0.875rem', { lineHeight: '1.25rem' }],
xs: ['0.75rem', { lineHeight: '1rem' }],
404: ['18.75rem', { lineHeight: '18.75rem' }],
},
fontWeight: {
bold: '700',
Expand Down Expand Up @@ -128,9 +129,14 @@ const config: Config = {
'0%': { opacity: '0' },
'100%': { opacity: '1' },
},
wave: {
'0%': { transform: 'translate(0)' },
'100%': { transform: 'translate(-30%)' },
},
},
animation: {
fade: 'show 0.5s ease-in',
wave: 'wave 0.8s linear infinite',
},
},
},
Expand Down