屏幕使用时间程序 HTML 界面:报告、设置、关于
<!DOCTYPE html>
<html>
<head>
<title>屏幕使用时间程序 - 报告、设置、关于</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
}
<pre><code>h1 {
text-align: center;
}
.menu {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.menu button {
margin-right: 10px;
}
.content {
text-align: center;
}
</code></pre>
</style>
</head>
<body>
<h1>屏幕使用时间程序</h1>
<div class="menu">
<button id="reportBtn">报告</button>
<button id="settingsBtn">设置</button>
<button id="aboutBtn">关于</button>
</div>
<div class="content">
<div id="report" style="display: none;">
<!-- 报告内容 -->
</div>
<pre><code><div id="settings" style="display: none;">
<!-- 设置内容 -->
</div>
<div id="about" style="display: none;">
<!-- 关于内容 -->
</div>
</code></pre>
</div>
<script>
const reportBtn = document.getElementById("reportBtn");
const settingsBtn = document.getElementById("settingsBtn");
const aboutBtn = document.getElementById("aboutBtn");
const report = document.getElementById("report");
const settings = document.getElementById("settings");
const about = document.getElementById("about");
reportBtn.addEventListener("click", function() {
report.style.display = "block";
settings.style.display = "none";
about.style.display = "none";
});
settingsBtn.addEventListener("click", function() {
report.style.display = "none";
settings.style.display = "block";
about.style.display = "none";
});
aboutBtn.addEventListener("click", function() {
report.style.display = "none";
settings.style.display = "none";
about.style.display = "block";
});
</script>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/qeGl 著作权归作者所有。请勿转载和采集!