mirror of
https://ghproxy.com/https://github.com/StreakingMan/solvable-sheep-game
synced 2025-05-26 07:18:14 +08:00
fix: 主题配置表单样式优化
This commit is contained in:
parent
3913982716
commit
8dec5b6420
|
@ -69,6 +69,56 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inputContainer {
|
||||||
|
word-break: keep-all;
|
||||||
|
|
||||||
|
audio {
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
select {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type='file'] {
|
||||||
|
padding: 4px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type='checkbox'] {
|
||||||
|
flex-grow: 0;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type='color'] {
|
||||||
|
padding: 0 2px;
|
||||||
|
flex-grow: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
min-width: 74px;
|
||||||
|
opacity: 0.7;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imgPreview {
|
||||||
|
height: 30px;
|
||||||
|
border: 1px dashed rgb(0 0 0 / 30%);
|
||||||
|
min-width: 30px;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.required .label {
|
||||||
|
&::after {
|
||||||
|
content: '*';
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.dialog {
|
.dialog {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -135,55 +185,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
&:not([type='checkbox']) {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputContainer {
|
max-width: 100%;
|
||||||
word-break: keep-all;
|
box-sizing: border-box;
|
||||||
|
|
||||||
audio {
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input,
|
|
||||||
select {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='file'] {
|
input[type='file'] {
|
||||||
padding: 4px 12px;
|
padding: 3px 12px;
|
||||||
}
|
|
||||||
|
|
||||||
input[type='checkbox'] {
|
|
||||||
flex-grow: 0;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type='color'] {
|
|
||||||
padding: 0 2px;
|
|
||||||
flex-grow: 0;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
|
||||||
min-width: 74px;
|
|
||||||
opacity: 0.7;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.imgPreview {
|
|
||||||
height: 30px;
|
|
||||||
border: 1px dashed rgb(0 0 0 / 30%);
|
|
||||||
min-width: 30px;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.required .label {
|
|
||||||
&::after {
|
|
||||||
content: '*';
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,16 +218,6 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type='file'] {
|
|
||||||
padding: 3px 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconPreview {
|
.iconPreview {
|
||||||
height: 109px;
|
height: 109px;
|
||||||
width: 109px;
|
width: 109px;
|
||||||
|
|
|
@ -65,6 +65,7 @@ const ConfigDialog: FC<{
|
||||||
const [customTheme, setCustomTheme] = useState<CustomTheme>({
|
const [customTheme, setCustomTheme] = useState<CustomTheme>({
|
||||||
title: '',
|
title: '',
|
||||||
sounds: [],
|
sounds: [],
|
||||||
|
pure: false,
|
||||||
icons: new Array(10).fill(0).map(() => ({
|
icons: new Array(10).fill(0).map(() => ({
|
||||||
name: randomString(4),
|
name: randomString(4),
|
||||||
content: '',
|
content: '',
|
||||||
|
@ -375,6 +376,15 @@ const ConfigDialog: FC<{
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 彩蛋
|
||||||
|
const [pureClickTime, setPureClickTime] = useState<number>(0);
|
||||||
|
useEffect(() => {
|
||||||
|
updateCustomTheme(
|
||||||
|
'pure',
|
||||||
|
pureClickTime % 5 === 0 && pureClickTime !== 0
|
||||||
|
);
|
||||||
|
}, [pureClickTime]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(style.dialog)}>
|
<div className={classNames(style.dialog)}>
|
||||||
<div className={style.closeBtn} onClick={closeMethod}>
|
<div className={style.closeBtn} onClick={closeMethod}>
|
||||||
|
@ -680,7 +690,12 @@ const ConfigDialog: FC<{
|
||||||
(谨慎操作,单文件不超过1M为宜,文件过大可能导致崩溃,介时请刷新浏览器)
|
(谨慎操作,单文件不超过1M为宜,文件过大可能导致崩溃,介时请刷新浏览器)
|
||||||
</div>
|
</div>
|
||||||
{configError && <div className={style.errorTip}>{configError}</div>}
|
{configError && <div className={style.errorTip}>{configError}</div>}
|
||||||
<WxQrCode />
|
{customTheme.pure && (
|
||||||
|
<div className={style.tip}>
|
||||||
|
🎉🎉🎉恭喜发现彩蛋,生成的主题将开启纯净模式~
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<WxQrCode onClick={() => setPureClickTime(pureClickTime + 1)} />
|
||||||
<div className={'flex-container'}>
|
<div className={'flex-container'}>
|
||||||
<button
|
<button
|
||||||
className={'primary flex-grow'}
|
className={'primary flex-grow'}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import React, { FC, useState } from 'react';
|
import React, { FC, MouseEventHandler, useState } from 'react';
|
||||||
import style from './WxQrCode.module.scss';
|
import style from './WxQrCode.module.scss';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
const WxQrCode: FC<{ title?: string }> = ({
|
const WxQrCode: FC<{ title?: string; onClick?: MouseEventHandler }> = ({
|
||||||
title = '【广告位招租中】同时如果您喜欢这个项目的话,可以点击扫描下方收款码分摊后台相关费用,感谢~😘',
|
title = '【广告位招租中】同时如果您喜欢这个项目的话,可以点击扫描下方收款码分摊后台相关费用,感谢~😘',
|
||||||
|
onClick,
|
||||||
}) => {
|
}) => {
|
||||||
const [fullScreen, setFullScreen] = useState<Record<number, boolean>>({
|
const [fullScreen, setFullScreen] = useState<Record<number, boolean>>({
|
||||||
0: false,
|
0: false,
|
||||||
|
@ -28,7 +29,7 @@ const WxQrCode: FC<{ title?: string }> = ({
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className={style.wxQrCodeContainer}>
|
<div className={style.wxQrCodeContainer} onClick={onClick}>
|
||||||
<div className={style.wxQrCodeTitle}>{title}</div>
|
<div className={style.wxQrCodeTitle}>{title}</div>
|
||||||
{[1, 5, 8].map((num, idx) => (
|
{[1, 5, 8].map((num, idx) => (
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in New Issue
Block a user