Files
workspace/code/allapp/allapp-rn/test.html
T
2026-01-25 22:18:27 +08:00

148 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bottom Nav Demo</title>
<link rel="stylesheet" href="style.css" />
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont;
}
body {
background: #f6f7f9;
height: 100vh;
}
.content {
padding: 16px;
padding-bottom: 80px;
color: #555;
}
/* 底部栏 */
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 56px;
background: #fff;
border-top: 1px solid #e5e5e5;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 12px;
}
/* 左右按钮 */
.nav-btn {
width: 40px;
height: 40px;
border: none;
background: none;
font-size: 18px;
color: #333;
}
/* 中间区域 */
.nav-center {
flex: 1;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #222;
display: flex;
justify-content: center;
align-items: center;
gap: 4px;
}
.nav-center .arrow {
font-size: 12px;
color: #999;
}
/* 扩展菜单 */
.extension {
position: fixed;
bottom: 56px;
left: 12px;
right: 12px;
background: #fff;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0,0,0,0.08);
transform: translateY(20px);
opacity: 0;
pointer-events: none;
transition: all 0.2s ease;
}
.extension.show {
transform: translateY(0);
opacity: 1;
pointer-events: auto;
}
.extension-item {
padding: 14px 16px;
font-size: 14px;
color: #333;
border-bottom: 1px solid #eee;
}
.extension-item:last-child {
border-bottom: none;
}
.extension-item.danger {
color: #d93026;
}
</style>
</head>
<body>
<main class="content">
<p>当前工具内容区域</p>
</main>
<!-- 扩展菜单 -->
<div class="extension" id="extension">
<div class="extension-item">视图切换</div>
<div class="extension-item">工具设置</div>
<div class="extension-item">导出数据</div>
<div class="extension-item danger">清空记录</div>
</div>
<!-- 底部导航 -->
<nav class="bottom-bar">
<button class="nav-btn">←</button>
<div class="nav-center">
<span class="title">记账 · 本月</span>
<span class="arrow">▾</span>
</div>
<button class="nav-btn" onclick="toggleExt()">⋯</button>
</nav>
<script>
function toggleExt() {
document.getElementById('extension')
.classList.toggle('show')
}
</script>
</body>
</html>