PageSourceSearch

https://mspc.jp/mg/wp-content/themes/origami_all_white_3.5.3/assets/home/js/functions.js

js mspc.jp collected 2026-10-09 17:33:20 UTC 5,453 bytes, 238 lines download raw bytes

1jQuery(document).ready(function($) {
2
3$(window).on('load', function(){
4	var sliderTimer = 14400;
5	var $productsSlider = $('#products .slider');
6	var $productsProgress = $('#products .slider-progress');
7
8	var controls = $productsSlider.parents('.inner').find('.slider-controls');
9	var current = controls.find('.num_current');
10	var total = controls.find('.num_total');
11
12	$productsSlider.on('init', function(e, slick) {
13		var current_num = zeroPadding(slick.currentSlide + 1,2);
14		var total_num = zeroPadding(slick.slideCount,2);
15	    current.text(current_num);
16	    total.text(total_num);
17	});
18
19	$productsSlider.slick({
20		autoplay: true,
21		autoplaySpeed: sliderTimer,
22		speed: 600,
23		waitForAnimate: false,
24		touchThreshold: 100,
25		arrows: false,
26		dots: false,
27		adaptiveHeight: true,
28		pauseOnFocus: false,
29		pauseOnHover: false,
30		responsive: [
31	      {
32	        breakpoint: 768,
33	        settings: {
34	        	speed: 400,
35	        },
36	      },
37	    ],
38	});
39
40	$('#products .slider-prev-arrow').on('click', function() {
41	  $productsSlider.slick('slickPrev');
42	});
43	$('#products .slider-next-arrow').on('click', function() {
44	  $productsSlider.slick('slickNext');
45	});
46
47
48	progressBar();
49	function progressBar(){
50		$productsProgress.find('span').removeAttr('style');
51		$productsProgress.find('span').removeClass('active');
52		setTimeout(function(){
53			$productsProgress.find('span').css('transition-duration', (sliderTimer/1000)+'s').addClass('active');
54		}, 100);
55	}
56	
57	$productsSlider.find('.slick-current .imgBox').children('img').eq(0).css({opacity:'1'});
58	setInterval(function(){
59		photoFade();
60	}, 2400);
61	function photoFade() {
62		var imgBox = $productsSlider.find('.slick-current .imgBox');
63		imgBox.children('img').css({opacity:'0'});
64		imgBox.children('img').eq(0).clone(true).appendTo(imgBox);
65		imgBox.children('img').eq(-1).css({opacity:'0'});
66		
67		imgBox.children('img').eq(1).animate({opacity:'1'});
68		imgBox.children('img').eq(0).animate({opacity:'0'},{
69			complete: function(){
70				setTimeout(function(){
71					imgBox.children('img').eq(0).remove();
72				},600);
73			}
74		});
75	}
76
77	$productsSlider.on('beforeChange', function(e, slick, currentSlide, nextSlide) {
78		$('.slick-slide[data-slick-index="'+nextSlide+'"] .imgBox').children('img').eq(0).animate({opacity:'1'});
79
80		progressBar();
81
82		var next_current_num = zeroPadding(nextSlide + 1,2);
83		current.text(next_current_num);
84	});
85
86	function zeroPadding(num,length){
87	    return ('0000000000' + num).slice(-length);
88	}
89
90});
91
92
93$(window).on('load', function() {
94	$('#mv .imgBox').each( function( index, element ){
95		photoFade($(element));
96		setInterval(function(){
97			photoFade($(element));
98		}, 5000);
99	});
100});
101
102function photoFade(el) {
103	var imgBox = el;
104	imgBox.children('.image').eq(0).clone(true).appendTo(imgBox);
105	imgBox.children('.image').eq(-1).css({ opacity:'0'});
106	imgBox.children('.image').eq(-1).animate({ opacity:'1' },{
107		duration: 1000,
108		complete: function(){
109			setTimeout(function(){
110				imgBox.children('.image').eq(0).remove();
111			},1200);
112		}
113 	});
114}
115
116
117$(function(){
118	var sliderTimer = 3000;
119
120	if ($('#ec .slider').length) {
121	    $('#ec .slider').slick({
122			autoplay: true,
123			autoplaySpeed: sliderTimer,
124			speed: 400,
125			swipeToSlide: true,
126			waitForAnimate: false,
127			touchThreshold: 200,
128			arrows: false,
129			dots: false,
130			adaptiveHeight: true,
131			pauseOnFocus: false,
132			pauseOnHover: false,
133			slidesToShow: 3,
134			slidesToScroll: 1,
135			responsive: [
136			{
137				breakpoint: 768,
138				settings: {
139					slidesToShow: 2,
140					speed: 300,
141				}
142			}, {
143				breakpoint: 576,
144				settings: {
145					slidesToShow: 2,
146					centerMode: true,
147					centerPadding: '50vw',
148					speed: 200,
149				}
150			}, {
151				breakpoint: 480,
152				settings: {
153					slidesToShow: 2,
154					centerMode: true,
155					centerPadding: '25vw',
156					speed: 200,
157				}
158			}, {
159				breakpoint: 425,
160				settings: {
161					slidesToShow: 2,
162					centerMode: true,
163					centerPadding: '15vw',
164					speed: 200,
165				}
166		    }
167		    ],
168		});
169
170		var progress = $('#ec .slider-progress');
171	    progressBar(progress);
172		$('#ec .slider').on('beforeChange', function(e, slick, currentSlide, nextSlide) {
173			progressBar(progress);
174		});
175		$('#ec .slider-prev-arrow').on('click', function() {
176		  $('#ec .slider').slick('slickPrev');
177		});
178		$('#ec .slider-next-arrow').on('click', function() {
179		  $('#ec .slider').slick('slickNext');
180		});
181	}
182
183	function progressBar(p){
184		p.find('span').removeAttr('style');
185		p.find('span').removeClass('active');
186		setTimeout(function(){
187			p.find('span').css('transition-duration', (sliderTimer/1000)+'s').addClass('active');
188		}, 100);
189	}
190});
191
192
193$(function() {
194	var sliderTimer = 3000;
195	if ($('#styling .slider').length) {
196	    $('#styling .slider').not('.slick-initialized').slick({
197			autoplay: true,
198			autoplaySpeed: sliderTimer,
199			speed: 600,
200			waitForAnimate: false,
201			touchThreshold: 100,
202			arrows: false,
203			dots: false,
204			adaptiveHeight: true,
205			pauseOnFocus: false,
206			pauseOnHover: false,
207			slidesToShow: 4,
208			slidesToScroll: 1,
209			centerMode: false,
210			responsive: [
211			  {
212		        breakpoint: 1440,
213		        settings: {
214		        	slidesToShow: 3,
215		        },
216		      },
217		      {
218		        breakpoint: 768,
219		        settings: {
220		        	slidesToShow: 2,
221		        	speed: 500,
222		        },
223		      },
224		      {
225		        breakpoint: 576,
226		        settings: {
227		        	slidesToShow: 1,
228		        	speed: 400,
229		        },
230		      },
231		    ],
232		});
233	}
234});
235
236
237
238});

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.