Compare commits

..

3 Commits

Author SHA1 Message Date
tim
05522fcdc7 fix: 修改分割线颜色 2025-09-09 00:32:17 +08:00
tim
3820eaa774 fix: changlog--移动端支持换行 #938 2025-09-09 00:23:53 +08:00
Tim
7effaf920a style: adjust diff2html fonts on mobile 2025-09-08 23:48:32 +08:00
3 changed files with 27 additions and 13 deletions

View File

@@ -17,7 +17,7 @@
--background-color: white; --background-color: white;
--background-color-blur: rgba(255, 255, 255, 0.57); --background-color-blur: rgba(255, 255, 255, 0.57);
--menu-border-color: lightgray; --menu-border-color: lightgray;
--normal-border-color: lightgray; --normal-border-color: rgba(211, 211, 211, 0.63);
--menu-selected-background-color: rgba(88, 241, 255, 0.166); --menu-selected-background-color: rgba(88, 241, 255, 0.166);
--normal-light-background-color: rgba(242, 242, 242, 0.884); --normal-light-background-color: rgba(242, 242, 242, 0.884);
--menu-selected-background-color-hover: rgba(242, 242, 242, 0.884); --menu-selected-background-color-hover: rgba(242, 242, 242, 0.884);
@@ -348,6 +348,22 @@ body {
} }
} }
/* Adjust diff2html layout on mobile */
@media (max-width: 768px) {
.content-diff .d2h-wrapper,
.content-diff .d2h-code-line,
.content-diff .d2h-code-side-line,
.content-diff .d2h-code-line-ctn,
.content-diff .d2h-code-side-line-ctn,
.content-diff .d2h-file-header {
font-size: 12px;
}
.content-diff .d2h-wrapper {
overflow-x: auto;
}
}
/* Transition API */ /* Transition API */
::view-transition-old(root), ::view-transition-old(root),
::view-transition-new(root) { ::view-transition-new(root) {

View File

@@ -11,18 +11,18 @@
<span v-if="log.username" class="change-log-user">{{ log.username }}</span> <span v-if="log.username" class="change-log-user">{{ log.username }}</span>
<span v-if="log.type === 'CONTENT'" class="change-log-content">变更了文章内容</span> <span v-if="log.type === 'CONTENT'" class="change-log-content">变更了文章内容</span>
<span v-else-if="log.type === 'TITLE'" class="change-log-content">变更了文章标题</span> <span v-else-if="log.type === 'TITLE'" class="change-log-content">变更了文章标题</span>
<span v-else-if="log.type === 'CATEGORY'" class="change-log-content change-log-category"> <template v-else-if="log.type === 'CATEGORY'">
<div class="change-log-category-text">变更了文章分类, </div> <div class="change-log-category-text">变更了文章分类, </div>
<ArticleCategory :category="log.oldCategory" /> <ArticleCategory :category="log.oldCategory" />
<div class="change-log-category-text">修改为</div> <div class="change-log-category-text">修改为</div>
<ArticleCategory :category="log.newCategory" /> <ArticleCategory :category="log.newCategory" />
</span> </template>
<span v-else-if="log.type === 'TAG'" class="change-log-content change-log-category"> <template v-else-if="log.type === 'TAG'">
<div class="change-log-category-text">变更了文章标签, </div> <div class="change-log-category-text">变更了文章标签, </div>
<ArticleTags :tags="log.oldTags" /> <ArticleTags :tags="log.oldTags" />
<div class="change-log-category-text">修改为</div> <div class="change-log-category-text">修改为</div>
<ArticleTags :tags="log.newTags" /> <ArticleTags :tags="log.newTags" />
</span> </template>
<span v-else-if="log.type === 'CLOSED'" class="change-log-content"> <span v-else-if="log.type === 'CLOSED'" class="change-log-content">
<template v-if="log.newClosed">关闭了文章</template> <template v-if="log.newClosed">关闭了文章</template>
<template v-else>重新打开了文章</template> <template v-else>重新打开了文章</template>
@@ -68,7 +68,6 @@ const props = defineProps({
}) })
const diffHtml = computed(() => { const diffHtml = computed(() => {
const isMobile = useIsMobile()
// Track theme changes // Track theme changes
const isDark = import.meta.client && document.documentElement.dataset.theme === 'dark' const isDark = import.meta.client && document.documentElement.dataset.theme === 'dark'
themeState.mode themeState.mode
@@ -83,7 +82,6 @@ const diffHtml = computed(() => {
showFiles: false, showFiles: false,
matching: 'lines', matching: 'lines',
drawFileList: false, drawFileList: false,
outputFormat: isMobile.value ? 'line-by-line' : 'side-by-side',
colorScheme, colorScheme,
}) })
} else if (props.log.type === 'TITLE') { } else if (props.log.type === 'TITLE') {
@@ -95,7 +93,6 @@ const diffHtml = computed(() => {
showFiles: false, showFiles: false,
matching: 'lines', matching: 'lines',
drawFileList: false, drawFileList: false,
outputFormat: isMobile.value ? 'line-by-line' : 'side-by-side',
colorScheme, colorScheme,
}) })
} }
@@ -110,9 +107,12 @@ const diffHtml = computed(() => {
/* padding-top: 5px; */ /* padding-top: 5px; */
/* padding-bottom: 30px; */ /* padding-bottom: 30px; */
font-size: 14px; font-size: 14px;
border-bottom: 1px solid var(--normal-border-color);
padding-bottom: 10px;
} }
.change-log-text { .change-log-text {
display: flex; display: flex;
flex-wrap: wrap;
align-items: center; align-items: center;
} }
.change-log-user { .change-log-user {
@@ -146,5 +146,6 @@ const diffHtml = computed(() => {
flex-direction: row; flex-direction: row;
gap: 4px; gap: 4px;
align-items: center; align-items: center;
flex-wrap: wrap;
} }
</style> </style>

View File

@@ -1163,6 +1163,7 @@ onMounted(async () => {
margin-top: 10px; margin-top: 10px;
gap: 10px; gap: 10px;
align-items: center; align-items: center;
flex-wrap: wrap;
} }
.info-content-container { .info-content-container {
@@ -1218,7 +1219,7 @@ onMounted(async () => {
} }
.post-time { .post-time {
font-size: 14px; font-size: 12px;
opacity: 0.5; opacity: 0.5;
} }
@@ -1284,10 +1285,6 @@ onMounted(async () => {
font-size: 12px; font-size: 12px;
} }
.post-time {
font-size: 12px;
}
.info-content-text { .info-content-text {
line-height: 1.5; line-height: 1.5;
} }