Skip to content

Commit 68bf794

Browse files
committed
perf: light mode
1 parent 08ca00f commit 68bf794

5 files changed

Lines changed: 57 additions & 21 deletions

File tree

src/App.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<template>
2-
<n-config-provider :theme-overrides="overrides[theme]" :theme="darkTheme" :class="theme">
2+
<n-config-provider
3+
:theme-overrides="overrides[theme]"
4+
:theme="theme === 'dark' ? darkTheme : null"
5+
:class="theme"
6+
>
37
<n-message-provider>
48
<router-view />
59
</n-message-provider>

src/layouts/Content/SliceList/index.vue

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,17 @@ setVideoInfoSetting();
274274
max-width: 100%;
275275
padding: 6px 10px;
276276
border-radius: 999px;
277-
background: rgba(255, 255, 255, 0.04);
278-
border: 1px solid rgba(255, 255, 255, 0.06);
277+
background: rgba(156, 163, 175, 0.1);
278+
border: 1px solid rgba(156, 163, 175, 0.15);
279279
transition:
280280
background 0.2s,
281281
border-color 0.2s;
282+
283+
:global(.dark) & {
284+
background: rgba(255, 255, 255, 0.04);
285+
border-color: rgba(255, 255, 255, 0.06);
286+
}
287+
282288
&.is-empty {
283289
opacity: 0.7;
284290
}
@@ -336,19 +342,33 @@ setVideoInfoSetting();
336342
transition:
337343
background 0.15s,
338344
border-color 0.15s;
339-
border: 1px solid rgba(255, 255, 255, 0.06);
345+
border: 1px solid rgba(156, 163, 175, 0.15);
340346
border-radius: 10px;
341347
348+
:global(.dark) & {
349+
border-color: rgba(255, 255, 255, 0.06);
350+
}
351+
342352
&:hover {
343-
background: rgba(255, 255, 255, 0.06);
353+
background: rgba(156, 163, 175, 0.08);
354+
355+
:global(.dark) & {
356+
background: rgba(255, 255, 255, 0.06);
357+
}
358+
344359
.item-close {
345360
opacity: 1;
346361
transform: translateX(0);
347362
}
348363
}
349364
&.active {
350-
background: rgba(64, 158, 255, 0.14);
351-
border-color: rgba(64, 158, 255, 0.35);
365+
background: rgba(64, 158, 255, 0.12);
366+
border-color: rgba(64, 158, 255, 0.3);
367+
368+
:global(.dark) & {
369+
background: rgba(64, 158, 255, 0.14);
370+
border-color: rgba(64, 158, 255, 0.35);
371+
}
352372
}
353373
.item-main {
354374
display: flex;

src/layouts/Content/index.vue

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/layouts/index.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
<template>
2-
<n-flex class="!gap-0 !flex-nowrap">
2+
<n-flex class="!gap-0 !flex-nowrap main-bg-base">
33
<Side />
44

5-
<n-layout class="flex flex-col">
6-
<n-layout-header class="flex items-center w-full h-14">
5+
<n-layout class="flex flex-col main-bg-base">
6+
<n-layout-header class="flex items-center w-full h-14 header-base">
77
<Header @back="handleBack" />
88
</n-layout-header>
99

10-
<n-divider class="!m-0" />
10+
<n-divider class="!m-0 divider-base" />
1111

1212
<n-layout
1313
has-sider
14-
:content-style="{ gap: '24px', height: 'calc(100vh - 4rem)' }"
14+
:content-style="{ gap: '24px', height: 'calc(100vh - 3.6rem)' }"
1515
sider-placement="right"
16-
class="w-full"
16+
class="w-full main-bg-base"
1717
>
1818
<n-layout-content
1919
:content-style="{
2020
display: 'flex',
2121
padding: '0 12px 0 20px'
2222
}"
23+
class="main-bg-base"
2324
>
2425
<Upload v-if="!showPlayer" @parser="handleParser" />
2526

26-
<div v-else ref="playerWrapRef" class="w-full h-full">
27+
<div v-else ref="playerWrapRef" class="w-full h-full main-bg-base">
2728
<router-view :key="route.fullPath" />
2829
</div>
2930
</n-layout-content>
@@ -37,6 +38,7 @@
3738
collapse-mode="width"
3839
v-model:collapsed="siderCollapsed"
3940
content-style="padding: 24px;"
41+
class="right-side"
4042
>
4143
<SliceList
4244
@play="handlePlay"

uno.config.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,27 @@ export default defineConfig({
1919
'upload-bg-base': 'bg-[#F0F2F5] dark:bg-[#202225] switch-animation',
2020
'list-bg-base': 'bg-[#F6F7F8] dark:bg-[#252627] switch-animation',
2121
'text-base': 'text-[#20202a] dark:text-[#f0f0f0] switch-animation',
22+
'text-secondary': 'text-[#666666] dark:text-[#a0a0a0] switch-animation',
23+
'text-muted': 'text-[#999999] dark:text-[#767676] switch-animation',
2224
'icon-hover': 'hover:color-[#1ab394] switch-animation',
2325
'header-base':
2426
'bg-[#F0F2F5] dark:bg-[#202225] text-[#20202a] dark:text-[#F6F7F8] switch-animation',
2527
'right-side':
26-
'text-[#20202a] dark:text-[#F6F7F8] bg-[#FFFFFF] dark:bg-[#18191B] switch-animation'
28+
'text-[#20202a] dark:text-[#F6F7F8] bg-[#FFFFFF] dark:bg-[#18191B] switch-animation',
29+
'card-bg-base': 'bg-[#FFFFFF] dark:bg-[#1E1E1E] switch-animation',
30+
'border-base': 'border-[#E5E7EB] dark:border-[#374151] switch-animation',
31+
'border-light': 'border-[#F3F4F6] dark:border-[#2D3748] switch-animation',
32+
'divider-base': 'bg-[#E5E7EB] dark:bg-[#374151] switch-animation',
33+
'hover-bg-light': 'hover:bg-[#F9FAFB] dark:hover:bg-[#2D3748] switch-animation',
34+
'hover-bg-medium': 'hover:bg-[#F3F4F6] dark:hover:bg-[#374151] switch-animation',
35+
'active-bg': 'bg-[#EBF8FF] dark:bg-[#1A202C] switch-animation',
36+
'shadow-light': 'shadow-sm shadow-[#00000008] dark:shadow-[#FFFFFF08]',
37+
'shadow-medium': 'shadow-md shadow-[#00000010] dark:shadow-[#FFFFFF10]',
38+
'input-bg':
39+
'bg-[#FFFFFF] dark:bg-[#2D3748] border-[#D1D5DB] dark:border-[#4A5568] switch-animation',
40+
'btn-primary': 'bg-[#3B82F6] hover:bg-[#2563EB] text-white switch-animation',
41+
'btn-secondary':
42+
'bg-[#F3F4F6] hover:bg-[#E5E7EB] dark:bg-[#374151] dark:hover:bg-[#4A5568] switch-animation'
2743
},
2844
theme: {
2945
fontSize: {

0 commit comments

Comments
 (0)