3b9e362bc9
feat(sidepanel): 优化时间戳工具页面布局与响应式样式 新增 datetime-box 和 input-group 容器类,用于优化时间戳转换和日期时间转换功能的 界面结构。调整 input-text、select-box 和 convert-button 的宽度及响应式行为,使其在 移动端设备上能够自适应显示。同时更新 HTML 结构以匹配新的 CSS 类名和布局方式,提升 用户体验与界面可读性。 ```
118 lines
3.8 KiB
HTML
118 lines
3.8 KiB
HTML
<!-- sidepanel/index.html -->
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>测试工具</title>
|
|
<link rel="stylesheet" href="index.css" />
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<!-- 导航栏 -->
|
|
<nav class="navbar">
|
|
<button id="nav-timestamp" class="nav-button active">时间戳转换</button>
|
|
<button id="nav-other" class="nav-button">其他工具</button>
|
|
<button id="close" class="close-button">X</button>
|
|
</nav>
|
|
|
|
<!-- 页面内容容器 -->
|
|
<div class="content">
|
|
<!-- 时间戳工具页面 -->
|
|
<div id="page-timestamp" class="page active">
|
|
<h2>时间戳工具</h2>
|
|
<div>
|
|
<h2>当前时间戳</h2>
|
|
<p>
|
|
<a href="javascript:;" id="current-timestamp">1762873747965</a>
|
|
<span id="timestamp-unit">毫秒</span>
|
|
<button id="toggle-timestamp-btn">切换单位</button>
|
|
<button id="copy-timestamp-btn">复制</button>
|
|
<button id="stop-timestamp-btn">停止</button>
|
|
<button id="start-timestamp-btn" style="display: none">开始</button>
|
|
</p>
|
|
</div>
|
|
|
|
<!-- 时间戳转日期时间 -->
|
|
<div>
|
|
<h2>时间戳转日期时间</h2>
|
|
<div class="datetime-box">
|
|
<div class="input-group">
|
|
<input
|
|
type="text"
|
|
id="input-timestamp"
|
|
placeholder="请输入时间戳"
|
|
class="input-text"
|
|
/>
|
|
<select class="select-box">
|
|
<option value="milliseconds">毫秒(ms)</option>
|
|
<option value="seconds">秒(s)</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="input-group">
|
|
<button id="convert-timestamp-btn" class="convert-button">转换</button>
|
|
</div>
|
|
|
|
<div class="input-group">
|
|
<input
|
|
type="text"
|
|
id="timestamp-input-result"
|
|
placeholder="转换结果"
|
|
class="input-text"
|
|
/>
|
|
<select class="select-box">
|
|
<option>Asia/Shanghai</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 日期时间转时间戳 -->
|
|
<div>
|
|
<h2>日期时间转时间戳</h2>
|
|
<div class="datetime-box">
|
|
<div class="input-group">
|
|
<input
|
|
type="text"
|
|
id="input-datetime"
|
|
placeholder="输入日期时间"
|
|
class="input-text"
|
|
/>
|
|
<select class="select-box">
|
|
<option>Asia/Shanghai</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="input-group">
|
|
<button id="convert-datetime-btn" class="convert-button">转换</button>
|
|
</div>
|
|
|
|
<div class="input-group">
|
|
<input
|
|
type="text"
|
|
id="datetime-input-result"
|
|
placeholder="转换结果"
|
|
class="input-text"
|
|
/>
|
|
<select class="select-box">
|
|
<option value="milliseconds">毫秒(ms)</option>
|
|
<option value="seconds">秒(s)</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 其他工具页面 -->
|
|
<div id="page-other" class="page">
|
|
<h2>其他工具页面</h2>
|
|
<p>这里可以放置其他工具的内容。</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="index.js"></script>
|
|
</body>
|
|
</html>
|