Add dark mode support (#16)
This commit is contained in:
1 parent
ddef4cec2a
commit
b8970e1373
46 files changed
+247
-166
No files matched your search
@@ -144,7 +144,6 @@ export default defineComponent({
|
||||
.info {
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-regular);
|
||||
// display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
.actions {
|
||||
|
||||
@@ -34,7 +34,7 @@ export default defineComponent({
|
||||
width: 2px;
|
||||
height: 16px;
|
||||
margin-top: 3px;
|
||||
background-color: var(--el-color-black);
|
||||
background-color: var(--el-text-color-primary);
|
||||
animation: blink 1s infinite;
|
||||
}
|
||||
</style>
|
||||
@@ -34,7 +34,6 @@
|
||||
</span>
|
||||
<el-input
|
||||
v-model="questionValue"
|
||||
:rows="3"
|
||||
:disabled="disabled"
|
||||
class="input"
|
||||
type="textarea"
|
||||
@@ -143,6 +142,8 @@ export default defineComponent({
|
||||
position: relative;
|
||||
.input {
|
||||
textarea {
|
||||
height: auto;
|
||||
max-height: 100px;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
@@ -165,7 +166,7 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
.input-box {
|
||||
width: 100%;
|
||||
border: 1px solid #eee;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 10px;
|
||||
background: none;
|
||||
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
|
||||
@@ -175,7 +176,7 @@ export default defineComponent({
|
||||
.btn-upload {
|
||||
cursor: not-allowed;
|
||||
.icon-attachment {
|
||||
color: #eee;
|
||||
color: var(--el-text-color-disabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,20 +196,20 @@ export default defineComponent({
|
||||
left: 10px;
|
||||
.icon-attachment {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
&.btn-send {
|
||||
right: 15px;
|
||||
&.disabled {
|
||||
.icon-send {
|
||||
color: #eee;
|
||||
color: var(--el-text-color-disabled);
|
||||
}
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.icon-send {
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
.introduction-item {
|
||||
font-size: 14px;
|
||||
background-color: #eee;
|
||||
color: #333;
|
||||
background-color: var(--el-fill-color-extra-light);
|
||||
color: var(--el-text-color-primary);
|
||||
border: 1px solid var(--el-border-color-lighter);
|
||||
padding: 10px 20px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ export default defineComponent({
|
||||
align-items: start;
|
||||
.content {
|
||||
background-color: var(--el-bg-color-page);
|
||||
color: var(--el-color-black);
|
||||
color: var(--el-text-color-primary);
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,23 +130,21 @@ export default defineComponent({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.model-selector {
|
||||
background-color: #ececf1;
|
||||
background-color: var(--el-bg-color-page);
|
||||
padding: 7px 6px;
|
||||
border-radius: 15px;
|
||||
margin-bottom: 5px;
|
||||
.group {
|
||||
padding: 20px 30px;
|
||||
color: black;
|
||||
color: var(--el-text-color-primary);
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
margin: 0 3px;
|
||||
background-color: inherit;
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: inherit;
|
||||
}
|
||||
&:focus,
|
||||
&.active {
|
||||
background-color: white;
|
||||
background-color: var(--el-fill-color-extra-light);
|
||||
}
|
||||
.icon {
|
||||
display: inline-block;
|
||||
@@ -161,7 +159,7 @@ export default defineComponent({
|
||||
.fa-chevron-down {
|
||||
margin-left: 5px;
|
||||
font-weight: 100;
|
||||
color: #999;
|
||||
color: var(--el-text-color-primary);
|
||||
transform: scale(0.8);
|
||||
}
|
||||
}
|
||||
@@ -171,6 +169,7 @@ export default defineComponent({
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.icon {
|
||||
width: 15px;
|
||||
display: flex;
|
||||
@@ -190,12 +189,12 @@ export default defineComponent({
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
color: var(--el-text-color-primary);
|
||||
margin: 0;
|
||||
}
|
||||
.description {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
color: var(--el-text-color-secondary);
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ export default defineComponent({
|
||||
padding: 15px;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
border-right: 1px solid #eee;
|
||||
border-right: 1px solid var(--el-border-color);
|
||||
overflow-y: scroll;
|
||||
|
||||
.conversations {
|
||||
@@ -164,15 +164,15 @@ export default defineComponent({
|
||||
flex-direction: row;
|
||||
padding: 10px;
|
||||
margin-bottom: 5px;
|
||||
border: 1px dashed hsl(0, 0%, 93%);
|
||||
border: 1px dashed var(--el-border-color);
|
||||
line-height: 30px;
|
||||
border-radius: 10px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
cursor: pointer;
|
||||
|
||||
&.active,
|
||||
&:hover {
|
||||
background-color: #eee;
|
||||
background-color: var(--el-fill-color-extra-light);
|
||||
}
|
||||
|
||||
.icons {
|
||||
@@ -189,10 +189,11 @@ export default defineComponent({
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 8px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
.operations {
|
||||
width: 40px;
|
||||
color: var(--el-text-color-regular);
|
||||
.icon {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
|
||||
@@ -34,7 +34,7 @@ export default defineComponent({
|
||||
width: 2px;
|
||||
height: 16px;
|
||||
margin-top: 3px;
|
||||
background-color: var(--el-color-black);
|
||||
background-color: var(--el-text-color-primary);
|
||||
animation: blink 1s infinite;
|
||||
}
|
||||
</style>
|
||||
@@ -143,7 +143,7 @@ export default defineComponent({
|
||||
padding: 15px;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
border-right: 1px solid #eee;
|
||||
border-right: 1px solid var(--el-border-color);
|
||||
overflow-y: scroll;
|
||||
|
||||
.conversations {
|
||||
@@ -158,15 +158,15 @@ export default defineComponent({
|
||||
flex-direction: row;
|
||||
padding: 10px;
|
||||
margin-bottom: 5px;
|
||||
border: 1px dashed hsl(0, 0%, 93%);
|
||||
border: 1px dashed var(--el-border-color);
|
||||
line-height: 30px;
|
||||
border-radius: 10px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
cursor: pointer;
|
||||
|
||||
&.active,
|
||||
&:hover {
|
||||
background-color: #eee;
|
||||
background-color: var(--el-fill-color-extra-light);
|
||||
}
|
||||
|
||||
.icons {
|
||||
@@ -183,10 +183,11 @@ export default defineComponent({
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 8px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
.operations {
|
||||
width: 40px;
|
||||
color: var(--el-text-color-regular);
|
||||
.icon {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
|
||||
@@ -88,7 +88,7 @@ export default defineComponent({
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
margin-top: 5px;
|
||||
background-color: #eee;
|
||||
background-color: var(--el-bg-color-page);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
</span>
|
||||
<el-input
|
||||
v-model="questionValue"
|
||||
:rows="3"
|
||||
:disabled="disabled"
|
||||
class="input"
|
||||
type="textarea"
|
||||
@@ -89,6 +88,8 @@ export default defineComponent({
|
||||
.input-box {
|
||||
.input {
|
||||
textarea {
|
||||
height: auto;
|
||||
max-height: 100px;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
@@ -112,7 +113,7 @@ export default defineComponent({
|
||||
.input-box {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border: 1px solid #eee;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 10px;
|
||||
background: none;
|
||||
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
|
||||
@@ -132,13 +133,13 @@ export default defineComponent({
|
||||
right: 15px;
|
||||
&.disabled {
|
||||
.icon-send {
|
||||
color: #eee;
|
||||
color: var(--el-text-color-disabled);
|
||||
}
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.icon-send {
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,7 +148,7 @@ export default defineComponent({
|
||||
.info {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
color: var(--el-text-color-regular);
|
||||
margin-top: 5px;
|
||||
margin-left: 3px;
|
||||
margin-bottom: 0;
|
||||
|
||||
@@ -140,7 +140,7 @@ export default defineComponent({
|
||||
align-items: start;
|
||||
.content {
|
||||
background-color: var(--el-bg-color-page);
|
||||
color: var(--el-color-black);
|
||||
color: var(--el-text-color-primary);
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export default defineComponent({
|
||||
border-radius: 50%;
|
||||
padding: 5px 6px;
|
||||
cursor: pointer;
|
||||
color: var(--el-color-black);
|
||||
background: var(--el-color-white);
|
||||
background-color: inherit;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<dark-switch class="switch" dark-background="#333" light-background="#fff" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { Switch as DarkSwitch, toggleDark, isDark } from 'vue-dark-switch';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
DarkSwitch
|
||||
},
|
||||
emits: ['update:dark'],
|
||||
computed: {
|
||||
dark() {
|
||||
return this.$store.getters.dark;
|
||||
},
|
||||
switchValue() {
|
||||
return isDark.value;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
switchValue(val) {
|
||||
console.log('switchValue', val);
|
||||
this.$store.dispatch('setDark', val);
|
||||
},
|
||||
dark(val) {
|
||||
document.documentElement.classList.toggle('dark', val);
|
||||
this.$store.dispatch('setDark', this.dark);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.dark) {
|
||||
toggleDark(true);
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
toggleDark(false);
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.switch {
|
||||
margin-top: 2px;
|
||||
--n-rail-color-active: var(--el-color-primary) !important;
|
||||
--n-loading-color: var(--el-color-primary) !important;
|
||||
border-radius: 10px !important;
|
||||
border: 1px solid var(--el-border-color);
|
||||
overflow: hidden;
|
||||
.n-switch__button {
|
||||
border-radius: 50% !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,29 +0,0 @@
|
||||
<template>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="`<p>${$t('common.message.helpWechat')}: yuxingzou</p><p>${$t(
|
||||
'common.message.helpWechat2'
|
||||
)}: sunbitty</p>`"
|
||||
placement="top-start"
|
||||
raw-content
|
||||
>
|
||||
<el-button type="primary" circle size="large">
|
||||
<font-awesome-icon icon="fa-solid fa-question" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElTooltip, ElButton } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'HelpEntry',
|
||||
components: {
|
||||
ElTooltip,
|
||||
ElButton,
|
||||
FontAwesomeIcon
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,45 +0,0 @@
|
||||
<template>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="`<p>${$t('common.message.helpWechat')}: yuxingzou</p><p>${$t(
|
||||
'common.message.helpWechat2'
|
||||
)}: sunbitty</p>`"
|
||||
placement="top-start"
|
||||
raw-content
|
||||
>
|
||||
<el-button class="button">
|
||||
<font-awesome-icon icon="fa-solid fa-question" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElTooltip, ElButton } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'HelpEntry',
|
||||
components: {
|
||||
ElTooltip,
|
||||
ElButton,
|
||||
FontAwesomeIcon
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.button {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
background-color: var(--el-bg-color-page);
|
||||
&.active,
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: var(--el-button-hover-bg-color);
|
||||
color: var(--el-button-active-text-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<img :src="url" class="logo" @click="$emit('click')" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
emits: ['click'],
|
||||
data() {
|
||||
return {
|
||||
url1: 'https://cdn.acedata.cloud/logo.png/thumb_450x_',
|
||||
url2: 'https://cdn.acedata.cloud/logo2.png/thumb_450x_'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
dark() {
|
||||
return this.$store.getters.dark;
|
||||
},
|
||||
url() {
|
||||
return this.dark ? this.url2 : this.url1;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -4,7 +4,8 @@
|
||||
<chevron v-else class="chevron" direction="left" @click="onCollapseMenu"></chevron>
|
||||
<div class="top">
|
||||
<div v-if="!collapsed">
|
||||
<img src="@/assets/images/logo.png" class="logo" @click="onHome" />
|
||||
<logo @click="onHome" />
|
||||
<dark-selector v-show="false" />
|
||||
</div>
|
||||
<el-menu v-if="!collapsed" :default-active="activeIndex">
|
||||
<el-menu-item
|
||||
@@ -97,11 +98,15 @@ import {
|
||||
ROUTE_MIDJOURNEY_INDEX
|
||||
} from '@/router/constants';
|
||||
import Chevron from './Chevron.vue';
|
||||
import DarkSelector from './DarkSelector.vue';
|
||||
import Logo from './Logo.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Navigator',
|
||||
components: {
|
||||
ElButton,
|
||||
Logo,
|
||||
DarkSelector,
|
||||
ElTooltip,
|
||||
LocaleSelector,
|
||||
FontAwesomeIcon,
|
||||
@@ -213,8 +218,16 @@ export default defineComponent({
|
||||
.el-menu {
|
||||
width: 180px;
|
||||
border-right: none;
|
||||
background: none;
|
||||
.el-menu-item {
|
||||
height: 50px;
|
||||
color: var(--el-text-color-primary);
|
||||
&.active,
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: var(--el-button-hover-bg-color);
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,11 +261,11 @@ export default defineComponent({
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
background-color: var(--el-bg-color-page);
|
||||
color: var(--el-text-color-primary);
|
||||
background-color: var(--el-bg-color-overlay);
|
||||
&.active,
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: var(--el-button-hover-bg-color);
|
||||
color: var(--el-button-active-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ $padding-left: 10px;
|
||||
cursor: pointer;
|
||||
margin-bottom: 5px;
|
||||
position: relative;
|
||||
color: #444;
|
||||
color: var(--el-text-color-primary);
|
||||
line-height: $height;
|
||||
padding-left: 10px;
|
||||
.suffix {
|
||||
@@ -150,7 +150,7 @@ $padding-left: 10px;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
background-color: #ebedf1;
|
||||
background-color: var(--el-fill-color-extra-light);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2139,7 +2139,7 @@ export default defineComponent({
|
||||
margin-bottom: 8px;
|
||||
border-width: 3px;
|
||||
border-style: solid;
|
||||
border-color: #eee;
|
||||
border-color: var(--el-border-color);
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -48,7 +48,7 @@ export default defineComponent({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.channel-selector {
|
||||
background-color: #ececf1;
|
||||
background-color: var(--el-bg-color-page);
|
||||
padding: 7px 6px;
|
||||
border-radius: 15px;
|
||||
margin-bottom: 5px;
|
||||
@@ -57,17 +57,15 @@ export default defineComponent({
|
||||
margin-right: auto;
|
||||
.button {
|
||||
padding: 20px 30px;
|
||||
color: black;
|
||||
color: var(--el-text-color-primary);
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
margin: 0 3px;
|
||||
background-color: inherit;
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: inherit;
|
||||
}
|
||||
&:focus,
|
||||
&.active {
|
||||
background-color: white;
|
||||
background-color: var(--el-fill-color-extra-light);
|
||||
}
|
||||
.icon {
|
||||
display: inline-block;
|
||||
|
||||
@@ -56,7 +56,6 @@ export default defineComponent({
|
||||
border-right: 1px solid var(--el-border-color);
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
background-color: var(--el-bg-color);
|
||||
.block {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export default defineComponent({
|
||||
.item {
|
||||
width: 115px;
|
||||
height: 60px;
|
||||
border: 2px solid #eee;
|
||||
border: 2px solid var(--el-border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -101,7 +101,7 @@ export default defineComponent({
|
||||
.item {
|
||||
width: 40px;
|
||||
height: 60px;
|
||||
border: 2px solid #eee;
|
||||
border: 2px solid var(--el-border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -118,7 +118,7 @@ export default defineComponent({
|
||||
justify-content: center;
|
||||
|
||||
.rect {
|
||||
border: 2px solid #eee;
|
||||
border: 2px solid var(--el-border-color);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 2px;
|
||||
|
||||
@@ -85,7 +85,7 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
.description {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.tasks {
|
||||
|
||||
Reference in new issue
Block a user