feat: 全量落地后端与功能闭环
- 真实后端(server/):SQLite 存储 + scrypt 会话鉴权 + SMTP 邮件 - auth 注册/登录/登出/me/资料更新 - contact 联系表单(落库+邮件)、newsletter 订阅(去重) - favorites 作品收藏、comments 新闻评论、account 管理收件箱 - 用户系统 UI:个人中心 /account(资料/收藏/评论/管理员面板)、 收藏按钮、评论组件、登录/注册弹窗接真实 API(useApiError 错误映射) - 内容单点事实源:app/data/news|work 消除三处重复,页面全部引用 - 修复断链:首页动态/作品卡可点击、分享按钮真实动作、移除 # 死链、 语言切换器、社交链接统一 siteConfig - SEO:动态 sitemap/robots、JSON-LD、脚本生成真实 og-image.png - 列表增强:搜索 + 加载更多 - 部署自动化:build-and-push.sh 支持 git tag 版本化镜像; deploy.sh 一条命令构建推送+注入 Secret/ConfigMap+kubectl 滚动升级; deployment 挂 PVC 持久化;Dockerfile 支持 better-sqlite3 原生编译 - 组件注册去目录前缀,修复 AppLoader/AnimatedButton 等未渲染问题
This commit is contained in:
@@ -13,11 +13,12 @@
|
||||
|
||||
<!-- Bento 网格 -->
|
||||
<div class="grid grid-cols-12 gap-4 md:gap-6 auto-rows-[200px]">
|
||||
<div
|
||||
<NuxtLink
|
||||
v-for="(item, index) in updates"
|
||||
:key="item.id"
|
||||
:key="item.slug"
|
||||
:to="`/news/${item.slug}`"
|
||||
:ref="el => setCardRef(el, index)"
|
||||
class="update-card group relative overflow-hidden rounded-3xl cursor-pointer"
|
||||
class="update-card group relative overflow-hidden rounded-3xl cursor-pointer block"
|
||||
:class="item.gridClass"
|
||||
:style="{ opacity: 0 }"
|
||||
@mouseenter="() => handleCardHover(index, true)"
|
||||
@@ -31,27 +32,27 @@
|
||||
<div>
|
||||
<div class="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/20 backdrop-blur-sm text-xs md:text-sm font-semibold mb-4">
|
||||
<Icon :name="item.categoryIcon" class="w-4 h-4" />
|
||||
{{ t(`home.updates.categories.${item.category}`) }}
|
||||
{{ t(`news.categories.${item.category}`) }}
|
||||
</div>
|
||||
|
||||
<h3 class="text-xl md:text-3xl font-bold mb-3 line-clamp-2">
|
||||
{{ t(`home.updates.items.${item.id}.title`) }}
|
||||
{{ t(`news.items.${item.slug}.title`) }}
|
||||
</h3>
|
||||
|
||||
<p v-if="item.showDescription" class="text-white/90 text-sm md:text-base line-clamp-3">
|
||||
{{ t(`home.updates.items.${item.id}.description`) }}
|
||||
{{ t(`news.items.${item.slug}.excerpt`) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs md:text-sm text-white/80">{{ item.date }}</span>
|
||||
<span class="text-xs md:text-sm text-white/80">{{ formatNewsDate(item.date, locale) }}</span>
|
||||
<Icon name="ph:arrow-up-right" class="w-5 h-5 md:w-6 md:h-6 transition-transform duration-300 group-hover:translate-x-1 group-hover:-translate-y-1" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 悬浮效果 -->
|
||||
<div class="absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-300"></div>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<!-- 查看更多 -->
|
||||
@@ -73,10 +74,11 @@ import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import gsap from 'gsap'
|
||||
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
||||
import { newsItems, formatNewsDate } from '~/data/news'
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger)
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
const rootRef = ref<HTMLElement | null>(null)
|
||||
const headerRef = ref<HTMLElement | null>(null)
|
||||
@@ -87,62 +89,21 @@ const setCardRef = (el: any, index: number) => {
|
||||
if (el) cardElements.value[index] = el
|
||||
}
|
||||
|
||||
const updates = [
|
||||
{
|
||||
id: 'project1',
|
||||
category: 'project',
|
||||
categoryIcon: 'ph:briefcase',
|
||||
gradient: 'bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500',
|
||||
gridClass: 'col-span-12 md:col-span-6 md:row-span-2',
|
||||
showDescription: true,
|
||||
date: '2026-06-01'
|
||||
},
|
||||
{
|
||||
id: 'blog1',
|
||||
category: 'blog',
|
||||
categoryIcon: 'ph:article',
|
||||
gradient: 'bg-gradient-to-br from-orange-500 to-red-500',
|
||||
gridClass: 'col-span-12 md:col-span-3 md:row-span-1',
|
||||
showDescription: false,
|
||||
date: '2026-05-28'
|
||||
},
|
||||
{
|
||||
id: 'news1',
|
||||
category: 'news',
|
||||
categoryIcon: 'ph:newspaper',
|
||||
gradient: 'bg-gradient-to-br from-green-500 to-emerald-500',
|
||||
gridClass: 'col-span-12 md:col-span-3 md:row-span-1',
|
||||
showDescription: false,
|
||||
date: '2026-05-25'
|
||||
},
|
||||
{
|
||||
id: 'project2',
|
||||
category: 'project',
|
||||
categoryIcon: 'ph:briefcase',
|
||||
gradient: 'bg-gradient-to-br from-indigo-500 to-blue-500',
|
||||
gridClass: 'col-span-12 md:col-span-3 md:row-span-2',
|
||||
showDescription: true,
|
||||
date: '2026-05-20'
|
||||
},
|
||||
{
|
||||
id: 'blog2',
|
||||
category: 'blog',
|
||||
categoryIcon: 'ph:article',
|
||||
gradient: 'bg-gradient-to-br from-pink-500 to-rose-500',
|
||||
gridClass: 'col-span-12 md:col-span-6 md:row-span-1',
|
||||
showDescription: false,
|
||||
date: '2026-05-15'
|
||||
},
|
||||
{
|
||||
id: 'news2',
|
||||
category: 'news',
|
||||
categoryIcon: 'ph:newspaper',
|
||||
gradient: 'bg-gradient-to-br from-amber-500 to-orange-500',
|
||||
gridClass: 'col-span-12 md:col-span-3 md:row-span-1',
|
||||
showDescription: false,
|
||||
date: '2026-05-10'
|
||||
}
|
||||
]
|
||||
// Bento 布局(与动态数据一一对应;分类图标/渐变/跨度)
|
||||
const layout = [
|
||||
{ categoryIcon: 'ph:article', gradient: 'bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500', gridClass: 'col-span-12 md:col-span-6 md:row-span-2', showDescription: true },
|
||||
{ categoryIcon: 'ph:briefcase', gradient: 'bg-gradient-to-br from-orange-500 to-red-500', gridClass: 'col-span-12 md:col-span-3 md:row-span-1', showDescription: false },
|
||||
{ categoryIcon: 'ph:newspaper', gradient: 'bg-gradient-to-br from-green-500 to-emerald-500', gridClass: 'col-span-12 md:col-span-3 md:row-span-1', showDescription: false },
|
||||
{ categoryIcon: 'ph:article', gradient: 'bg-gradient-to-br from-indigo-500 to-blue-500', gridClass: 'col-span-12 md:col-span-3 md:row-span-2', showDescription: true },
|
||||
{ categoryIcon: 'ph:briefcase', gradient: 'bg-gradient-to-br from-pink-500 to-rose-500', gridClass: 'col-span-12 md:col-span-6 md:row-span-1', showDescription: false },
|
||||
{ categoryIcon: 'ph:newspaper', gradient: 'bg-gradient-to-br from-amber-500 to-orange-500', gridClass: 'col-span-12 md:col-span-3 md:row-span-1', showDescription: false },
|
||||
] as const
|
||||
|
||||
// 取前 6 条动态,绑定布局
|
||||
const updates = newsItems.slice(0, 6).map((item, i) => ({
|
||||
...item,
|
||||
...layout[i],
|
||||
}))
|
||||
|
||||
// 卡片悬浮效果
|
||||
const handleCardHover = (index: number, isHover: boolean) => {
|
||||
@@ -155,7 +116,7 @@ const handleCardHover = (index: number, isHover: boolean) => {
|
||||
? '0 25px 50px -12px rgba(0, 0, 0, 0.25)'
|
||||
: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
||||
duration: 0.3,
|
||||
ease: 'power2.out'
|
||||
ease: 'power2.out',
|
||||
})
|
||||
}
|
||||
|
||||
@@ -171,7 +132,7 @@ onMounted(async () => {
|
||||
gsap.set(card, { autoAlpha: 0, y: 60, scale: 0.9 })
|
||||
})
|
||||
|
||||
// 入场动画(无 pin):标题 + 卡片错开出现
|
||||
// 入场动画:标题 + 卡片错开出现
|
||||
const tl = gsap.timeline()
|
||||
|
||||
tl.to(headerRef.value, { autoAlpha: 1, y: 0, duration: 0.8, ease: 'power3.out' }, 0)
|
||||
|
||||
Reference in New Issue
Block a user