feat(router): 引入路由系统并重构页面结构

- 为项目引入基于 hash 的前端路由系统,支持多页面切换与动态加载
- 将原有单一 bundle 拆分为多个入口打包(index.js 和 timestamp.js)
- 修改 Rollup 配置以支持多输出文件及插件共享
- 更新 HTML 结构以适配路由容器和页面占位元素
- 调整 CSS 样式,移除旧的页面切换动画,交由路由控制
- 优化 domUtils 工具函数,并迁移部分样式处理逻辑
- 在 timestamp.js 中封装初始化函数以便路由调用
- todolist 页面模板新增,用于后续功能开发
```
This commit is contained in:
雨霖铃
2025-11-27 23:04:24 +08:00
parent ed6053473d
commit 884fc09750
10 changed files with 293 additions and 164 deletions
+3 -23
View File
@@ -53,9 +53,10 @@
p a {
box-sizing: border-box;
color: #2b2b2b;
font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New,
monospace;
}
button {
padding: 0.5rem 1rem;
background-color: #28a745;
@@ -150,27 +151,6 @@
overflow: hidden;
}
/* 页面切换动画 */
.page {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 1rem;
opacity: 0;
transform: translateX(20px);
transition: opacity 0.3s ease, transform 0.3s ease;
}
.page.active {
display: block;
position: relative;
opacity: 1;
transform: translateX(0);
transition: opacity 0.3s ease, transform 0.3s ease;
}
/* 按钮点击效果 */
.button:active,
.convert-button:active,