adjust styles

This commit is contained in:
pompurin404 2024-09-26 19:07:05 +08:00
parent d9f6aad7d4
commit c516f8d1d9
No known key found for this signature in database
15 changed files with 101 additions and 58 deletions

View File

@ -13,7 +13,7 @@ const BorderSwitch: React.FC<SiderSwitchProps> = (props) => {
classNames={{ classNames={{
wrapper: cn('border-2', { wrapper: cn('border-2', {
'border-transparent': !isShowBorder, 'border-transparent': !isShowBorder,
'border-white': isShowBorder 'border-primary-foreground': isShowBorder
}), }),
thumb: cn('absolute z-4', 'transform -translate-x-[2px]'), thumb: cn('absolute z-4', 'transform -translate-x-[2px]'),
...classNames ...classNames

View File

@ -187,7 +187,7 @@ const ProfileItem: React.FC<Props> = (props) => {
{...attributes} {...attributes}
{...listeners} {...listeners}
title={info?.name} title={info?.name}
className={`text-ellipsis whitespace-nowrap overflow-hidden text-md font-bold leading-[32px] ${isCurrent ? 'text-white' : 'text-foreground'}`} className={`text-ellipsis whitespace-nowrap overflow-hidden text-md font-bold leading-[32px] ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
> >
{info?.name} {info?.name}
</h3> </h3>
@ -208,7 +208,7 @@ const ProfileItem: React.FC<Props> = (props) => {
> >
<IoMdRefresh <IoMdRefresh
color="default" color="default"
className={`${isCurrent ? 'text-white' : 'text-foreground'} text-[24px] ${updating ? 'animate-spin' : ''}`} className={`${isCurrent ? 'text-primary-foreground' : 'text-foreground'} text-[24px] ${updating ? 'animate-spin' : ''}`}
/> />
</Button> </Button>
</Tooltip> </Tooltip>
@ -219,7 +219,7 @@ const ProfileItem: React.FC<Props> = (props) => {
<Button isIconOnly size="sm" variant="light" color="default"> <Button isIconOnly size="sm" variant="light" color="default">
<IoMdMore <IoMdMore
color="default" color="default"
className={`text-[24px] ${isCurrent ? 'text-white' : 'text-foreground'}`} className={`text-[24px] ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
/> />
</Button> </Button>
</DropdownTrigger> </DropdownTrigger>
@ -240,7 +240,7 @@ const ProfileItem: React.FC<Props> = (props) => {
</div> </div>
{info.type === 'remote' && extra && ( {info.type === 'remote' && extra && (
<div <div
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`} className={`mt-2 flex justify-between ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
> >
<small>{`${calcTraffic(usage)}/${calcTraffic(total)}`}</small> <small>{`${calcTraffic(usage)}/${calcTraffic(total)}`}</small>
<small> <small>
@ -250,12 +250,12 @@ const ProfileItem: React.FC<Props> = (props) => {
)} )}
{info.type === 'local' && ( {info.type === 'local' && (
<div <div
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`} className={`mt-2 flex justify-between ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
> >
<Chip <Chip
size="sm" size="sm"
variant="bordered" variant="bordered"
className={`${isCurrent ? 'text-white border-white' : 'border-primary text-primary'}`} className={`${isCurrent ? 'text-primary-foreground border-primary-foreground' : 'border-primary text-primary'}`}
> >
</Chip> </Chip>
@ -267,7 +267,7 @@ const ProfileItem: React.FC<Props> = (props) => {
<Progress <Progress
className="w-full" className="w-full"
classNames={{ classNames={{
indicator: isCurrent ? 'bg-white' : 'bg-foreground' indicator: isCurrent ? 'bg-primary-foreground' : 'bg-foreground'
}} }}
value={calcPercent(extra?.upload, extra?.download, extra?.total)} value={calcPercent(extra?.upload, extra?.download, extra?.total)}
/> />

View File

@ -39,17 +39,22 @@ const ConnCard: React.FC = () => {
const [chartColor, setChartColor] = useState('rgba(255,255,255)') const [chartColor, setChartColor] = useState('rgba(255,255,255)')
useEffect(() => { useEffect(() => {
setTimeout(() => {
const islight = theme === 'system' ? systemTheme === 'light' : theme.includes('light')
setChartColor( setChartColor(
match match
? 'rgba(255,255,255)' ? `hsla(${getComputedStyle(document.documentElement).getPropertyValue('--nextui-primary-foreground')})`
: islight : `hsla(${getComputedStyle(document.documentElement).getPropertyValue('--nextui-foreground')})`
? window.getComputedStyle(document.documentElement).color
: 'rgb(255,255,255)'
) )
}, 1000) }, [theme, systemTheme, match])
}, [theme, systemTheme, match, customTheme])
useEffect(() => {
setTimeout(() => {
setChartColor(
match
? `hsla(${getComputedStyle(document.documentElement).getPropertyValue('--nextui-primary-foreground')})`
: `hsla(${getComputedStyle(document.documentElement).getPropertyValue('--nextui-foreground')})`
)
}, 200)
}, [customTheme])
const transform = tf ? { x: tf.x, y: tf.y, scaleX: 1, scaleY: 1 } : null const transform = tf ? { x: tf.x, y: tf.y, scaleX: 1, scaleY: 1 } : null
useEffect(() => { useEffect(() => {
@ -111,10 +116,12 @@ const ConnCard: React.FC = () => {
> >
<IoLink <IoLink
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px]`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px]`}
/> />
</Button> </Button>
<div className={`p-2 w-full ${match ? 'text-white' : 'text-foreground'} `}> <div
className={`p-2 w-full ${match ? 'text-primary-foreground' : 'text-foreground'} `}
>
<div className="flex justify-between"> <div className="flex justify-between">
<div className="w-full text-right mr-2">{calcTraffic(upload)}/s</div> <div className="w-full text-right mr-2">{calcTraffic(upload)}/s</div>
<FaCircleArrowUp className="h-[24px] leading-[24px]" /> <FaCircleArrowUp className="h-[24px] leading-[24px]" />
@ -127,7 +134,9 @@ const ConnCard: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>
@ -175,13 +184,15 @@ const ConnCard: React.FC = () => {
> >
<IoLink <IoLink
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -57,7 +57,7 @@ const DNSCard: React.FC = () => {
color="default" color="default"
> >
<LuServer <LuServer
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
<BorderSwitch <BorderSwitch
@ -69,7 +69,11 @@ const DNSCard: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}>DNS</h3> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
DNS
</h3>
</CardFooter> </CardFooter>
</Card> </Card>
</div> </div>

View File

@ -47,13 +47,17 @@ const LogCard: React.FC = () => {
> >
<IoJournalOutline <IoJournalOutline
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}></h3> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3>
</CardFooter> </CardFooter>
</Card> </Card>
</div> </div>

View File

@ -69,7 +69,7 @@ const MihomoCoreCard: React.FC = () => {
className="flex justify-between h-[32px]" className="flex justify-between h-[32px]"
> >
<h3 <h3
className={`text-md font-bold leading-[32px] ${match ? 'text-white' : 'text-foreground'} `} className={`text-md font-bold leading-[32px] ${match ? 'text-primary-foreground' : 'text-foreground'} `}
> >
{version?.version ?? '-'} {version?.version ?? '-'}
</h3> </h3>
@ -90,14 +90,14 @@ const MihomoCoreCard: React.FC = () => {
}} }}
> >
<IoMdRefresh <IoMdRefresh
className={`${match ? 'text-white' : 'text-foreground'} text-[24px]`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px]`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<div <div
className={`flex justify-between w-full text-md font-bold ${match ? 'text-white' : 'text-foreground'}`} className={`flex justify-between w-full text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
> >
<h4></h4> <h4></h4>
<h4>{calcTraffic(mem)}</h4> <h4>{calcTraffic(mem)}</h4>
@ -122,13 +122,15 @@ const MihomoCoreCard: React.FC = () => {
> >
<LuCpu <LuCpu
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -49,13 +49,17 @@ const OverrideCard: React.FC = () => {
> >
<MdFormatOverline <MdFormatOverline
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px]`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px]`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}></h3> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3>
</CardFooter> </CardFooter>
</Card> </Card>
</div> </div>

View File

@ -75,7 +75,7 @@ const ProfileCard: React.FC = () => {
> >
<h3 <h3
title={info?.name} title={info?.name}
className={`text-ellipsis whitespace-nowrap overflow-hidden text-md font-bold leading-[32px] ${match ? 'text-white' : 'text-foreground'} `} className={`text-ellipsis whitespace-nowrap overflow-hidden text-md font-bold leading-[32px] ${match ? 'text-primary-foreground' : 'text-foreground'} `}
> >
{info?.name} {info?.name}
</h3> </h3>
@ -91,7 +91,7 @@ const ProfileCard: React.FC = () => {
}} }}
> >
<CgLoadbarDoc <CgLoadbarDoc
className={`text-[24px] ${match ? 'text-white' : 'text-foreground'}`} className={`text-[24px] ${match ? 'text-primary-foreground' : 'text-foreground'}`}
/> />
</Button> </Button>
{info.type === 'remote' && ( {info.type === 'remote' && (
@ -109,7 +109,7 @@ const ProfileCard: React.FC = () => {
}} }}
> >
<IoMdRefresh <IoMdRefresh
className={`text-[24px] ${match ? 'text-white' : 'text-foreground'} ${updating ? 'animate-spin' : ''}`} className={`text-[24px] ${match ? 'text-primary-foreground' : 'text-foreground'} ${updating ? 'animate-spin' : ''}`}
/> />
</Button> </Button>
</Tooltip> </Tooltip>
@ -118,7 +118,7 @@ const ProfileCard: React.FC = () => {
</div> </div>
{info.type === 'remote' && extra && ( {info.type === 'remote' && extra && (
<div <div
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `} className={`mt-2 flex justify-between ${match ? 'text-primary-foreground' : 'text-foreground'} `}
> >
<small>{`${calcTraffic(usage)}/${calcTraffic(total)}`}</small> <small>{`${calcTraffic(usage)}/${calcTraffic(total)}`}</small>
<small> <small>
@ -128,12 +128,12 @@ const ProfileCard: React.FC = () => {
)} )}
{info.type === 'local' && ( {info.type === 'local' && (
<div <div
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'}`} className={`mt-2 flex justify-between ${match ? 'text-primary-foreground' : 'text-foreground'}`}
> >
<Chip <Chip
size="sm" size="sm"
variant="bordered" variant="bordered"
className={`${match ? 'text-white border-white' : 'border-primary text-primary'}`} className={`${match ? 'text-primary-foreground border-primary-foreground' : 'border-primary text-primary'}`}
> >
</Chip> </Chip>
@ -144,7 +144,7 @@ const ProfileCard: React.FC = () => {
{extra && ( {extra && (
<Progress <Progress
className="w-full" className="w-full"
classNames={{ indicator: match ? 'bg-white' : 'bg-foreground' }} classNames={{ indicator: match ? 'bg-primary-foreground' : 'bg-foreground' }}
value={calcPercent(extra?.upload, extra?.download, extra?.total)} value={calcPercent(extra?.upload, extra?.download, extra?.total)}
/> />
)} )}
@ -168,13 +168,15 @@ const ProfileCard: React.FC = () => {
> >
<TiFolder <TiFolder
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px]`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px]`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -50,15 +50,15 @@ const ProxyCard: React.FC = () => {
color="default" color="default"
> >
<LuGroup <LuGroup
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
<Chip <Chip
classNames={ classNames={
match match
? { ? {
base: 'border-white', base: 'border-primary-foreground',
content: 'text-white' content: 'text-primary-foreground'
} }
: { : {
base: 'border-primary', base: 'border-primary',
@ -74,7 +74,9 @@ const ProxyCard: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -48,13 +48,15 @@ const ResourceCard: React.FC = () => {
> >
<IoLayersOutline <IoLayersOutline
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -50,15 +50,15 @@ const RuleCard: React.FC = () => {
> >
<MdOutlineAltRoute <MdOutlineAltRoute
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px]`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px]`}
/> />
</Button> </Button>
<Chip <Chip
classNames={ classNames={
match match
? { ? {
base: 'border-white', base: 'border-primary-foreground',
content: 'text-white' content: 'text-primary-foreground'
} }
: { : {
base: 'border-primary', base: 'border-primary',
@ -74,7 +74,11 @@ const RuleCard: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}></h3> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3>
</CardFooter> </CardFooter>
</Card> </Card>
</div> </div>

View File

@ -59,7 +59,7 @@ const SniffCard: React.FC = () => {
> >
<RiScan2Fill <RiScan2Fill
color="default" color="default"
className={`${match ? 'text-white' : 'text-foreground'} text-[24px]`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px]`}
/> />
</Button> </Button>
<BorderSwitch <BorderSwitch
@ -70,7 +70,9 @@ const SniffCard: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -46,13 +46,15 @@ const SubStoreCard: React.FC = () => {
color="default" color="default"
> >
<SubStoreIcon <SubStoreIcon
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
Sub-Store Sub-Store
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -61,7 +61,7 @@ const SysproxySwitcher: React.FC = () => {
color="default" color="default"
> >
<AiOutlineGlobal <AiOutlineGlobal
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
<BorderSwitch <BorderSwitch
@ -72,7 +72,9 @@ const SysproxySwitcher: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>

View File

@ -98,7 +98,7 @@ const TunSwitcher: React.FC = () => {
color="default" color="default"
> >
<TbDeviceIpadHorizontalBolt <TbDeviceIpadHorizontalBolt
className={`${match ? 'text-white' : 'text-foreground'} text-[24px] font-bold`} className={`${match ? 'text-primary-foreground' : 'text-foreground'} text-[24px] font-bold`}
/> />
</Button> </Button>
<BorderSwitch <BorderSwitch
@ -109,7 +109,9 @@ const TunSwitcher: React.FC = () => {
</div> </div>
</CardBody> </CardBody>
<CardFooter className="pt-1"> <CardFooter className="pt-1">
<h3 className={`text-md font-bold ${match ? 'text-white' : 'text-foreground'}`}> <h3
className={`text-md font-bold ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
</h3> </h3>
</CardFooter> </CardFooter>