mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
💄 完善 wiki 页面样式
This commit is contained in:
@@ -1,23 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="twc-constellations-box">
|
<div class="twc-constellations-box">
|
||||||
<div class="twc-constellations-title">命座</div>
|
<v-tabs v-model="tab">
|
||||||
<div class="twc-constellation" v-for="item in props.data" :key="item.Id">
|
<v-tab
|
||||||
<div class="twc-constellation-top">
|
v-for="item in props.data"
|
||||||
|
:key="item.Id"
|
||||||
|
:value="item.Name"
|
||||||
|
:title="item.Name"
|
||||||
|
class="twc-constellation-tab"
|
||||||
|
density="compact"
|
||||||
|
>
|
||||||
<!-- todo 换成本地资源 -->
|
<!-- todo 换成本地资源 -->
|
||||||
<img :src="`https://api.ambr.top/assets/UI/${item.Icon}.png`" alt="icon" />
|
<img :src="`https://api.ambr.top/assets/UI/${item.Icon}.png`" alt="icon" />
|
||||||
<span>{{ item.Name }}</span>
|
<span v-if="tab === item.Name">{{ item.Name }}</span>
|
||||||
</div>
|
</v-tab>
|
||||||
<div class="twc-constellation-bottom">
|
</v-tabs>
|
||||||
|
<v-window v-model="tab">
|
||||||
|
<v-window-item
|
||||||
|
:value="item.Name"
|
||||||
|
v-for="item in props.data"
|
||||||
|
:key="item.Id"
|
||||||
|
class="twc-constellation-desc"
|
||||||
|
>
|
||||||
<span v-html="parseDesc(item.Description)"></span>
|
<span v-html="parseDesc(item.Description)"></span>
|
||||||
</div>
|
</v-window-item>
|
||||||
</div>
|
</v-window>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
interface TwcConstellationProps {
|
interface TwcConstellationProps {
|
||||||
data: TGApp.Plugins.Hutao.Character.RhisdTalent[];
|
data: TGApp.Plugins.Hutao.Character.RhisdTalent[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<TwcConstellationProps>();
|
const props = defineProps<TwcConstellationProps>();
|
||||||
|
const tab = ref<string>();
|
||||||
|
|
||||||
function parseDesc(desc: string): string {
|
function parseDesc(desc: string): string {
|
||||||
const reg = /<color=(.*?)>(.*?)<\/color>/g;
|
const reg = /<color=(.*?)>(.*?)<\/color>/g;
|
||||||
@@ -37,49 +54,32 @@ function parseDesc(desc: string): string {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
.twc-constellations-box {
|
.twc-constellations-box {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
row-gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.twc-constellations-title {
|
|
||||||
color: var(--common-text-title);
|
|
||||||
font-family: var(--font-title);
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.twc-constellation {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border: 1px solid var(--common-shadow-1);
|
border: 1px solid var(--common-shadow-1);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
row-gap: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.twc-constellation-top {
|
.twc-constellation-tab {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: center;
|
||||||
justify-content: flex-start;
|
justify-content: center;
|
||||||
gap: 5px;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.twc-constellation-top img {
|
.twc-constellation-tab img {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
filter: brightness(0.25);
|
filter: brightness(0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .twc-constellation-top img {
|
.dark .twc-constellation-tab img {
|
||||||
filter: brightness(0.75);
|
filter: brightness(0.75);
|
||||||
}
|
}
|
||||||
|
|
||||||
.twc-constellation-top span {
|
.twc-constellation-desc {
|
||||||
border-bottom: 1px solid var(--common-shadow-4);
|
padding-left: 10px;
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.twc-constellation-bottom {
|
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -5,10 +5,13 @@
|
|||||||
v-for="(item, index) in tabValues"
|
v-for="(item, index) in tabValues"
|
||||||
:key="index"
|
:key="index"
|
||||||
:value="item.name"
|
:value="item.name"
|
||||||
|
:title="item.name"
|
||||||
class="twc-skill-tab"
|
class="twc-skill-tab"
|
||||||
|
density="compact"
|
||||||
>
|
>
|
||||||
<!-- todo 换成本地资源 -->
|
<!-- todo 换成本地资源 -->
|
||||||
<img :src="`https://api.ambr.top/assets/UI/${item.icon}.png`" alt="icon" />
|
<img :src="`https://api.ambr.top/assets/UI/${item.icon}.png`" alt="icon" />
|
||||||
|
<span v-if="tab === item.name">{{ item.name }}</span>
|
||||||
</v-tab>
|
</v-tab>
|
||||||
</v-tabs>
|
</v-tabs>
|
||||||
<v-window v-model="tab">
|
<v-window v-model="tab">
|
||||||
@@ -41,14 +44,13 @@ onMounted(() => {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
border: 1px solid var(--common-shadow-1);
|
border: 1px solid var(--common-shadow-1);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
row-gap: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.twc-skill-tab {
|
.twc-skill-tab {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
row-gap: 5px;
|
justify-content: center;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.twc-skill-tab img {
|
.twc-skill-tab img {
|
||||||
|
|||||||
@@ -46,20 +46,46 @@
|
|||||||
<TwcMaterials :data="data.materials" />
|
<TwcMaterials :data="data.materials" />
|
||||||
<TwcSkills :data="data.skills" />
|
<TwcSkills :data="data.skills" />
|
||||||
<TwcConstellations :data="data.constellation" />
|
<TwcConstellations :data="data.constellation" />
|
||||||
<div class="twc-text">
|
<v-expansion-panels :theme="vuetifyTheme" class="twc-text-item">
|
||||||
<div class="twc-text-title">资料</div>
|
<v-expansion-panel>
|
||||||
<div class="twc-text-item" v-for="(item, index) in data?.talks" :key="index">
|
<template #title><span class="twc-text-title">资料</span></template>
|
||||||
<div class="twc-text-item-title">{{ item.Title }}</div>
|
<template #text>
|
||||||
<div class="twc-text-item-content">{{ item.Context }}</div>
|
<v-expansion-panels variant="popout">
|
||||||
</div>
|
<v-expansion-panel
|
||||||
</div>
|
expand-icon="mdi-menu-down"
|
||||||
<div class="twc-text">
|
v-for="(item, index) in data?.talks"
|
||||||
<div class="twc-text-title">故事</div>
|
:key="index"
|
||||||
<div class="twc-text-item" v-for="(item, index) in data.stories" :key="index">
|
>
|
||||||
<div class="twc-text-item-title">{{ item.Title }}</div>
|
<template #title
|
||||||
<div class="twc-text-item-content">{{ item.Context }}</div>
|
><span class="twc-text-item-title">{{ item.Title }}</span></template
|
||||||
</div>
|
>
|
||||||
</div>
|
<template #text
|
||||||
|
><span class="twc-text-item-content">{{ item.Context }}</span></template
|
||||||
|
>
|
||||||
|
</v-expansion-panel>
|
||||||
|
</v-expansion-panels>
|
||||||
|
</template>
|
||||||
|
</v-expansion-panel>
|
||||||
|
<v-expansion-panel>
|
||||||
|
<template #title><span class="twc-text-title">故事</span></template>
|
||||||
|
<template #text>
|
||||||
|
<v-expansion-panels variant="popout">
|
||||||
|
<v-expansion-panel
|
||||||
|
expand-icon="mdi-menu-down"
|
||||||
|
v-for="(item, index) in data.stories"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<template #title
|
||||||
|
><span class="twc-text-item-title">{{ item.Title }}</span></template
|
||||||
|
>
|
||||||
|
<template #text
|
||||||
|
><span class="twc-text-item-content">{{ item.Context }}</span></template
|
||||||
|
>
|
||||||
|
</v-expansion-panel>
|
||||||
|
</v-expansion-panels>
|
||||||
|
</template>
|
||||||
|
</v-expansion-panel>
|
||||||
|
</v-expansion-panels>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -75,6 +101,7 @@ import TwcConstellations from "../components/wiki/twc-constellations.vue";
|
|||||||
import TwcMaterials from "../components/wiki/twc-materials.vue";
|
import TwcMaterials from "../components/wiki/twc-materials.vue";
|
||||||
import TwcSkills from "../components/wiki/twc-skills.vue";
|
import TwcSkills from "../components/wiki/twc-skills.vue";
|
||||||
import { getWikiData } from "../data";
|
import { getWikiData } from "../data";
|
||||||
|
import { useAppStore } from "../store/modules/app";
|
||||||
|
|
||||||
// 路由数据
|
// 路由数据
|
||||||
const id = <string>useRoute().params.id;
|
const id = <string>useRoute().params.id;
|
||||||
@@ -84,6 +111,12 @@ const loadingEmpty = ref<boolean>(false);
|
|||||||
const loadingTitle = ref<string>("正在加载");
|
const loadingTitle = ref<string>("正在加载");
|
||||||
const loadingSub = ref<string>();
|
const loadingSub = ref<string>();
|
||||||
|
|
||||||
|
// 主题
|
||||||
|
const appStore = useAppStore();
|
||||||
|
const vuetifyTheme = computed(() => {
|
||||||
|
return appStore.theme === "dark" ? "dark" : "light";
|
||||||
|
});
|
||||||
|
|
||||||
// 数据
|
// 数据
|
||||||
const data = ref<TGApp.App.Character.WikiItem>();
|
const data = ref<TGApp.App.Character.WikiItem>();
|
||||||
const box = computed(() => {
|
const box = computed(() => {
|
||||||
@@ -141,6 +174,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
.twc-brief {
|
.twc-brief {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
column-gap: 10px;
|
column-gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,6 +198,7 @@ onMounted(async () => {
|
|||||||
.twc-bi-top :nth-child(2) {
|
.twc-bi-top :nth-child(2) {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
|
font-size: 14px;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,9 +241,6 @@ onMounted(async () => {
|
|||||||
.twc-text-item {
|
.twc-text-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 5px;
|
|
||||||
border: 1px solid var(--common-shadow-1);
|
|
||||||
border-radius: 5px;
|
|
||||||
row-gap: 5px;
|
row-gap: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user