️ 样式重构,移除分享

This commit is contained in:
目棃
2024-03-05 21:23:30 +08:00
parent 37de85b62c
commit e8cf6b297a
3 changed files with 35 additions and 80 deletions

View File

@@ -40,6 +40,7 @@ interface HtaOverlayOverviewProps {
interface HtaOverlayOverviewEmits { interface HtaOverlayOverviewEmits {
(e: "update:modelValue", value: boolean): void; (e: "update:modelValue", value: boolean): void;
(e: "cancel"): void; (e: "cancel"): void;
} }
@@ -87,16 +88,12 @@ function onCancel(): void {
} }
.hta-oob-item :nth-child(2n-1) { .hta-oob-item :nth-child(2n-1) {
color: var(--box-text-4); color: var(--box-text-2);
font-family: var(--font-title);
font-size: 16px;
text-align: left; text-align: left;
} }
.hta-oob-item :nth-child(2n) { .hta-oob-item :nth-child(2n) {
color: var(--tgc-yellow-1); color: var(--box-text-3);
font-size: 14px;
text-align: right; text-align: right;
text-shadow: 0 0 5px var(--tgc-dark-7);
} }
</style> </style>

View File

@@ -1,29 +1,18 @@
<template> <template>
<div class="hta-th-box"> <div class="hta-th-box">
<table class="hta-th-table"> <v-data-table :headers="headers" :items="props.modelValue">
<!-- 表头 --> <template v-slot:item="{ item }">
<tr> <tr class="hta-th-tr">
<th>角色</th> <td class="hta-th-icon">
<th>持有</th> <TibWikiAbyss2 v-model="item.AvatarId" />
<th>0</th> </td>
<th>1</th> <td>{{ (item.HoldingRate * 100).toFixed(3) }}%</td>
<th>2</th> <td v-for="rate in item.Constellations" :key="rate.Item">
<th>3</th> {{ (rate.Rate * 100).toFixed(3) }}%
<th>4</th> </td>
<th>5</th> </tr>
<th>6</th> </template>
</tr> </v-data-table>
<!-- 表格 -->
<tr v-for="item in props.modelValue" :key="item.HoldingRate" class="hta-th-tr">
<td class="hta-th-td">
<TibWikiAbyss2 v-model="item.AvatarId" />
</td>
<td>{{ (item.HoldingRate * 100).toFixed(3) }}%</td>
<td v-for="rate in item.Constellations" :key="rate.Item">
{{ (rate.Rate * 100).toFixed(3) }}%
</td>
</tr>
</table>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@@ -34,6 +23,18 @@ interface HtaTabHoldProps {
} }
const props = defineProps<HtaTabHoldProps>(); const props = defineProps<HtaTabHoldProps>();
const headers = [
{ title: "角色", align: "center", key: "AvatarId" },
{ title: "持有", align: "center", key: "HoldingRate" },
{ title: "0命", align: "center", key: "Constellations[0].Rate" },
{ title: "1命", align: "center", key: "Constellations[1].Rate" },
{ title: "2命", align: "center", key: "Constellations[2].Rate" },
{ title: "3命", align: "center", key: "Constellations[3].Rate" },
{ title: "4命", align: "center", key: "Constellations[4].Rate" },
{ title: "5命", align: "center", key: "Constellations[5].Rate" },
{ title: "6命", align: "center", key: "Constellations[6].Rate" },
];
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.hta-th-box { .hta-th-box {
@@ -44,25 +45,12 @@ const props = defineProps<HtaTabHoldProps>();
overflow-y: auto; overflow-y: auto;
} }
.hta-th-table { .hta-th-tr {
width: 100%; height: 100px;
border-radius: 5px;
background: var(--box-bg-1);
text-align: center; text-align: center;
} }
.hta-th-tr { .hta-th-icon {
border-radius: 5px; width: 100px;
background: var(--box-bg-2);
border-collapse: collapse;
}
.hta-th-td {
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
padding: 10px;
} }
</style> </style>

View File

@@ -8,10 +8,6 @@
<v-tab value="team">队伍出场</v-tab> <v-tab value="team">队伍出场</v-tab>
<v-tab value="hold">角色持有</v-tab> <v-tab value="hold">角色持有</v-tab>
</v-tabs> </v-tabs>
<v-btn variant="outlined" class="hta-btn" @click="shareWiki">
<v-icon>mdi-share-variant</v-icon>
<span>分享</span>
</v-btn>
<div class="hta-title"> <div class="hta-title">
<span>胡桃数据库</span> <span>胡桃数据库</span>
<span @click="showDialog = true">更新于 {{ getUpdated() }}</span> <span @click="showDialog = true">更新于 {{ getUpdated() }}</span>
@@ -44,9 +40,7 @@ import HtaTabTeam from "../../components/hutaoAbyss/hta-tab-team.vue";
import HtaTabUp from "../../components/hutaoAbyss/hta-tab-up.vue"; import HtaTabUp from "../../components/hutaoAbyss/hta-tab-up.vue";
import HtaTabUse from "../../components/hutaoAbyss/hta-tab-use.vue"; import HtaTabUse from "../../components/hutaoAbyss/hta-tab-use.vue";
import ToLoading from "../../components/overlay/to-loading.vue"; import ToLoading from "../../components/overlay/to-loading.vue";
// plugins
import Hutao from "../../plugins/Hutao"; import Hutao from "../../plugins/Hutao";
import { generateShareImg } from "../../utils/TGShare";
// loading // loading
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
@@ -87,31 +81,6 @@ function getUpdated(): string {
.toLocaleString("zh-CN", { hour12: false }) .toLocaleString("zh-CN", { hour12: false })
.replace(/\//g, "-"); .replace(/\//g, "-");
} }
function getShareTitle(): string {
switch (tab.value) {
case "use":
return `【胡桃】${overview.value.ScheduleId}-角色使用`;
case "up":
return `【胡桃】${overview.value.ScheduleId}-角色出场`;
case "team":
return `【胡桃】${overview.value.ScheduleId}-队伍出场`;
case "hold":
return `【胡桃】${overview.value.ScheduleId}-角色持有`;
}
return `【胡桃】${overview.value.ScheduleId}-深渊数据`;
}
async function shareWiki(): Promise<void> {
const div = <HTMLDivElement>document.querySelector(".hta-tab-item");
const title = getShareTitle();
loadingTitle.value = "正在生成分享图";
loadingSub.value = `${title}.png`;
loading.value = true;
await generateShareImg(title, div);
loadingSub.value = "";
loading.value = false;
}
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.hta-box { .hta-box {
@@ -143,15 +112,16 @@ async function shareWiki(): Promise<void> {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-left: auto;
column-gap: 10px; column-gap: 10px;
font-size: 20px; font-size: 20px;
} }
.hta-title :nth-child(2) { .hta-title :last-child {
font-family: var(--font-text); font-family: var(--font-text);
} }
.hta-title :nth-child(2):hover { .hta-title :last-child:hover {
cursor: pointer; cursor: pointer;
text-decoration: underline; text-decoration: underline;
} }