Skip to content

Commit

Permalink
feat: add wave animation in error page big title
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmx233 committed Dec 13, 2023
1 parent f249d43 commit d7e1456
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 9 deletions.
25 changes: 16 additions & 9 deletions web/src/pages/Error/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { FC, useMemo } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import "./style.css";

import img_png from "@/assets/img/error/img_20231213.png";
import img_webp from "@/assets/img/error/img_20231213.webp";

import { useTheme } from "@mui/material";
import { Box, Stack, Typography, ButtonGroup, Button } from "@mui/material";

import { GoLogin } from "@util/nav";

export const Error: FC = () => {
const theme = useTheme();
const nav = useNavigate();
const loc = useLocation();
const state: ErrorState | undefined = useMemo(() => loc.state, [loc]);
Expand Down Expand Up @@ -54,16 +57,20 @@ export const Error: FC = () => {
</Box>

<Stack alignItems={{ xs: "center", sm: "baseline" }}>
<Typography
variant={"h1"}
fontWeight={"bolder"}
letterSpacing={"0.2rem"}
mb={4}
color={"text.secondary"}
display={{ xs: "none", sm: "block" }}
<Box
className={"ops"}
sx={{
display: { xs: "none", sm: "block" },
color: "text.secondary",
mb: 2,
"&>h1:nth-of-type(1)": {
WebkitTextStroke: `2px ${theme.palette.text.secondary}`,
},
}}
>
OPS!
</Typography>
<Typography variant={"h1"}>OPS!</Typography>
<Typography variant={"h1"}>OPS!</Typography>
</Box>

<Stack px={0.7}>
<Typography
Expand Down
49 changes: 49 additions & 0 deletions web/src/pages/Error/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.ops {
position: relative;
}

.ops h1 {
font-weight: bolder;
letter-spacing: 0.2rem;
}

.ops h1:nth-of-type(1) {
color: transparent;
}

.ops h1:nth-of-type(2) {
top: 0;
position: absolute;
animation: wave 10s ease-in-out infinite;
}

@keyframes wave {
0%,
100% {
clip-path: polygon(
0% 45%,
16% 44%,
33% 50%,
54% 60%,
70% 61%,
84% 59%,
100% 52%,
100% 100%,
0% 100%
);
}

50% {
clip-path: polygon(
0% 60%,
15% 65%,
34% 66%,
51% 62%,
67% 50%,
84% 45%,
100% 46%,
100% 100%,
0% 100%
);
}
}

0 comments on commit d7e1456

Please sign in to comment.