mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
💄 添加 switch,调整样式
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
<template>
|
||||
<!-- todo 支持 share -->
|
||||
<TOverlay v-model="visible" hide :to-click="onCancel" blur-val="20px">
|
||||
<div class="ton-box" v-if="props.data">
|
||||
<img alt="bg" class="ton-bg" v-if="props.data" :src="props.data.profile" />
|
||||
<div class="ton-content">
|
||||
<span>{{ props.data.name }}</span>
|
||||
<span>{{ props.data.desc }}</span>
|
||||
<span>获取途径:{{ props.data.source }}</span>
|
||||
<div v-if="props.data" class="ton-container">
|
||||
<slot name="left"></slot>
|
||||
<div class="ton-box">
|
||||
<img alt="bg" class="ton-bg" v-if="props.data" :src="props.data.profile" />
|
||||
<div class="ton-content">
|
||||
<span>{{ props.data.name }}</span>
|
||||
<span>{{ props.data.desc }}</span>
|
||||
<span>获取途径:{{ props.data.source }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<slot name="right"></slot>
|
||||
</div>
|
||||
</TOverlay>
|
||||
</template>
|
||||
@@ -39,6 +43,13 @@ function onCancel() {
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.ton-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
column-gap: 10px;
|
||||
}
|
||||
|
||||
.ton-box {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
@@ -75,7 +86,12 @@ function onCancel() {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.ton-content :not(:nth-child(1)) {
|
||||
.ton-content :nth-child(2) {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.ton-content :nth-child(3) {
|
||||
border-top: 1px dotted var(--tgc-white-1);
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -15,7 +15,18 @@
|
||||
</v-list>
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
<ToNamecard v-model="visible" :data="curNameCard" />
|
||||
<ToNamecard v-model="visible" :data="curNameCard">
|
||||
<template #left>
|
||||
<div class="card-arrow left" @click="switchCard(false)">
|
||||
<img src="../../assets/icons/arrow-right.svg" alt="right" />
|
||||
</div>
|
||||
</template>
|
||||
<template #right>
|
||||
<div class="card-arrow" @click="switchCard(true)">
|
||||
<img src="../../assets/icons/arrow-right.svg" alt="right" />
|
||||
</div>
|
||||
</template>
|
||||
</ToNamecard>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -35,6 +46,24 @@ function toNameCard(item: TGApp.App.NameCard.Item) {
|
||||
curNameCard.value = item;
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
function switchCard(isNext: boolean) {
|
||||
const index = AppNameCardsData.findIndex((item) => item.name === curNameCard.value?.name);
|
||||
if (index === -1) return;
|
||||
if (isNext) {
|
||||
if (index === AppNameCardsData.length - 1) {
|
||||
curNameCard.value = AppNameCardsData[0];
|
||||
} else {
|
||||
curNameCard.value = AppNameCardsData[index + 1];
|
||||
}
|
||||
} else {
|
||||
if (index === 0) {
|
||||
curNameCard.value = AppNameCardsData[AppNameCardsData.length - 1];
|
||||
} else {
|
||||
curNameCard.value = AppNameCardsData[index - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.tw-nc-box {
|
||||
@@ -54,4 +83,27 @@ function toNameCard(item: TGApp.App.NameCard.Item) {
|
||||
cursor: pointer;
|
||||
font-family: var(--font-title);
|
||||
}
|
||||
|
||||
.card-arrow {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dark .card-arrow {
|
||||
filter: invert(11%) sepia(73%) saturate(11%) hue-rotate(139deg) brightness(97%) contrast(81%);
|
||||
}
|
||||
|
||||
.card-arrow img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.card-arrow.left img {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user