Skip to content

Commit 24e33ef

Browse files
committed
feat(ui): 💄 Add dark night mode to select page
1 parent aa455cc commit 24e33ef

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

components/p/form/Select.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const optionsLeft = computed(() => rootPos.left.value)
2424
<template>
2525
<div ref="rootEl" class="inline-block">
2626
<HListbox v-slot="{ open }" v-model="selectedOp">
27-
<HListboxButton class="w-full px-2 py-0.5 rounded-md flex justify-between items-center space-x-4 bg-white whitespace-nowrap" :class="{ 'ring ring-purple-100': ring }">
27+
<HListboxButton class="w-full px-2 py-0.5 rounded-md flex justify-between items-center space-x-4 bg-white whitespace-nowrap dark:bg-gray-600 dark:text-gray-200" :class="{ 'ring ring-purple-100': ring }">
2828
<div>{{ selectedOp.name }}</div>
2929
<div
3030
class="i-uil:angle-down w-5 h-5 transition-transform" :class="{ 'rotate-180': open }"
@@ -34,7 +34,7 @@ const optionsLeft = computed(() => rootPos.left.value)
3434
<Teleport to="body">
3535
<div
3636
ref="optionsEl"
37-
class="z-51 absolute -mx-1 pt-1 pb-2 px-1 overflow-hidden"
37+
class="z-51 absolute -mx-1 pt-1 pb-2 px-1 overflow-hidden "
3838
:style="{
3939
'top': `${optionsTop}px`,
4040
'left': `${optionsLeft}px`,
@@ -49,7 +49,7 @@ const optionsLeft = computed(() => rootPos.left.value)
4949
leave-from-class="translate-y-0 opacity-100"
5050
leave-to-class="-translate-y-2/3 opacity-0"
5151
>
52-
<HListboxOptions class="py-1 w-full rounded-md shadow bg-white">
52+
<HListboxOptions class="py-1 w-full rounded-md shadow bg-white dark:bg-gray-600">
5353
<HListboxOption
5454
v-for="op in ops"
5555
v-slot="{ active, selected }"
@@ -59,7 +59,7 @@ const optionsLeft = computed(() => rootPos.left.value)
5959
>
6060
<span
6161
class="block rounded-md whitespace-nowrap py-1 px-4 cursor-pointer select-none transition transition-colors"
62-
:class="[selected ? 'font-medium' : 'font-normal', active && 'bg-purple-100']"
62+
:class="[selected ? 'font-medium' : 'font-normal', active && 'bg-purple-100 dark:bg-gray-700']"
6363
>
6464
{{ op.name }}
6565
</span>

components/video/SearchResult.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function updateVisibleSite(visible_site: number) {
9595
</div>
9696
<div class="flex items-center space-x-1">
9797
<div
98-
v-for="(item, index) in VisibleSites" :key="item.value" class="py-0.5 px-2 rounded-md cursor-pointer text-purple-600" :class="{ 'bg-purple-100': index === visibleSite }"
98+
v-for="(item, index) in VisibleSites" :key="item.value" class="py-0.5 px-2 rounded-md cursor-pointer text-purple-600 dark:text-purple-200" :class="{ 'bg-purple-100 dark:bg-purple-800': index !== visibleSite, 'bg-purple-200 dark:bg-purple-900': index === visibleSite }"
9999
@click="updateVisibleSite(index)"
100100
>
101101
{{ item.name }}

pages/search.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Types = [
2424
name: t('search.search-result.playlist.tab'),
2525
},
2626
]
27-
const activeTabClass = 'bg-white'
27+
const activeTabClass = 'bg-white dark:bg-gray-600'
2828
const type = computed(() => pickFirstQuery(route.query.type) || 'video')
2929
const page = computed(() => Number(pickFirstQuery(route.query.page)) || 1)
3030
const limit = computed(() => Number(pickFirstQuery(route.query.limit)) || 40)
@@ -64,16 +64,16 @@ function updateType(type: string) {
6464
{{ t('search.search-result.search-keywords') + queryWord }}
6565
</div>
6666
<div class="w-full flex space-x-2 text-purple-600">
67-
<div class="flex-grow flex bg-purple-100 p-1.5 rounded-md">
67+
<div class="flex-grow flex bg-purple-100 p-1.5 rounded-md dark:bg-gray-800">
6868
<div
69-
v-for="item in Types" :key="item.value" class="px-4 md:px-6 py-0.5 md:py-2 rounded-md cursor-pointer" :class="item.value === type && activeTabClass"
69+
v-for="item in Types" :key="item.value" class="px-4 md:px-6 py-0.5 md:py-2 rounded-md cursor-pointer dark:text-white " :class="item.value === type && activeTabClass"
7070
@click="updateType(item.value)"
7171
>
7272
{{ item.name }}
7373
</div>
7474
</div>
75-
<div class="flex items-center space-x-2 bg-purple-100 p-1.5 rounded-md">
76-
<PFormSelect v-model:selected-op="order" class="rounded-md bg-white md:px-2 md:py-1.5" :ops="Orders" />
75+
<div class="flex items-center space-x-2 bg-purple-100 p-1.5 rounded-md dark:bg-gray-800">
76+
<PFormSelect v-model:selected-op="order" class="rounded-md bg-white md:px-2 md:py-1.5 dark:bg-gray-600" :ops="Orders" />
7777
</div>
7878
</div>
7979

0 commit comments

Comments
 (0)