Improve shadows

This commit is contained in:
Corey 2024-05-07 08:59:29 +00:00
parent 5f215050b7
commit 1553b2606b
5 changed files with 301 additions and 291 deletions

View File

@ -1,10 +1,12 @@
import { Card, CardContent, Typography } from '@mui/material'; import { Card, CardContent, Typography } from '@mui/material';
import { useThemeModeContext } from '../context/ThemeContext';
type ErrorCardProps = { error: string }; type ErrorCardProps = { error: string };
export default function ErrorCard({ error }: ErrorCardProps) { export default function ErrorCard({ error }: ErrorCardProps) {
const { themeMode } = useThemeModeContext();
return ( return (
<Card className="mb-2"> <Card className="mb-2" raised={themeMode === 'light'}>
<CardContent className="p-4"> <CardContent className="p-4">
<Typography align="center" variant="h6"> <Typography align="center" variant="h6">
¯\_(ツ)_/¯ ¯\_(ツ)_/¯

View File

@ -1,5 +1,6 @@
import { import {
Container, Container,
Divider,
Grid, Grid,
Input, Input,
Slider, Slider,
@ -150,6 +151,7 @@ export default function SearchServers({
}; };
return ( return (
<>
<Container <Container
ref={containerRef} ref={containerRef}
className="overflow-hidden" className="overflow-hidden"
@ -444,5 +446,7 @@ export default function SearchServers({
</Grid> </Grid>
</Grid> </Grid>
</Container> </Container>
{contentHeight > 0 && <Divider />}
</>
); );
} }

View File

@ -64,7 +64,7 @@ export default function SettingsChipCloud({ server }: SettingsChipCloudProps) {
'&> .MuiChip-label': { '&> .MuiChip-label': {
paddingRight: 0.5, paddingRight: 0.5,
}, },
boxShadow: '0px 3px 3px rgba(0, 0, 0, .25)', boxShadow: 1,
}} }}
/> />
</Tooltip> </Tooltip>

View File

@ -26,6 +26,7 @@ import {
useState, useState,
} from 'react'; } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useThemeModeContext } from '../context/ThemeContext';
import { ServerData } from '../data/ServerData'; import { ServerData } from '../data/ServerData';
import CopyImageIcon from '../images/copy-image.png'; import CopyImageIcon from '../images/copy-image.png';
import ExpansionBar from './Server/ExpansionsBar'; import ExpansionBar from './Server/ExpansionsBar';
@ -46,6 +47,7 @@ type ServerCardProps = {
}; };
export default function ServerCard({ server, children }: ServerCardProps) { export default function ServerCard({ server, children }: ServerCardProps) {
const { themeMode } = useThemeModeContext();
const [clipboardTooltip, setClipboardTooltip] = useState('Copy server URL.'); const [clipboardTooltip, setClipboardTooltip] = useState('Copy server URL.');
const [clipboardTooltipOpen, setClipboardTooltipOpen] = useState(false); const [clipboardTooltipOpen, setClipboardTooltipOpen] = useState(false);
const handleClipboardTooltipClose = () => { const handleClipboardTooltipClose = () => {
@ -110,7 +112,7 @@ export default function ServerCard({ server, children }: ServerCardProps) {
}; };
return ( return (
<Card className="mb-2"> <Card className="mb-2" raised={themeMode === 'light'}>
<Accordion <Accordion
className="my-0" className="my-0"
defaultExpanded={isSettingsDataGridChild} defaultExpanded={isSettingsDataGridChild}

View File

@ -6,16 +6,18 @@ import {
Box, Box,
Card, Card,
CardContent, CardContent,
Paper,
Typography, Typography,
alpha, alpha,
} from '@mui/material'; } from '@mui/material';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useThemeModeContext } from '../context/ThemeContext';
export default function About() { export default function About() {
const { themeMode } = useThemeModeContext();
return ( return (
<> <>
<Card className="mb-3"> <Card className="mb-2" raised={themeMode === 'light'}>
<CardContent> <CardContent>
<Box className="mb-3"> <Box className="mb-3">
<Typography align="center" variant="h6"> <Typography align="center" variant="h6">
@ -148,7 +150,7 @@ export default function About() {
</Box> </Box>
</CardContent> </CardContent>
</Card> </Card>
<Card> <Card className="mb-2" raised={themeMode === 'light'}>
<Accordion className="my-0"> <Accordion className="my-0">
<AccordionSummary expandIcon={<ExpandMore />}> <AccordionSummary expandIcon={<ExpandMore />}>
<Typography variant="h5">For server owners:</Typography> <Typography variant="h5">For server owners:</Typography>
@ -203,8 +205,8 @@ export default function About() {
> >
Create a new file <b>settings/api.lua</b> in your server Create a new file <b>settings/api.lua</b> in your server
directory. directory.
<Paper elevation={2}> <Card className="bg-neutral-500/50">
<pre className="m-0 p-2"> <pre className="m-0 select-text p-2">
<code> <code>
{`xi = xi or {} {`xi = xi or {}
xi.settings = xi.settings or {} xi.settings = xi.settings or {}
@ -216,7 +218,7 @@ xi.settings.api =
}`} }`}
</code> </code>
</pre> </pre>
</Paper> </Card>
The world server needs to be restarted after any changes to any The world server needs to be restarted after any changes to any
of the settings. If you set <b>DO_NOT_TRACK</b> to <b>true</b>, of the settings. If you set <b>DO_NOT_TRACK</b> to <b>true</b>,
your server will be removed on the next hourly update. your server will be removed on the next hourly update.