-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
108 lines (95 loc) · 3.46 KB
/
index.html
File metadata and controls
108 lines (95 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>景德镇市第九中学南梁保护中心</title>
<style>
/* 在这里可以添加样式 */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #fff; /* 默认白天模式背景色 */
color: #333; /* 默认白天模式文本颜色 */
}
footer {
background-color: #ffc0cb; /* 淡粉红色 */
color: #fff;
padding: 10px;
text-align: center;
position: fixed;
bottom: 0;
width: 100%;
}
section h2 {
color: #0099ff; /* 淡蓝色 */
font-weight: bold; /* 粗体 */
}
/* 链接样式 */
a {
text-decoration: none; /* 去除下划线 */
color: #ff69b4; /* 粉红色 */
}
/* 添加更多样式以适应您的需求 */
/* 夜间模式 */
body.dark-mode {
background-color: #000; /* 夜间模式背景色 */
color: #fff; /* 夜间模式文本颜色 */
}
body.dark-mode footer {
background-color: #444; /* 夜间模式底部背景色 */
}
/* 悬浮按钮样式 */
.toggle-button {
position: fixed;
bottom: 50px; /* 调整按钮距离底部的距离 */
right: 20px;
z-index: 999;
background-color: #333;
color: #fff;
padding: 5px; /* 调整按钮大小 */
cursor: pointer;
}
</style>
</head>
<body>
<!-- 您提供的文字内容 -->
<section>
<h2>南梁保护中心</h2>
<p>景德镇市第九中学南梁保护中心是一个致力于保护、研究和宣传南梁文化的机构。南梁是当地一种独特的植物品种,在景德镇市第九中学校园内生长着丰富的南梁资源。</p>
<p>请访问我们的<a href="https://www.yuanshen.com/#/">网站</a>了解更多信息。</p>
</section>
<footer>
网站运行时间:<span id="uptime">0天 0小时 0分钟 0秒</span>
</footer>
<!-- 切换按钮 -->
<div class="toggle-button" onclick="toggleDarkMode()">切换夜间模式</div>
<script>
// JavaScript 计时器
let startTime = new Date("2024-03-28T21:00:00").getTime();
function updateUptime() {
let currentTime = new Date().getTime();
let timeDifference = currentTime - startTime;
let days = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
timeDifference -= days * (1000 * 60 * 60 * 24);
let hours = Math.floor(timeDifference / (1000 * 60 * 60));
timeDifference -= hours * (1000 * 60 * 60);
let minutes = Math.floor(timeDifference / (1000 * 60));
timeDifference -= minutes * (1000 * 60);
let seconds = Math.floor(timeDifference / 1000);
document.getElementById("uptime").textContent = days + "天 " + hours + "小时 " + minutes + "分钟 " + seconds + "秒";
}
setInterval(updateUptime, 1000);
// 切换夜间模式和白天模式
function toggleDarkMode() {
document.body.classList.toggle("dark-mode");
}
// 自动切换夜间模式
var currentHour = new Date().getHours();
if (currentHour >= 19 || currentHour < 7) {
document.body.classList.add("dark-mode");
}
</script>
</body>
</html>