update render
This commit is contained in:
1 parent
f047c9b62f
commit
61f4fdd6ca
9 files changed
+55
-6
No files matched your search
@@ -36,6 +36,7 @@
|
|||||||
"dayjs": "^1.10.7",
|
"dayjs": "^1.10.7",
|
||||||
"element-plus": "^2.2.28",
|
"element-plus": "^2.2.28",
|
||||||
"github-markdown-css": "^5.1.0",
|
"github-markdown-css": "^5.1.0",
|
||||||
|
"highlight.js": "^11.7.0",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
"mustache": "^4.2.0",
|
"mustache": "^4.2.0",
|
||||||
"programming-languages-logos": "^0.0.3",
|
"programming-languages-logos": "^0.0.3",
|
||||||
|
|||||||
@@ -10,10 +10,30 @@
|
|||||||
|
|
||||||
.markdown-body .highlight pre,
|
.markdown-body .highlight pre,
|
||||||
.markdown-body pre {
|
.markdown-body pre {
|
||||||
background-color: white !important;
|
background-color: #253238 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body img {
|
.markdown-body img {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 0px 3px 0px var(--color-border-muted);
|
box-shadow: 0px 0px 3px 0px var(--color-border-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre button {
|
||||||
|
color: #adb5bd;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: 0.2s ease-out;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
background: rgba(0, 0, 0, 0.15);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0);
|
||||||
|
padding: 5px 10px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
border-radius: 0 0.15rem;
|
||||||
|
}
|
||||||
@@ -102,11 +102,12 @@ export default defineComponent({
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #202123;
|
background-color: #202123;
|
||||||
color: white;
|
color: white;
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
padding: 15px 5px;
|
padding: 15px 5px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
.conversations {
|
.conversations {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
.operators {
|
.operators {
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<vue-markdown :source="content" class="markdown-body" />
|
<vue-markdown v-highlight :source="content" class="markdown-body" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -30,6 +30,7 @@ export default defineComponent({
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.markdown-body {
|
.markdown-body {
|
||||||
background: none;
|
background: none;
|
||||||
|
padding-top: 3px;
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
ol {
|
ol {
|
||||||
list-style: initial;
|
list-style: initial;
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ export default defineComponent({
|
|||||||
.operations {
|
.operations {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
padding-top: 15px;
|
.operation {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
.fa-copy,
|
.fa-copy,
|
||||||
.fa-stop {
|
.fa-stop {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ $width: 300px;
|
|||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
top: 20px;
|
top: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
+19
@@ -8,6 +8,9 @@ import './assets/css/tailwind.css';
|
|||||||
import dayjs from './plugins/dayjs';
|
import dayjs from './plugins/dayjs';
|
||||||
import './plugins/font-awesome';
|
import './plugins/font-awesome';
|
||||||
import { vLoading } from 'element-plus';
|
import { vLoading } from 'element-plus';
|
||||||
|
import hl from 'highlight.js';
|
||||||
|
import 'highlight.js/styles/night-owl.css';
|
||||||
|
import copyToClipboard from 'copy-to-clipboard';
|
||||||
|
|
||||||
console.debug('start to create app');
|
console.debug('start to create app');
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
@@ -21,3 +24,19 @@ app.use(dayjs, {
|
|||||||
app.directive('loading', vLoading);
|
app.directive('loading', vLoading);
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
console.debug('app mounted');
|
console.debug('app mounted');
|
||||||
|
|
||||||
|
app.directive('highlight', (el) => {
|
||||||
|
const blocks = el.querySelectorAll('pre code');
|
||||||
|
blocks.forEach((block: HTMLPreElement) => {
|
||||||
|
// create the copy button
|
||||||
|
const copy = document.createElement('button');
|
||||||
|
copy.innerHTML = i18n.global.t('common.button.copy').toString();
|
||||||
|
// add the event listener to each click
|
||||||
|
copy.addEventListener('click', () => {
|
||||||
|
copyToClipboard(block.innerText);
|
||||||
|
});
|
||||||
|
// append the copy button to each code block
|
||||||
|
block.parentElement?.prepend(copy);
|
||||||
|
hl.highlightBlock(block);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -428,7 +428,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.messages-wrapper {
|
.messages-wrapper {
|
||||||
margin-bottom: 100px;
|
margin-bottom: 120px;
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
}
|
}
|
||||||
.introduction-wrapper {
|
.introduction-wrapper {
|
||||||
|
|||||||
@@ -2150,6 +2150,11 @@ hex-color-regex@^1.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
|
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
|
||||||
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
|
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
|
||||||
|
|
||||||
|
highlight.js@^11.7.0:
|
||||||
|
version "11.7.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.7.0.tgz#3ff0165bc843f8c9bce1fd89e2fda9143d24b11e"
|
||||||
|
integrity sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ==
|
||||||
|
|
||||||
hsl-regex@^1.0.0:
|
hsl-regex@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e"
|
resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e"
|
||||||
|
|||||||
Reference in new issue
Block a user