ai_service/outputs/generated_code.vue

100 lines
2.1 KiB
Vue

<template>
<div class="poster-container">
<img class="background" :src="backgroundImage" alt="端午节背景">
<div class="main-title">{{ title }}</div>
<div class="sub-title">{{ subtitle }}</div>
<img class="content-image" :src="contentImage" alt="端午节内容">
<div class="logo-area">
<img :src="logoImage" alt="Logo">
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
const backgroundImage = ref('https://example.com/background.jpg')
const contentImage = ref('https://example.com/content.jpg')
const logoImage = ref('https://example.com/logo.png')
const title = ref('端午节安康')
const subtitle = ref('粽叶飘香,龙舟竞渡,共庆端午佳节')
</script>
<style scoped>
.poster-container {
position: relative;
width: 100%;
max-width: 1080px;
aspect-ratio: 9/16;
margin: 0 auto;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.background {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
filter: brightness(0.9);
}
.main-title {
position: absolute;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
font-size: clamp(40px, 8vw, 80px);
color: #fff;
text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
z-index: 2;
font-weight: 700;
text-align: center;
width: 90%;
font-family: 'Microsoft YaHei', sans-serif;
}
.sub-title {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
font-size: clamp(20px, 4vw, 36px);
color: #fff;
text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
z-index: 2;
text-align: center;
width: 80%;
line-height: 1.5;
font-family: 'Microsoft YaHei', sans-serif;
}
.content-image {
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
max-height: 40%;
z-index: 2;
object-fit: contain;
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.logo-area {
position: absolute;
bottom: 5%;
left: 50%;
transform: translateX(-50%);
width: 20%;
max-width: 200px;
z-index: 2;
}
.logo-area img {
width: 100%;
height: auto;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
</style>