-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
69 lines (54 loc) · 2.68 KB
/
Copy pathscript.js
File metadata and controls
69 lines (54 loc) · 2.68 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
const menuToggle = document.querySelector(".menu-toggle");
const siteNav = document.querySelector(".site-nav");
if (menuToggle && siteNav) {
menuToggle.addEventListener("click", () => {
siteNav.classList.toggle("is-open");
});
}
const currentPage = window.location.pathname.split("/").pop() || "index.html";
document.querySelectorAll(".site-nav a").forEach((link) => {
if (link.getAttribute("href") === currentPage) {
link.classList.add("is-active");
}
});
const existingClientBookingLink =
"https://www.vagaro.com/Users/BusinessWidget.aspx?enc=MMLjhIwJMcwFQhXLL7ifVNegKF6XEhkW8fsL0qaCKPKiwTc6lrPA+9bc+rNHn1y1m7JPw3aCiXY9ZpndUIRYZHY5aLzQ3tD/Emowzrjfqc/64IKxnyEPxwwDA59jK2K0dtbOfoYSEELZuDsODh82I302t5XqsR3R1uaf6o7hxCvwoDRqfp7Uxqv/0/wx/88R76XmrgYE58EUZ42ECO38Eo8XGACY+NSEBc6ROUnx0jPqy8jgkWABHUwgiMT7DHu/g/o5/hqPx64WNfefhI97wZoqgUi/LsrQ9ElF+kz6Dl+KC0lxrcbKMyyigoWacOkOodBCJg5mumnvmp9aZ+DDGNScr1BUpTPRJZVt4LSn9OM0aMc6xXWIcW1wvWm62AORmH4j4MES7nKO96NZDRgfF5gm3UAjbDLdAcFn13Y1ZVjeu9nZGdnjqc8TPa/d2sYzGhMpgFcgb3ubFEx/jYIsVv/VYrFJItkUK2DKhqwl3kg=";
const clientPortalLinks = {
"NGU-A": existingClientBookingLink,
"NGU-A21": existingClientBookingLink,
"MIL-C": existingClientBookingLink,
TEST21: "salon.html#booking",
NEW21: "https://docs.google.com/forms/d/e/1FAIpQLSfx-d8XV8dK5MV7Ipuv1ZPb2tjcGKTUJ5n0QCYOgZIVgET7gw/viewform?usp=header",
VIP21: "https://www.vagaro.com/cl/g0DZI7~ydq9D9PoeHO2L0xx1zh7~fzj81vUZ17IACbQ=",
CIRCA21: "https://www.vagaro.com/cl/s~FTxq0JJAFO7Rj0~9eRbEY0G4pDn8j1E4PwJv6lxPE=",
};
document.querySelectorAll("#clientPortalForm, [data-client-portal-form]").forEach((form) => {
form.addEventListener("submit", (event) => {
event.preventDefault();
const input = form.querySelector("input[name='clientCode'], #clientCode");
const message = form.querySelector("[data-portal-message], #portalMessage");
if (!input) return;
const code = input.value.trim().toUpperCase();
const destination = clientPortalLinks[code];
if (destination) {
if (message) {
message.textContent = "Opening your Studio 21 link...";
}
window.location.href = destination;
return;
}
if (message) {
message.textContent = "That access code was not found.";
}
});
});
document.querySelectorAll("[data-mailto-form]").forEach((form) => {
form.addEventListener("submit", (event) => {
event.preventDefault();
const email = form.dataset.email;
const subject = form.dataset.subject || "Studio 21 Message";
const message = form.querySelector("textarea")?.value.trim() || "";
const body = encodeURIComponent(message);
window.location.href = `mailto:${email}?subject=${encodeURIComponent(subject)}&body=${body}`;
});
});