5a7ad8de11
- OSS 文件存储(RustFS / S3 v4 兼容,零依赖手写 SigV4): 上传/列表/删除走桶 arcticnewone,/uploads 代理服务 + 本地回退; server/utils/sigv4.ts 纯函数 + AWS 测试向量验证 - 业务动态配置:settings 表 + /api/settings(公开) + /api/admin/settings(PATCH), useSiteSettings 组合式,footer/contact/tools/app.vue/侧边栏/工具页全部接入, 后台 /admin/settings 修改前台即时生效(站点/联系/社交/工具箱/页脚/SEO) - 后台全面优化:Admin* 设计系统(按钮/输入/表单/卡片/徽标/弹窗/确认/空态/骨架/ 分页/页头/Toast)14 组件;Dashboard 增强;各列表页搜索/筛选/批量删除/分页; 布局与侧边栏分组;统一 toast/确认反馈 - 个人中心全新重设计:顶部资料卡 + 统计、精致化改密/删号(二次确认)、 收藏封面网格、评论卡片、移动端适配 - deploy.sh 支持 OSS 凭据注入(NUXT_OSS_*);.env.example 更新 - 测试 17 例全过(含 SigV4 AWS 向量、settings 默认结构)
134 lines
4.7 KiB
Vue
Executable File
134 lines
4.7 KiB
Vue
Executable File
<template>
|
|
<main class="page-container min-h-screen pt-32 pb-20 px-4 md:px-8 mx-auto max-w-[1200px]">
|
|
<div
|
|
ref="headerWrapRef"
|
|
class="flex flex-col items-center justify-center text-center mb-10 md:mb-16"
|
|
style="opacity: 0; visibility: hidden;"
|
|
>
|
|
<h1 ref="titleRef" class="text-3xl md:text-5xl font-bold mb-4 md:mb-6 tracking-tight text-black">{{ t('tools.title') }}</h1>
|
|
<p ref="descRef" class="text-base md:text-lg text-gray-600 max-w-2xl">{{ t('tools.description') }}</p>
|
|
</div>
|
|
|
|
<div
|
|
ref="cardsWrapRef"
|
|
class="grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 lg:gap-8"
|
|
style="opacity: 0; visibility: hidden;"
|
|
>
|
|
<a
|
|
v-for="tool in settings?.tools ?? []"
|
|
:key="tool.id"
|
|
:href="tool.url"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="tool-card group relative flex flex-col p-5 md:p-8 rounded-2xl md:rounded-3xl bg-white border border-gray-100 shadow-sm hover:shadow-xl transition-all duration-500 overflow-hidden cursor-pointer hover:-translate-y-2"
|
|
>
|
|
<div
|
|
class="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 bg-gradient-to-br"
|
|
:class="tool.color"
|
|
></div>
|
|
|
|
<div class="relative z-10 flex flex-col h-full">
|
|
<div class="flex items-center justify-between mb-6 md:mb-8">
|
|
<div class="w-12 h-12 md:w-14 md:h-14 rounded-2xl flex items-center justify-center bg-gray-50 text-black group-hover:bg-white group-hover:shadow-sm transition-all duration-300">
|
|
<Icon :name="tool.icon" class="w-6 h-6 md:w-8 md:h-8" />
|
|
</div>
|
|
<div class="w-9 h-9 md:w-10 md:h-10 rounded-full flex items-center justify-center bg-gray-50 text-gray-400 group-hover:bg-black group-hover:text-white transition-all duration-300">
|
|
<Icon name="ph:arrow-up-right" class="w-4 h-4 md:w-5 md:h-5" />
|
|
</div>
|
|
</div>
|
|
|
|
<h3 class="text-lg md:text-2xl font-bold mb-2 md:mb-3 text-black">{{ tool.name }}</h3>
|
|
<p class="text-sm md:text-base text-gray-600 leading-snug md:leading-relaxed flex-grow">{{ locale === 'zh' ? tool.descZh : tool.descEn }}</p>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</main>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useSeoMeta } from '#imports'
|
|
import gsap from 'gsap'
|
|
import { useAppStore } from '~/stores/app'
|
|
|
|
const { t, locale } = useI18n()
|
|
const appStore = useAppStore()
|
|
const { settings } = useSiteSettings()
|
|
|
|
const headerWrapRef = ref<HTMLElement | null>(null)
|
|
const titleRef = ref<HTMLElement | null>(null)
|
|
const descRef = ref<HTMLElement | null>(null)
|
|
const cardsWrapRef = ref<HTMLElement | null>(null)
|
|
let cardsCtx: gsap.Context | null = null
|
|
|
|
useSeoMeta({
|
|
title: () => t('tools.title'),
|
|
description: () => t('tools.description'),
|
|
})
|
|
|
|
const playPageIntro = async () => {
|
|
await nextTick()
|
|
if (!headerWrapRef.value || !titleRef.value || !descRef.value || !cardsWrapRef.value) return
|
|
|
|
cardsCtx?.revert()
|
|
|
|
cardsCtx = gsap.context(() => {
|
|
const cards = gsap.utils.toArray<HTMLElement>('.tool-card', cardsWrapRef.value!)
|
|
|
|
gsap.delayedCall(0, () => {
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
const tl = gsap.timeline({ defaults: { ease: 'power3.out' } })
|
|
|
|
tl.set(headerWrapRef.value!, { autoAlpha: 1 })
|
|
tl.fromTo(titleRef.value!, { autoAlpha: 0, y: 20 }, { autoAlpha: 1, y: 0, duration: 0.85, ease: 'power4.out', clearProps: 'transform' })
|
|
tl.fromTo(descRef.value!, { autoAlpha: 0, y: 16 }, { autoAlpha: 1, y: 0, duration: 0.7, ease: 'power4.out', clearProps: 'transform' }, '-=0.45')
|
|
|
|
tl.set(cardsWrapRef.value!, { autoAlpha: 1 }, '-=0.05')
|
|
tl.fromTo(
|
|
cards,
|
|
{ autoAlpha: 0, y: 34, scale: 0.965 },
|
|
{
|
|
autoAlpha: 1,
|
|
y: 0,
|
|
scale: 1,
|
|
duration: 0.95,
|
|
ease: 'power4.out',
|
|
stagger: { each: 0.11, from: 'start' },
|
|
clearProps: 'transform',
|
|
},
|
|
'+=0.08'
|
|
)
|
|
|
|
tl.set([headerWrapRef.value!, cardsWrapRef.value!], { clearProps: 'opacity,visibility' })
|
|
})
|
|
})
|
|
})
|
|
}, headerWrapRef.value)
|
|
}
|
|
|
|
onMounted(() => {
|
|
const handleLoadingDone = () => {
|
|
playPageIntro()
|
|
}
|
|
|
|
if (!appStore.isAppLoading) {
|
|
playPageIntro()
|
|
return
|
|
}
|
|
|
|
window.addEventListener('app-loading-done', handleLoadingDone, { once: true })
|
|
})
|
|
|
|
onBeforeUnmount(() => {
|
|
cardsCtx?.revert()
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
p {
|
|
word-break: break-word;
|
|
}
|
|
</style>
|