-
Notifications
You must be signed in to change notification settings - Fork 0
/
pricing.html
149 lines (135 loc) · 4.89 KB
/
pricing.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hair Stylist Pricing</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<style>
.selected {
border: 2px solid green;
}
.disabled {
opacity: 0.5;
}
</style>
</head>
<body>
<!-- Primary Navigation Bar -->
<nav class="navbar navbar-expand-lg navbar-danger-bg-subtle bg-danger-bg-subtle">
<div class="container">
<a class="navbar-brand" href="#">Hair by Sloane</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link white" href="index.html">
<span class="inline-container">
<span class="material-symbols-outlined">apartment</span> Home
</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link white" href="about.html">
<span class="inline-container">
<span class="material-symbols-outlined">info</span> About
</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link white" href="booking.html">
<span class="inline-container">
<span class="material-symbols-outlined">calendar_month</span> Booking
</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link white" href="testimonials.html">
<span class="inline-container">
<span class="material-symbols-outlined">forum</span> Testimonials
</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<h1 class="mt-5 text-center">Hair Stylist Pricing</h1>
<form action="checkout.html" method="POST">
<div class="row mt-5">
<div class="col-md-4">
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title text-center">Haircut</h5>
</div>
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">Standard Cut</h6>
<p class="card-text">Price: $25</p>
<input type="checkbox" name="selected_services[]" value="Haircut" class="form-check-input">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title text-center">Hair Coloring</h5>
</div>
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">Basic Color</h6>
<p class="card-text">Price: $40</p>
<input type="checkbox" name="selected_services[]" value="Hair Coloring" class="form-check-input">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title text-center">Highlights</h5>
</div>
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">Partial Highlights</h6>
<p class="card-text">Price: $60</p>
<input type="checkbox" name="selected_services[]" value="Highlights" class="form-check-input">
</div>
</div>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary">Checkout</button>
</div>
</form>
</div>
<script>
const checkboxes = document.querySelectorAll('input[type="checkbox"]');
const maxServices = 2;
checkboxes.forEach((checkbox) => {
checkbox.addEventListener('change', () => {
const selectedCheckboxes = document.querySelectorAll('input[type="checkbox"]:checked');
const isChecked = checkbox.checked;
if (selectedCheckboxes.length > maxServices) {
checkbox.checked = false;
return;
}
checkboxes.forEach((cb) => {
if (selectedCheckboxes.length >= maxServices && !cb.checked) {
cb.disabled = true;
cb.parentNode.parentNode.classList.add('disabled');
} else {
cb.disabled = false;
cb.parentNode.parentNode.classList.remove('disabled');
}
});
if (isChecked) {
checkbox.parentNode.parentNode.classList.add('selected');
} else {
checkbox.parentNode.parentNode.classList.remove('selected');
}
});
});
</script>
</body>
</html>