Commit 23ca402b authored by timel's avatar timel

refactor: styles

parent 057d1e06
...@@ -18,3 +18,17 @@ ...@@ -18,3 +18,17 @@
background: rgba(136, 136, 136, 0.8); background: rgba(136, 136, 136, 0.8);
} }
} }
@mixin noise-bg($opacity: 0.3) {
&::before {
content: "";
position: absolute;
left: 0;
top: 0;
height: 100%;
max-height: 100%;
width: 100%;
background-image: url("/neos-assets/noise-light.webp");
opacity: $opacity;
}
}
@use "/src/styles/utils.scss";
.detail { .detail {
z-index: 10; z-index: 10;
position: absolute; position: absolute;
...@@ -6,7 +8,7 @@ ...@@ -6,7 +8,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 10px 20px 10px; padding: 0 10px 20px 10px;
transition: 0.2s; // transition: 0.2s;
} }
.detail.open { .detail.open {
...@@ -15,10 +17,10 @@ ...@@ -15,10 +17,10 @@
.container { .container {
height: 100%; height: 100%;
background-color: rgba(141, 133, 166, 0.245); background-color: hsla(0, 0%, 100%, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 30px 0 #ffffff54;
backdrop-filter: blur(20px); backdrop-filter: blur(20px);
border-radius: 4px; @include utils.noise-bg;
} }
.btn-close { .btn-close {
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
&:hover { &:hover {
background-color: rgba(0, 168, 202, 0.451) !important; background-color: rgba(0, 168, 202, 0.451) !important;
transform: scale(1.1); transform: scale(1.1);
filter: brightness(1.2);
} }
} }
} }
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
.title { .title {
height: 44px; height: 44px;
flex: 0 0 44px; flex: 0 0 44px;
justify-content: space-between;
} }
.deck-zone { .deck-zone {
@include utils.scrollbar; @include utils.scrollbar;
......
...@@ -7,7 +7,14 @@ import { ...@@ -7,7 +7,14 @@ import {
SortAscendingOutlined, SortAscendingOutlined,
UndoOutlined, UndoOutlined,
} from "@ant-design/icons"; } from "@ant-design/icons";
import { Button, ConfigProvider, Input, Space, type ThemeConfig } from "antd"; import {
Button,
ConfigProvider,
Input,
Space,
type ThemeConfig,
Badge,
} from "antd";
import { Background } from "../Shared"; import { Background } from "../Shared";
import { CardDetail } from "./CardDetail"; import { CardDetail } from "./CardDetail";
...@@ -53,14 +60,12 @@ export const Component: React.FC = () => { ...@@ -53,14 +60,12 @@ export const Component: React.FC = () => {
}; };
Component.displayName = "Build"; Component.displayName = "Build";
/** 正在编辑的卡组 */
const Deck: React.FC = () => { const Deck: React.FC = () => {
return ( return (
<div className={styles.deck}> <div className={styles.deck}>
<div className={styles.container}> <div className={styles.container}>
<Space <Space className={styles.title}>
className={styles.title}
style={{ justifyContent: "space-between" }}
>
<Input <Input
placeholder="我的卡组" placeholder="我的卡组"
bordered={false} bordered={false}
...@@ -107,6 +112,7 @@ const Deck: React.FC = () => { ...@@ -107,6 +112,7 @@ const Deck: React.FC = () => {
); );
}; };
/** 卡片库,选择卡片加入正在编辑的卡组 */
const CardSelect: React.FC = () => { const CardSelect: React.FC = () => {
return ( return (
<div className={styles.select}> <div className={styles.select}>
...@@ -121,9 +127,12 @@ const CardSelect: React.FC = () => { ...@@ -121,9 +127,12 @@ const CardSelect: React.FC = () => {
<div className={styles["select-btns"]}> <div className={styles["select-btns"]}>
<Button block type="text" icon={<FilterOutlined />}> <Button block type="text" icon={<FilterOutlined />}>
筛选 筛选
{/* TODO: 下面这个Badge应根据有无筛选规则而显示 */}
{false && <Badge dot offset={[5, -5]} />}
</Button> </Button>
<Button block type="text" icon={<SortAscendingOutlined />}> <Button block type="text" icon={<SortAscendingOutlined />}>
排列 排列
{false && <Badge dot offset={[5, -5]} />}
</Button> </Button>
<Button block type="text" icon={<DeleteOutlined />}> <Button block type="text" icon={<DeleteOutlined />}>
重置 重置
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
transition: 0.2s; transition: 0.2s;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
box-shadow: 0 0 0 4px #2a5560; box-shadow: 0 0 0 4px #226170;
// background: hsla(0, 0%, 100%, 0.07); // background: hsla(0, 0%, 100%, 0.07);
filter: brightness(1.2); filter: brightness(1.2);
} }
......
...@@ -15,6 +15,7 @@ export const loader: LoaderFunction = () => { ...@@ -15,6 +15,7 @@ export const loader: LoaderFunction = () => {
if (user) { if (user) {
accountStore.login(user); accountStore.login(user);
setCookie(CookieKeys.USER, JSON.stringify(user)); setCookie(CookieKeys.USER, JSON.stringify(user));
// TODO: toast显示登录成功
} }
return null; return null;
}; };
......
@use "/src/styles/utils.scss";
.background { .background {
position: fixed; position: fixed;
left: 0; left: 0;
...@@ -10,18 +12,7 @@ ...@@ -10,18 +12,7 @@
z-index: -1; z-index: -1;
display: flex; display: flex;
justify-content: center; justify-content: center;
// align-items: center; @include utils.noise-bg;
&::before {
content: "";
position: absolute;
left: 0;
top: 0;
height: 100%;
max-height: 100%;
width: 100%;
background-image: url("/neos-assets/noise-light.webp");
opacity: 0.3;
}
} }
.inner { .inner {
......
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