ai_service/configs/vue_templates.yaml
2025-07-12 17:22:40 +08:00

960 lines
23 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Vue模板配置文件
# 为不同海报类型预定义Vue组件模板
vue_templates:
# 插画风模板
illustration:
name: "插画风海报"
description: "4层结构插画底图+文字图层"
layers:
- name: "插画底图"
type: "background"
description: "AI生成的通用建筑插图彩色插画色调和谐"
- name: "主标题"
type: "text"
content: "见微知著记录南开"
description: "最大号字体,放置在不遮挡主体的相对空白处"
- name: "南开大学logo"
type: "logo"
description: "南开大学标识"
- name: "机构名称"
type: "text"
content: "南开大学融媒体中心"
description: "底部居中放置"
template: |
<template>
<div class="poster-container illustration-theme" :style="containerStyle">
<!-- 插画底图层 -->
<div class="background-layer">
<img :src="backgroundImage" alt="插画背景" class="background-image" />
</div>
<!-- 内容层 -->
<div class="content-layer">
<!-- 主标题 -->
<div class="main-title-section">
<h1 class="primary-title">{{ mainTitle }}</h1>
</div>
<!-- 南开logo -->
<div class="logo-section">
<img src="../outputs/nankai.png" alt="南开大学" class="nankai-logo" />
</div>
<!-- 机构名称 -->
<div class="organization-section">
<h2 class="organization-name">{{ organizationName }}</h2>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'IllustrationPoster',
data() {
return {
mainTitle: '见微知著记录南开',
organizationName: '南开大学融媒体中心',
backgroundImage: '../outputs/background.png'
}
},
computed: {
containerStyle() {
return {
width: '1080px',
height: '1920px',
position: 'relative',
overflow: 'hidden',
background: 'linear-gradient(135deg, #f5f7fa, #c3cfe2)'
}
}
}
}
</script>
<style scoped>
.poster-container {
margin: 0 auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.background-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.background-image {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.9;
}
.content-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.main-title-section {
position: absolute;
top: 15%;
left: 8%;
width: 40%;
}
.primary-title {
font-size: 72px;
font-weight: bold;
color: #2c3e50;
text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
line-height: 1.2;
font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
}
.logo-section {
position: absolute;
top: 45%;
right: 10%;
width: 200px;
height: 200px;
}
.nankai-logo {
width: 100%;
height: 100%;
object-fit: contain;
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}
.organization-section {
position: absolute;
bottom: 8%;
left: 50%;
transform: translateX(-50%);
text-align: center;
}
.organization-name {
font-size: 36px;
color: #34495e;
font-weight: 500;
font-family: 'Microsoft YaHei', sans-serif;
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}
</style>
# 中秋节模板
festival:
name: "中秋节海报"
description: "8层结构背景+遮罩+装饰+logo+多文字层"
layers:
- name: "背景图层"
type: "background"
description: "AI生成节日插画"
- name: "纯色遮罩"
type: "overlay"
description: "插画主色调遮罩"
- name: "小插图背景"
type: "decoration"
description: "节日元素插图"
- name: "南开logo"
type: "logo"
- name: "单位名称"
type: "text"
content: "南开大学"
- name: "节日名称"
type: "text"
content: "中秋节"
- name: "目的主题"
type: "text"
content: "月圆人团圆"
- name: "日期元素"
type: "text"
content: "2025年10月6日"
template: |
<template>
<div class="poster-container festival-theme" :style="containerStyle">
<!-- 背景图层 -->
<div class="background-layer">
<img :src="backgroundImage" alt="节日背景" class="background-image" />
</div>
<!-- 纯色遮罩层 -->
<div class="color-overlay" :style="overlayStyle"></div>
<!-- 装饰元素层 -->
<div class="decoration-layer">
<img :src="decorationImage" alt="节日装饰" class="decoration-image" />
</div>
<!-- 内容层 -->
<div class="content-layer">
<!-- 南开logo -->
<div class="logo-section">
<img src="../outputs/nankai.png" alt="南开大学" class="nankai-logo" />
</div>
<!-- 单位名称 -->
<div class="university-section">
<h1 class="university-name">{{ universityName }}</h1>
</div>
<!-- 节日名称 -->
<div class="festival-section">
<h2 class="festival-name">{{ festivalName }}</h2>
</div>
<!-- 目的主题 -->
<div class="theme-section">
<div class="theme-background"></div>
<h3 class="theme-text">{{ themeText }}</h3>
</div>
<!-- 日期元素 -->
<div class="date-section">
<div class="date-background"></div>
<p class="date-text">{{ dateText }}</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'FestivalPoster',
data() {
return {
universityName: '南开大学',
festivalName: '中秋节',
themeText: '月圆人团圆',
dateText: '2025年10月6日',
backgroundImage: '../outputs/background.png',
decorationImage: '../outputs/lotus.jpg',
mainColor: '#d4a574' // 中秋主色调
}
},
computed: {
containerStyle() {
return {
width: '1080px',
height: '1920px',
position: 'relative',
overflow: 'hidden'
}
},
overlayStyle() {
return {
backgroundColor: this.mainColor,
opacity: 0.3
}
}
}
}
</script>
<style scoped>
.poster-container {
margin: 0 auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.background-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.background-image {
width: 100%;
height: 100%;
object-fit: cover;
}
.color-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.decoration-layer {
position: absolute;
top: 60%;
right: 5%;
width: 300px;
height: 300px;
z-index: 3;
opacity: 0.6;
}
.decoration-image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
filter: blur(1px);
}
.content-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 4;
}
.logo-section {
position: absolute;
top: 8%;
left: 8%;
width: 150px;
height: 150px;
}
.nankai-logo {
width: 100%;
height: 100%;
object-fit: contain;
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}
.university-section {
position: absolute;
top: 25%;
left: 50%;
transform: translateX(-50%);
text-align: center;
}
.university-name {
font-size: 48px;
color: #2c3e50;
font-weight: bold;
font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}
.festival-section {
position: absolute;
top: 35%;
left: 50%;
transform: translateX(-50%);
text-align: center;
}
.festival-name {
font-size: 96px;
color: #d4a574;
font-weight: bold;
font-family: 'SimSun', 'KaiTi', serif;
text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}
.theme-section {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%);
text-align: center;
position: relative;
}
.theme-background {
position: absolute;
top: -20px;
left: -40px;
width: calc(100% + 80px);
height: calc(100% + 40px);
background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(212, 165, 116, 0.1));
border-radius: 20px;
z-index: -1;
}
.theme-text {
font-size: 56px;
color: #8b4513;
font-weight: 500;
font-family: 'KaiTi', serif;
text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.6);
}
.date-section {
position: absolute;
bottom: 12%;
left: 50%;
transform: translateX(-50%);
text-align: center;
position: relative;
}
.date-background {
position: absolute;
top: -15px;
left: -30px;
width: calc(100% + 60px);
height: calc(100% + 30px);
background: linear-gradient(135deg, rgba(212, 165, 116, 0.3), rgba(212, 165, 116, 0.2));
border-radius: 15px;
z-index: -1;
}
.date-text {
font-size: 32px;
color: #654321;
font-weight: 400;
font-family: 'Microsoft YaHei', sans-serif;
margin: 0;
}
</style>
# 通用模板保留原有的lotus模板作为备用
lotus.jpg:
theme: "荷花主题"
style: "传统优雅"
template: |
<template>
<div class="poster-container lotus-theme">
<div class="background-layer">
<img src="../outputs/lotus.jpg" alt="荷花背景" class="background-image" />
</div>
<div class="content-layer">
<div class="title-section">
<h1 class="main-title lotus-title">{{ title }}</h1>
<h2 class="subtitle lotus-subtitle">{{ subtitle }}</h2>
</div>
<div class="main-content lotus-content">
<div class="decoration-elements">
<div class="lotus-decoration"></div>
</div>
</div>
<div class="footer-section">
<div class="logo-area">
<span class="logo-text">{{ logoText }}</span>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
const title = ref('{{ title_content }}')
const subtitle = ref('{{ subtitle_content }}')
const logoText = ref('{{ logo_content }}')
</script>
<style scoped>
.poster-container {
width: 1080px;
height: 1920px;
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #f8f4e6, #e8dcc0);
}
.background-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.background-image {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.8;
}
.content-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.title-section {
position: absolute;
top: 20%;
left: 50%;
transform: translateX(-50%);
text-align: center;
width: 80%;
}
.lotus-title {
font-size: 64px;
font-weight: bold;
color: #2d5016;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
margin-bottom: 20px;
font-family: 'SimSun', serif;
}
.lotus-subtitle {
font-size: 32px;
color: #4a6741;
margin-bottom: 40px;
font-family: 'KaiTi', cursive;
}
.lotus-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 70%;
}
.lotus-decoration {
width: 200px;
height: 200px;
background: radial-gradient(circle, rgba(255,192,203,0.6), rgba(255,182,193,0.3));
border-radius: 50%;
margin: 0 auto;
}
.footer-section {
position: absolute;
bottom: 10%;
left: 50%;
transform: translateX(-50%);
}
.logo-text {
font-size: 24px;
color: #2d5016;
font-weight: 500;
}
</style>
nku.png:
theme: "南开大学"
style: "学术正式"
template: |
<template>
<div class="poster-container nku-theme">
<div class="background-layer">
<img src="../outputs/background.png" alt="背景" class="background-image" />
</div>
<div class="content-layer">
<div class="header-section">
<img src="../outputs/nku.png" alt="南开大学logo" class="nku-logo" />
</div>
<div class="title-section">
<h1 class="main-title nku-title">{{ title }}</h1>
<h2 class="subtitle nku-subtitle">{{ subtitle }}</h2>
</div>
<div class="main-content nku-content">
<div class="academic-decoration">
<div class="knowledge-symbol"></div>
</div>
</div>
<div class="footer-section">
<div class="university-info">
<span class="university-name">{{ logoText }}</span>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
const title = ref('{{ title_content }}')
const subtitle = ref('{{ subtitle_content }}')
const logoText = ref('{{ logo_content }}')
</script>
<style scoped>
.poster-container {
width: 1080px;
height: 1920px;
position: relative;
overflow: hidden;
background: linear-gradient(180deg, #7E0C6E, #4a0845);
}
.background-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.background-image {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.3;
}
.content-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.header-section {
position: absolute;
top: 8%;
left: 50%;
transform: translateX(-50%);
}
.nku-logo {
width: 120px;
height: auto;
}
.title-section {
position: absolute;
top: 25%;
left: 50%;
transform: translateX(-50%);
text-align: center;
width: 85%;
}
.nku-title {
font-size: 58px;
font-weight: bold;
color: #ffffff;
text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
margin-bottom: 25px;
font-family: 'Microsoft YaHei', sans-serif;
}
.nku-subtitle {
font-size: 28px;
color: #f0f0f0;
margin-bottom: 40px;
line-height: 1.4;
}
.nku-content {
position: absolute;
top: 55%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
}
.knowledge-symbol {
width: 150px;
height: 150px;
background: rgba(255,255,255,0.1);
border: 3px solid rgba(255,255,255,0.3);
border-radius: 50%;
margin: 0 auto;
position: relative;
}
.knowledge-symbol::before {
content: '知';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 48px;
color: #ffffff;
font-family: 'SimSun', serif;
}
.footer-section {
position: absolute;
bottom: 8%;
left: 50%;
transform: translateX(-50%);
}
.university-name {
font-size: 22px;
color: #ffffff;
font-weight: 500;
letter-spacing: 2px;
}
</style>
stamp.jpg:
theme: "印章装饰"
style: "传统文化"
template: |
<template>
<div class="poster-container stamp-theme">
<div class="background-layer">
<img src="../outputs/background.png" alt="背景" class="background-image" />
</div>
<div class="content-layer">
<div class="title-section">
<h1 class="main-title stamp-title">{{ title }}</h1>
<h2 class="subtitle stamp-subtitle">{{ subtitle }}</h2>
</div>
<div class="main-content stamp-content">
<div class="stamp-decoration">
<img src="../outputs/stamp.jpg" alt="印章" class="stamp-image" />
</div>
</div>
<div class="footer-section">
<div class="traditional-footer">
<span class="logo-text">{{ logoText }}</span>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
const title = ref('{{ title_content }}')
const subtitle = ref('{{ subtitle_content }}')
const logoText = ref('{{ logo_content }}')
</script>
<style scoped>
.poster-container {
width: 1080px;
height: 1920px;
position: relative;
overflow: hidden;
background: linear-gradient(45deg, #faf0e6, #f5e6d3);
}
.background-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.background-image {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.4;
}
.content-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.title-section {
position: absolute;
top: 18%;
left: 50%;
transform: translateX(-50%);
text-align: center;
width: 85%;
}
.stamp-title {
font-size: 56px;
font-weight: bold;
color: #8B4513;
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
margin-bottom: 20px;
font-family: 'SimSun', serif;
}
.stamp-subtitle {
font-size: 26px;
color: #A0522D;
margin-bottom: 40px;
line-height: 1.5;
font-family: 'KaiTi', cursive;
}
.stamp-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 60%;
text-align: center;
}
.stamp-image {
width: 200px;
height: 200px;
object-fit: contain;
filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.3));
}
.footer-section {
position: absolute;
bottom: 12%;
left: 50%;
transform: translateX(-50%);
}
.logo-text {
font-size: 20px;
color: #8B4513;
font-weight: 500;
font-family: 'SimSun', serif;
}
</style>
background.png:
theme: "通用背景"
style: "简约现代"
template: |
<template>
<div class="poster-container modern-theme">
<div class="background-layer">
<img src="../outputs/background.png" alt="背景" class="background-image" />
</div>
<div class="content-layer">
<div class="title-section">
<h1 class="main-title modern-title">{{ title }}</h1>
<h2 class="subtitle modern-subtitle">{{ subtitle }}</h2>
</div>
<div class="main-content modern-content">
<div class="modern-decoration">
<div class="geometric-shape"></div>
</div>
</div>
<div class="footer-section">
<div class="modern-footer">
<span class="logo-text">{{ logoText }}</span>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
const title = ref('{{ title_content }}')
const subtitle = ref('{{ subtitle_content }}')
const logoText = ref('{{ logo_content }}')
</script>
<style scoped>
.poster-container {
width: 1080px;
height: 1920px;
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.background-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.background-image {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.7;
}
.content-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.title-section {
position: absolute;
top: 22%;
left: 50%;
transform: translateX(-50%);
text-align: center;
width: 90%;
}
.modern-title {
font-size: 60px;
font-weight: 700;
color: #ffffff;
text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
margin-bottom: 25px;
font-family: 'Microsoft YaHei', sans-serif;
}
.modern-subtitle {
font-size: 30px;
color: #f0f0f0;
margin-bottom: 40px;
line-height: 1.4;
font-weight: 300;
}
.modern-content {
position: absolute;
top: 55%;
left: 50%;
transform: translate(-50%, -50%);
width: 70%;
}
.geometric-shape {
width: 180px;
height: 180px;
background: rgba(255,255,255,0.1);
border: 2px solid rgba(255,255,255,0.3);
transform: rotate(45deg);
margin: 0 auto;
backdrop-filter: blur(10px);
}
.footer-section {
position: absolute;
bottom: 10%;
left: 50%;
transform: translateX(-50%);
}
.logo-text {
font-size: 24px;
color: #ffffff;
font-weight: 400;
letter-spacing: 1px;
}
</style>