Compare commits

...

6 Commits

Author SHA1 Message Date
Leonmmcoset
921570f229 add beta notice 2025-10-20 22:01:54 +08:00
Leonmmcoset
48ec0d9fb4 qwq 2025-10-20 21:24:03 +08:00
Leonmmcoset
2e4d39be6d change borderRadius 2025-10-20 20:59:18 +08:00
Leonmmcoset
a3bd238885 awa 2025-10-20 20:30:35 +08:00
Leonmmcoset
991af83c2e change appbar 2025-10-20 20:16:09 +08:00
Leonmmcoset
56f11f62ea login page add menubar 2025-10-20 19:49:24 +08:00
7 changed files with 66 additions and 34 deletions

View File

@@ -2,7 +2,7 @@ import { createTheme, CssBaseline, GlobalStyles, styled, ThemeProvider, useMedia
import { grey } from "@mui/material/colors";
import { ThemeOptions } from "@mui/material/styles/createTheme";
import i18next from "i18next";
import { enqueueSnackbar, MaterialDesignContent, SnackbarProvider } from "notistack";
import { enqueueSnackbar, MaterialDesignContent, SnackbarProvider, useSnackbar } from "notistack";
import { Suspense, useEffect, useMemo } from "react";
import { useTranslation } from "react-i18next";
import { Outlet } from "react-router-dom";
@@ -21,7 +21,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
...themeConfig,
shape: {
...themeConfig.shape,
borderRadius: 12,
borderRadius: 4,
},
components: {
MuiCssBaseline: {
@@ -31,6 +31,18 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
},
},
},
MuiBackdrop: {
styleOverrides: {
root: {
backgroundColor: "rgba(255, 255, 255, 0.15)",
backdropFilter: "blur(8px)",
"&.MuiBackdrop-invisible": {
backgroundColor: "transparent",
backdropFilter: "none",
},
},
},
},
MuiTooltip: {
defaultProps: {
enterDelay: 500,
@@ -63,7 +75,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
MuiListItemButton: {
styleOverrides: {
root: {
borderRadius: 12,
borderRadius: 4,
},
},
},
@@ -82,7 +94,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
MuiMenu: {
styleOverrides: {
paper: {
borderRadius: "8px",
borderRadius: "4px",
},
list: {
padding: "4px 0",
@@ -106,7 +118,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
MuiMenuItem: {
styleOverrides: {
root: {
borderRadius: "8px",
borderRadius: "4px",
margin: "0px 4px",
paddingLeft: "8px",
paddingRight: "8px",
@@ -127,7 +139,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
"&:hover:not(.Mui-disabled, .Mui-error):before": {
borderBottom: "none",
},
borderRadius: 12,
borderRadius: 4,
// '&:hover:not(.Mui-disabled, .Mui-error):before': {
// borderBottom: '2px solid var(--TextField-brandBorderHoverColor)',
// },
@@ -271,7 +283,7 @@ const getPreferredTheme = (
const StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({
"&.notistack-MuiContent": {
borderRadius: 12,
borderRadius: 4,
},
"&.notistack-MuiContent-success": {
backgroundColor: theme.palette.success.main,
@@ -288,6 +300,15 @@ const AppContent = () => {
const title = useAppSelector((state) => state.siteConfig.basic.config.title);
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const { enqueueSnackbar } = useSnackbar();
useEffect(() => {
// 显示测试网站提示
enqueueSnackbar("请注意,本网站是测试网站", {
variant: "warning",
autoHideDuration: 5000,
});
}, [enqueueSnackbar]);
const scrollBar = {
"&::-webkit-scrollbar-button": {
width: 0,

View File

@@ -64,6 +64,7 @@ const HeadlessFooterPreview = ({ footer, bottom }: { footer?: string; bottom?: s
maxHeight: "40px",
mb: 2,
}}
style={{ display: "flex", justifyContent: "center", alignItems: "center" }}
/>
<div>
<Box

View File

@@ -10,7 +10,7 @@ export const OutlineIconTextField = ({ icon, ...rest }: OutlineIconTextFieldProp
return (
<TextField
{...rest}
variant="filled"
variant="standard"
slotProps={{
input: {
startAdornment: !isMobile && <InputAdornment position="start">{icon}</InputAdornment>,

View File

@@ -1,4 +1,5 @@
import { Box, Container, Grid, Paper } from "@mui/material";
import { Box, Container, Grid, Paper, AppBar, Toolbar, IconButton, Typography, Button } from "@mui/material";
import MenuIcon from "@mui/icons-material/Menu";
import { Outlet, useNavigation } from "react-router-dom";
import { useAppDispatch, useAppSelector } from "../../redux/hooks.ts";
import AutoHeight from "../Common/AutoHeight.tsx";
@@ -40,6 +41,35 @@ const HeadlessFrame = () => {
overflow: "auto",
}}
>
<Box sx={{ flexGrow: 1 }}>
<AppBar
sx={{
backgroundColor: "#f5f5f5",
}}
>
<Toolbar>
{/* <IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton> */}
{/* <Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
News
</Typography> */}
<Logo
sx={{
maxWidth: "40%",
maxHeight: "40px",
mb: 2,
}}
/>
</Toolbar>
</AppBar>
</Box>
<Container maxWidth={"xs"}>
<Grid
container

View File

@@ -1,6 +1,5 @@
import { Box, BoxProps, Typography, useTheme } from "@mui/material";
import LogoIcon from "./assets/logo.svg";
import LogoIconDark from "./assets/logo_light.svg";
import Logo from "../Common/Logo";
export interface PoweredByProps extends BoxProps {}
@@ -11,7 +10,6 @@ const PoweredBy = ({ ...rest }: PoweredByProps) => {
<Box
component="a"
marginBottom={2}
href="https://cloudreve.org"
target="_blank"
sx={{
width: "100%",
@@ -38,16 +36,8 @@ const PoweredBy = ({ ...rest }: PoweredByProps) => {
}}
fontWeight={500}
>
Powered by
Powered by Miaostars
</Typography>
<Box
component="img"
alt="Cloudreve"
sx={{
height: 20,
}}
src={theme.palette.mode === "dark" ? LogoIconDark : LogoIcon}
/>
</Box>
</Box>
);

View File

@@ -32,7 +32,7 @@ export default function PasskeyLoginButton({ autoComplete, ...rest }: PasskeyLog
window.PublicKeyCredential &&
PublicKeyCredential.isConditionalMediationAvailable
) {
PublicKeyCredential.isConditionalMediationAvailable().then((v) => {
PublicKeyCredential.isConditionalMediationAvailable().then(() => {
if (!abortRef.current.signal.aborted) startLogin(true)();
});
}
@@ -43,12 +43,7 @@ export default function PasskeyLoginButton({ autoComplete, ...rest }: PasskeyLog
const startLogin = (conditional: boolean) => async () => {
if (!navigator.credentials || !window.PublicKeyCredential) {
enqueueSnackbar({
message: t("setting.browserNotSupported"),
variant: "warning",
action: DefaultCloseAction,
});
enqueueSnackbar(t("setting.browserNotSupported"), { variant: "error", action: DefaultCloseAction });
return;
}

View File

@@ -37,12 +37,7 @@ const PasskeyList = (props: PasskeyProps) => {
const [deleteLoading, setDeleteLoading] = useState(false);
const addPasskey = async () => {
if (!navigator.credentials || !window.PublicKeyCredential) {
enqueueSnackbar({
message: t("setting.browserNotSupported"),
variant: "warning",
action: DefaultCloseAction,
});
dispatch(confirmOperation(t("setting.browserNotSupported")));
return;
}