Skip to content

Commit

Permalink
Refine styles for pages (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
崔庆才丨静觅 authored Jan 3, 2024
1 parent 2d6ac1f commit 4e6c9a9
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "refine styles",
"packageName": "@zhishuyun/hub",
"email": "[email protected]",
"dependentChangeType": "patch"
}
12 changes: 12 additions & 0 deletions src/assets/scss/_markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
background-color: #253238 !important;
}

.markdown-body pre code {
color: white;
}

.markdown-body pre code .hljs-title,
.hljs-keyword,
.hljs-built_in,
.hljs-number,
.hljs-comment {
font-style: normal !important;
}

.markdown-body img {
border-radius: 10px;
box-shadow: 0px 0px 3px 0px var(--color-border-muted);
Expand Down
1 change: 0 additions & 1 deletion src/components/chat/Introduction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export default defineComponent({
margin-bottom: 100px;
.icon {
font-size: 20px;
margin-bottom: 10px;
}
.subtitle {
text-align: center;
Expand Down
5 changes: 4 additions & 1 deletion src/components/common/MarkdownRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ export default defineComponent({
background: none;
padding-top: 3px;
color: inherit;
// color: var(--el-text-color-primary);
ol {
list-style: initial;
}
pre code {
color: white;
}
}
</style>
6 changes: 5 additions & 1 deletion src/components/console/SidePanel.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="side-panel">
<div>
<img src="@/assets/images/logo.svg" class="logo" @click="onHome" />
<img v-if="isOfficial" src="@/assets/images/logo.svg" class="logo" @click="onHome" />
</div>
<div class="links">
<a
Expand Down Expand Up @@ -36,6 +36,7 @@ import {
ROUTE_CONSOLE_DISTRIBUTION_INDEX
} from '@/router';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { BASE_URL_HUB } from '@/constants';
interface ILink {
key: string;
Expand All @@ -52,6 +53,9 @@ export default defineComponent({
FontAwesomeIcon
},
computed: {
isOfficial() {
return window.location.origin === BASE_URL_HUB;
},
active() {
return this.$route.matched[0].path;
},
Expand Down
6 changes: 4 additions & 2 deletions src/components/midjourney/tasks/TaskFullList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
</div>
<div v-else class="tasks">
<el-card v-for="_ in 8" :key="_" class="task">
<el-card v-for="_ in 12" :key="_" class="task">
<el-skeleton animated>
<template #template>
<el-skeleton-item variant="image" class="icon-placeholder" />
Expand Down Expand Up @@ -120,12 +120,14 @@ export default defineComponent({
flex: 1;
width: 100%;
overflow-y: scroll;
margin-top: 15px;
flex-wrap: wrap;
display: flex;
justify-content: space-around;
flex-direction: row;
align-items: center;
max-width: 1700px;
margin: 15px auto;
padding-top: 10px;
.task {
width: 350px;
margin-bottom: 30px;
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/zh/chat/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
question3: '用简单的术语解释量子计算的基本原理',
question4: '虚拟现实对艺术创作产生了怎样的影响?',
question5: '隐私保护和数据安全如何影响法律实践?',
question6: '如何应对复杂的税务法规变化?',
question6: '如何应对当今世界复杂的税务法规变化?',
question7: '如何结合不同地区的文化背景创作独特美食?',
question8: '如何通过旅行体验汲取文学创作灵感?',
question9: '如何从不同行业的成功案例中获取商业创意?',
Expand Down
8 changes: 0 additions & 8 deletions src/layouts/Midjourney.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ export default defineComponent({
padding: 15px;
height: 100%;
overflow-x: scroll;
.title {
font-size: 14px;
margin-bottom: 10px;
}
.btn.btn-generate {
width: 80px;
border-radius: 20px;
}
}
.results {
overflow-y: scroll;
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.directive('loading', vLoading);
app.mount('#app');
console.debug('app mounted');

app.directive('highlight', (el) => {
app.directive('highlight', async (el) => {
const blocks = el.querySelectorAll('pre code');
blocks.forEach((block: HTMLPreElement) => {
// create the copy button
Expand Down
10 changes: 5 additions & 5 deletions src/operators/chat/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
IChatConversation,
IChatConversationAction
} from './models';
import { ENDPOINT_API } from '../common/contants';
import { BASE_URL_API } from '@/constants';

class ChatOperator {
async askQuestion(data: IChatAskRequest, options: IChatAskOptions): Promise<AxiosResponse<IChatAskResponse>> {
Expand Down Expand Up @@ -43,7 +43,7 @@ class ChatOperator {
headers: {
'content-type': 'application/json'
},
baseURL: ENDPOINT_API
baseURL: BASE_URL_API
}
);
}
Expand All @@ -59,7 +59,7 @@ class ChatOperator {
headers: {
'content-type': 'application/json'
},
baseURL: ENDPOINT_API
baseURL: BASE_URL_API
}
);
}
Expand All @@ -75,7 +75,7 @@ class ChatOperator {
headers: {
'content-type': 'application/json'
},
baseURL: ENDPOINT_API
baseURL: BASE_URL_API
}
);
}
Expand All @@ -91,7 +91,7 @@ class ChatOperator {
headers: {
'content-type': 'application/json'
},
baseURL: ENDPOINT_API
baseURL: BASE_URL_API
}
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/operators/common/contants.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/operators/midjourney/operator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios, { AxiosResponse } from 'axios';
import { IMidjourneyImagineRequest, IMidjourneyImagineResponse, IMidjourneyImagineTask } from './models';
import { ENDPOINT_API } from '../common/contants';
import { BASE_URL_API } from '@/constants';

class MidjourneyOperator {
async task(id: string): Promise<AxiosResponse<IMidjourneyImagineTask>> {
Expand All @@ -15,7 +15,7 @@ class MidjourneyOperator {
accept: 'application/json',
'content-type': 'application/json'
},
baseURL: ENDPOINT_API
baseURL: BASE_URL_API
}
);
}
Expand All @@ -32,7 +32,7 @@ class MidjourneyOperator {
accept: 'application/json',
'content-type': 'application/json'
},
baseURL: ENDPOINT_API
baseURL: BASE_URL_API
}
);
}
Expand Down
12 changes: 8 additions & 4 deletions src/pages/console/distribution/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,19 @@
<el-divider class="mt-4 mb-4" />
<div class="clear-both overflow-hidden">
<div class="float-left description">
<p>{{ $t('distribution.title.currentLevel') }}: L{{ distributionStatus?.level?.level }}</p>
<p>
<p class="mt-0">
{{ $t('distribution.title.currentLevel') }}: L{{ distributionStatus?.level?.level }}
</p>
<p class="mt-0">
{{ $t('distribution.title.currentPercentage') }}:
{{ distributionLevelMap[distributionStatus?.level?.level!]?.percentage }}%
</p>
</div>
<div class="float-right description">
<p>{{ $t('distribution.title.nextLevel') }}: L{{ distributionStatus?.level?.level! + 1 }}</p>
<p>
<p class="mt-0">
{{ $t('distribution.title.nextLevel') }}: L{{ distributionStatus?.level?.level! + 1 }}
</p>
<p class="mt-0">
{{ $t('distribution.title.nextPercentage') }}:
{{ distributionLevelMap[distributionStatus?.level?.level! + 1]?.percentage }}%
</p>
Expand Down
37 changes: 10 additions & 27 deletions src/pages/midjourney/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,35 +218,18 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
.page {
width: 100%;
.operation {
flex: 1;
padding: 15px;
height: 100%;
display: flex;
flex-direction: row;
.presets {
width: 260px;
height: 100%;
overflow-y: scroll;
overflow-x: scroll;
.title {
font-size: 14px;
margin-bottom: 10px;
}
.main {
flex: 1;
padding: 15px;
height: 100%;
overflow-x: scroll;
.title {
font-size: 14px;
margin-bottom: 10px;
}
.btn.btn-generate {
width: 80px;
border-radius: 20px;
}
}
.result {
overflow-y: scroll;
width: 400px;
height: 100%;
border-left: 1px solid var(--el-border-color);
.btn.btn-generate {
width: 80px;
border-radius: 20px;
}
}
</style>

0 comments on commit 4e6c9a9

Please sign in to comment.