-
Notifications
You must be signed in to change notification settings - Fork 0
/
love-memory.html
116 lines (106 loc) · 2.77 KB
/
love-memory.html
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
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>爱寇寇的Xin</title>
<style>
body {
margin: 20px;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.image-container {
display: flex;
justify-content: space-between;
align-items: center;
width: 80%;
max-width: 800px;
}
.image-container img {
width: 30%;
border-radius: 10px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.modal {
display: flex;
flex-direction: column;
align-items: center;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
background-color: #fff;
padding: 20px;
border: 1px solid #ccc;
width: 300px;
text-align: center;
}
.modal h2 {
margin-top: 0;
}
.modal input {
margin-bottom: 10px;
}
.modal button {
padding: 5px 10px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
}
audio {
position: fixed;
top:20px;
}
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var passwordModal = document.getElementById("password-modal");
var passwordInput = document.getElementById("password-input");
var passwordSubmit = document.getElementById("password-submit");
var mainPage = document.getElementById("main");
mainPage.style.display = "none";
passwordModal.style.display = "flex";
passwordSubmit.addEventListener("click", function() {
var password = passwordInput.value;
if (password === "kouyulei") {
passwordModal.style.display = "none";
mainPage.style.display = "flex";
} else {
alert("密码错误,请重新输入。");
}
});
passwordInput.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
passwordSubmit.click();
}
});
});
</script>
</head>
<body>
<div id="password-modal" class="modal">
<div class="modal-content">
<h2>请输入密码</h2>
<input type="password" id="password-input" placeholder="密码">
<button id="password-submit">提交</button>
</div>
</div>
<audio src="music/Beautiful(Instrumental)-Crush.320.mp3" controls autoplay loop></audio>
<div class="image-container" id="main">
<img src="image/pic1.jpg" alt="Image 1">
<img src="image/pic2.jpg" alt="Image 2">
<img src="image/pic3.jpg" alt="Image 3">
</div>
<script src="js/sakura.js"></script>
</body>
</html>