feat: 完成见素起名小程序核心功能
- 实现 AI 起名功能(Kimi API 接入) - 添加用户收藏功能(MySQL 数据库) - 实现海报生成与分享 - 添加音效和触觉反馈 - 配置生产环境部署(WAR 包 + Nginx) - 支持多种起名模式(经典、诗词、自然、现代) - 实现分批加载优化体验
This commit is contained in:
@@ -1,195 +1,302 @@
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 容器 */
|
||||
.container {
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #FAFAFA;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 意境感加载页 */
|
||||
.loading-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 100%);
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: all 0.4s ease;
|
||||
}
|
||||
|
||||
.loading-container.visible {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 40rpx;
|
||||
}
|
||||
|
||||
.loading-circle {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border: 4rpx solid #E8E8E8;
|
||||
border-top-color: #2D2D2D;
|
||||
border-radius: 50%;
|
||||
animation: rotate 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 32rpx;
|
||||
color: #4A4A4A;
|
||||
letter-spacing: 8rpx;
|
||||
animation: fadeInOut 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.loading-subtext {
|
||||
font-size: 24rpx;
|
||||
color: #A0A0A0;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
@keyframes fadeInOut {
|
||||
0%, 100% { opacity: 0.6; }
|
||||
50% { opacity: 1; }
|
||||
}
|
||||
|
||||
/* 顶部标题 */
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
font-size: 36rpx;
|
||||
color: #A0A0A0;
|
||||
padding: 20rpx;
|
||||
margin-left: -20rpx;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 28rpx;
|
||||
color: #2D2D2D;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.header-spacer {
|
||||
width: 76rpx;
|
||||
}
|
||||
|
||||
/* 卡片堆叠区域 */
|
||||
.card-stack {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 40rpx;
|
||||
position: relative;
|
||||
width: 70vw;
|
||||
height: 100vw;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.card-container {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 600rpx;
|
||||
aspect-ratio: 3/4;
|
||||
perspective: 1000px;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
box-shadow: 0 20px 60px rgba(0,0,0,0.04);
|
||||
border: 1px solid #F0F0F0;
|
||||
border-radius: 8rpx;
|
||||
background: white;
|
||||
transform-style: preserve-3d;
|
||||
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.card.flipped {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
.card-face {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
backface-visibility: hidden;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.08);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.front {
|
||||
transform: rotateY(0deg);
|
||||
.card-face.front {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.back {
|
||||
.card-face.back {
|
||||
transform: rotateY(180deg);
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card.flipped .front {
|
||||
transform: rotateY(-180deg);
|
||||
}
|
||||
.card.flipped .back {
|
||||
transform: rotateY(0deg);
|
||||
}
|
||||
|
||||
.front .name {
|
||||
font-family: "Noto Serif SC", "Source Han Serif SC", "PingFang SC", serif;
|
||||
font-size: 140rpx;
|
||||
.name {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 96rpx;
|
||||
color: #2D2D2D;
|
||||
margin-bottom: 60rpx;
|
||||
font-weight: 300;
|
||||
letter-spacing: 10rpx;
|
||||
text-align: center;
|
||||
letter-spacing: 16rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.poem-container {
|
||||
height: 350rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.front .poem {
|
||||
font-size: 26rpx;
|
||||
color: #A0A0A0;
|
||||
letter-spacing: 12rpx;
|
||||
writing-mode: vertical-rl;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back {
|
||||
transform: rotateY(180deg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between !important;
|
||||
padding: 80rpx 60rpx !important;
|
||||
.poem {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 2;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.desc-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.back .desc {
|
||||
.desc {
|
||||
font-size: 28rpx;
|
||||
color: #4A4A4A;
|
||||
line-height: 2.2;
|
||||
line-height: 2;
|
||||
text-align: justify;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.analysis-container {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
border-top: 1rpx solid #F0F0F0;
|
||||
padding-top: 30rpx;
|
||||
gap: 20rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tone-tag, .score-tag {
|
||||
font-size: 18rpx;
|
||||
color: #D0D0D0;
|
||||
font-size: 22rpx;
|
||||
color: #888888;
|
||||
letter-spacing: 2rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
margin-top: 20rpx;
|
||||
padding: 16rpx 40rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 16rpx;
|
||||
color: #A0A0A0;
|
||||
border: 1rpx solid #F0F0F0;
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 40rpx;
|
||||
letter-spacing: 2rpx;
|
||||
gap: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.save-btn:active {
|
||||
background: #FAFAFA;
|
||||
transform: scale(0.95);
|
||||
background: #E8E8E8;
|
||||
}
|
||||
|
||||
.save-icon {
|
||||
margin-right: 8rpx;
|
||||
font-size: 14rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 退出动画 */
|
||||
.card-exit-left {
|
||||
transform: translate3d(-150%, 0, 0) rotate(-20deg) !important;
|
||||
opacity: 0 !important;
|
||||
transition: all 0.5s ease-in !important;
|
||||
/* 底部操作栏 */
|
||||
.action-bar {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 80rpx;
|
||||
padding: 60rpx 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.card-exit-right {
|
||||
transform: translate3d(150%, 0, 0) rotate(20deg) !important;
|
||||
opacity: 0 !important;
|
||||
transition: all 0.5s ease-in !important;
|
||||
.action-btn {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 48rpx;
|
||||
transition: all 0.2s;
|
||||
box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 100rpx;
|
||||
.action-btn.dislike-btn {
|
||||
background: #FFFFFF;
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.hint {
|
||||
font-size: 22rpx;
|
||||
color: #D0D0D0;
|
||||
.action-btn.like-btn {
|
||||
background: #2D2D2D;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.action-btn:active {
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 60vh;
|
||||
}
|
||||
|
||||
.empty-state text {
|
||||
font-size: 28rpx;
|
||||
color: #A0A0A0;
|
||||
letter-spacing: 4rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.empty-state button {
|
||||
background: none !important;
|
||||
color: #2D2D2D !important;
|
||||
font-size: 24rpx !important;
|
||||
border: 1rpx solid #E0E0E0 !important;
|
||||
padding: 16rpx 40rpx !important;
|
||||
letter-spacing: 4rpx !important;
|
||||
}
|
||||
|
||||
.empty-state button::after {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/* 收藏锦囊 */
|
||||
.collection-bag {
|
||||
position: fixed;
|
||||
right: 60rpx;
|
||||
bottom: 120rpx;
|
||||
right: 40rpx;
|
||||
bottom: 200rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background-color: #FFFFFF;
|
||||
background: #FFFFFF;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 10rpx 40rpx rgba(0,0,0,0.08);
|
||||
box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
z-index: 10;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
@@ -241,12 +348,11 @@ page {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
border-top-left-radius: 40rpx;
|
||||
border-top-right-radius: 40rpx;
|
||||
box-shadow: 0 -10rpx 60rpx rgba(0,0,0,0.05);
|
||||
right: 0;
|
||||
background: #FFFFFF;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
padding: 60rpx 40rpx;
|
||||
max-height: 70vh;
|
||||
transform: translateY(100%);
|
||||
transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
@@ -256,37 +362,38 @@ page {
|
||||
}
|
||||
|
||||
.collection-title {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 32rpx;
|
||||
color: #2D2D2D;
|
||||
text-align: center;
|
||||
padding: 40rpx 0;
|
||||
font-size: 24rpx;
|
||||
color: #A0A0A0;
|
||||
letter-spacing: 4rpx;
|
||||
border-bottom: 1rpx solid #F0F0F0;
|
||||
margin-bottom: 40rpx;
|
||||
letter-spacing: 8rpx;
|
||||
}
|
||||
|
||||
.collection-scroll {
|
||||
height: calc(100% - 110rpx);
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
.collection-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 60rpx;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #F0F0F0;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 32rpx;
|
||||
font-size: 36rpx;
|
||||
color: #2D2D2D;
|
||||
margin-bottom: 4rpx;
|
||||
margin-bottom: 8rpx;
|
||||
letter-spacing: 8rpx;
|
||||
}
|
||||
|
||||
.item-origin {
|
||||
font-size: 20rpx;
|
||||
color: #A0A0A0;
|
||||
font-weight: 200;
|
||||
font-size: 22rpx;
|
||||
color: #888888;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
@@ -299,13 +406,214 @@ page {
|
||||
}
|
||||
|
||||
.delete-btn:active {
|
||||
background-color: #F0F0F0;
|
||||
color: #B22222;
|
||||
background: #FAFAFA;
|
||||
}
|
||||
|
||||
.collection-empty {
|
||||
text-align: center;
|
||||
padding: 100rpx;
|
||||
padding: 100rpx 60rpx;
|
||||
font-size: 24rpx;
|
||||
color: #E0E0E0;
|
||||
}
|
||||
color: #D0D0D0;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
/* 海报弹窗 */
|
||||
.poster-modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 100;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.poster-modal.visible {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.poster-content {
|
||||
width: 80%;
|
||||
max-width: 600rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.poster-close {
|
||||
position: absolute;
|
||||
top: -80rpx;
|
||||
right: 0;
|
||||
font-size: 48rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 20rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 海报内容区域 */
|
||||
.poster-capture-area {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.poster-bg {
|
||||
width: 100%;
|
||||
aspect-ratio: 3/4;
|
||||
background: linear-gradient(135deg, #FAFAFA 0%, #F0F0F0 100%);
|
||||
position: relative;
|
||||
padding: 60rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 大字竖排 */
|
||||
.poster-name-vertical {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.poster-name-vertical text {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 120rpx;
|
||||
color: #2D2D2D;
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: upright;
|
||||
letter-spacing: 20rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* 出处 */
|
||||
.poster-origin {
|
||||
position: absolute;
|
||||
top: 60rpx;
|
||||
right: 60rpx;
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 22rpx;
|
||||
color: #888888;
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: mixed;
|
||||
letter-spacing: 4rpx;
|
||||
line-height: 2;
|
||||
max-height: 300rpx;
|
||||
}
|
||||
|
||||
/* 印章 */
|
||||
.poster-seal {
|
||||
position: absolute;
|
||||
bottom: 180rpx;
|
||||
right: 60rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border: 4rpx solid #B22222;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 36rpx;
|
||||
color: #B22222;
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: upright;
|
||||
letter-spacing: 8rpx;
|
||||
transform: rotate(-5deg);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* 底部信息 */
|
||||
.poster-footer {
|
||||
position: absolute;
|
||||
bottom: 60rpx;
|
||||
left: 60rpx;
|
||||
right: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.poster-desc {
|
||||
font-size: 20rpx;
|
||||
color: #A0A0A0;
|
||||
line-height: 1.8;
|
||||
max-width: 60%;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.poster-qrcode {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.qrcode-text {
|
||||
font-size: 16rpx;
|
||||
color: #C0C0C0;
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: upright;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
/* 海报操作按钮 */
|
||||
.poster-actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 40rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.poster-btn {
|
||||
width: 240rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 26rpx;
|
||||
letter-spacing: 4rpx;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.poster-btn.save-btn {
|
||||
background: #FFFFFF;
|
||||
color: #2D2D2D;
|
||||
}
|
||||
|
||||
.poster-btn.save-btn:active {
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
.poster-btn.share-btn {
|
||||
background: transparent;
|
||||
color: #FFFFFF;
|
||||
border: 2rpx solid rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.poster-btn.share-btn:active {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user