-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
402 lines (354 loc) · 16.3 KB
/
Copy pathindex.html
File metadata and controls
402 lines (354 loc) · 16.3 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<!--
Code by GrouSrlpPrsc | Mã nguồn được viết bởi GrouSrlpPrsc
Facebook: https://www.facebook.com/GrouSrlpPrsc
Github: https://github.com/phanminhtai
My website: https://sharescript.net
Share code vui lòng không xoá chú thích này! Cảm ơn!
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Li Xì By Anh Đăng Đẹp Trai!</title>
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Francois+One&display=swap'>
<link rel='stylesheet' href='css/sweetalert.css'>
<link rel='stylesheet' href='css/custom.css'>
<script type="text/javascript" src="js/Winwheel.min.js"></script>
<script type="text/javascript" src="js/TweenMax.min.js"></script>
<script src='js/sweetalert-dev.js'></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
</head>
<div class="pyro">
<div class="before" style="z-index: 9999"></div>
<div class="after"></div>
</div>
<body onload="nhappass()">
<div class="topheader" style="margin: auto;margin-top:200px">
<!-- <img class="responsive" style="z-index:99;top:50px;" /> -->
</div>
<div id="caidat">
<img id="popup" src="img/popup.jpg" />
<div class="sotiendalixi" id="sotiendalixi"></div>
<div class="lichsulixi" id="lichsulixi"></div>
<div class="buttontatpopup" onClick="tatpopup()"></div>
<div class="buttonlammoi" id="lammoi" onClick="lammoi()"></div>
<div class="nenpopup"></div>
</div>
<div id="popupnhantien">
<img id="popuptien" src="img/popupnhantien.png" />
<div class="sotienpopupnhantien" id="sotienpopupnhantien"><img id="xuatsotienpopup"></img></div>
<div class="lammoipopupnhantien" id="lammoi" onClick="lammoi()"></div>
<div class="nenpopup"></div>
</div>
<div class="vongquay">
<canvas id="canvas" width="450" height="450" data-responsiveMinWidth="180" data-responsiveScaleHeight="true"
data-responsiveMargin="50">
</canvas>
<div id="batdauquay" class="nutbatdau"></div>
<div onClick="startSpin();" class="nutquay"></div>
</div>
<img class="responsive2" style="position:fixed;z-index:99;top:0px;right:0px" src="img/hea1.png" />
<div
style="position:fixed;z-index:99;bottom:-50px;left:0;width:100%;height:500px;background:url(img/bot1.png) repeat-x bottom left;">
</div>
<img class="responsive3" style="position:fixed;z-index:99;bottom:20px;left:20px" src="img/bot2.png" />
<div class="nutcaidat" style="position:fixed;bottom:0px;left:20px" onClick="mopopup()"></div>
<input type="range" id="manhornhe" style="position:fixed;bottom:2px;right:20px;z-index: 999" onchange="laypower()"
min="5" step="0.01" max="20" value="13">
<!-- <img style="position:fixed;z-index:99;top:2px;left:1px" src="img/banglixi.png"/> -->
<div id="annhantien" style="display: none;">
<div class="buttonnhantien" style="position:fixed;z-index:99;top:153px;left:1px;cursor: pointer;"
onclick="nhantien()"></div>
<!-- <img style="position:fixed;z-index:99;top:183px;left:24px;" src="img/muiten.gif" /> -->
</div>
<div style="position:fixed;z-index:999;top:37px;left:40px;text-shadow: 2px 2px 5px #f7ff29;color: #f2f4be;"
id="xuatluotquay"></div>
<img style="position:fixed;z-index:999;top:105px;left:9px" id="xuatsotien"></img>
<audio id="votay">
<source src="sound/votay.mp3" type="audio/mpeg">
</audio>
<audio id="matluot">
<source src="sound/matluot.mp3" type="audio/mpeg">
</audio>
<audio id="dangquay">
<source src="sound/XSO.mp3" type="audio/mpeg">
</audio>
</body>
<script>
var matkhau = "HaYeuDang";
var solanquay = 3;
// Sau khi load trang sẽ yêu cầu nhập mật khẩu
function nhappass() {
swal({
title: "Vòng quay bị khoá!",
text: "Nhập mật khẩu để mở khoá vòng quay:",
type: "input",
showCancelButton: false, // Có hiển thị nút cancel không(true = có)
closeOnConfirm: false, // Có thể tắt popup khi nhấp Ok không (true = có)
showLoaderOnConfirm: true, // Hiển thị loading khi nhấp vào nút Ok
animation: "slide-from-top", // Như tên của nó, popup sẽ slide from top
inputPlaceholder: "Nhập mật khẩu..."
},
function (inputValue) {
if (inputValue === false) return false;
if (inputValue !== matkhau) {
setTimeout(function () {
swal.showInputError("Mật khẩu sai, vui lòng nhập lại!");
}, 1000);
return false
}
setTimeout(function () {
swal("Mở khoá thành công!", "Hãy đưa chiếc điện thoại cho người muốn nhận lì xì nào!", "success");
}, 1000);
});
}
function mopopup() {
document.getElementById("caidat").style.display = "block";
}
function tatpopup() {
document.getElementById("caidat").style.display = "none";
}
$(".buttontatpopup").hover(
function () {
$("#popup").attr("src", 'img/popup2.jpg');
}, function () {
$("#popup").attr("src", 'img/popup.jpg');
}
);
$(".buttonlammoi").hover(
function () {
$("#popup").attr("src", 'img/popup1.png');
}, function () {
$("#popup").attr("src", 'img/popup.jpg');
}
);
$(".buttonnhantien").hover(
function () {
$(".buttonnhantien").attr("src", 'img/nhantienhover.png');
}, function () {
$(".buttonnhantien").attr("src", 'img/nhantien.png');
}
);
$(".lammoipopupnhantien").hover(
function () {
$("#popuptien").attr("src", 'img/popupnhantienhover.png');
}, function () {
$("#popuptien").attr("src", 'img/popupnhantien.png');
}
);
let theWheel = new Winwheel({
'outerRadius': 220, // Bán kính ngoài
'innerRadius': 0, // Size lỗ trung tâm
'textFontSize': 24, // Size chữ
'textOrientation': 'horizontal', // Chữ nằm ngang
'textAlignment': 'outer', // Căn chỉnh văn bản ra bên ngoài bánh xe.
'numSegments': 8, // Số ô
'responsive': true,
'segments': [{
'fillStyle': '#E9967A',
'text': '1.000.000 VNĐ',
'size': winwheelPercentToDegrees(24),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#910f06',
'text': '5.000.000 VNĐ',
'size': winwheelPercentToDegrees(3),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#ab6f03',
'text': '2.000.000 VNĐ',
'size': winwheelPercentToDegrees(20),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#8FBC8F',
'text': '3.000.000 VNĐ',
'size': winwheelPercentToDegrees(15),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#FF7F50',
'text': '4.000.000 VNĐ',
'size': winwheelPercentToDegrees(3),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#F4A460',
'text': 'Gấp đôi năm ngoái',
'size': winwheelPercentToDegrees(17),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#4682B4',
'text': '2.000.000 VNĐ',
'size': winwheelPercentToDegrees(12),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}, {
'fillStyle': '#D2B48C',
'text': 'Gấp ba năm ngoái',
'size': winwheelPercentToDegrees(12),
'textFontSize': 15,
'textFillStyle': '#ffffff'
}],
'animation': // Chỉ định hình động để sử dụng.
{
'type': 'spinToStop',
'duration': 35, // Thời lượng tính bằng giây.
'spins': 35, // Số vòng quay hoàn chỉnh mặc định.
'callbackFinished': alertPrize,
'callbackSound': playSound, // Chức năng gọi khi âm thanh đánh dấu được kích hoạt.
'soundTrigger': 'pin', // Chỉ định các chân là để kích hoạt âm thanh, tùy chọn khác là 'phân đoạn'.
'type': 'spinToStop',
'duration': 6.4,
},
'pins': {
'number': 8, // Số lượng chân. Họ không gian đều xung quanh bánh xe.
'responsive': true,
'fillStyle': 'silver',
'outerRadius': 4,
}
});
// Vars được sử dụng bởi mã trong trang này để thực hiện các điều khiển nguồn.
let wheelPower = 13;
let wheelSpinning = false;
// ---------------------------------------------------------------------
// Tải âm thanh đánh dấu và chức năng phát được gọi khi pin đi qua con trỏ.
let audio = new Audio('http://dougtesting.net//elements/sound/tick.mp3'); // Tạo đối tượng âm thanh và tải tập tin tick.mp3.
var dem = 0;
var demnhantien = 0; // Đếm số lần click vào nút nhận tiền
var lichsulixi = "";
var tongtienlixi = 0;
var tiendalixi;
document.getElementById("xuatluotquay").innerHTML = solanquay;
var votay = document.getElementById("votay");
var matluot = document.getElementById("matluot");
var dangquay = document.getElementById("dangquay");
function playSound() {
// Dừng và tua lại âm thanh nếu nó đã phát.
audio.pause();
audio.currentTime = 0;
// Phát âm thanh.
audio.play();
}
// -------------------------------------------------------
// Xử lý thanh range
// -------------------------------------------------------
function laypower() {
wheelPower = document.getElementById("manhornhe").value; // Lấy dữ liệu thanh range
}
// -------------------------------------------------------
// Sau khi nhấp vào nút quay
// -------------------------------------------------------
function startSpin() {
// Nút quay không nhấp được khi đang chạy
if (wheelSpinning == false) {
// Dựa trên mức công suất được chọn, hãy điều chỉnh số vòng quay cho bánh xe, càng nhiều lần
// để xoay với thời lượng của hình ảnh động thì bánh xe quay càng nhanh.
theWheel.animation.spins = wheelPower;
// Tắt nút xoay để không thể nhấp lại trong khi bánh xe đang quay.
$(".nutbatdau").css("background-image", "url(img/controhover.png)");
// Bắt đầu quay bằng cách gọi startAnimation.
theWheel.startAnimation();
// Đặt thành true để không thể thay đổi nguồn và bật nút quay lại trong khi
// hình ảnh động hiện tại. Người dùng sẽ phải thiết lập lại trước khi quay lại.
wheelSpinning = true;
}
if (dem < solanquay) {
dangquay.play();
}
}
// -------------------------------------------------------
// Sau khi nhấp vào nút làm mới
// -------------------------------------------------------
function lammoi() {
swal({
title: "Làm mới vòng quay!",
text: "Làm mới vòng quay sẽ xoá hết các vòng quay còn lại. \nLịch sử và tổng tiền lì xì vẫn giữ nguyên. \nChú ý nếu tải lại trang sẽ làm mất lịch sử và tổng tiền lì xì\nNhập mật khẩu để tiếp tục:",
type: "input",
showCancelButton: true, // Có hiển thị nút cancel không(true = có)
closeOnConfirm: false, // Có thể tắt popup khi nhấp Ok không (true = có)
showLoaderOnConfirm: true, // Hiển thị loading khi nhấp vào nút Ok
animation: "slide-from-top", // Như tên của nó, popup sẽ slide from top
inputPlaceholder: "Nhập mật khẩu..."
},
function (inputValue) {
if (inputValue === false) return false;
if (inputValue !== matkhau) {
setTimeout(function () {
swal.showInputError("Mật khẩu sai, vui lòng nhập lại!");
}, 2000);
return false
}
setTimeout(function () {
swal("Làm mới thành công!", "Hãy đưa chiếc điện thoại cho người muốn nhận lì xì nào!", "success");
document.getElementById("popupnhantien").style.display = "none"; // Tắt popup nhận tiền
theWheel.stopAnimation(false); // Dừng hình động
theWheel.rotationAngle = 0; // Đặt lại góc bánh xe về 0 độ.
theWheel.draw(); // Gọi draw để hiển thị các thay đổi cho bánh xe.
$(".nutbatdau").css("background-image", "url(img/contro.png)"); // Hiển thị lại nút Quay
document.getElementById("xuatluotquay").innerHTML = solanquay;
wheelSpinning = false; // Đặt lại thành false thành các nút nguồn và quay có thể được bấm lại.
document.getElementById("annhantien").style.display = "none"; // Ẩn nút nhận tiền
document.getElementById("xuatsotien").src = ""; // Xoá ảnh tiền
dem = 0;
}, 2000);
});
}
// -------------------------------------------------------
// Sau khi vòng quay quay xong
// -------------------------------------------------------
function alertPrize(indicatedSegment) {
dem++;
tiendalixi = indicatedSegment.text.replace(".000 VNĐ", "");
if (dem < solanquay) { // Check xem đã hết lượt quay chưa
theWheel.rotationAngle = 0; // Đặt lại góc bánh xe về 0 độ.
theWheel.draw(); // Gọi draw để hiển thị các thay đổi cho bánh xe.
wheelSpinning = false; // Đặt lại thành false thành các nút nguồn và quay có thể được bấm lại.
$(".nutbatdau").css("background-image", "url(img/contro.png)"); // Hiển thị lại nút Quay
document.getElementById("xuatluotquay").innerHTML = solanquay - dem; // Xuất kết quả
if (indicatedSegment.text == 'Ô mất lượt') { // Nếu quay vào 0k
matluot.play(); // Bật nhạc fail
document.getElementById("annhantien").style.display = "none"; // Ẩn nút nhận tiền
document.getElementById("xuatsotien").src = ""; // Xoá ảnh tiền
swal("Rất tiếc!", "Bạn không nhận được đồng nào\nNhưng bạn còn lại " + (solanquay - dem) + " lần quay, cố gắng lên nào!", "error");
} else { // Nếu không quay vào 0k
votay.play(); // Bật nhạc vỗ tay
document.getElementById("annhantien").style.display = ""; // Hiển thị nút nhận tiền
document.getElementById("xuatsotien").src = "img/" + indicatedSegment.text.replace(".000 VNĐ", "") + "k.jpg"; // Xuất ảnh tiền
swal("Tết ấm no!", "Bạn nhận được " + indicatedSegment.text + "\nBạn còn lại " + (solanquay - dem) + " lần quay\nChú ý: Nếu quay tiếp bạn sẽ mất số tiền trước đó!", "success");
}
} else { // Nếu hết lượt quay(dem = solanquay)
document.getElementById("xuatluotquay").innerHTML = "0";
$(".nutbatdau").css("background-image", "url(img/controhetluot.png)");
if (indicatedSegment.text == 'Ô mất lượt') {
matluot.play(); // Bật nhạc fail
document.getElementById("annhantien").style.display = "none"; // Ẩn nút nhận tiền
document.getElementById("xuatsotien").src = ""; // Xoá ảnh tiền
swal("Rất tiếc!", "Bạn không nhận được đồng nào và số lượt quay đã hết!", "error");
} else {
votay.play(); // Bật nhạc vỗ tay
document.getElementById("annhantien").style.display = ""; // Hiển thị nút nhận tiền
document.getElementById("xuatsotien").src = "img/" + indicatedSegment.text.replace(".000 VNĐ", "") + "k.jpg"; // Xuất ảnh tiền
swal("Tết ấm no!", "Bạn nhận được " + indicatedSegment.text + "\nBạn đã hết lượt quay", "success");
}
}
}
// -------------------------------------------------------
// Sau khi nhấp vào nút nhận tiền
// -------------------------------------------------------
function nhantien() {
document.getElementById("annhantien").style.display = "none"; // Ẩn nút nhận tiền
document.getElementById("popupnhantien").style.display = "block"; // Mở popup
document.getElementById("xuatsotienpopup").src = "img/" + tiendalixi + "kk.jpg";
demnhantien++;
tongtienlixi += Number(tiendalixi);
document.getElementById("sotiendalixi").innerHTML = tongtienlixi + ".000 VNĐ";
lichsulixi += "Người " + demnhantien + " : " + tiendalixi + ".000 VNĐ<br/>";
document.getElementById("lichsulixi").innerHTML = lichsulixi;
}
</script>
</html>