Skip to content

Commit

Permalink
💄 添加ID信息
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Sep 23, 2024
1 parent a731c55 commit 525d775
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/components/main/t-postcard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-card :rounded="true" v-if="card" :id="`post-card-${card.postId}`" class="tpc-card">
<div v-if="card" :id="`post-card-${card.postId}`" class="tpc-card">
<div class="tpc-cover">
<img :src="card.cover" alt="cover" @click="createPost(card)" />
<div v-if="isAct" class="tpc-act">
Expand Down Expand Up @@ -53,7 +53,8 @@
:value="props.modelValue.post.post_id"
data-html2canvas-ignore
/>
</v-card>
<div class="tpc-info-id" v-else>{{ props.modelValue.post.post_id }}</div>
</div>
</template>
<script lang="ts" setup>
import { computed, onBeforeMount, ref } from "vue";
Expand Down Expand Up @@ -215,12 +216,16 @@ async function shareCard(): Promise<void> {
if (!card.value) return;
const dom = <HTMLDivElement>document.querySelector(`#post-card-${card.value.postId}`);
const fileName = `PostCard_${card.value.postId}`;
await generateShareImg(fileName, dom, 2);
await generateShareImg(fileName, dom, 2.5);
}
</script>
<style lang="css" scoped>
.tpc-card {
position: relative;
overflow: hidden;
width: 100%;
border: 1px solid var(--common-shadow-1);
border-radius: 5px;
box-shadow: 2px 2px 5px var(--common-shadow-2);
}
Expand All @@ -236,7 +241,7 @@ async function shareCard(): Promise<void> {
}
.tpc-cover img {
min-width: 100%;
width: 100%;
object-fit: cover;
object-position: center;
transition: all 0.3s linear;
Expand Down Expand Up @@ -376,4 +381,23 @@ async function shareCard(): Promise<void> {
gap: 5px;
opacity: 0.8;
}
.tpc-info-id {
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 0 5px;
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
background: var(--common-shadow-1);
border-bottom-right-radius: 5px;
border-top-left-radius: 5px;
box-shadow: 2px 2px 5px var(--tgc-dark-1);
color: var(--tgc-white-1);
font-size: 12px;
text-shadow: 0 0 5px var(--tgc-dark-1);
}
</style>

0 comments on commit 525d775

Please sign in to comment.