PageSourceSearch

https://elpinto.com/js/main.js

js elpinto.com collected 2026-10-03 21:20:11 UTC 12,461 bytes, 411 lines download raw bytes

1/* --------------------------------------------
2  DOCUMENT.READY
3--------------------------------------------- */
4$(window).on("load", function () {
5	$(".hidden").fadeIn(1000).removeClass("hidden");
6});
7$(".carousel").swipe({
8	swipe: function (event, direction, distance, duration, fingerCount, fingerData) {
9		if (direction == "left") $(this).carousel("next");
10		if (direction == "right") $(this).carousel("prev");
11	},
12	allowPageScroll: "vertical",
13});
14// Init Tooltips
15const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
16const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
17//Contact Sidebar
18$(document).ready(function() {
19	$('.sidebar-toggle').click(function() {
20	  $('.sidebar').toggleClass('sidebar-expanded');
21	});
22});
23const site = {
24	init: function () {
25		this.header();
26		this.nav();
27	},
28	header: function () {
29		$(".header-sticky").on({
30			"topaz:menu:scrolled": function () {
31				let $this = $(this);
32				let $child = $this.children(".navbar");
33				let $collapse = $this.find(".navbar-collapse").offset().top - $(window).scrollTop();
34				$this.addClass("sticky");
35				$this.css("min-height", $child.css("height"));
36				// for the navbar
37				this.style.setProperty("--distance-from-top", $collapse + "px");
38			},
39			"topaz:menu:top": function () {
40				let $this = $(this);
41				let $child = $this.children(".navbar");
42				let $collapse = $this.find(".navbar-collapse").offset().top - $(window).scrollTop();
43				$this.removeClass("sticky");
44				$this.css("min-height", $child.css("height"));
45				// for the navbar
46				this.style.setProperty("--distance-from-top", $collapse + "px");
47			},
48		});
49		$(window).on({
50			scroll: function () {
51				let $this = $(this);
52				if ($(".header-sticky").length > 0) {
53					if ($(".header-sticky").offset().top < $this.scrollTop()) {
54						$(".header-sticky").trigger("topaz:menu:scrolled");
55					} else {
56						$(".header-sticky").trigger("topaz:menu:top");
57					}
58				}
59			},
60		});
61		$(".header-sticky").trigger("topaz:menu:top");
62	},
63	nav: function () {
64		$('[data-toggle="offcanvas"]').on("click", function (e) {
65			e.preventDefault();
66			const $this = $(this);
67			const target = $this.data("target");
68			$(target).toggleClass("show");
69			$this.toggleClass("collapsed");
70			if (!$this.is(".collapsed")) {
71				$this.attr("aria-expanded", true);
72			} else {
73				$this.attr("aria-expanded", false);
74			}
75		});
76		$("[href='" + location.pathname + "']")
77			.parents(".nav-item")
78			.addClass("active");
79	},
80};
81(function ($) {
82	"use strict";
83	//map global variable;
84	$(document).ready(function (e) {
85		site.init();
86	});
87})(jQuery);
88$(window).on('load', function () {
89// Internal Page Header Offset
90	let header = $("#header").outerHeight() + $("#topBar").outerHeight();
91	$(".page-header").css("margin-top", "179px");
92	var modal = $(".modal");
93	var body = $("body");
94	var navbar = $(".navbar");
95	modal.on("shown.bs.modal", function () {
96		modal.addClass("modal").css({ "padding-right": "0px" });
97		body.css({ "padding-right": "0px" });
98		navbar.css({ "padding-right": "0px" });
99	});
100});
101gsap.registerPlugin(ScrollTrigger, EasePack, CSSRulePlugin, Flip);
102var mobile = Modernizr.mq("(max-width: 992px)");
103var path = window.location.pathname.toString();
104var url = window.location.href.toString();
105var pathProto = path.split("/");
106var pathUrl = url.split("//");
107if (pathProto[2] === "proto") {
108	var proto = pathProto[3].toString();
109	if (pathProto[4] === "home" || pathProto[1] === "home") {
110		window.location.replace("https://legacy-admin.spillover.com/spillover/proto/" + proto + "/");
111	}
112} else if (pathProto[2] === "designs") {
113	var proto = pathProto[3].toString();
114	if (pathProto[4] === "home" || pathProto[1] === "home") {
115		window.location.replace("https://legacy-admin.spillover.com/spillover/designs/" + proto + "/");
116	}
117} else {
118	var protoBefore = pathUrl[1].split(".");
119	var proto = protoBefore[0].toString();
120	if (pathProto[4] === "home" || pathProto[1] === "home") {
121		window.location.replace(location.protocol + "//" + location.host);
122	}
123}
124const socialIcons = gsap.utils.toArray("footer .socials li, .topB
124ar .socials li");
125gsap.set(socialIcons, { autoAlpha: 0, x: Math.random() * (100 - -100) + -100 });
126if (mobile) {
127	ScrollTrigger.batch(socialIcons, {
128		start: "top 100%",
129		end: "bottom 0%",
130		onEnter: (batch) => {
131			gsap.to(batch, { autoAlpha: 1, stagger: 0.05, x: 0 });
132		},
133	});
134} else {
135	ScrollTrigger.batch(socialIcons, {
136		start: "top 100%",
137		end: "bottom 0%",
138		onEnter: (batch) => {
139			gsap.to(batch, { autoAlpha: 1, stagger: 0.05, x: 0 });
140		},
141	});
142}
143const bottomNavs = gsap.utils.toArray("footer .nav-item");
144gsap.set(bottomNavs, { autoAlpha: 0, y: Math.random() * (100 - -100) + -100 });
145if (mobile) {
146	ScrollTrigger.batch(bottomNavs, {
147		start: "top bottom",
148		end: "bottom top",
149		onEnter: (batch) => {
150			gsap.to(batch, { autoAlpha: 1, stagger: 0.05, y: 0 });
151		},
152	});
153} else {
154	ScrollTrigger.batch(bottomNavs, {
155		start: "top bottom",
156		end: "bottom top",
157		onEnter: (batch) => {
158			gsap.to(batch, { autoAlpha: 1, stagger: 0.05, y: 0 });
159		},
160	});
161}
162window.addEventListener("load", () => {
163
164	$("a.lb-cancel").attr("rel", "nofollow");
165	$("a.lb-close").attr("rel", "nofollow");
166	$("a.lb-cancel").attr("href", "#");
167	$("a.lb-close").attr("href", "#");
168	// Forms
169	$(".modal .control-label")
170		.each(function () {
171			$(this).attr("style", "");
172			$(this).removeClass("col-sm-3");
173			$(this).removeClass("col-form-label");
174			let label = $(this).attr("for");
175			$(this).insertAfter(".modal #" + label);
176		})
177		.promise()
178		.done(function () {
179			$(".modal .control-label").each(function () {
180				let label = $(this).attr("for");
181				if ($(".modal [for=" + label + "]").length > 1) {
182					$(".modal [for=" + label + "]")
183						.first()
184						.remove();
185				}
186			});
187		});
188	$(".toast-container .control-label")
189		.each(function () {
190			$(this).attr("style", "");
191			$(this).removeClass("col-sm-3");
192			$(this).removeClass("col-form-label");
193			let label = $(this).attr("for");
194			$(this).insertAfter(".toast-container #" + label);
195		})
196		.promise()
197		.done(function () {
198			$(".toast-container .control-label").each(function () {
199				let label = $(this).attr("for");
200				if ($(".toast-container [for=" + label + "]").length > 1) {
201					$(".toast-container [for=" + label + "]")
202						.first()
203						.remove();
204				}
205			});
206		});
207	$("main .control-label")
208		.each(function () {
209			$(this).attr("style", "");
210			$(this).removeClass("col-sm-3");
211			$(this).removeClass("col-form-label");
212			let label = $(this).attr("for");
213			$(this).insertAfter("main #" + label);
214		})
215		.promise()
216		.done(function () {
217			$("main .control-label").each(function () {
218				let label = $(this).attr("for");
219				if ($("main [for=" + label + "]").length > 1) {
220					$("main [for=" + label + "]")
221						.first()
222						.remove();
223				}
224			});
225		});
226	setTimeout(function () {
227		$(".cmsform .form-group").each(function () {
228			$(this).addClass("mb-3");
229			var checkRadio = $(this).find(".cmsform .form-check").length;
230			var hasButton = $(this).find("button").length;
231			var spanChild = $(this).children('span[data-forfield="resume"]').length;
232			var checkChild = $(this).children("div.form-check").length;
233			if (checkRadio === 0 && spanChild === 0 && hasButton === 0 && checkChild === 0) {
234				$(this).addClass("form-floating");
235				$(this).children(".cmsform label").wrapInner('<span class="formTextColor"></span>');
236			}
237			if (hasButton !== 0) {
238				$(this).removeClass("mb-3");
239			}
240		});
241	}, 500);
242	$(".cmsform .form-control:not([placeholder])").each(function () {
243		$(this).attr("placeholder", " ");
244	});
245	$(".cmsform .form-check-input").each(function () {
246		$(this).attr("style", "");
247	});
248	$(".cmsform textarea.form-control").each(function () {
249		$(this).attr("rows", "3");
250	});
251	$.datepicker.setDefaults({
252		minDate: 0,
253	});
254	var disabledDays = ["27-4-2016", "25-12-2016", "26-12-2016", "4-4-2017", "5-4-2017", "6-4-2017", "6-4-2016", "7-4-2017", "8-4-2017", "9-4-2017"];
255	//replace these with the id's of your datepickers
256	$('input[name="event-date"]').datepicker({
257		beforeShowDay: function (date) {
258			var day = date.getDay();
259			var string = jQuery.datepicker.formatDate("d-m-yy", date);
260			var isDisabled = $.inArray(string, disabledDays) != -1;
261			//day != 0 disables all Sundays
262			return [day != 0 && !isDisabled];
263		},
264	});
265	// Internal Pages
266	if (
267		pathProto[4] !== "calendar" &&
268		pathProto[1] !== "calendar" &&
269		pathProto[4] !== "menu" &&
270		pathProto[1] !== "menu" &&
271		pathProto[4] !== "restaurant-menus" &&
272		pathProto[1] !== "restaurant-menus" &&
273		pathProto[4] !== "catering-menus" &&
274		pathProto[1] !== "catering-menus" &&
275		pathProto[4] !== "gluten-free-menu" &&
276		pathProto[1] !== "gluten-free-menu" &&
277		pathProto[4] !== "gallery" &&
278		pathProto[1] !== "gallery" &&
279		pathProto[1] !== "" &&
280		pathProto[1] !== "index.htm" &&
281		pathProto[1] !== "/" &&
282		pathProto[4] !== "" &&
283		pathProto[4] !== "index.htm" &&
284		pathProto[4] !== "/"
285	) {
286		const internalTitles = gsap.utils.toArray(".internal main div");
287		gsap.set(internalTitles, { autoAlpha: 0, x: Math.random() * (100 - -100) + -100, y: Math.random() * (100 - -100) + -100 });
288		if (mobile) {
289			ScrollTrigger.batch(internalTitles, {
290				start: "top 100%",
291				end: "bottom 0%",
292				onEnter: (batch) => {
293					gsap.to(batch, { autoAlpha: 1, stagger: 0.1, x: 0, y: 0 });
294				},
295			});
296		} else {
297			ScrollTrigger.batch(internalTitles, {
298				start: "top 98%",
299				end: "bottom 2%",
300				onEnter: (batch) => {
301					gsap.to(batch, { autoAlpha: 1, stagger: 0.1, x: 0, y: 0 });
302				},
303			});
304		}
305	}
306	if (mobile) {
307		setTimeout(function () {
308			ScrollTrigger.refresh(true);
309		}, 1500);
310	} else {
311		setTimeout(function () {
312			ScrollTrigger.refresh(true);
313		}, 1000);
314	}
315});
316// Gallery
317window.addEventListener("load", () => {
318	var galleryIsotope = $(".gallery-items").isotope({
319		itemSelector: ".gallery-item",
320		layoutMode: "masonry",
321		containerStyle: {
322			overflow: "hidden",
323			position: "relative",
324		},
325		filter: $(".gallery-filters li:first-child").attr("data-filter"),
326	});
327	$(".gallery-filters li").on("click", function () {
328		var galleryFilters = $(".gallery-filters li");
329		galleryFilters.each(function () {
330			$(this).removeClass("filter-active");
331		});
332		$(this).addClass("filter-active");
333		var filter = $(this).attr("data-filter");
334		galleryIsotope.isotope({
335			filter: filter,
336		});
337	});
338	galleryIsotope.on("arrangeComplete", function () {
339		$(".gallery-item:hidden").removeClass("mag");
340		$(".gallery-item:visible").addClass("mag");
341	});
342	galleryIsotope.magnificPopup({
343		type: "image",
344		delegate: "a.mag",
345		gallery: {
346			enabled: true,
347		},
348		zoom: {
349			enabled: true,
350			duration: 300,
351			opener: function (e) {
352				return e.find("img");
353			},
354		},
355	});
356	var $galleryContainer = $(".gallery-items");
357	var $galleryImgs = $("img");
358	$galleryContainer.imagesLoaded(function () {
359		galleryIsotope.isotope({
360			itemSelector: ".gallery-item",
361		});
362		$galleryImgs.on("load", function () {
363			galleryIsotope.isotope("layout");
364		});
365	});
366});
367// Refreshes Menu Tabs When Tabbing Through Them
368$(".nav-link").on("click", function () {
369	ScrollTrigger.refresh(true);
370});
371// =============================================
372// Mailing List Cookie
373// =============================================
374let alreadyShowing = false;
375const mailingToast = $("#mailingListToast");
376let mailingListCookieName = proto + "-mailingList";
377const toast = new bootstrap.Toast(mailingToast);
378if (Cookies.get(mailingListCookieName) == null || Cookies.get(mailingListCookieName) != "false") {
379	Cookies.set(mailingListCookieName, "true", {
380		expires: 7,
381	});
382}
383$(document).on("scroll", function () {
384	if ($(this).scrollTop() > 500 && Cookies.get(mailingListCookieName) == "true" && alreadyShowing == false) {
385		toast.show();
386		alreadyShowing = true;
387	}
388});
389$("#mailingListModal button").on("click", function () {
390	Cookies.set(mailingListCookieName, "false", {
391		expires: 1,
392	});
393});
394$("#mailingListToast button").on("click", function () {
395	Cookies.set(mailingListCookieName, "false", {
396		expires: 1,
397	});
398});
399$("#mailingListToast .btn.btn-template").on("click", function () {
400	toast.hide();
401});
402$('#mailingListModal button[type="submit"]').on("click", function () {
403	Cookies.set(mailingListCookieName, "false", {
404		expires: 180,
405	});
406});
407$('#mailingListToast button[type="submit"]').on("click", function () {
408	Cookies.set(mailingListCookieName, "false", {
409		expires: 180,
410	});
411});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.