@ -4,87 +4,220 @@ import { ref } from 'vue';
const { t } = useI18n ( ) ;
/ / 社 区 活 动 数 据
const upcomingEvents = ref ( [
interface Comment {
id : number ;
user : string ;
content : string ;
timestamp : string ;
}
interface Post {
id : number ;
title : string ;
content : string ;
author : string ;
timestamp : string ;
comments : Comment [ ] ;
}
/ / 社 交 媒 体 账 号 数 据
const socialMediaAccounts = [
{
id : 1 ,
title : 'MOSE 开发者大会' ,
date : '2023-12-15' ,
type : 'virtual' ,
image : '/public/images.png'
platform : 'Twitter ',
handle : '@mose202399 ',
icon : 'M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085a4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z ',
url : 'https://twitter.com/mose202399 '
} ,
{
id : 2 ,
title : 'MOSE 区块链峰会' ,
date : '2024-01-20' ,
type : 'inperson' ,
image : '/public/images.png'
platform : 'Twitter ',
handle : '@Nosafuture ',
icon : 'M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085a4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z ',
url : 'https://twitter.com/Nosafuture '
} ,
{
id : 3 ,
title : 'MOSE 黑客松 ',
date : '2024-02-10 ',
type : 'virtual ',
image : '/public/images.png '
platform : 'Twitter ',
handle : '@MoseComa ',
icon : 'M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085a4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z ',
url : 'https://twitter.com/MoseComa '
}
] ) ;
] ;
const pastEvents = ref ( [
/ / 奖 励 数 据
const rewardData = [
{
id : 4 ,
title : 'MOSE 生态系统发布会' ,
date : '2023-06-05' ,
type : 'virtual' ,
image : '/public/images.png' ,
recording : '#'
id : 1 ,
title : t ( 'community.rewards.daily_contest' ) ,
icon : '🏆'
} ,
{
id : 5 ,
title : 'MOSE 技术研讨会' ,
date : '2023-08-12' ,
type : 'inperson' ,
image : '/public/images.png' ,
recording : '#'
id : 2 ,
title : t ( 'community.rewards.weekly_whale' ) ,
icon : '🏆'
}
] ) ;
] ;
/ / 社 区 贡 献 者 数 据
const contributors = ref ( [
/ / 社 区 活 动 数 据
const communityEvents = [
{
id : 1 ,
name : 'Alex Johnson' ,
role : 'Core Developer' ,
image : '/public/vite.svg' ,
github : 'https://github.com'
title : t ( 'community.events.singapore_conference' ) ,
image : '/public/LOGO.png' ,
date : '2024-06-15'
} ,
{
id : 2 ,
name : 'Sarah Chen' ,
role : 'UI/UX Designer' ,
image : '/public/vite.svg' ,
github : 'https://github.com'
title : t ( 'community.events.dubai_summit' ) ,
image : '/public/LOGO.png' ,
date : '2024-09-20'
} ,
{
id : 3 ,
name : 'David Kim' ,
role : 'Community Manager' ,
image : '/public/vite.svg' ,
github : 'https://github.com'
title : t ( 'community.events.tokyo_hackathon' ) ,
image : '/public/LOGO.png' ,
date : '2024-11-10'
}
] ;
/ / 官 方 论 坛 帖 子
const officialPosts : Post [ ] = [
{
id : 1 ,
title : t ( 'community.posts.mainnet_launch.title' ) ,
content : t ( 'community.posts.mainnet_launch.content' ) ,
author : 'MOSE Team' ,
timestamp : '2023-11-20T09:00:00' ,
comments : [
{
id : 1 ,
user : 'CryptoFan' ,
content : t ( 'community.comments.great' ) ,
timestamp : '2023-11-20T10:15:00'
} ,
{
id : 2 ,
user : 'BlockchainDev' ,
content : t ( 'community.comments.testnet' ) ,
timestamp : '2023-11-20T11:30:00'
}
]
} ,
{
id : 2 ,
title : t ( 'community.posts.singapore_license.title' ) ,
content : t ( 'community.posts.singapore_license.content' ) ,
author : 'MOSE Compliance Team' ,
timestamp : '2023-11-15T14:00:00' ,
comments : [
{
id : 1 ,
user : 'RegulationExpert' ,
content : t ( 'community.comments.congrats' ) ,
timestamp : '2023-11-15T15:20:00'
}
]
} ,
{
id : 4 ,
name : 'Maria Rodriguez' ,
role : 'Documentation' ,
image : '/public/vite.svg' ,
github : 'https://github.com'
id : 3 ,
title : t ( 'community.posts.tokyo_hackathon.title' ) ,
content : t ( 'community.posts.tokyo_hackathon.content' ) ,
author : 'MOSE Events Team' ,
timestamp : '2023-11-10T11:00:00' ,
comments : [ ]
}
] ) ;
] ;
/ / 新 留 言
const newMessage = ref ( {
postId : null as number | null ,
user : '' ,
content : ''
} ) ;
/ / 当 前 查 看 的 帖 子 I D
const currentPostId = ref < number | null > ( null ) ;
/ / 提 交 留 言
const submitComment = ( postId : number ) => {
if ( newMessage . value . user && newMessage . value . content ) {
/ / 查 找 帖 子 并 添 加 评 论
const post = officialPosts . find ( p => p . id === postId ) ;
if ( post ) {
post . comments . push ( {
id : post . comments . length + 1 ,
user : newMessage . value . user ,
content : newMessage . value . content ,
timestamp : new Date ( ) . toISOString ( )
} ) ;
/ / 重 置 表 单
newMessage . value . user = '' ;
newMessage . value . content = '' ;
newMessage . value . postId = null ;
}
}
} ;
/ / 准 备 留 言
const prepareComment = ( postId : number ) => {
/ / 记 录 当 前 滚 动 位 置
const scrollPosition = window . scrollY ;
/ / 设 置 当 前 查 看 的 帖 子 I D
currentPostId . value = postId ;
newMessage . value . postId = postId ;
/ / 使 用 s e t T i m e o u t 确 保 D O M 更 新 后 再 恢 复 滚 动 位 置
setTimeout ( ( ) => {
window . scrollTo ( {
top : scrollPosition ,
behavior : 'auto'
} ) ;
} , 0 ) ;
} ;
/ / 关 闭 评 论
const closeComment = ( ) => {
/ / 记 录 当 前 滚 动 位 置
const scrollPosition = window . scrollY ;
/ / 关 闭 评 论 区
currentPostId . value = null ;
/ / 使 用 s e t T i m e o u t 确 保 D O M 更 新 后 再 恢 复 滚 动 位 置
setTimeout ( ( ) => {
window . scrollTo ( {
top : scrollPosition ,
behavior : 'auto'
} ) ;
} , 0 ) ;
} ;
/ / 计 算 帖 子 发 布 时 间
const getTimeAgo = ( timestamp : string ) => {
const now = new Date ( ) ;
const postTime = new Date ( timestamp ) ;
const diffTime = Math . abs ( now . getTime ( ) - postTime . getTime ( ) ) ;
const diffDays = Math . floor ( diffTime / ( 1000 * 60 * 60 * 24 ) ) ;
if ( diffDays < 1 ) {
return t ( 'community.time.today' ) ;
} else if ( diffDays === 1 ) {
return t ( 'community.time.yesterday' ) ;
} else if ( diffDays < 7 ) {
return t ( 'community.time.days_ago' , { days : diffDays } ) ;
} else {
return new Date ( timestamp ) . toLocaleDateString ( ) ;
}
} ;
< / script >
< template >
< div class = "bg-background min-h-screen" >
<!-- Hero Section -- >
< section class = "relative py-32 px-6 md:px-12 lg:px-24 bg-background-dark overflow-hidden" >
< section class = "relative py-24 px-6 md:px-12 lg:px-24 bg-background-dark overflow-hidden" >
< div class = "container mx-auto relative z-10" >
< div class = "max-w-3xl mx-auto text-center" >
< h1 class = "text-4xl md:text-5xl lg:text-6xl font-bold text-text mb-6 wow animate__animated animate__fadeInDown animate__duration-fast" >
@ -104,177 +237,251 @@ const contributors = ref([
< / div >
< / section >
<!-- Community Channels Section -- >
<!-- 1. 社交媒体墙 Section -- >
< section class = "py-16 px-6 md:px-12 lg:px-24" >
< div class = "container mx-auto" >
< div class = "max-w-3xl mx-auto text-center mb-16" >
< h2 class = "text-3xl font-bold text-text mb-4 wow animate__animated animate__fadeInUp" >
{ { t ( 'community.join.title' ) } }
< / h2 >
< p class = "text-text-secondary wow animate__animated animate__fadeInUp animate__delay-xs" >
{ { t ( 'community.join.subtitle' ) } }
< / p >
< / div >
< h2 class = "text-3xl font-bold text-text mb-10 text-center wow animate__animated animate__fadeInUp" >
{ { t ( 'community.social_media.title' ) } }
< / h2 >
< div class = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6" >
<!-- Discord -- >
< div class = "bg-background-light rounded-xl p-6 shadow-card wow animate__animated animate__fadeInUp" >
< div class = "h-16 w-16 bg-primary/20 rounded-full flex items-center justify-center mb-4" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-8 w-8 text-primary-light" fill = "currentColor" viewBox = "0 0 24 24" >
< path d = "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.608 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1634-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" / >
< / svg >
< / div >
< h3 class = "text-xl font-bold text-text mb-2" > { { t ( 'community.channels.discord.title' ) } } < / h3 >
< p class = "text-text-secondary mb-4" > { { t ( 'community.channels.discord.description' ) } } < / p >
< a href = "#" class = "inline-block px-6 py-2 bg-primary text-text rounded-lg btn-hover-float" >
{ { t ( 'community.channels.discord.button' ) } }
< / a >
< / div >
<!-- Telegram -- >
< div class = "bg-background-light rounded-xl p-6 shadow-card wow animate__animated animate__fadeInUp animate__delay-xs" >
< div class = "h-16 w-16 bg-primary/20 rounded-full flex items-center justify-center mb-4" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-8 w-8 text-primary-light" fill = "currentColor" viewBox = "0 0 24 24" >
< path d = "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.96 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" / >
< div class = "flex flex-wrap justify-center gap-6 mb-10" >
< a
v - for = "account in socialMediaAccounts"
: key = "account.id"
: href = "account.url"
target = "_blank"
rel = "noopener noreferrer"
class = "flex items-center bg-background-light p-4 rounded-xl shadow-card transition-all duration-300 hover:shadow-lg hover:-translate-y-1"
>
< div class = "h-12 w-12 bg-primary bg-opacity-10 rounded-full flex items-center justify-center mr-4" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-6 w-6 text-primary-light" fill = "currentColor" viewBox = "0 0 24 24" >
< path d = "M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085a4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z" / >
< / svg >
< / div >
< h3 class = "text-xl font-bold text-text mb-2" > { { t ( 'community.channels.telegram.title' ) } } < / h3 >
< p class = "text-text-secondary mb-4" > { { t ( 'community.channels.telegram.description' ) } } < / p >
< a href = "#" class = "inline-block px-6 py-2 bg-primary text-text rounded-lg btn-hover-float" >
{ { t ( 'community.channels.telegram.button' ) } }
< / a >
< / div >
<!-- Twitter -- >
< div class = "bg-background-light rounded-xl p-6 shadow-card wow animate__animated animate__fadeInUp animate__delay-sm" >
< div class = "h-16 w-16 bg-primary/20 rounded-full flex items-center justify-center mb-4" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-8 w-8 text-primary-light" fill = "currentColor" viewBox = "0 0 24 24" >
< path d = "M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z" / >
< / svg >
< / div >
< h3 class = "text-xl font-bold text-text mb-2" > { { t ( 'community.channels.twitter.title' ) } } < / h3 >
< p class = "text-text-secondary mb-4" > { { t ( 'community.channels.twitter.description' ) } } < / p >
< a href = "#" class = "inline-block px-6 py-2 bg-primary text-text rounded-lg btn-hover-float" >
{ { t ( 'community.channels.twitter.button' ) } }
< / a >
< / div >
<!-- Forum -- >
< div class = "bg-background-light rounded-xl p-6 shadow-card wow animate__animated animate__fadeInUp animate__delay-md" >
< div class = "h-16 w-16 bg-primary/20 rounded-full flex items-center justify-center mb-4" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-8 w-8 text-primary-light" fill = "none" viewBox = "0 0 24 24" stroke = "currentColor" >
< path stroke -linecap = " round " stroke -linejoin = " round " stroke -width = " 2 " d = "M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z" / >
< / svg >
< / div >
< h3 class = "text-xl font-bold text-text mb-2" > { { t ( 'community.channels.forum.title' ) } } < / h3 >
< p class = "text-text-secondary mb-4" > { { t ( 'community.channels.forum.description' ) } } < / p >
< a href = "#" class = "inline-block px-6 py-2 bg-primary text-text rounded-lg btn-hover-float" >
{ { t ( 'community.channels.forum.button' ) } }
< / a >
< / div >
< span class = "text-lg font-medium text-text" > { { account . handle } } < / span >
< / a >
< / div >
< / div >
< / section >
<!-- Community Events Section -- >
<!-- 2. 论坛入口 Section -- >
< section class = "py-16 px-6 md:px-12 lg:px-24 bg-background-light" >
< div class = "container mx-auto" >
< h2 class = "text-3xl font-bold text-text mb-12 text-center wow animate__animated animate__fadeInUp" >
{ { t ( 'community.events .title' ) } }
< h2 class = "text-3xl font-bold text-text mb-6 text-center wow animate__animated animate__fadeInUp" >
{ { t ( 'community.forum.title' ) } }
< / h2 >
<!-- Upcoming Events -- >
< div class = "mb-16" >
< h3 class = "text-2xl font-bold text-text mb-6 wow animate__animated animate__fadeInUp" >
{ { t ( 'community.events.upcoming' ) } }
< / h3 >
< div class = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" >
< div v-for ="event in upcomingEvents" :key="event.id" class="bg-background rounded-xl overflow-hidden shadow-card wow animate__animated animate__fadeInUp" >
< div class = "relative h-48 overflow-hidden" >
< img :src ="event.image" :alt ="event.title" class = "w-full h-full object-cover" / >
< div class = "absolute top-4 right-4 px-3 py-1 rounded-full" : class = "event.type === 'virtual' ? 'bg-secondary' : 'bg-accent'" >
< span class = "text-xs font-medium text-text" >
{ { t ( ` community.events. ${ event . type } ` ) } }
< / span >
< / div >
< / div >
< div class = "p-6" >
< h4 class = "text-xl font-bold text-text mb-2" > { { event . title } } < / h4 >
< p class = "text-text-secondary mb-4" > { { event . date } } < / p >
< button class = "px-6 py-2 bg-primary text-text rounded-lg w-full btn-hover-glow" >
{ { t ( 'community.events.register' ) } }
< / button >
< p class = "text-text-secondary text-center mb-8 max-w-2xl mx-auto" >
{ { t ( 'community.forum.description' ) } }
< / p >
<!-- 优化后的论坛框 -- >
< div class = "max-w-4xl mx-auto bg-background rounded-xl shadow-lg overflow-hidden border border-background-light" >
<!-- 论坛标题栏 -- >
< div class = "bg-primary bg-opacity-10 p-4 border-b border-background-light" >
< div class = "flex items-center justify-between" >
< h3 class = "font-bold text-lg text-primary" > MOSE Forum < / h3 >
< div class = "flex items-center space-x-2" >
< span class = "inline-block w-2 h-2 rounded-full bg-green-500" > < / span >
< span class = "text-sm text-text-secondary" > { { officialPosts . length } } { { t ( 'community.forum.topics' ) } } < / span >
< / div >
< / div >
< / div >
< / div >
<!-- Past Events -- >
< div >
< h3 class = "text-2xl font-bold text-text mb-6 wow animate__animated animate__fadeInUp" >
{ { t ( 'community.events.past' ) } }
< / h3 >
< div class = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" >
< div v-for ="event in pastEvents" :key="event.id" class="bg-background rounded-xl overflow-hidden shadow-card wow animate__animated animate__fadeInUp" >
< div class = "relative h-48 overflow-hidden" >
< img :src ="event.image" :alt ="event.title" class = "w-full h-full object-cover opacity-70" / >
< div class = "absolute top-4 right-4 px-3 py-1 rounded-full" : class = "event.type === 'virtual' ? 'bg-secondary' : 'bg-accent'" >
< span class = "text-xs font-medium text-text" >
{ { t ( ` community.events. ${ event . type } ` ) } }
< / span >
<!-- 论坛帖子列表区域 - 固定高度并可滚动 -- >
< div class = "h-[600px] overflow-y-auto" >
< div class = "p-6" >
<!-- 官方帖子列表 -- >
< div
v - for = "post in officialPosts"
: key = "post.id"
class = "mb-6 overflow-hidden"
>
<!-- 帖子卡片 -- >
< div class = "bg-background-light rounded-lg border border-background-light hover:border-primary-light transition-colors duration-300" >
<!-- 帖子标题与内容 -- >
< div class = "p-5" >
< div class = "flex justify-between items-center mb-4" >
< h3 class = "text-xl font-bold text-text hover:text-primary transition-colors duration-300" > { { post . title } } < / h3 >
< span class = "text-sm text-text-secondary bg-background-dark bg-opacity-20 px-2 py-1 rounded-full" > { { getTimeAgo ( post . timestamp ) } } < / span >
< / div >
< p class = "text-text-secondary text-base mb-4 leading-relaxed" > { { post . content } } < / p >
< div class = "flex items-center text-sm text-text-secondary" >
< span class = "font-medium flex items-center" >
< span class = "inline-block w-8 h-8 rounded-full bg-primary bg-opacity-20 text-primary flex items-center justify-center mr-2" >
{ { post . author . charAt ( 0 ) } }
< / span >
{ { post . author } }
< / span >
< span class = "mx-2" > • < / span >
< span class = "bg-primary bg-opacity-10 text-primary px-2 py-1 rounded-full text-xs" >
{ { t ( 'community.social_media.official_post' ) } }
< / span >
< / div >
< / div >
<!-- 帖子评论区 - 默认隐藏 , 点击展开 -- >
< div v-if ="currentPostId === post.id" class="border-t border-background-light" >
< div class = "p-5 bg-background bg-opacity-50" >
< h4 class = "font-bold text-base text-text mb-4 flex items-center" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-5 w-5 mr-2 text-primary" viewBox = "0 0 20 20" fill = "currentColor" >
< path fill -rule = " evenodd " d = "M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z" clip -rule = " evenodd " / >
< / svg >
{ { t ( 'community.forum.comments' ) } } ( { { post . comments . length } } )
< / h4 >
<!-- 评论列表 -- >
< div v-if ="post.comments.length > 0" class="space-y-4 mb-5 max-h-[250px] overflow-y-auto" >
< div
v - for = "comment in post.comments"
: key = "comment.id"
class = "bg-background rounded-lg p-4 border border-background-light"
>
< div class = "flex justify-between items-center mb-2" >
< span class = "font-bold text-text text-sm flex items-center" >
< span class = "inline-block w-6 h-6 rounded-full bg-secondary bg-opacity-20 text-secondary flex items-center justify-center mr-2 text-xs" >
{ { comment . user . charAt ( 0 ) } }
< / span >
{ { comment . user } }
< / span >
< span class = "text-xs text-text-secondary bg-background-dark bg-opacity-10 px-2 py-1 rounded-full" > { { getTimeAgo ( comment . timestamp ) } } < / span >
< / div >
< p class = "text-text-secondary text-sm pl-8" > { { comment . content } } < / p >
< / div >
< / div >
<!-- 空评论提示 -- >
< div v -else class = "text-center text-text-secondary text-sm py-6 bg-background-dark bg-opacity-5 rounded-lg border border-dashed border-background-light" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-10 w-10 mx-auto mb-2 text-text-secondary opacity-50" viewBox = "0 0 20 20" fill = "currentColor" >
< path fill -rule = " evenodd " d = "M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z" clip -rule = " evenodd " / >
< / svg >
{ { t ( 'community.forum.no_comments' ) } }
< / div >
<!-- 添加评论表单 -- >
< form @submit.prevent ="submitComment(post.id)" class = "mt-6 bg-background p-4 rounded-lg border border-background-light" >
< h5 class = "font-medium text-sm text-text mb-3" > { { t ( 'community.forum.add_comment' ) } } < / h5 >
< div class = "mb-3" >
< input
type = "text"
v - model = "newMessage.user"
class = "w-full px-4 py-2 text-sm rounded-lg border border-background-light bg-background focus:outline-none focus:ring-1 focus:ring-primary"
: placeholder = "t('community.forum.username')"
required
>
< / div >
< div class = "mb-3" >
< textarea
v - model = "newMessage.content"
rows = "3"
class = "w-full px-4 py-2 text-sm rounded-lg border border-background-light bg-background focus:outline-none focus:ring-1 focus:ring-primary"
: placeholder = "t('community.forum.comment')"
required
> < / textarea >
< / div >
< div class = "flex justify-between items-center" >
< button
type = "button"
class = "px-4 py-2 border border-primary-light text-primary-light text-sm rounded-lg hover:bg-primary-light hover:bg-opacity-10 transition-colors duration-200"
@ click = "closeComment"
>
{ { t ( 'community.forum.cancel' ) } }
< / button >
< button
type = "submit"
class = "px-4 py-2 bg-primary text-text text-sm rounded-lg hover:bg-primary-dark transition-colors duration-200 flex items-center"
>
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-4 w-4 mr-1" viewBox = "0 0 20 20" fill = "currentColor" >
< path fill -rule = " evenodd " d = "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13a1 1 0 102 0V9.414l1.293 1.293a1 1 0 001.414-1.414z" clip -rule = " evenodd " / >
< / svg >
{ { t ( 'community.forum.submit' ) } }
< / button >
< / div >
< / form >
< / div >
< / div >
<!-- 查看评论按钮 -- >
< div v -else class = "p-4 flex justify-between items-center border-t border-background-light bg-background-dark bg-opacity-5" >
< span class = "text-sm text-text-secondary flex items-center" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-4 w-4 mr-1" viewBox = "0 0 20 20" fill = "currentColor" >
< path fill -rule = " evenodd " d = "M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z" clip -rule = " evenodd " / >
< / svg >
{ { t ( 'community.forum.comments' ) } } : { { post . comments . length } }
< / span >
< button
@ click = "prepareComment(post.id)"
class = "px-4 py-2 text-sm bg-primary text-text rounded-lg hover:bg-primary-dark transition-colors duration-200 flex items-center"
>
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-4 w-4 mr-1" viewBox = "0 0 20 20" fill = "currentColor" >
< path d = "M10 12a2 2 0 100-4 2 2 0 000 4z" / >
< path fill -rule = " evenodd " d = "M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z" clip -rule = " evenodd " / >
< / svg >
{ { t ( 'community.forum.view_comments' ) } }
< / button >
< / div >
< / div >
< / div >
< div class = "p-6" >
< h4 class = "text-xl font-bold text-text mb-2" > { { event . title } } < / h4 >
< p class = "text-text-secondary mb-4" > { { event . date } } < / p >
< a :href ="event.recording" class = "px-6 py-2 bg-transparent border border-primary-light text-primary-light rounded-lg flex items-center justify-center btn-hover-shadow" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-5 w-5 mr-2" fill = "none" viewBox = "0 0 24 24" stroke = "currentColor" >
< path stroke -linecap = " round " stroke -linejoin = " round " stroke -width = " 2 " d = "M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" / >
< path stroke -linecap = " round " stroke -linejoin = " round " stroke -width = " 2 " d = "M21 12a9 9 0 11-18 0 9 9 0 0118 0z" / >
< / svg >
{ { t ( 'community.events.watch' ) } }
< / a >
< / div >
< / div >
< / div >
< / div >
< / div >
< / section >
<!-- Community Contributors Section -- >
<!-- 3. 信息公示 Section -- >
< section class = "py-16 px-6 md:px-12 lg:px-24" >
< div class = "container mx-auto" >
< div class = "max-w-3xl mx-auto text-center mb-12" >
< h2 class = "text-3xl font-bold text-text mb-4 wow animate__animated animate__fadeInUp" >
{ { t ( 'community.contributors.title' ) } }
< / h2 >
< p class = "text-text-secondary wow animate__animated animate__fadeInUp animate__delay-xs" >
{ { t ( 'community.contributors.description' ) } }
< / p >
< / div >
< h2 class = "text-3xl font-bold text-text mb-4 text-center wow animate__animated animate__fadeInUp" >
{ { t ( 'community.announcements.title' ) } }
< / h2 >
< h3 class = "text-xl font-medium text-text mb-8 text-center wow animate__animated animate__fadeIn animate__delay-xs" >
{ { t ( 'community.announcements.awards_title' ) } }
< / h3 >
< div class = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-12" >
< div v-for ="contributor in contributors" :key="contributor.id" class="bg-background-light rounded-xl p-6 text-center shadow-card wow animate__animated animate__fadeInUp" >
< div class = "w-24 h-24 rounded-full mx-auto mb-4 overflow-hidden" >
< img :src ="contributor.image" :alt ="contributor.name" class = "w-full h-full object-cover" / >
< div class = "grid grid-cols-1 md:grid-cols-2 gap-6 max-w-3xl mx-auto" >
< div
v - for = "reward in rewardData"
: key = "reward.id"
class = "bg-background-light rounded-xl p-6 shadow-card hover:shadow-lg transition-all duration-300 flex items-center"
>
< div class = "text-4xl mr-4" > { { reward . icon } } < / div >
< div class = "flex-1" >
< p class = "text-lg text-text font-medium" > { { reward . title } } < / p >
< / div >
< h4 class = "text-xl font-bold text-text mb-1" > { { contributor . name } } < / h4 >
< p class = "text-text-secondary mb-4" > { { contributor . role } } < / p >
< a :href ="contributor.github" class = "text-primary-light hover:text-primary flex items-center justify-center" >
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-5 w-5 mr-2" fill = "currentColor" viewBox = "0 0 24 24" >
< path d = "M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" / >
< / svg >
GitHub
< / a >
< / div >
< / div >
< / div >
< / section >
<!-- 4. 社区风采 Section -- >
< section class = "py-16 px-6 md:px-12 lg:px-24 bg-background-light" >
< div class = "container mx-auto" >
< h2 class = "text-3xl font-bold text-text mb-4 text-center wow animate__animated animate__fadeInUp" >
{ { t ( 'community.highlights.title' ) } }
< / h2 >
< div class = "text-center" >
< a href = "#" class = "inline-block px-8 py-3 bg-primary text-text rounded-lg btn-hover-scale" >
{ { t ( 'community.contributors.become' ) } }
< / a >
< h3 class = "text-xl font-medium text-text mb-8 text-center wow animate__animated animate__fadeIn animate__delay-xs" >
{ { t ( 'community.highlights.ugc_title' ) } }
< / h3 >
< div class = "grid grid-cols-1 md:grid-cols-3 gap-6" >
< div
v - for = "event in communityEvents"
: key = "event.id"
class = "bg-background rounded-xl overflow-hidden shadow-card hover:shadow-lg transition-all duration-300"
>
< div class = "h-48 overflow-hidden" >
< img :src ="event.image" :alt ="event.title" class = "w-full h-full object-cover hover:scale-105 transition-transform duration-300" >
< / div >
< div class = "p-6" >
< h4 class = "text-lg font-bold text-text mb-2" > { { event . title } } < / h4 >
< p class = "text-text-secondary" > { { event . date } } < / p >
< / div >
< / div >
< / div >
< / div >
< / section >
@ -283,11 +490,11 @@ const contributors = ref([
< style scoped >
. shadow - card {
box - shadow : 0 10 px 15 px - 3 px rgba ( 0 , 0 , 0 , 0.1 ) , 0 4 px 6 px - 2 px rgba ( 0 , 0 , 0 , 0.05 ) ;
transition : transform 0.3 s ease , box - shadow 0.3 s ease ;
}
. shadow - card : hover {
transform : translateY ( - 5 px ) ;
box - shadow : 0 15 px 30 px rgba ( 0 , 0 , 0 , 0.2 ) ;
box - shadow : 0 20 px 25 px - 5 px rgba ( 0 , 0 , 0 , 0.1 ) , 0 10 px 10 px - 5 px rgba ( 0 , 0 , 0 , 0.04 ) ;
}
< / style >