Skip to content

Commit

Permalink
fix: unify shadow & rounded
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso committed Dec 8, 2024
1 parent 1c26b96 commit 9075528
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 40 deletions.
9 changes: 9 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
font-family: 'NotoEmoji';
src: url('./NotoColorEmoji-flagsonly.ttf') format('truetype');
}

@layer components {
.card {
@apply rounded-btn bg-base-100 shadow-card;
}
.collapse {
@apply rounded-btn bg-base-100 shadow-card;
}
}
10 changes: 5 additions & 5 deletions src/components/connections/ConnectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineComponent<{
</span>
)
const download = (
<div class="badge flex bg-base-200 px-1 text-sm text-base-content">
<div class="badge flex px-1 text-sm text-base-content">
<ArrowDownIcon class="h-4 w-3" />
<div class="hidden w-16 text-right sm:inline">
{prettyBytesHelper(props.conn.download)} |{' '}
Expand All @@ -44,14 +44,14 @@ export default defineComponent<{
</div>
)
const uploadCompact = (
<div class="badge hidden bg-base-200 px-1 text-sm text-base-content 2xl:flex">
<div class="badge hidden px-1 text-sm text-base-content 2xl:flex">
<ArrowUpIcon class="h-4 w-3" />
<div class="w-16 text-right">{prettyBytesHelper(props.conn.upload)} | </div>
<div class="w-20 text-right">{prettyBytesHelper(props.conn.uploadSpeed)}/s</div>
</div>
)
const upload = (
<div class="badge hidden bg-base-200 px-1 text-sm text-base-content lg:flex">
<div class="badge hidden px-1 text-sm text-base-content lg:flex">
<ArrowUpIcon class="h-4 w-3" />
<div class="w-16 text-right">{prettyBytesHelper(props.conn.upload)} | </div>
<div class="w-20 text-right">{prettyBytesHelper(props.conn.uploadSpeed)}/s</div>
Expand Down Expand Up @@ -125,7 +125,7 @@ export default defineComponent<{

if (isLargeScreen.value && compactConnectionCard.value) {
return (
<div class="card w-full flex-row items-center justify-between gap-1 rounded-xl bg-base-100 px-2 py-1 shadow-lg">
<div class="card w-full flex-row items-center justify-between gap-1 px-2 py-1">
{host}
{chians}
{connectionCompact}
Expand All @@ -138,7 +138,7 @@ export default defineComponent<{
)
} else {
return (
<div class="card w-full gap-[1px] rounded-xl bg-base-100 px-2 py-[1px] shadow-lg">
<div class="card w-full gap-[1px] px-2 py-[1px]">
<div class="flex flex-row items-center gap-1 px-1">
{host}
{flex1}
Expand Down
4 changes: 2 additions & 2 deletions src/components/connections/ConnectionTable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<table class="table table-zebra table-xs overflow-hidden rounded-lg bg-base-100 shadow-lg">
<thead class="bg-base-100">
<table class="table table-zebra table-xs overflow-hidden rounded-btn shadow-card">
<thead class="">
<tr
v-for="headerGroup in table.getHeaderGroups()"
:key="headerGroup.id"
Expand Down
2 changes: 1 addition & 1 deletion src/components/proxies/ProxyGroup.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="collapse collapse-arrow bg-base-100 shadow-lg">
<div class="collapse collapse-arrow">
<div class="collapse-title">
<div class="flex items-center gap-2">
<div class="flex items-center gap-1 text-lg font-medium sm:text-xl">
Expand Down
2 changes: 1 addition & 1 deletion src/components/proxies/ProxyNodeCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div
:class="
twMerge(
'flex cursor-pointer flex-wrap items-center justify-end gap-1 rounded-md bg-base-200 p-2 shadow-md sm:hover:scale-105',
'flex cursor-pointer flex-wrap items-center justify-end gap-1 rounded-btn bg-base-200 p-2 shadow-card shadow-md sm:hover:scale-105',
active && 'bg-primary text-primary-content',
truncateProxyName && isTruncated && 'tooltip text-left',
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/proxies/ProxyPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div
v-for="node in nodesLatency"
:key="node.name"
class="flex h-4 w-4 items-center justify-center rounded-full shadow-lg"
class="flex h-4 w-4 items-center justify-center rounded-full"
:class="getBgColor(node.latency)"
>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/proxies/ProxyProvider.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="collapse collapse-arrow bg-base-100 shadow-lg">
<div class="collapse collapse-arrow">
<div class="collapse-title">
<div class="flex items-center gap-2">
<div class="text-lg font-medium sm:text-xl">
Expand Down
2 changes: 1 addition & 1 deletion src/components/rules/RuleCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="card block w-full gap-2 rounded-xl bg-base-100 p-2 text-sm shadow-lg">
<div class="card block w-full gap-2 p-2 text-sm">
<span>{{ rule.type }}</span>
<span class="mx-2">{{ rule.payload }}</span>
<span class="min-w-32 text-primary">-> {{ rule.proxy }}</span>
Expand Down
4 changes: 1 addition & 3 deletions src/components/rules/RuleProvider.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<template>
<div
class="card w-full flex-row items-center gap-2 rounded-xl bg-base-100 p-1 px-2 text-sm shadow-lg"
>
<div class="card w-full flex-row items-center gap-2 p-1 px-2 text-sm">
<div class="flex flex-1 flex-col sm:flex-row">
<div class="w-48 flex-1 text-primary">
{{ ruleProvider.name }} ({{ ruleProvider.ruleCount }})
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/SourceIPLabels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
v-model="sourceIPLabelMap[ip]"
/>
<button
class="btn btn-circle btn-xs bg-base-300"
class="btn btn-circle btn-xs"
@click="() => handlerLabelRemove(ip)"
>
<MinusCircleIcon class="h-4 w-4" />
Expand All @@ -32,7 +32,7 @@
v-model="newLabelForIP.label"
/>
<button
class="btn btn-circle btn-xs bg-base-300"
class="btn btn-circle btn-xs"
@click="handlerLabelAdd"
>
<PlusIcon class="h-4 w-4" />
Expand Down
8 changes: 4 additions & 4 deletions src/components/settings/TableSettings.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div>{{ $t('customTableColumns') }}:</div>
<div class="flex rounded bg-base-200 lg:flex-col">
<div class="flex rounded lg:flex-col">
<VueDraggable
class="flex flex-1 flex-col gap-2 bg-base-300 p-2 lg:flex-row"
class="flex flex-1 flex-col gap-2 bg-base-200 p-2 lg:flex-row"
v-model="connectionTableColumns"
:animation="150"
group="list"
Expand All @@ -11,7 +11,7 @@
<div
v-for="item in connectionTableColumns"
:key="item"
class="flex h-8 cursor-move items-center rounded bg-neutral px-2 text-neutral-content shadow-lg"
class="flex h-8 cursor-move items-center rounded bg-neutral px-2 text-neutral-content"
>
{{ $t(item) }}
</div>
Expand All @@ -26,7 +26,7 @@
<div
v-for="item in restOfColumns"
:key="item"
class="flex h-8 cursor-move items-center rounded bg-neutral px-2 text-neutral-content shadow-lg"
class="flex h-8 cursor-move items-center rounded bg-neutral px-2 text-neutral-content"
>
{{ $t(item) }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/CommonCtrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ $t('version') }}:
<img
:src="isSingBox ? SingBoxLogo : MetacubexLogo"
class="w-4 rounded-sm"
class="w-4"
/>
{{ version }}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/sidebar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
<VerticalInfos />
</template>
<template v-else>
<div class="card bg-base-100 shadow-lg">
<div class="card shadow-sm">
<component
v-if="sidebarComp"
:is="sidebarComp"
/>
<CommonSidebar />
</div>
<div
class="card overflow-hidden bg-base-100 shadow-lg"
class="card overflow-hidden shadow-sm"
v-if="route.name !== ROUTE_NAME.settings"
>
<SpeedCharts />
Expand Down
2 changes: 1 addition & 1 deletion src/components/statistics/MemoryCharts.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
ref="chart"
class="h-28 w-full bg-base-100"
class="h-28 w-full"
></div>
<span
class="hidden text-base-content"
Expand Down
2 changes: 1 addition & 1 deletion src/components/statistics/SpeedCharts.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
ref="chart"
class="h-28 w-full bg-base-100"
class="h-28 w-full"
></div>
<span
class="hidden text-base-content"
Expand Down
2 changes: 1 addition & 1 deletion src/views/ConnectionsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="h-full overflow-auto p-2">
<template v-if="useConnectionCard">
<template v-if="!renderConnections.length">
<div class="card w-full flex-row gap-1 rounded-xl bg-base-100 p-2 text-sm shadow-lg">
<div class="card w-full flex-row gap-1 p-2 text-sm">
{{ $t('noContent') }}
</div>
</template>
Expand Down
6 changes: 2 additions & 4 deletions src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<SideBar />

<div
class="drawer-content fixed bottom-0 flex h-full w-full flex-col overflow-hidden bg-base-200/50 md:relative md:w-auto"
class="drawer-content fixed bottom-0 flex h-full w-full flex-col overflow-hidden bg-base-200/20 md:relative md:w-auto"
>
<component
v-if="ctrlComp && isSiderbarCollapsed"
Expand Down Expand Up @@ -41,9 +41,7 @@
</li>
</ul>
<label for="sidebar">
<div
class="btn btn-circle drawer-button btn-sm bg-neutral text-neutral-content shadow-lg"
>
<div class="btn btn-circle drawer-button btn-sm bg-neutral text-neutral-content">
<Bars3Icon class="h-4 w-4" />
</div>
</label>
Expand Down
4 changes: 2 additions & 2 deletions src/views/LogsPage.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="flex h-full flex-col gap-1 overflow-y-auto overflow-x-hidden p-2">
<template v-if="!renderLogs.length">
<div class="card w-full flex-row gap-1 rounded-xl bg-base-100 p-2 text-sm shadow-lg">
<div class="card w-full flex-row gap-1 p-2 text-sm">
{{ $t('noContent') }}
</div>
</template>
<div
v-for="log in renderLogs"
:key="log.seq"
class="card block rounded-xl bg-base-100 p-2 text-sm shadow-lg"
class="card block p-2 text-sm"
>
<span>{{ log.seq }}</span>
<span class="mx-2 text-primary">{{
Expand Down
10 changes: 5 additions & 5 deletions src/views/SettingsPage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="grid grid-cols-1 gap-2 overflow-y-auto p-2">
<!-- dashboard -->
<div class="card card-compact bg-base-100 shadow-lg">
<div class="card card-compact">
<div class="card-title px-4 pt-4 text-primary">
<div class="indicator">
<span
Expand Down Expand Up @@ -79,7 +79,7 @@
</div>

<!-- statistics -->
<div class="card card-compact bg-base-100 shadow-lg">
<div class="card card-compact">
<div class="card-title px-4 pt-4">
{{ $t('statistics') }}
</div>
Expand All @@ -91,7 +91,7 @@
</div>

<!-- backend -->
<div class="card card-compact bg-base-100 shadow-lg">
<div class="card card-compact">
<div class="card-title px-4 pt-4">
{{ $t('backend') }}
</div>
Expand Down Expand Up @@ -138,7 +138,7 @@
</div>

<!-- proxies -->
<div class="card card-compact bg-base-100 shadow-lg">
<div class="card card-compact">
<div class="card-title px-4 pt-4">
{{ $t('proxies') }}
</div>
Expand Down Expand Up @@ -237,7 +237,7 @@
</div>

<!-- connections -->
<div class="card card-compact bg-base-100 shadow-lg">
<div class="card card-compact">
<div class="card-title px-4 pt-4">
{{ $t('connections') }}
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/views/SetupPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="absolute bottom-4 right-4">
<LanguageSelect />
</div>
<div class="rounded-lg bg-base-100 p-6 shadow-lg">
<div class="card p-6">
<h1 class="mb-4 text-2xl font-semibold">{{ $t('setup') }}</h1>
<div class="form-control mb-4">
<label class="label">
Expand Down Expand Up @@ -152,7 +152,11 @@ const query = new URLSearchParams(
)
if (query.has('hostname')) {
handleSubmit({
protocol: query.get('http') ? 'http' : query.get('https') ? 'https' : window.location.protocol.replace(':', ''),
protocol: query.get('http')
? 'http'
: query.get('https')
? 'https'
: window.location.protocol.replace(':', ''),
host: query.get('hostname') as string,
port: Number(query.get('port')) as unknown as number,
password: query.get('secret') as string,
Expand Down
3 changes: 3 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default {
'3xl': '1800px',
},
extend: {
boxShadow: {
card: '0 0 8px rgba(0, 0, 0, 0.06), 0 4px 32px rgba(0, 0, 0, 0.04)',
},
fontFamily: {
MiSans: ['MiSans-VF', 'NotoEmoji', 'system-ui'],
SarasaUI: ['SarasaUiSC-Regular', 'NotoEmoji', 'system-ui'],
Expand Down

0 comments on commit 9075528

Please sign in to comment.