Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Add: スマホ版ののHomeのUI(メディアクエリは夜眠くなってからに回す)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sea10wood committed Aug 10, 2024
1 parent d8dd091 commit af47151
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 16 deletions.
55 changes: 55 additions & 0 deletions src/components/ui/Button/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.button-style {
border-width: 0;

&:hover {
&:not([disabled]) {
scale: 1.2;
}
}

&[data-size="sm"] {
padding: 4px 8px;
font-size: 12px;
border-radius: 4px;
}

&[data-size="md"] {
padding: 4px 32px;
font-size: 24px;
font-weight: bold;
border-radius: 4px;
}

&[data-size="lg"] {
padding: 8px 48px;
font-size: 24px;
font-weight: bold;
border-radius: 4px;
white-space: nowrap;
}

&[data-variant="contained"] {
color: var(--white);


&[data-color="red"] {
background-color: var(--red);
}

&[data-color="black"] {
background-color: var(--black);
}
}

&[data-variant="outlined"] {
background-color: var(--white);
color: var(--black);
border-width: 2px;
border-style: solid;

&[data-color="red"] {
border-color: var(--red);
}

}
}
29 changes: 29 additions & 0 deletions src/components/ui/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { ComponentPropsWithoutRef, ReactNode } from "react";
import styles from "./index.module.css";

type ButtonProps = {
children: ReactNode;
variant?: "contained" | "outlined";
size?: "sm" | "md" | "lg";
color?: "red" | "black";
} & ComponentPropsWithoutRef<"button">;

export const DefaultButton = ({
children,
variant = "outlined",
size = "md",
color = "red",
...props
}: ButtonProps) => {
return (
<button
className={styles["button-style"]}
data-variant={variant}
data-size={size}
data-color={color}
{...props}
>
{children}
</button>
);
};
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ body {
display: flex;
min-width: 320px;
min-height: 100vh;
background-color: #FFF2F2;
}

h1 {
Expand Down
26 changes: 25 additions & 1 deletion src/pages/home/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,28 @@
}
.scroll-infinity__item>img {
width: 100%;
}
}

.background-logo{
opacity: 0.8;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
justify-content: center;
align-items: center;
}

li{
font-size: 20px;
padding: 0 24px;
}

.go_game{
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
justify-content: center;
align-items: center;
}
47 changes: 32 additions & 15 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
import { DefaultButton } from "../../components/ui/Button";
import styles from "./index.module.css";

function Home() {
return (
<div className={styles["scroll-infinity"]}>
<div className={styles["scroll-infinity__wrap"]}>
<ul
className={`${styles["scroll-infinity__list"]} ${styles["scroll-infinity__list--left"]}`}
>
<li className={styles["scroll-infinity__item"]}>
VIRTUAL_NATSUMATSURI
</li>
<li className={styles["scroll-infinity__item"]}>
VIRTUAL_NATSUMATSURI
</li>
<li className={styles["scroll-infinity__item"]}>
VIRTUAL_NATSUMATSURI
</li>
</ul>

<div>
<div className={styles["scroll-infinity"]}>
<div className={styles["scroll-infinity__wrap"]}>
<ul
className={`${styles["scroll-infinity__list"]} ${styles["scroll-infinity__list--left"]}`}
>
<li className={styles["scroll-infinity__item"]}>
VIRTUAL_NATSUMATSURI
</li>
<li className={styles["scroll-infinity__item"]}>
VIRTUAL_NATSUMATSURI
</li>
<li className={styles["scroll-infinity__item"]}>
VIRTUAL_NATSUMATSURI
</li>
</ul>
</div>
</div>
<div className={styles["background-logo"]}>
<img
src="/logo.webp"
alt="背景にばーちゃるなつまつりのロゴ"
width="350"
height="350"
/>
</div>
<div className={styles["go-game"]}>
<DefaultButton color="red" size="lg">
射的へ向かう
</DefaultButton>
</div>
</div>
);
Expand Down

0 comments on commit af47151

Please sign in to comment.