-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdummy.html
106 lines (103 loc) · 4.73 KB
/
dummy.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Big Screen - Home</title>
<link rel="stylesheet" href="dist/bootstrap-4.6.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="dist/bootstrap-icons-1.7.2/bootstrap-icons.css" />
<link rel="stylesheet" href="dist/fontawesome-5.15.4/css/all.min.css" />
<script src="dist/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<script src="dist/popper-2.11.0/popper.min.js"></script>
<script src="dist/bootstrap-4.6.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/dummy.css" />
</head>
<body>
<div class="container">
<button id="reload-seat">Reload</button>
<div class="w-100">
<div style="display: none;" id="masking" class="position-fixed"></div>
<div style="display: none;" id="popup" class="seat-container p-3 border position-fixed">
<div class="close-popup">
<div class="d-flex justify-content-end align-items-center">
<i id="close-times" class="far fa-times-circle"></i>
</div>
</div>
<div class="cinema-hall-screen mb-5">
<div id="screen" class="w-100">
<h4 id="screen-word" class="text-white text-center text-uppercase">Screen</h4>
</div>
</div>
<div id="seat" class="select-seat-container">
</div>
</div>
<div style="display: none;" id="confirm-seat" class="position-fixed">
<div class="bg-light">
<button id="confirm-button" class="btn btn-block text-center text-uppercase">Confirm</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
function checkedSeat() {
var checkedValue = false;
$("label.seat-available.seat-clicked").each(function () {
checkedValue = true;
});
if (checkedValue) {
$("#confirm-button").addClass("confirm-button-available");
}
else {
$("#confirm-button").removeClass("confirm-button-available");
}
}
function reload_seat() {
$("#seat").html("");
$("#confirm-button").removeClass("confirm-button-available");
var seat_name_prefix = ["A", "B", "C", "D", "E"];
var seat_odd_available = [1,1,0,1,0,1,0,1,0,1,0,0];
var seat_even_available = [0,0,1,0,1,0,1,0,1,0,1,1];
var seatSOP_html = "<div class=\"seat-circle seat-sop\" title=\"Unavailable due to SOP.\"></div>";
for (var r = 0; r < 5; r++) {
var odd_or_even = r%2;
var seat_to_arrange = [];
if (odd_or_even == 1) {
seat_to_arrange = seat_even_available;
}
else {
seat_to_arrange = seat_odd_available;
}
for (var i = 0; i < 12; i++) {
var seat_number = seat_name_prefix[r] + (i+1).toString();
var seat_html = "<label for=\"" + seat_number + "\" class=\"seat-circle seat-available\"></label>";
seat_html += "<input type=\"checkbox\" id=\"" + seat_number + "\" class=\"d-none\" name=\"seat[]\" value=\"" + seat_number + "\" />";
if (seat_to_arrange[i] == 1) {
$("#seat").append(seat_html);
}
else {
$("#seat").append(seatSOP_html);
}
if (i == 1 || i == 9) {
var empty_stair_html = "<div class=\"seat-circle\"></div>";
$("#seat").append(empty_stair_html);
}
}
}
$("label.seat-available").click(function () {
$(this).toggleClass("seat-clicked");
checkedSeat();
});
}
$("#reload-seat").click(function () {
reload_seat();
$("#masking,#popup,#confirm-seat").fadeIn();
});
$("#masking,#close-times").click(function () {
$("#masking,#popup,#confirm-seat").fadeOut();
});
});
</script>
</body>
</html>