diff --git a/src/components/Web/TopBackground/TopBackground.stories.tsx b/src/components/Web/TopBackground/TopBackground.stories.tsx new file mode 100644 index 0000000..f79e55f --- /dev/null +++ b/src/components/Web/TopBackground/TopBackground.stories.tsx @@ -0,0 +1,19 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import { TopBackground } from "./TopBackground"; + +export default { + title: "Web/TopBackground", + component: TopBackground, + tags: ["autodocs"], + parameters: { + layout: "fullscreen", + }, + argTypes: {}, +} as Meta; + +export const Default: StoryObj = { + args: { + hovering: "hack", + }, +}; diff --git a/src/components/Web/TopBackground/TopBackground.tsx b/src/components/Web/TopBackground/TopBackground.tsx new file mode 100644 index 0000000..a8ecbfa --- /dev/null +++ b/src/components/Web/TopBackground/TopBackground.tsx @@ -0,0 +1,66 @@ +import { imagePaths } from "@/constants/topBackground"; +import { TopBackgroundProps } from "@/types/web"; +import { Box, Stack, useMediaQuery } from "@mui/material"; + +export const TopBackground = ({ hovering }: TopBackgroundProps) => { + const isDarkMode = useMediaQuery("(prefers-color-scheme: dark)"); + const isSmall = useMediaQuery("(min-width:800px)"); + + return ( + + {imagePaths.map(({ department, imagePath }, index) => ( + + + + ))} + + ); +}; diff --git a/src/constants/topBackground.ts b/src/constants/topBackground.ts new file mode 100644 index 0000000..7dcd4b2 --- /dev/null +++ b/src/constants/topBackground.ts @@ -0,0 +1,27 @@ +export const imagePaths = [ + { + department: "hack", + imagePath: + "https://img.freepik.com/free-photo/cute-kitten-staring-out-the-window-playful-curiosity-generative-ai_188544-12520.jpg", + }, + { + department: "game", + imagePath: + "https://img.freepik.com/free-photo/cute-kitten-staring-out-the-window-playful-curiosity-generative-ai_188544-12520.jpg", + }, + { + department: "2dcg", + imagePath: + "https://img.freepik.com/free-photo/cute-kitten-staring-out-the-window-playful-curiosity-generative-ai_188544-12520.jpg", + }, + { + department: "3dcg", + imagePath: + "https://img.freepik.com/free-photo/cute-kitten-staring-out-the-window-playful-curiosity-generative-ai_188544-12520.jpg", + }, + { + department: "music", + imagePath: + "https://img.freepik.com/free-photo/cute-kitten-staring-out-the-window-playful-curiosity-generative-ai_188544-12520.jpg", + }, +]; diff --git a/src/types/web.ts b/src/types/web.ts index c0a9916..49901a6 100644 --- a/src/types/web.ts +++ b/src/types/web.ts @@ -60,3 +60,6 @@ export type CategoryOutlineCardProps = { caption: string; redirectPath: string; }; +export type TopBackgroundProps = { + hovering: "hack" | "game" | "2dcg" | "3dcg" | "music" | ""; +};