mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
💄 美化卡池组件样式
This commit is contained in:
@@ -5,50 +5,45 @@
|
|||||||
限时祈愿
|
限时祈愿
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!loading" class="pool-grid">
|
<div v-if="!loading" class="pool-grid">
|
||||||
<v-card v-for="pool in poolCards" :key="pool.postId" class="pool-card">
|
<div v-for="pool in poolCards" :key="pool.postId" class="pool-card">
|
||||||
<v-list class="pool-list">
|
|
||||||
<v-list-item :title="pool.title" :subtitle="pool.subtitle">
|
|
||||||
<!-- todo 点击播放语音 -->
|
|
||||||
<template #prepend>
|
|
||||||
<img :src="pool.voice.icon" class="pool-voice-icon" alt="icon" />
|
|
||||||
</template>
|
|
||||||
<template v-if="pool.voice.url" #append>
|
|
||||||
<audio :src="pool.voice.url" controls />
|
|
||||||
</template>
|
|
||||||
</v-list-item>
|
|
||||||
</v-list>
|
|
||||||
<div class="pool-cover" @click="toPost(pool)">
|
<div class="pool-cover" @click="toPost(pool)">
|
||||||
<img :src="pool.cover" alt="cover" />
|
<img :src="pool.cover" alt="cover" />
|
||||||
</div>
|
</div>
|
||||||
<div class="pool-character">
|
<div class="pool-bottom">
|
||||||
<div class="pool-icon-grid">
|
<div class="pool-character">
|
||||||
<div
|
<div class="pool-icon-grid">
|
||||||
v-for="character in pool.characters"
|
<div
|
||||||
:key="character.url"
|
v-for="character in pool.characters"
|
||||||
class="pool-icon"
|
:key="character.url"
|
||||||
@click="toOuter(character.url, pool.title)"
|
class="pool-icon"
|
||||||
>
|
@click="toOuter(character.url, pool.title)"
|
||||||
<img :src="character.icon" alt="character" />
|
>
|
||||||
|
<img :src="character.icon" alt="character" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pool-clock">
|
<div class="pool-time">
|
||||||
<v-progress-circular
|
<div class="pool-time-dur">
|
||||||
:model-value="poolTimePass[pool.postId]"
|
<v-icon>mdi-calendar-clock</v-icon>
|
||||||
size="100"
|
{{ pool.time.start }}~{{ pool.time.end }}
|
||||||
width="10"
|
</div>
|
||||||
:color="poolColor[pool.postId]"
|
<v-progress-linear :model-value="poolTimePass[pool.postId]" :rounded="true">
|
||||||
|
</v-progress-linear>
|
||||||
|
<div
|
||||||
|
v-if="poolTimeGet[pool.postId] === '已结束'"
|
||||||
|
:style="{ color: poolColor[pool.postId] }"
|
||||||
>
|
>
|
||||||
{{ poolTimeGet[pool.postId] }}
|
{{ poolTimeGet[pool.postId] }}
|
||||||
</v-progress-circular>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<span>剩余时间:</span>
|
||||||
|
<span :style="{ color: poolColor[pool.postId] }">
|
||||||
|
{{ poolTimeGet[pool.postId] }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<v-card-text>
|
</div>
|
||||||
<span style="width: 60%">
|
|
||||||
<v-icon>mdi-calendar-clock</v-icon>
|
|
||||||
{{ pool.time.start }}~{{ pool.time.end }}
|
|
||||||
</span>
|
|
||||||
</v-card-text>
|
|
||||||
</v-card>
|
|
||||||
</div>
|
</div>
|
||||||
<v-snackbar v-model="showBar" :color="barColor" timeout="1000">
|
<v-snackbar v-model="showBar" :color="barColor" timeout="1000">
|
||||||
{{ barText }}
|
{{ barText }}
|
||||||
@@ -92,7 +87,7 @@ defineExpose({
|
|||||||
loading,
|
loading,
|
||||||
});
|
});
|
||||||
|
|
||||||
function poolLastInterval(postId: number): void {
|
function poolLastInterval(postId: number): TGApp.Plugins.Mys.Gacha.RenderCard | undefined {
|
||||||
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] === "未开始") {
|
||||||
@@ -122,6 +117,8 @@ onMounted(async () => {
|
|||||||
console.error("获取限时祈愿数据失败");
|
console.error("获取限时祈愿数据失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log("获取限时祈愿数据成功");
|
||||||
|
console.info(gachaData);
|
||||||
if (!checkCover(gachaData)) {
|
if (!checkCover(gachaData)) {
|
||||||
poolCards.value = await Mys.Gacha.card(gachaData);
|
poolCards.value = await Mys.Gacha.card(gachaData);
|
||||||
const coverData: Record<number, string> = {};
|
const coverData: Record<number, string> = {};
|
||||||
@@ -241,42 +238,31 @@ onUnmounted(() => {
|
|||||||
.pool-grid {
|
.pool-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
grid-gap: 20px;
|
gap: 20px;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-card {
|
.pool-card {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: var(--common-bg-1);
|
background: var(--common-bg-1);
|
||||||
color: var(--common-bgt-1);
|
color: var(--common-bgt-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-list {
|
|
||||||
background: inherit;
|
|
||||||
color: inherit;
|
|
||||||
font-family: var(--font-title);
|
|
||||||
}
|
|
||||||
|
|
||||||
.pool-voice-icon {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
transform: translateY(-5px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.pool-cover {
|
.pool-cover {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: calc(100% - 40px);
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin: 0 20px 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-cover img {
|
.pool-cover img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 10px;
|
border-radius: 5px;
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,23 +272,45 @@ onUnmounted(() => {
|
|||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-character {
|
.pool-bottom {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 70px;
|
align-items: center;
|
||||||
margin: 0 20px;
|
justify-content: space-between;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
background: rgb(0 0 0/20%);
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
border-bottom-right-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-character {
|
||||||
|
display: flex;
|
||||||
|
width: auto;
|
||||||
|
height: 60px;
|
||||||
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-icon-grid {
|
.pool-icon-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-column-gap: 10px;
|
grid-column-gap: 10px;
|
||||||
grid-template-columns: repeat(4, 70px);
|
grid-template-columns: repeat(4, 60px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-icon {
|
.pool-icon {
|
||||||
width: 70px;
|
width: 60px;
|
||||||
height: 70px;
|
height: 60px;
|
||||||
|
border: 1px solid rgb(255 255 255 / 50%);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 0 5px rgb(0 0 0/20%);
|
||||||
|
transition: all ease-in-out 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-icon:hover {
|
||||||
|
transform: scale(1.1);
|
||||||
|
transition: all ease-in-out 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-icon img {
|
.pool-icon img {
|
||||||
@@ -312,8 +320,15 @@ onUnmounted(() => {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-clock {
|
.pool-time {
|
||||||
margin-left: 60px;
|
display: flex;
|
||||||
font-size: small;
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin-right: 10px;
|
||||||
|
color: #faf7e8;
|
||||||
|
font-size: 12px;
|
||||||
|
gap: 10px;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user