-
Notifications
You must be signed in to change notification settings - Fork 0
/
love.html
191 lines (170 loc) · 3.09 KB
/
love.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<html>
<head>
<meta charset="UTF-8"/>
<title>.....</title>
<link rel="shorcut icon" href="heart.jpeg"/>
</head>
<body>
<div id="main-outer">
<div id="main">
<div id="text">
EM CÓ YÊU ANH KHÔNG?
</div>
<div id="button-row">
<button id="yes">Có</button>
<button id="no">Không</button>
</div>
</div>
</div>
<div id="popup-outer">
<div hidden id="popup">
<button id="exit">X</button>
<div id="popup-text">
Anh biết mà
</div>
</div>
</div>
<style>
#exit {
position: absolute;
top: 0px;
right: 0px;
height: 20px;
background-color: red;
}
#popup-text {
position: absolute;
width: 100%;
font-family: Arial;
font-size: 27pt;
text-align: center;
top: 80px;
color: green;
}
#popup {
position: relative;
background: #EEEEEE;
margin: 0 auto;
width: 300px;
height: 220px;
border-style: solid;
border-width: 1px;
border-radius: 3px;
box-shadow: 5px 5px 5px grey;
}
#popup-outer {
position: absolute;
top: 70px;
width: 100%;
}
#yes {
position: absolute;
height: 30px;
width: 100px;
left: 160px;
box-shadow: 3px 3px 3px grey;
}
#no {
position: absolute;
height: 30px;
width: 100px;
right: 160px;
box-shadow: 3px 3px 3px grey;
}
#button-row {
position: absolute;
height: 30px;
width: 100%;
bottom: 70px;
}
#text {
top: 80px;
position: absolute;
width: 100%;
font-size: 28pt;
font-family: Arial;
text-align: center;
}
#main {
position: relative;
width: 600px;
height: 300px;
background: linear-gradient(to bottom, white, #DDDDDD);
margin: 0 auto;
border-style: solid;
border-width: 2px;
border-radius: 10px;
box-shadow: 5px 5px 5px grey;
}
#main-outer {
position: absolute;
top: 40px;
width: 100%;
}
</style>
<script>
nobutton_moved = false;
buttons_swaped = true;
no_count = 0;
var yes = document.getElementById("yes");
var no = document.getElementById("no");
var popup = document.getElementById("popup");
var exit = document.getElementById("exit");
var left = yes, right = no;
exit.onclick = function() {
popup.style.display = 'none';
}
function yes_onclick() {
no_count = 0;
popup.style.display = 'block';
}
function yes_onmouseover() {
}
var move_count = 0;
var interval = null;
function move_buttons() {
if (move_count == 4) {
left.style.display = 'none';
right.style.display = 'none';
}
move_count++;
left.style.left -= 3;
right.style.right -= 3;
if (move_count == 40) {
clearInterval(interval);
}
}
function no_onmouseover() {
no_count++;
if (no_count >= 6) {
no.style.top = '0px';
interval = setInterval(move_buttons, 40);
return;
}
if (!nobutton_moved) {
swap_button = Math.random() >= 0.5;
if (!swap_button) {
no.style.top = "-60px";
nobutton_moved = true;
return;
}
yes.innerHTML = "Không";
no.innerHTML = "Có";
var tmp = yes;
yes = no;
no = tmp;
yes.onmouseover = yes_onmouseover;
yes.onclick = yes_onclick;
no.onmouseover = no_onmouseover;
}
else {
no.style.top = "0px";
nobutton_moved = false;
}
}
yes.onmouseover = yes_onmouseover;
yes.onclick = yes_onclick;
no.onmouseover = no_onmouseover;
</script>
</body>
</html>