Skip to content

Commit

Permalink
💄 将所有像素改为八的整数倍大小以符合规范
Browse files Browse the repository at this point in the history
  • Loading branch information
neila-a committed Apr 20, 2024
1 parent fa256c2 commit 0e1096d
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 40 deletions.
46 changes: 24 additions & 22 deletions packages/core/src/app/components/HeadBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,30 @@ export default function HeadBar(props: HeadBarOption): JSX.Element {
{props.isIndex ? upper : props.pageName}
</Typography>
<showSidebar.Consumer>
{value => !props.isIndex && value.show === false ? (
<MouseOverPopover text={get("menu.打开菜单")}>
<IconButton onClick={event => {
value.set(!value.show);
}} size="large" edge="end" color="inherit" aria-label={get("menu.打开菜单")} sx={{
mr: 1,
...noDrag
}}>
<MenuIcon />
</IconButton>
</MouseOverPopover>
) : (
<MouseOverPopover text={get("menu.关闭菜单")}>
<IconButton onClick={event => {
value.set(!value.show);
}} size="large" edge="end" color="inherit" aria-label={get("menu.关闭菜单")} sx={{
mr: 1,
...noDrag
}}>
<MenuOpen />
</IconButton>
</MouseOverPopover>
{value => !props.isIndex && (
value.show === false ? (
<MouseOverPopover text={get("menu.打开菜单")}>
<IconButton onClick={event => {
value.set(!value.show);
}} size="large" edge="end" color="inherit" aria-label={get("menu.打开菜单")} sx={{
mr: 1,
...noDrag
}}>
<MenuIcon />
</IconButton>
</MouseOverPopover>
) : (
<MouseOverPopover text={get("menu.关闭菜单")}>
<IconButton onClick={event => {
value.set(!value.show);
}} size="large" edge="end" color="inherit" aria-label={get("menu.关闭菜单")} sx={{
mr: 1,
...noDrag
}}>
<MenuOpen />
</IconButton>
</MouseOverPopover>
)
)}
</showSidebar.Consumer>
<title>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/components/TransferList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default function TransferList(props: {
}
return (
<Grid container spacing={2} justifyContent="center" alignItems="center" sx={{
p: "10px 0px"
p: "8px 0px"
}}>
<Grid item>{customList(left)}</Grid>
<Grid item>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/first/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function First() {
width: "100vw",
height: "100vh",
flexDirection: "column",
backgroundColor: "#1976d2",
backgroundColor: theme => theme.palette.primary.main,
justifyContent: "space-evenly",
alignItems: "center"
}} ref={ref} onClick={event => {
Expand Down
11 changes: 4 additions & 7 deletions packages/core/src/app/index/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,12 @@ export default function Sidebar(props: {
}
}}>
<Toolbar />
<Paper sx={{
margin: '2px 4px',
p: '2px 4px',
display: 'flex',
alignItems: 'center'
<Box sx={{
display: "flex"
}}>
<MouseOverPopover text={get('搜索')}>
<IconButton type="button" sx={{
p: '10px 5px'
p: 1
}} aria-label={get('搜索')} onClick={() => {
searchTools(searchText);
}}>
Expand Down Expand Up @@ -134,7 +131,7 @@ export default function Sidebar(props: {
props.setShow("tools");
}
}} />
</Paper>
</Box>
<Box sx={{
textAlign: "center"
}}>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/index/SingleTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function SingleTool(props: {
<Card elevation={elevation} sx={{
width: viewMode == "grid" ? 275 : fullWidth,
maxWidth: fullWidth,
boxShadow: theme => props.focus && `inset 0 0 0 3px ${theme.palette.primary[theme.palette.mode]}`,
boxShadow: theme => props.focus && `inset 0 0 0 8px ${theme.palette.primary[theme.palette.mode]}`,
backgroundColor: !gradientTool && `#${tool.color[0]}`,
backgroundImage: gradientTool && `linear-gradient(45deg, #${tool.color[0]}, #${tool.color[1]})`
}} onMouseEnter={event => {
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/app/layout/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function Menu() {
{sortingFor !== "__home__" && (
<MouseOverPopover text={get("back")}>
<IconButton type="button" sx={{
p: '10px 5px'
p: 1
}} aria-label={get("back")} onClick={() => {
setSearchText("");
setSortingFor("__home__");
Expand All @@ -154,7 +154,7 @@ export default function Menu() {
)}
<MouseOverPopover text={get('搜索')}>
<IconButton type="button" sx={{
p: '10px 5px'
p: 1
}} aria-label={get('搜索')} onClick={() => {
searchTools(searchText);
}}>
Expand All @@ -165,7 +165,7 @@ export default function Menu() {
ml: 1,
flex: 1
}} placeholder={get('搜索工具')} inputProps={{
'aria-label': 'searchtools'
'aria-label': get('搜索工具')
}} onChange={event => {
if (searchText !== event.target.value) {
setSearchText(event.target.value);
Expand Down Expand Up @@ -297,7 +297,7 @@ export default function Menu() {
}}>
<MouseOverPopover text={get("主页")}>
<IconButton color="primary" sx={{
p: '10px'
p: 1
}} aria-label={get("主页")} onClick={_event => {
router.push("/" satisfies Route);
}}>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/layout/WindowContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function WindowContainer() {
{windows.map(single => (
<Window {...single} key={single.id} sx={{
backgroundImage: color && `linear-gradient(45deg, #${single.color[0]}, #${single.color[1]})`,
backgroundColor: !color && single.color[0],
backgroundColor: !color && `#${single.color[0]}`,
}} />
))}
</ErrorBoundary>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/setting/option/Module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Module(props: {
display: "flex",
flexDirection: "column",
alignItems: "center",
boxShadow: theme => isThis && `inset 0 0 0 3px ${theme.palette.primary[theme.palette.mode]}`,
boxShadow: theme => isThis && `inset 0 0 0 8px ${theme.palette.primary[theme.palette.mode]}`,
borderColor: theme => isThis && theme.palette.primary[theme.palette.mode]
}}>
{props.children}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/tools/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function ToolFinder(props: {
<>
<HeadBar isIndex={false} pageName={name === "" ? get("未找到工具") : name} only={only} sx={tool !== undefined && {
backgroundImage: color && `linear-gradient(45deg, #${tool.color[0]}, #${tool.color[1]})`,
backgroundColor: !color && tool.color[0]
backgroundColor: !color && `#${tool.color[0]}`
}} />
<Box sx={{
p: 3
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app/tools/pillar/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function Pillar(): JSX.Element {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
boxShadow: theme => `inset 0 0 0 3px ${theme.palette[pillar ? "primary" : "secondary"][theme.palette.mode]}`,
boxShadow: theme => `inset 0 0 0 8px ${theme.palette[pillar ? "primary" : "secondary"][theme.palette.mode]}`,
}}>
<Typography>{pillar ? get("pillar.name") : get("pillar.distance")}</Typography>
</Box>
Expand Down

0 comments on commit 0e1096d

Please sign in to comment.