PageSourceSearch

https://www.artscape.org/wp-content/themes/mission/assets/js/scripts.js

js artscape.org collected 2026-10-02 05:58:53 UTC 9,303 bytes, 290 lines download raw bytes

1$(document).ready(function() {
2
3	//////////////////////////////////////////////////////////////////////
4	// HEADER
5	//////////////////////////////////////////////////////////////////////
6
7	//parallax asset
8	$(window).scroll(function(){
9		var scroll = $(window).scrollTop();
10		$(".header .bg-accent img.diamond").css("transform","translateY(" + (-scroll/2)  + "px)");
11		$(".header .bg-accent img.diamond").css("-webkit-transform","translateY(" + (-scroll/2)  + "px)");
12	});
13
14	//homepage header video
15	$('.header.home .pause.control').on("click touch", function() {
16		$('.header.home video').trigger('pause');
17		$('.header.home .pause.control').removeClass('active');
18		$('.header.home .play.control').addClass('active');
19	});
20	$('.header.home .play.control').on("click touch", function() {
21		$('.header.home video').trigger('play');
22		$('.header.home .play.control').removeClass('active');
23		$('.header.home .pause.control').addClass('active');
24	});
25
26	//////////////////////////////////////////////////////////////////////
27	// SLIDERS
28	//////////////////////////////////////////////////////////////////////
29
30	//sponsors
31	$('.sponsors .slides').each(function(num, elem) {
32		elem = $(elem);
33
34	});
35
36	$('.event-slider .slides').slick({
37		dots: false,
38		infinite: false,
39		speed: 300,
40		slidesToShow: 4,
41		slidesToScroll: 1,
42		prevArrow: $('.event-slider .buttons .prev'),
43		nextArrow: $('.event-slider .buttons .next'),
44		responsive: [
45		{
46		  breakpoint: 1024,
47		  settings: {
48		    slidesToShow: 3,
49		    slidesToScroll: 3,
50		    infinite: true,
51		  }
52		},
53		{
54		  breakpoint: 780,
55		  settings: {
56		    slidesToShow: 2,
57		    slidesToScroll: 2
58		  }
59		},
60		{
61		  breakpoint: 600,
62		  settings: {
63		    slidesToShow: 1,
64		    slidesToScroll: 1
65		  }
66		}
67		]
68	});
69
70	$('.sponsor-slider .slides').slick({
71		dots: false,
72		infinite: false,
73		speed: 300,
74		slidesToShow: 4,
75		slidesToScroll: 1,
76		prevArrow: $('.sponsor-slider .buttons .prev'),
77		nextArrow: $('.sponsor-slider .buttons .next'),
78		responsive: [
79		{
80		  breakpoint: 1024,
81		  settings: {
82		    slidesToShow: 3,
83		    slidesToScroll: 3,
84		    infinite: true,
85		  }
86		},
87		{
88		  breakpoint: 780,
89		  settings: {
90		    slidesToShow: 2,
91		    slidesToScroll: 2
92		  }
93		},
94		{
95		  breakpoint: 600,
96		  settings: {
97		    slidesToShow: 1,
98		    slidesToScroll: 1
99		  }
100		}
101		]
102	});
103
104	//alert slider
105	$('.alerts .slides').slick({
106		centerMode: true,
107		centerPadding: '0px',
108		slidesToShow: 1,
109		autoplay: true,
110		autoplaySpeed: 5000,
111		fade: true,
112		prevArrow: $('.alerts .prev'),
113		nextArrow: $('.alerts .next')
114	});
115	$('.alerts .pause').on("click touch", function() {
116		$('.alerts .slides').slick('slickPause');
117		$(this).addClass('disable');
118		$('.alerts .play').addClass('enable').removeClass('disable');
119	});
120	$('.alerts .play').on("click touch", function() {
121		$('.alerts .slides').slick('slickPlay');
122		$(this).addClass('disable');
123		$('.alerts .pause').addClass('enable').removeClass('disable');
124	});
125	$('.alerts .close').on("click touch", function() {
126		if ($(".mobile-menu").hasClass('active')){
127			$(".mobile-menu").css('top',parseInt($(".mobile-menu").css('top')) - $("nav .alerts").outerHeight());
128		}
129		$('.alerts').addClass('hidden');
130	});
131	//hide pause/play if slick-hidden arrows and only one slide
132	if ($(".alerts .prev.slick-hidden").length == 1) {
133		$('.alerts .pause').css('display','none');
134	}
135
136	//////////////////////////////////////////////////////////////////////
137	// ACCORDION
138	//////////////////////////////////////////////////////////////////////
139
140	$('#accordion').find('.accordion-toggle').click(function(){
141		is_open = $(this).hasClass('active') ? true : false;
142		$(".accordion-toggle").removeClass("active");
143
144		if (!is_open) $(this).addClass("active");
145		$(this).next().slideToggle('fast');
146		$(".accordion-content").not($(this).next()).slideUp('fast');
147	});
148
149    //////////////////////////////////////////////////////////////////////
150	// GALLERY
151	//////////////////////////////////////////////////////////////////////
152
153	//check if the gallery exists
154	if ($(".gallery").length == 1 && $(".gallery .image").length > 0) {
155		//wrap every 8 image elements in the gallery
156		var galleryImage = $(".gallery .image");
157		for(var i = 0; i < galleryImage.length; i+=8) {
158			galleryImage.slice(i, i+8).wrapAll("<div class='wrap'></div>");
159		}
160
161		//detect the final image in the final wrap
162		//get its top position and height to calculate the proper dynamic size of wrap
163		$(window).on("resize", function () {
164		    var imagePosition = $(".gallery .wrap:last-of-type .image:last-of-type").position();
165		    var imageHeight = $(".gallery .wrap:last-of-type .image:last-of-type").height();
166		    var finalWrapHeight = imagePosition.top + imageHeight;
167		    $(".gallery .wrap:last-of-type").height(finalWrapHeight);
168	    }).resize();
169	}
170
171    //////////////////////////////////////////////////////////////////////
172	// NAVIGATION
173	//////////////////////////////////////////////////////////////////////
174
175	//display condensed version
176	$(window).scroll(function(){
177		//check if alert exists to offset more height
178		if ($(".alerts:visible").length == 1) {
179			if ($(window).width() > 900) {
180				if ($(this).scrollTop() > 70) {
181					$('nav').addClass('condense');
182					$("nav .logo").attr("src","/wp-content/themes/mission/assets/images/artscape-color-logo.svg");
183					$('nav').addClass('condense-plus');
184				} else {
185					$('nav').removeClass('condense');
186					$("nav .logo").attr("src","/wp-content/themes/mission/assets/images/artscape-logo-white.svg");
187					$('nav').removeClass('condense-plus');
188				}
189			}
190		}
191		//check if alert does not exist
192		else{
193			if ($(window).width() > 900) {
194				if ($(this).scrollTop() > 70) {
195					$('nav').addClass('condense');
196					$("nav .logo").attr("src","/wp-content/themes/mission/assets/images/artscape-color-logo.svg");
197				} else {
198					$('nav').removeClass('condense');
199					$("nav .logo").attr("src","/wp-content/themes/mission/assets/images/artscape-logo-white.svg");
200				}
201			}
202		}
203	});
204
205	//display mobile menu
206    $(".header nav .mobile .hamburger").on("click touch", function() {
207	    $(this).find('.icon').toggleClass('active');
208	    $(".navigation.mobile .hamburger").toggleClass('active');
209	    //get height of all nav elements
210			var adminHeight = $("#wpadminbar").length > 0 ? $("#wpadminbar").outerHeight() : 0;
211			var alertHeight = $("nav .alerts").outerHeight();
212	    var navHeight = $(".header nav .wrap.mobile").outerHeight();
213	    var totalNavHeight = adminHeight + alertHeight + navHeight;
214	    //make links visible and offset top by var set above
215			$(".mobile-menu").toggleClass('active').css('top',totalNavHeight);
216			$('body').toggleClass("fixed-position");
217
218		});
219	//open mobile menu accordions
220    $(".header nav .mobile ul li").on("click touch", function() {
221	    $(this).toggleClass('active');
222	});
223
224	//offset header if alert & title exist
225	if ($(".alerts").length == 1) {
226		$(window).on("resize", function () {
227			if ($(".header .title").length == 1) {
228		    	var alertHeight = $("nav .alerts").height();
229		    	var navHeight = $("nav").height();
230				$(".header .title").css('margin-top', alertHeight);
231				if ($(window).width() < 900) {
232					$(".header.listing .mobile-header").css('top', navHeight);
233					$(".single-events .header .mobile-header").css('top', navHeight);
234					$("nav .logo").attr("src","/wp-content/themes/mission/assets/images/artscape-color-logo.svg");
235				} else {
236					if ($(window).scrollTop() < 70) {
237						$("nav .logo").attr("src","/wp-content/themes/mission/assets/images/artscape-logo-white.svg");
238					}
239				}
240			}
241			else{
242				var alertHeight = $("nav .alerts").height();
243				var navHeight = $("nav").height();
244				if ($(window).width() > 900) {
245					$(".header").css('min-height', alertHeight + 360);
246				}
247				else {
248					$(".header").css('min-height', alertHeight + 360);
249					$(".header.event .mobile-header").css('top', navHeight);
250					$(".single-events .header .mobile-header").css('top', navHeight);
251				}
252			}
253	    }).resize();
254	}
255	//remove any top margin when closing alert & title exist
256	$(".alerts .controls img.close").on("click touch", function() {
257		$(".header .title").css('margin-top', '0px');
258
259		if ($(window).width() > 900) {
260			$(".header").css('min-height', "360px");
261		}
262		else {
263			var navHeight = $("nav").height();
264			$(".header").css('min-height', "360px");
265			$(".header.event .mobile-header").css('top', navHeight);
266			$(".single-events .header .mobile-header").css('top', navHeight);
267			$(".header.listing .mobile-header").css('top', navHeight);
268		}
269
270	});
271
272	//////////////////////////////////////////////////////////////////////
273  // Next/Previous Disabled Buttons
274  //////////////////////////////////////////////////////////////////////
275
276	$('a.disabled').on('click', function(e){
277		e.preventDefault();
278	});
279
280	//////////////////////////////////////////////////////////////////////
281  // Upcoming events section - trigger link hover state when mouse over image
282  //////////////////////////////////////////////////////////////////////
283
284	$('#upcoming_events a:first-of-type').on('mouseover', function(e){
285		$(this).parent().find('a.inline').addClass('hover');
286	});
287	$('#upcoming_events a:first-of-type').on('mouseleave', function(e){
288		$(this).parent().find('a.inline').removeClass('hover');
289	});
290});//(document).ready

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.