update render
This commit is contained in:
1 parent
f047c9b62f
commit
61f4fdd6ca
9 files changed
+55
-6
No files matched your search
@@ -10,10 +10,30 @@
|
||||
|
||||
.markdown-body .highlight pre,
|
||||
.markdown-body pre {
|
||||
background-color: white !important;
|
||||
background-color: #253238 !important;
|
||||
}
|
||||
|
||||
.markdown-body img {
|
||||
border-radius: 10px;
|
||||
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;
|
||||
background-color: #202123;
|
||||
color: white;
|
||||
height: 100vh;
|
||||
height: 100%;
|
||||
padding: 15px 5px;
|
||||
font-size: 14px;
|
||||
.conversations {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.operators {
|
||||
height: fit-content;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<vue-markdown :source="content" class="markdown-body" />
|
||||
<vue-markdown v-highlight :source="content" class="markdown-body" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -30,6 +30,7 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
.markdown-body {
|
||||
background: none;
|
||||
padding-top: 3px;
|
||||
color: var(--el-text-color-primary);
|
||||
ol {
|
||||
list-style: initial;
|
||||
|
||||
@@ -114,7 +114,9 @@ export default defineComponent({
|
||||
.operations {
|
||||
width: fit-content;
|
||||
margin: auto;
|
||||
padding-top: 15px;
|
||||
.operation {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.fa-copy,
|
||||
.fa-stop {
|
||||
margin-right: 5px;
|
||||
|
||||
@@ -104,7 +104,7 @@ $width: 300px;
|
||||
display: block;
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
top: 20px;
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+19
@@ -8,6 +8,9 @@ import './assets/css/tailwind.css';
|
||||
import dayjs from './plugins/dayjs';
|
||||
import './plugins/font-awesome';
|
||||
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');
|
||||
const app = createApp(App);
|
||||
@@ -21,3 +24,19 @@ app.use(dayjs, {
|
||||
app.directive('loading', vLoading);
|
||||
app.mount('#app');
|
||||
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 {
|
||||
margin-bottom: 100px;
|
||||
margin-bottom: 120px;
|
||||
padding-top: 50px;
|
||||
}
|
||||
.introduction-wrapper {
|
||||
|
||||
Reference in new issue
Block a user