Commit 462ef67b authored by timel's avatar timel

feat: new start btn in waitroom

parent 93ca14a9
Pipeline #22943 failed with stages
in 11 minutes and 14 seconds
neos-protobuf @ 30f4ea7a
Subproject commit d6c01dd88fd72f22c432a52ba74eee9ece267499 Subproject commit 30f4ea7acd79b9cb18a358548520ca939e22dc5f
.container { .container {
height: 100%; height: 100%;
display: flex; display: flex;
--side-box-width: 400px; align-items: center;
--battle-icon-width: 50px; --side-box-width: 500px;
--gap-between-side-and-battle: 30px;
--border-radius: 10px; --border-radius: 10px;
--sider-width: 300px; --sider-width: 300px;
.main { .content {
height: 500px; // TODO: 修正这里的高度,或者说修正全局的高度设置。高度不应该超过100%
position: relative; position: relative;
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding-bottom: 5%; // padding-bottom: 5%;
transition: transform 0.3s; transition: transform 0.3s;
} }
.sider { .sider {
...@@ -30,11 +30,12 @@ ...@@ -30,11 +30,12 @@
.both-side-container { .both-side-container {
display: flex; display: flex;
gap: var(--gap-between-side-and-battle); flex-direction: column;
gap: 30px;
align-items: center; align-items: center;
margin-top: 80px; margin-top: 80px;
.side-box { .side-box {
height: 120px; height: 100px;
width: var(--side-box-width); width: var(--side-box-width);
border-radius: var(--border-radius); border-radius: var(--border-radius);
background: hsla(0, 0%, 100%, 0.1); background: hsla(0, 0%, 100%, 0.1);
...@@ -161,3 +162,7 @@ ...@@ -161,3 +162,7 @@
} }
overflow: hidden; overflow: hidden;
} }
.btn-action {
margin-top: auto;
}
...@@ -26,7 +26,7 @@ import { useSnapshot } from "valtio"; ...@@ -26,7 +26,7 @@ import { useSnapshot } from "valtio";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { accountStore, deckStore, IDeck, Player, roomStore } from "@/stores"; import { accountStore, deckStore, IDeck, Player, roomStore } from "@/stores";
import { Background, IconFont, Select } from "@/ui/Shared"; import { Background, IconFont, Select, SpecialButton } from "@/ui/Shared";
import { Chat } from "./Chat"; import { Chat } from "./Chat";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
...@@ -79,7 +79,7 @@ export const Component: React.FC = () => { ...@@ -79,7 +79,7 @@ export const Component: React.FC = () => {
/> />
<Chat /> <Chat />
</div> </div>
<div className={styles.main}> <div className={styles.content}>
{/* <div className={styles["status-bar"]}> {/* <div className={styles["status-bar"]}>
<LoadingOutlined /> <LoadingOutlined />
对方正在选择先后 对方正在选择先后
...@@ -121,6 +121,10 @@ export const Component: React.FC = () => { ...@@ -121,6 +121,10 @@ export const Component: React.FC = () => {
/> />
<PlayerZone who={Who.Op} player={room.getOpPlayer()} /> <PlayerZone who={Who.Op} player={room.getOpPlayer()} />
</div> </div>
<SpecialButton className={styles["btn-action"]}>
开始游戏
</SpecialButton>
</div> </div>
</div> </div>
</ConfigProvider> </ConfigProvider>
...@@ -283,7 +287,7 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({ ...@@ -283,7 +287,7 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
<Select <Select
title="卡组" title="卡组"
showSearch showSearch
style={{ width: 300 }} style={{ width: 250 }}
defaultValue={snapDeck.decks[0].deckName} defaultValue={snapDeck.decks[0].deckName}
options={snapDeck.decks.map((deck) => ({ options={snapDeck.decks.map((deck) => ({
value: deck.deckName, value: deck.deckName,
...@@ -336,6 +340,9 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({ ...@@ -336,6 +340,9 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
> >
退出房间 退出房间
</Button> </Button>
{/* <Button size="large" icon={<IconFont type="icon-play" size={12} />}>
开始游戏
</Button> */}
</Space> </Space>
); );
}; };
.special-btn {
cursor: pointer;
width: 200px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 12px 40px;
border: 3px solid hsla(0, 0%, 100%, 0.3);
border-radius: 8px;
background-clip: padding-box;
background-color: hsla(0, 0%, 100%, 0.9);
color: #0d0d0d;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.2px;
transition: 0.2s;
&:hover {
background-color: hsla(0, 0%, 100%, 1.1);
}
&::before {
position: absolute;
z-index: -1;
top: 5px;
right: 5px;
bottom: 0;
left: 5px;
border-radius: 6px;
background: conic-gradient(
from 147.14deg at 50% 50%,
#0294fe -55.68deg,
#ff2136 113.23deg,
#9b4dff 195deg,
#0294fe 304.32deg,
#ff2136 473.23deg
);
content: "";
filter: blur(20px);
opacity: 0.6;
}
}
import classNames from "classnames";
import styles from "./index.module.scss";
export const SpecialButton: React.FC<
React.PropsWithChildren<React.ComponentProps<"span">>
> = ({ children, className, ...rest }) => (
<span className={classNames(styles["special-btn"], className)} {...rest}>
{children}
</span>
);
...@@ -2,4 +2,5 @@ export * from "./Background"; ...@@ -2,4 +2,5 @@ export * from "./Background";
export * from "./css"; export * from "./css";
export * from "./IconFont"; export * from "./IconFont";
export * from "./Select"; export * from "./Select";
export * from "./SpecialButton";
export * from "./YgoCard"; export * from "./YgoCard";
...@@ -31,51 +31,6 @@ ...@@ -31,51 +31,6 @@
} }
} }
.start-btn {
cursor: pointer;
width: 200px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 12px 40px;
border: 3px solid hsla(0, 0%, 100%, 0.3);
border-radius: 8px;
background-clip: padding-box;
background-color: hsla(0, 0%, 100%, 0.9);
color: #0d0d0d;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.2px;
transition: 0.2s;
&:hover {
background-color: hsla(0, 0%, 100%, 1.1);
}
&::before {
position: absolute;
z-index: -1;
top: 5px;
right: 5px;
bottom: 0;
left: 5px;
border-radius: 6px;
background: conic-gradient(
from 147.14deg at 50% 50%,
#0294fe -55.68deg,
#ff2136 113.23deg,
#9b4dff 195deg,
#0294fe 304.32deg,
#ff2136 473.23deg
);
content: "";
filter: blur(20px);
opacity: 0.6;
}
}
// 以下是粒子动画的样式 // 以下是粒子动画的样式
.particles-container { .particles-container {
......
...@@ -4,7 +4,7 @@ import { useSnapshot } from "valtio"; ...@@ -4,7 +4,7 @@ import { useSnapshot } from "valtio";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { accountStore } from "@/stores"; import { accountStore } from "@/stores";
import { Background } from "@/ui/Shared"; import { Background, SpecialButton } from "@/ui/Shared";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
...@@ -54,13 +54,10 @@ const LoginBtn: React.FC<{ logined: boolean }> = ({ logined }) => { ...@@ -54,13 +54,10 @@ const LoginBtn: React.FC<{ logined: boolean }> = ({ logined }) => {
const goToMatch = () => navigate("/match"); const goToMatch = () => navigate("/match");
return ( return (
<span <SpecialButton onClick={logined ? goToMatch : loginViaSSO}>
className={styles["start-btn"]}
onClick={logined ? goToMatch : loginViaSSO}
>
<span>{logined ? "开始游戏" : "登录游戏"}</span> <span>{logined ? "开始游戏" : "登录游戏"}</span>
<RightOutlined /> <RightOutlined />
</span> </SpecialButton>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment