PageSourceSearch

https://matsumoto.ed.jp/wp-content/themes/insp_para/js/main.js?ver=1663053571

js matsumoto.ed.jp collected 2026-10-05 09:39:59 UTC 19,332 bytes, 731 lines download raw bytes

1/* =Main INIT Functions
2-------------------------------------------------------------- */
3function initializeVisia() {
4
5	var $window = jQuery( window );
6
7	"use strict";
8
9	//IE9 RECOGNITION
10	if (jQuery.browser.msie && jQuery.browser.version == 9) {
11
12		jQuery('html').addClass('ie9');
13	}
14
15	//NAVIGATION CUSTOM FUNCTION
16	jQuery(document).aetherNavigation();
17
18	//LOCAL SCROLL
19var scroll = new SmoothScroll('a[href*="#"]', {
20  header: '.logo',
21  speed: 1000,
22});
23	//ヘッダーナビ高さ自動取得
24	$(document).ready(function(){
25	var $headerHeight =$('nav').height();
26	$('body').css('margin-top', $headerHeight +5 + 'px');
27});
28	//RESPONSIVE HEADINGS
29	//jQuery("h1").fitText(1.8, { minFontSize: '30px', maxFontSize: '36px' });
30	//jQuery("h2").fitText(1.5, { minFontSize: '20px', maxFontSize: '28px' });
31
32
33	//HERO DIMENSTION AND CENTER
34	(function() {
35	    function heroInit(){
36	       var hero = jQuery('.hero'),
37				ww = $window.width(),
38				wh = $window.height(),
39				heroHeight = wh;
40
41			hero.css({
42				height: heroHeight+"px",
43			});
44
45			var heroContent = jQuery('.hero .content'),
46				contentHeight = heroContent.height(),
47				parentHeight = hero.height(),
48				topMargin = (parentHeight - contentHeight) / 2;
49
50			heroContent.css({
51				"margin-top" : topMargin+"px"
52			});
53	    }
54
55	    $window.on("resize", heroInit);
56	    jQuery(document).on("ready", heroInit);
57	})();
58
59	//HERO TICKER
60	var current = 1; 
61	var height = jQuery('.ticker').height(); 
62	var numberDivs = jQuery('.ticker').children().length; 
63	var first = jQuery('.ticker h1:nth-child(1)'); 
64	setInterval(function() {
65	    var number = current * -height;
66	    first.css('margin-top', number + 'px');
67	    if (current === numberDivs) {
68	        first.css('margin-top', '0px');
69	        current = 1;
70	    } else current++;
71	}, 2500);
72
73	//SERVICES TOOLTIP
74	(function() {
75		function tooltipInit(){
76			var tooltip = jQuery('.tooltip'),
77				target = jQuery('.feature-icon'),
78				arrow = jQuery ('.arrow-down'),
79				mobile = $window.width() < 960,
80				desktop = $window.width() > 960
81
82			if (mobile) {
83
84				jQuery( ".overview:odd" ).addClass('pull-left');
85
86				target.click(function(){
87					target.css({ "background-position": "top" });
88					jQuery(this).css({ "background-position": "bottom" });
89
90					tooltip.removeClass('visible'); arrow.removeClass('visible');
91					jQuery(this).siblings('.tooltip, .arrow-down').addClass('visible');
92				});
93
94				tooltip.click(function(){
95					jQuery(this).removeClass('visible');
96					jQuery(this).siblings('.arrow-down').removeClass('visible');
97					jQuery(this).siblings('.icon').css({
98						"background-position": "top"
99					});
100				});
101
102				target.unbind('mouseenter');
103				target.unbind('mouseleave');
104			}
105
106			if (desktop) {
107				jQuery('.pull-left').removeClass('pull-left');
108				target.css({"background-position" : "top"})
109				tooltip.removeClass('visible');
110				arrow.removeClass('visible');
111				target.bind('mouseenter', function(){
112					jQuery(this).siblings('.tooltip, .arrow-down').addClass('visible');
113					jQuery(this).css({"background-position" : "bottom"});
114
115					var removeTooltip = function(){ tooltip.removeClass('visible'); arrow.removeClass('visible'); };
116					target.bind( 'mouseleave', removeTooltip );
117					target.bind( 'mouseleave', function(){
118						jQuery(this).css({"background-position" : "top"});
119					});
120				});
121			}
122
123		}
124
125		$window.on("resize", tooltipInit);
126	    jQuery(document).on("ready", tooltipInit);
127
128	})();
129
130	//ANIMATIONS
131	jQuery('.animated').appear();
132
133	var $html = jQuery( 'html' );
134
135	jQuery( document.body ).on('appear', '.fade', function() {
136		if ( ! $html.hasClass( 'desktop' ) ) return;
137		jQuery(this).each(function(){ jQuery(this).addClass('ae-animation-fade') });
138	}).on('appear', '.slide', function() {
139		if ( ! $html.hasClass( 'desktop' ) ) return;
140		jQuery(this).each(function(){ jQuery(this).addClass('ae-animation-slide') });
141	}).on('appear', '.hatch', function() {
142		if ( ! $html.hasClass( 'desktop' ) ) return;
143		jQuery(this).each(function(){ jQuery(this).addClass('ae-animation-hatch') });
144	}).on('appear', '.entrance', function() {
145		if ( ! $html.hasClass( 'desktop' ) ) return;
146		jQuery(this).each(function(){ jQuery(this).addClass('ae-animation-entrance') });
147	});
148
149	//TIMER
150	jQuery('.timer').appear();
151	jQuery(document.body).on('appear', '.timer', function() {
152		jQuery(this).countTo();
153	});
154
155	jQuery(document.body).on('disappear', '.timer', function() {
156		jQuery(this).removeClass('timer');
157	});
158
159	//QUOTES
160	jQuery('.bxslider').each( function() {
161
162		var $this = jQuery( this ),
163			$section = $this.closest( 'section' );
164
165		$this.bxSlider({
166			mode: 'fade',
167			touchEnabled: true,
168			oneToOneTouch: true,
169			pagerCustom: $section.find( '.id-bx-pager' ),
170			nextSelector: $section.find( '.id-bx-next' ),
171			prevSelector: $section.find( '.id-bx-prev' ),
172			nextText: 'next',
173			prevText: 'prev'
174		});
175
176	});
177
178	//CONTACT-FORM
179	jQuery('#contact-open').click(function (e) {
180		e.preventDefault();
181		if ( jQuery('#contact-form').is(':hidden') ) {
182			jQuery('#contact-form').show();
183			jQuery('html, body').animate({ 
184				scrollTop: jQuery('#contact-form').offset().top 
185			}, 1000);
186			/*
187			jQuery('#contact-form').slideDown(200,function () {
188				console.log(jQuery('#contact-form').offset().top);
189				return;
190				jQuery('html, body').animate({ 
191					scrollTop: jQuery('#contact-form').offset().top 
192				}, 1000);
193			});
194			 */
195			
196		} else {
197			jQuery('#contact-form').slideUp();
198		}
199	});
200
201	//PARALLAX EFFECTS
202	$window.load( function() {
203
204		jQuery('.desktop .parallax').not(".parallax-disabled").each( function() {
205
206			var $this = jQuery( this ),
207				image = $this.css( 'background-image' ).replace(/.*\s?url\([\'\"]?/, '').replace(/[\'\"]?\).*/, '');
208
209			$this.parallax({ imageSrc: image });
210
211			$this
212				.closest( '.slider-cover' )
213					.addClass( 'has-parallax' )
214					.end()
215				.css({
216					'background-color': 'transparent',
217					'background-image': ''
218				});
219
220		});
221
222		$window.resize().scroll();
223
224		setTimeout( function() {
225
226			$window.resize().scroll();
227
228		}, 100);
229
230	});
231
232	//PORTFOLIO FILTER
233	jQuery(function(){
234		jQuery('.projectlist').each( function() {
235
236			var $this = jQuery( this );
237
238			$this.mixitup({
239				effects        : ['fade','scale','rotateX'],
240				easing         : 'snap',
241				filterSelector : $this.closest( 'section') .find( '.filter' )
242			});
243
244		});
245	});
246
247	//RESPONSIVE VIDEO
248	jQuery(".container").fitVids();
249	
250	//BLOG SLIDER
251	jQuery(".gallery.clearfix").each( function() {
252		jQuery(this).bxSlider({
253			pager: false,
254			nextSelector: jQuery(this).closest( '.post-media' ).children( ".gallery-next" ),
255			prevSelector: jQuery(this).closest( '.post-media' ).children( ".gallery-prev" ),
256			nextText: "next",
257			prevText: "prev"
258		});
259	});
260	
261	// test this
262	jQuery("li.bx-clone img[src^='data:image']").peLazyLoading();
263
264	//FULLSCREEN SLIDER CONTROLS
265	jQuery('#vegas-next').click(function(){
266		jQuery.vegas('next');
267
268		return false;
269	});
270	jQuery('#vegas-prev').click(function(){
271		jQuery.vegas('previous');
272
273		return false;
274	});
275
276	//FULLSCREEN VIDEO
277	jQuery(function() {
278		if ( jQuery( '.hero-video' ).length === 0 ) return;
279		
280		var ua = navigator.userAgent.toLowerCase();
281		var iDev = ua.match(/(iphone|ipod|ipad)/) !== null;
282		var android = !iDev && ua.match(/android ([^;]+)/);
283		var mobile = (iDev || android || ua.match(/(android|blackberry|webOS|opera mobi)/) !== null) || $window.width() < 960;
284
285
286		var videomp4 = jQuery( '.hero-video' ).data( 'video' ),
287			videoogv = videomp4.replace( '.mp4', '.ogv' ),
288	  mobilejpg = videomp4.replace( '.mp4', '.jpg' );
289		
290	    var BV = new jQuery.BigVideo({useFlashForFirefox:false});
291	    if ( mobile ) {
292			jQuery('.hero-video').css("background","url('"+mobilejpg+"')");
293		} else {
294			BV.init();
295	    	BV.show(videomp4,{altSource:videoogv, ambient:true});
296		}
297	});
298};
299
300function initializePortfolio() {
301
302	var $window = jQuery( window );
303
304	"use strict";
305
306	var current,
307		next, 
308		prev,
309		target, 
310		hash,
311		url,
312		page,
313		title,	  	  	  
314		projectIndex,
315		scrollPostition,
316		projectLength,
317		ajaxLoading = false,
318		wrapperHeight,
319		pageRefresh = true,
320		content =false,
321		correction = 30,
322		headerH = jQuery('.logo').height()+correction,
323		portfolioGrid = jQuery('.projectlist'),
324		easing = 'easeOutExpo',
325		folderName ='projects';
326
327		jQuery('.project-navigation ul').hide();
328		jQuery('.closeProject a').hide();
329
330	jQuery('.projectlist').on( 'click', '.project a', function(e) {
331
332		if ( jQuery( this ).closest( '.project' ).hasClass( 'doajax' ) ) {
333			window.location.hash = ("!/" + jQuery(this).attr("data-slug"));
334			e.preventDefault();
335
336			portfolioGrid = jQuery( this ).closest( '.projectlist' );
337
338			var $portfolio = portfolioGrid.closest( '.portfolio' );
339
340			url = jQuery( this ).attr( 'href' );
341
342			portfolioGrid.find('.project.current').children().removeClass('active');
343			portfolioGrid.find('.project.current').removeClass('current');
344			$portfolio.find('.projectlist.active-folio').removeClass('active-folio');
345			$portfolio.find('.ajax-content.active-ajax, .project-navigation.active-ajax, .closeProject.active-ajax, .loader.active-ajax').removeClass('active-ajax');
346
347			portfolioGrid.find('.project a[href="' + url + '"]' ).parent().addClass( 'current' );
348		 	portfolioGrid.find('.project.current').find('a[href="' + url + '"]').addClass('active');
349
350		 	portfolioGrid.find('.project a[href="' + url + '"]' ).parents('.projectlist').addClass( 'active-folio' );
351		 	portfolioGrid.siblings('.ajax-section').children('.ajax-content, .project-navigation, .closeProject, .loader').addClass('active-ajax');
352
353		 	var projectContainer = $portfolio.find('.ajax-content.active-ajax');
354		 	var loader = $portfolio.find('.loader.active-ajax');
355		 	var projectNav = $portfolio.find('.project-navigation.active-ajax ul');
356		 	var exitProject = $portfolio.find('.closeProject.active-ajax a');
357			
358			var done = false;
359			jQuery('html,body').stop().animate({scrollTop: (projectContainer.offset().top-headerH)+'px'},800,'easeOutExpo', function(){
360			if (done) {
361				return;
362			}
363			done = true;
364																																
365			if(content == false){						
366				loadProject( $portfolio );							
367			}else{	
368				projectContainer.animate({opacity:0,height:wrapperHeight},function(){
369					loadProject( $portfolio );
370				});
371			}
372					
373			projectNav.fadeOut('100');
374			exitProject.fadeOut('100');
375					
376			});
377		}
378
379	});
380
381	function loadProject( $portfolio ){
382
383		var loader = $portfolio.find('.loader.active-ajax');
384
385		loader.show().removeClass('projectError').html('');
386
387		if(!ajaxLoading) {				
388			ajaxLoading = true;
389
390			var projectContainer = $portfolio.find('.ajax-content.active-ajax');
391
392			projectContainer.load( url +' div#ajaxpage', function(xhr, statusText, request){
393
394				if(statusText == "success"){				
395
396				ajaxLoading = false;
397
398				page = projectContainer.children().first();
399					
400				page.find("img[data-original]:not(img.pe-lazyload-inited)").peLazyLoading();
401
402				setTimeout( function() {
403
404					page.find("img[data-original]:not(img.pe-lazyload-inited)").peLazyLoading();
405
406					$window.scroll().resize();
407
408				}, 1500 );
409
410				$portfolio.find('.accordion').each(function(){
411					var acc = jQuery(this).attr("rel") * 2;
412					jQuery(this).find('.accordion-inner:nth-child(' + acc + ')').show();
413					jQuery(this).find('.accordion-inner:nth-child(' + acc + ')').prev().addClass("active");
414				});
415
416				$portfolio.find('.accordion .accordion-title').click(function() {
417					if(jQuery(this).next().is(':hidden')) {
418						jQuery(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200);
419						jQuery(this).toggleClass('active').next().slideDown(200);
420					}
421				return false;
422				});
423
424				$portfolio.find( '.tabs' ).not( '.tabs-init' ).each( function() {
425
426					var $this = jQuery( this );
427
428					$this.addClass( '.tabs-init' );
429
430					$this
431						.find( 'div' )
432							.hide()
433							.end()
434						.find( 'div:first' )
435							.show()
436							.end()
437						.find( 'ul li:first' )
438							.addClass('active');
439
440					$this
441						.find( 'ul li a' )
442							.click( function(){
443
444								var $_this = jQuery( this );
445
446								$this.find( 'ul li' ).removeClass('active');
447
448								$_this.parent().addClass('active');
449
450								var currentTab = $_this.attr('href');
451
452								$this.find( 'div' ).hide();
453
454								jQuery( currentTab ).show();
455
456								return false;
457
458							});
459
460				});
461					
462				$portfolio.find('.slider').bxSlider({
463					mode: 'horizontal',
464					touchEnabled: true,
465					swipeThreshold: 50,
466					oneToOneTouch: true,
467					pagerSelector: page.find( '.slider-pager' ),
468					nextSelector: page.find( '.project-gallery-next' ),
469					prevSelector: page.find( '.project-gallery-prev' ),
470					nextText: page.find( '.project-gallery-next a' ).text(),
471					prevText: page.find( '.project-gallery-prev a' ).text(),
472					tickerHover: true
473				});
474					
475				// test this
476				$portfolio.find("li.bx-clone img[src^='data:image']").addClass("pe-lazyloading-forceload").peLazyLoading();
477				$window.trigger("pe-lazyloading-refresh");
478
479				page.waitForImages(function() {
480					hideLoader( $portfolio, page );  
481				});
482
483				$portfolio.find(".container").fitVids();
484
485				}
486
487			});
488
489		}
490			
491	}
492
493	function hideLoader( $portfolio, page ){
494		var loader = $portfolio.find('.loader.active-ajax');
495
496		loader.delay(400).fadeOut( function(){
497
498			showProject( $portfolio, page );
499
500		});			 
501	}
502
503	function showProject( $portfolio, page ){
504
505		var projectContainer = $portfolio.find('.ajax-content.active-ajax');
506		var projectNav = $portfolio.find('.project-navigation.active-ajax ul');
507		var exitProject = $portfolio.find('.closeProject.active-ajax a');
508
509		wrapperHeight = page.outerHeight()+'px';
510		
511		if(content==false){
512
513			wrapperHeight = page.outerHeight()+'px';
514
515			projectContainer.animate({opacity:1,height:wrapperHeight}, function(){
516				$portfolio.find(".container").fitVids();
517				scrollPostition = jQuery('html,body').scrollTop();
518				projectNav.fadeIn();
519				exitProject.fadeIn();
520				content = true;	
521
522				$window.resize();
523
524			});
525
526		} else {
527			wrapperHeight = page.outerHeight()+'px';
528
529			projectContainer.animate({opacity:1,height:wrapperHeight}, function(){
530				$portfolio.find(".container").fitVids();																		  
531				scrollPostition = jQuery('html,body').scrollTop();
532				projectNav.fadeIn();
533				exitProject.fadeIn();
534
535				$window.resize();
536
537			});					
538		}
539
540
541		projectIndex = $portfolio.find('.project.current').index();
542		projectLength = $portfolio.find('.project a').length-1;
543
544
545		if(projectIndex == projectLength){
546
547			$portfolio.find('.nextProject a').addClass('disabled');
548			$portfolio.find('.prevProject a').removeClass('disabled');
549
550		} else if(projectIndex == 0) {
551
552			$portfolio.find('.prevProject a').addClass('disabled');
553			$portfolio.find('.nextProject a').removeClass('disabled');
554
555		} else {
556
557			$portfolio.find('.nextProject a, .prevProject a').removeClass('disabled');
558
559		}
560
561		setTimeout( function() {
562
563			page.find("img[data-original]:not(img.pe-lazyload-inited)").peLazyLoading();
564
565			$window.scroll().resize();
566
567		}, 1500 );
568	
569  	}
570
571  	function deleteProject( closeURL, $portfolio ){
572
573  		var projectContainer = $portfolio.find('.ajax-content.active-ajax');
574  		var projectNav = $portfolio.find('.project-navigation.active-ajax ul');
575  		var exitProject = $portfolio.find('.closeProject.active-ajax a');
576
577		projectNav.fadeOut();
578		exitProject.fadeOut();
579
580		if(typeof closeURL!='undefined' && closeURL!='') {
581			window.location.hash = '#_';
582		}
583
584		projectContainer.animate({opacity:0,height:'0px'},800,'easeOutExpo');
585		projectContainer.empty();
586		jQuery('html,body').stop().animate({
587			scrollTop: (projectContainer.offset().top-headerH-100)+'px'},600
588		);
589
590		$portfolio.find('.projectlist.active-folio').removeClass('active-folio');
591		$portfolio.find('.ajax-content.active-ajax, .project-navigation.active-ajax, .closeProject.active-ajax').removeClass('active-ajax');
592		$portfolio.find('.project.current').children().removeClass('active');
593		$portfolio.find('.project.current').removeClass('current');
594
595		setTimeout( function() {
596
597			$window.trigger( 'resize' ).trigger( 'scroll' );
598
599		}, 800);
600
601		setTimeout( function() {
602
603			$window.trigger( 'resize' ).trigger( 'scroll' );
604
605		}, 1000);
606 	}
607
608 	jQuery('.nextProject a').on('click',function (e) {
609
610 		e.preventDefault();
611
612 		var $portfolio = jQuery( this ).closest( '.portfolio' );
613
614		current = $portfolio.find('.project.current');
615		next = current.nextAll('.project.doajax').first();
616
617		target = jQuery(next).children('a');
618		
619
620		if (next.length === 0) { 
621			return false;			  
622		} 
623
624		current.removeClass('current'); 
625		current.children().removeClass('active');
626		next.addClass('current');
627		next.children().addClass('active');
628
629		jQuery(target).click();
630	   
631	});
632
633	jQuery('.prevProject a').on('click',function (e) {
634
635		e.preventDefault();
636
637		var $portfolio = jQuery( this ).closest( '.portfolio' );
638
639		current = $portfolio.find('.project.current');
640		prev = current.prevAll('.project.doajax').first();
641
642		target = jQuery(prev).children('a');
643		
644
645		if (prev.length === 0) { 
646			return false;			  
647		} 
648
649		current.removeClass('current'); 
650		current.children().removeClass('active');
651		prev.addClass('current');
652		prev.children().addClass('active');
653
654		jQuery(target).click();
655
656	});
657
658	jQuery('.closeProject a').on('click',function () {
659
660		var $portfolio = jQuery( this ).closest( '.portfolio' );
661
662		var loader = $portfolio.find('.loader.active-ajax'); 
663							
664		deleteProject(jQuery(this).attr('href'), $portfolio);					
665		
666		$portfolio.find('.project.current').children().removeClass('active');
667		loader.fadeOut();
668
669		return false;
670	});
671
672	pageRefresh = false;
673};
674/* END ------------------------------------------------------- */
675
676
677/* =Window Load Trigger
678-------------------------------------------------------------- */
679jQuery( window ).load(function(){
680
681	var $window = jQuery( window );
682
683	$window.trigger( 'hashchange' );
684	$window.trigger( 'resize' );
685	var p = window.location.hash.match(/\/(.+)/);
686	if (p && p[1]) {
687		jQuery("a[data-slug='"+p[1]+"']").trigger("click");
688	}
689  	jQuery('[data-spy="scroll"]').each(function () {
690    	var $spy = $(this).scrollspy('refresh');
691	});
692
693});
694/* END ------------------------------------------------------- */
695
696
697/* =Document Ready Trigger
698-------------------------------------------------------------- */
699jQuery(document).ready(function(){
700
701	initializeVisia();
702	initializePortfolio();
703
704});
705
706
707/*タブ
708 * -----------------------------------------------------------------*/
709/*--------------------------------------------------------------------*/
710$(function(){
711  $('.tab').on('click',function(){
712    var idx=$('.tab').index(this);
713    $(this).addClass('is-active').siblings('.tab').removeClass('is-active');
714    $(this).closest('.tab-group').nextAll('.panel-group').find('.panel').removeClass('is-show');
715    $('.panel').eq(idx).addClass('is-show');
716  });
717});
718/*アコーディオン
719 * -----------------------------------------------------------------*/
720$(function(){
721$("#accordion dt").on("click", function() {
722$(this).next().slideToggle();
723$(this).toggleClass("active");//追加部分
724});
725});
726/*Searchページ最適化
727 * ---------------------------------------------------------------------*/
728jQuery(function($){
729	$("body.search section.blog").removeClass("container").addClass("flex");
730	$("body.search section.blog .title.grid-full h2").text("検索結果一覧");
731});

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.