mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-17 01:20:46 +08:00
feat: about page
This commit is contained in:
@@ -173,20 +173,24 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
.about-content h1,
|
||||||
.info-content-text h1 {
|
.info-content-text h1 {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.about-content h2,
|
||||||
.info-content-text h2 {
|
.info-content-text h2 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.about-content p,
|
||||||
.info-content-text p {
|
.info-content-text p {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.about-content li,
|
||||||
.info-content-text li {
|
.info-content-text li {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,27 +11,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="about-content" v-html="renderMarkdown(content)"></div>
|
<div class="about-content" v-html="renderMarkdown(content)"></div>
|
||||||
|
<div class="about-loading" v-if="isFetching">
|
||||||
|
<l-hatch-spinner size="100" stroke="10" speed="1" color="var(--primary-color)" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { renderMarkdown } from '../utils/markdown'
|
import { renderMarkdown } from '../utils/markdown'
|
||||||
|
import { hatch } from 'ldrs'
|
||||||
|
hatch.register()
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AboutPageView',
|
name: 'AboutPageView',
|
||||||
setup() {
|
setup() {
|
||||||
|
const isFetching = ref(false)
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ name: 'about', label: '关于', file: '/about/about.md' },
|
{ name: 'about', label: '关于', file: '/about/about.md' },
|
||||||
{ name: 'agreement', label: '用户协议', file: '/about/agreement.md' },
|
{ name: 'agreement', label: '用户协议', file: '/about/agreement.md' },
|
||||||
{ name: 'guideline', label: '创作准则', file: '/about/guideline.md' },
|
{ name: 'guideline', label: '创作准则', file: '/about/guideline.md' },
|
||||||
{ name: 'privacy', label: '隐私政策', file: '/about/privacy.md' }
|
{ name: 'privacy', label: '隐私政策', file: '/about/privacy.md' },
|
||||||
]
|
]
|
||||||
const selectedTab = ref(tabs[0].name)
|
const selectedTab = ref(tabs[0].name)
|
||||||
const content = ref('')
|
const content = ref('')
|
||||||
|
|
||||||
const loadContent = async (file) => {
|
const loadContent = async (file) => {
|
||||||
try {
|
try {
|
||||||
|
isFetching.value = true
|
||||||
const res = await fetch(file)
|
const res = await fetch(file)
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
content.value = await res.text()
|
content.value = await res.text()
|
||||||
@@ -41,6 +48,7 @@ export default {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
content.value = '# 内容加载失败'
|
content.value = '# 内容加载失败'
|
||||||
}
|
}
|
||||||
|
isFetching.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectTab = (name) => {
|
const selectTab = (name) => {
|
||||||
@@ -53,7 +61,7 @@ export default {
|
|||||||
loadContent(tabs[0].file)
|
loadContent(tabs[0].file)
|
||||||
})
|
})
|
||||||
|
|
||||||
return { tabs, selectedTab, content, renderMarkdown, selectTab }
|
return { tabs, selectedTab, content, renderMarkdown, selectTab, isFetching }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -72,11 +80,14 @@ export default {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
border-bottom: 1px solid var(--normal-border-color);
|
border-bottom: 1px solid var(--normal-border-color);
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
overflow-x: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.about-tabs-item {
|
.about-tabs-item {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.about-tabs-item.selected {
|
.about-tabs-item.selected {
|
||||||
@@ -88,4 +99,18 @@ export default {
|
|||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.about-loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.about-tabs {
|
||||||
|
width: 100vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user