feat: add announcements feature with JSON data and interactive UI

- Created a new JSON file for announcements containing activity and maintenance updates.
- Implemented a JavaScript module to fetch, filter, and display announcements dynamically.
- Added functionality for editing announcements with a modal interface and live preview.
- Included drag-and-drop support for content blocks within the announcement editor.
- Enhanced user experience with category filtering and search capabilities.
This commit is contained in:
zhangyuheng
2026-03-10 15:05:41 +08:00
parent 7171b3e14d
commit 588fd66bb5
6 changed files with 1920 additions and 0 deletions

86
data/announcements.json Normal file
View File

@@ -0,0 +1,86 @@
[
{
"title": "【26Q2Q3】官网首页封面图片投稿",
"intro": "服务器官方网站首页封面图片征集投稿活动。",
"time": "2026-03-10",
"category": "activity",
"content": [
{
"type": "text",
"content": "▸参与投稿"
},
{
"type": "text",
"content": "1. 打开服务器官网相册https://bailuyuan.lunadeer.cn/photo.html"
},
{
"type": "text",
"content": "2. 注册或登录账号;"
},
{
"type": "text",
"content": "3. 上传图片,在标签处选择或输入:#26Q2Q3官网封面活动"
},
{
"type": "text",
"content": "4. 回车确认标签被添加,最后点击上传图片;"
},
{
"type": "text",
"content": "---------------------------------"
},
{
"type": "text",
"content": "▸参与投票"
},
{
"type": "text",
"content": "1. 打开服务器官网相册https://bailuyuan.lunadeer.cn/photo.html"
},
{
"type": "text",
"content": "2. 注册或登录账号;"
},
{
"type": "text",
"content": "3. 筛选图片,选择:#26Q2Q3官网封面活动"
},
{
"type": "text",
"content": "4. 为你喜爱的图片点赞;"
},
{
"type": "text",
"content": "---------------------------------"
},
{
"type": "text",
"content": "▸活动截止日期"
},
{
"type": "text",
"content": "2026年3月31日"
}
]
},
{
"title": "服务器新增假人、无限末地门结构",
"intro": "服务器维护更新。",
"time": "2026-03-10",
"category": "maintenance",
"content": [
{
"type": "text",
"content": "服务器更新维护,本次维护新增如下内容:"
},
{
"type": "text",
"content": "1. 服务器新人假人系统Bot/FakePlayer详情参考文档里对假人的说明https://bailuyuan.lunadeer.cn/doc.html"
},
{
"type": "text",
"content": "2. 服务器重写了末地传送门结构生成规则,重写后与基岩版一致,为不限数量随机生成,便于生活在新出生点的玩家有便捷的末地传送门可用;"
}
]
}
]