Files
testing-tool/sidepanel/style/style.css
T
雨霖铃 884fc09750 ```
feat(router): 引入路由系统并重构页面结构

- 为项目引入基于 hash 的前端路由系统,支持多页面切换与动态加载
- 将原有单一 bundle 拆分为多个入口打包(index.js 和 timestamp.js)
- 修改 Rollup 配置以支持多输出文件及插件共享
- 更新 HTML 结构以适配路由容器和页面占位元素
- 调整 CSS 样式,移除旧的页面切换动画,交由路由控制
- 优化 domUtils 工具函数,并迁移部分样式处理逻辑
- 在 timestamp.js 中封装初始化函数以便路由调用
- todolist 页面模板新增,用于后续功能开发
```
2025-11-27 23:04:24 +08:00

200 lines
3.4 KiB
CSS

/* sidepanel/style.css */
#app {
display: flex;
flex-direction: column;
height: 100%;
}
.navbar {
display: flex;
background-color: #f8f9fa;
border-bottom: 1px solid #dee2e6;
padding: 0.5rem;
}
.nav-button {
flex: 1;
padding: 0.5rem 1rem;
background-color: transparent;
border: none;
cursor: pointer;
text-align: center;
transition: all 0.3s ease;
}
.nav-button:hover {
background-color: #e9ecef;
}
.nav-button.active {
background-color: #007bff;
color: white;
transform: translateY(-2px);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.close-button {
padding: 0.25rem 0.75rem;
background-color: #dc3545;
color: white;
border: none;
border-radius: 0.25rem;
cursor: pointer;
margin-left: auto;
transition: all 0.3s ease;
}
.close-button:hover {
background-color: #c82333;
transform: scale(1.05);
}
#current-timestamp {
p a {
box-sizing: border-box;
color: #2b2b2b;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New,
monospace;
}
button {
padding: 0.5rem 1rem;
background-color: #28a745;
color: white;
border: none;
border-radius: 0.25rem;
cursor: pointer;
height: 2rem;
align-self: flex-start;
transition: all 0.3s ease;
}
button:active {
transform: scale(0.95);
}
button:hover {
background-color: #218838;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
}
.datetime-box {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.5rem;
transition: all 0.3s ease;
}
.input-group {
display: flex;
gap: 1rem;
align-items: center;
transition: all 0.3s ease;
}
.input-text {
width: 200px;
padding: 0.5rem;
box-sizing: border-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: all 0.3s ease;
}
.input-text:focus {
border-color: #007bff;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
outline: none;
}
.select-box {
min-width: 150px;
padding: 0.5rem;
box-sizing: border-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: all 0.3s ease;
}
.select-box:focus {
border-color: #007bff;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
outline: none;
}
.convert-button {
padding: 0.5rem 1rem;
background-color: #28a745;
color: white;
border: none;
border-radius: 0.25rem;
cursor: pointer;
height: 2rem;
width: 4rem;
align-self: flex-start;
transition: all 0.3s ease;
}
.convert-button:hover {
background-color: #218838;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.content {
padding: 1rem;
position: relative;
flex: 1;
overflow: hidden;
}
/* 按钮点击效果 */
.button:active,
.convert-button:active,
.nav-button:active,
.close-button:active {
transform: scale(0.95);
}
/* 输入框动画 */
.input-text,
.select-box {
transition: all 0.2s ease-in-out;
}
.input-text:hover,
.select-box:hover {
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* 结果显示动画 */
#timestamp-conversion-result,
#date-conversion-result,
#current-timestamp-value {
transition: all 0.3s ease;
}
#timestamp-conversion-result:focus,
#date-conversion-result:focus,
#current-timestamp-value:focus {
transform: scale(1.02);
}
@media screen and (max-width: 900px) {
.input-group {
width: 100%;
}
.input-text {
width: 100%;
}
.page {
padding: 0.5rem;
}
}