请帮我写一个屏幕使用时间程序的html界面包括css与js该界面主要有几个选项:报告设置关于
以下是一个简单的屏幕使用时间程序的HTML界面,包括CSS和JS代码:
<!DOCTYPE html>
<html>
<head>
<title>屏幕使用时间程序</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
}
.menu {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.menu button {
margin-right: 10px;
}
.content {
text-align: center;
}
</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>
<div id="settings" style="display: none;">
<!-- 设置内容 -->
</div>
<div id="about" style="display: none;">
<!-- 关于内容 -->
</div>
</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/ixnt 著作权归作者所有。请勿转载和采集!