💄 首页UI调整

This commit is contained in:
目棃
2024-09-07 10:32:42 +08:00
parent 2edbf77824
commit 75d495590a
6 changed files with 68 additions and 70 deletions

View File

@@ -49,7 +49,7 @@ onBeforeMount(async () => {
next.value = TSAvatarBirth.getNextAvatarBirth(); next.value = TSAvatarBirth.getNextAvatarBirth();
}); });
function toBirth(type: TGApp.Archive.Birth.RoleItem | true) { function toBirth(type: TGApp.Archive.Birth.RoleItem) {
let dateStr; let dateStr;
if (type === true) { if (type === true) {
const date = new Date(); const date = new Date();
@@ -59,7 +59,7 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true) {
} else { } else {
dateStr = type.role_birthday; dateStr = type.role_birthday;
} }
if (type != true) { if (type !== true) {
router.push({ name: "留影叙佳期", params: { date: dateStr } }); router.push({ name: "留影叙佳期", params: { date: dateStr } });
return; return;
} }
@@ -72,20 +72,23 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true) {
} }
function parseDesc(intro: string): string { function parseDesc(intro: string): string {
const dom = document.createElement("div"); const dom = new DOMParser().parseFromString(intro, "text/html");
dom.innerHTML = intro; return dom.body.textContent || "";
return dom.innerText;
} }
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.tcb-container { .tcb-container {
display: flex;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 10px; flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
padding: 5px;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 5px inset var(--common-shadow-2); box-shadow: 0 0 5px inset var(--common-shadow-1);
overflow-y: auto; overflow-y: auto;
row-gap: 10px; row-gap: 5px;
} }
.tcb-top-none, .tcb-top-none,
@@ -93,13 +96,12 @@ function parseDesc(intro: string): string {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-bottom: 10px;
} }
.tcb-top-none img, .tcb-top-none img,
.tcb-top-active img { .tcb-top-active img {
width: 50px; width: 40px;
height: 50px; height: 40px;
} }
.tcb-top-active img.active { .tcb-top-active img.active {
@@ -108,8 +110,8 @@ function parseDesc(intro: string): string {
} }
.tcb-top-active img.tcb-cur { .tcb-top-active img.tcb-cur {
width: 50px; width: 40px;
height: 50px; height: 40px;
border-radius: 50%; border-radius: 50%;
background: var(--common-shadow-1); background: var(--common-shadow-1);
} }
@@ -122,7 +124,6 @@ function parseDesc(intro: string): string {
justify-content: flex-start; justify-content: flex-start;
padding: 5px; padding: 5px;
border-radius: 10px; border-radius: 10px;
margin-top: 10px;
background: var(--box-bg-1); background: var(--box-bg-1);
} }

View File

@@ -23,10 +23,10 @@ const props = defineProps<THomeCardProps>();
position: relative; position: relative;
min-height: 100px; min-height: 100px;
padding: 20px 10px 10px; padding: 20px 10px 10px;
border: 1px solid var(--common-shadow-1); border: 1px solid var(--common-shadow-2);
border-radius: 5px; border-radius: 5px;
margin-top: 30px; margin-top: 30px;
box-shadow: 5px 5px 10px var(--common-shadow-2); box-shadow: 2px 2px 5px var(--common-shadow-1);
} }
.thc-title, .thc-title,
@@ -38,8 +38,7 @@ const props = defineProps<THomeCardProps>();
justify-content: center; justify-content: center;
padding: 0 10px; padding: 0 10px;
border-radius: 5px; border-radius: 5px;
background: var(--box-bg-blue); background: var(--tgc-od-blue);
box-shadow: 0 0 5px var(--common-shadow-2);
font-family: var(--font-title); font-family: var(--font-title);
} }

View File

@@ -86,7 +86,7 @@ interface TPoolEmits {
const emits = defineEmits<TPoolEmits>(); const emits = defineEmits<TPoolEmits>();
function poolLastInterval(postId: number): TGApp.Plugins.Mys.Gacha.RenderCard | undefined { function poolLastInterval(postId: number): TGApp.Plugins.Mys.Gacha.RenderCard {
const pool = poolCards.value.find((pool) => pool.postId === postId); const pool = poolCards.value.find((pool) => pool.postId === postId);
if (!pool) return; if (!pool) return;
if (poolTimeGet.value[postId] === "未开始") { if (poolTimeGet.value[postId] === "未开始") {
@@ -206,7 +206,7 @@ function getCBox(info: TGApp.App.Character.WikiBriefInfo): TItemBoxData {
display: "inner", display: "inner",
clickable: true, clickable: true,
lt: `/icon/element/${info.element}元素.webp`, lt: `/icon/element/${info.element}元素.webp`,
ltSize: "20px", ltSize: "15px",
innerHeight: 20, innerHeight: 20,
innerIcon: `/icon/weapon/${info.weapon}.webp`, innerIcon: `/icon/weapon/${info.weapon}.webp`,
innerText: info.name, innerText: info.name,
@@ -258,7 +258,7 @@ onUnmounted(() => {
width: 100%; width: 100%;
border-radius: 5px; border-radius: 5px;
aspect-ratio: 69 / 32; aspect-ratio: 69 / 32;
box-shadow: 0 5px 5px var(--common-shadow-4); box-shadow: 2px 2px 5px var(--common-shadow-2);
} }
.pool-cover { .pool-cover {

View File

@@ -119,7 +119,7 @@ onUnmounted(() => {
display: grid; display: grid;
margin-top: 10px; margin-top: 10px;
grid-gap: 20px; grid-gap: 20px;
grid-template-columns: repeat(auto-fill, minmax(calc(400px + 2rem), 1fr)); grid-template-columns: repeat(auto-fill, minmax(calc(400px + 2rem), 0.5fr));
} }
.position-card { .position-card {

View File

@@ -1,26 +1,32 @@
<template> <template>
<ToLoading v-model="loading" :title="loadingTitle" :subtitle="loadingSubtitle" /> <ToLoading v-model="loading" :title="loadingTitle" :subtitle="loadingSubtitle" />
<div class="home-container"> <div class="home-container">
<div class="home-top">
<div class="home-tools" v-if="appStore.isLogin">
<v-select
v-model="curGid"
class="home-tool-select"
:items="gameSelectList"
item-title="title"
item-value="gid"
:hide-details="true"
variant="outlined"
label="分区"
/>
<TGameNav :model-value="curGid" />
</div>
<div class="home-select"> <div class="home-select">
<v-select <v-select
variant="outlined" variant="outlined"
v-model="showHome" v-model="showHome"
:items="homeStore.getShowItems()" :items="homeStore.getShowItems()"
hide-details :hide-details="true"
:multiple="true" :multiple="true"
:chips="true" :chips="true"
label="首页组件显示"
/> />
<v-btn class="select-btn" @click="submitHome" rounded>确定</v-btn> <v-btn class="select-btn" @click="submitHome" :rounded="true">确定</v-btn>
</div> </div>
<div class="home-tools" v-if="appStore.isLogin">
<v-select
v-model="curGameLabel"
class="home-tool-select"
:items="gameItem"
hide-details
variant="outlined"
/>
<TGameNav :model-value="gameList[curGameLabel]" />
</div> </div>
<component <component
:is="item" :is="item"
@@ -44,6 +50,7 @@ import ToLoading from "../../components/overlay/to-loading.vue";
import { useAppStore } from "../../store/modules/app.js"; import { useAppStore } from "../../store/modules/app.js";
import { useHomeStore } from "../../store/modules/home.js"; import { useHomeStore } from "../../store/modules/home.js";
import TGLogger from "../../utils/TGLogger.js"; import TGLogger from "../../utils/TGLogger.js";
import TGConstant from "../../web/constant/TGConstant.js";
// store // store
const appStore = useAppStore(); const appStore = useAppStore();
@@ -59,26 +66,8 @@ const endNum = ref<number>(0);
const components = shallowRef<any[]>([]); const components = shallowRef<any[]>([]);
const showHome = ref<string[]>(homeStore.getShowValue()); const showHome = ref<string[]>(homeStore.getShowValue());
// top nav const gameSelectList = TGConstant.BBS.CHANNELS;
const gameList = { const curGid = ref<string>(gameSelectList[0].gid);
原神: 2,
"崩坏:星穹铁道": 6,
崩坏3: 1,
崩坏2: 3,
未定事件簿: 4,
绝区零: 8,
大别野: 5,
};
const curGameLabel = ref<keyof typeof gameList>("原神");
const gameItem = ref<string[]>([
"原神",
"崩坏:星穹铁道",
"绝区零",
"崩坏3",
"崩坏2",
"未定事件簿",
"大别野",
]);
onMounted(async () => { onMounted(async () => {
loadingTitle.value = "正在加载首页"; loadingTitle.value = "正在加载首页";
@@ -155,8 +144,15 @@ onUnmounted(() => {
}); });
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.home-select { .home-container {
display: flex; display: flex;
flex-direction: column;
gap: 10px;
}
.home-top {
display: flex;
width: 100%;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 10px; gap: 10px;
@@ -170,19 +166,21 @@ onUnmounted(() => {
} }
.home-tool-select { .home-tool-select {
width: 200px;
max-width: 200px; max-width: 200px;
} }
.home-select {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.select-btn { .select-btn {
width: 100px; width: 100px;
height: 40px; height: 40px;
background: var(--tgc-btn-1); background: var(--tgc-btn-1);
color: var(--btn-text); color: var(--btn-text);
} }
.home-container {
display: flex;
flex-direction: column;
gap: 10px;
}
</style> </style>

View File

@@ -12,7 +12,7 @@
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["DOM", "ESNext"], "lib": ["DOM", "ESNext"],
"skipLibCheck": true, "skipLibCheck": true,
"types": ["vite/client", "node", "color-convert", "js-md5", "uuid"], "types": ["vite/client", "node", "color-convert", "js-md5", "uuid", "src/vite-env"],
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"composite": true "composite": true
}, },