PageSourceSearch

https://kyotosleep.net/wp-content/themes/sg073/js/main.js

js kyotosleep.net collected 2026-10-08 22:13:31 UTC 3,680 bytes, 132 lines download raw bytes

1//-----------------------------
2// css-vars
3//-----------------------------
4cssVars();
5//-----------------------------
6// smooth scroll
7//-----------------------------
8var offset = 0;
9if (matchMedia('only screen and (max-width: 767px)').matches) {
10	offset = 55;
11}
12var scroll = new SmoothScroll('a[href*="#"], [data-scroll]',{speed: 800,speedAsDuration: true,ignore:'.inline,.noScrl',offset: offset});
13//-----------------------------
14// アンカーつき遷移時の処理
15//-----------------------------
16var loadscroll = new SmoothScroll();
17var hrefHash = location.hash;
18if(hrefHash !== "" && hrefHash !== "#pgTop" && document.getElementById(hrefHash.replace('#','')) != null) {
19	anchor = document.querySelector(hrefHash);
20	var options = { speed: 800,speedAsDuration: true,offset: offset };
21	loadscroll.animateScroll(anchor,0,options);
22}
23
24//topへ戻る追従
25var jQueryWindow = jQuery(window), //ウィンドウを指定
26jQueryChange = jQuery(".pageTop"), //#change部分
27topContent = jQuery("#cnt").offset().top; //#contentの位置を取得
28var sticky = false;
29jQueryWindow.on("scroll", function () {
30	if (jQueryWindow.scrollTop() > topContent) {
31		//scroll位置が#contentの上にある場合
32		if ( sticky === false ){
33			//#change部分が降りてくる。
34			jQueryChange.slideDown();
35			sticky = true;
36		}
37	} else {
38		//scroll位置が下にある場合
39		if ( sticky === true ){
40			//#change部分が上がる。
41			jQueryChange.slideUp();
42			sticky = false;
43		}
44	}
45}).trigger("scroll");
46
47//blog loading
48if (document.getElementById('blogList')) {
49	var sgScrolling = false;
50	jQueryWindow.on('scroll', function(event) {
51		var bl = jQuery('#blogList');
52		if (!sgScrolling && jQueryWindow.scrollTop() + jQueryWindow.height() > bl.offset().top + bl.outerHeight() - jQueryWindow.height() * 0.17) {
53			(ld = jQuery('#pagerLoader')).fadeIn(111);
54			sgScrolling = true;
55			var count = bl.find('> li').length;
56			var pg = bl.attr('PG') || 2;
57			var url = window.location.origin + window.location.pathname + window.location.search;
58			if (url.indexOf('?') > 0) {
59				var parts = url.split('?');
60				url = parts[0] + (parts[0].charAt(parts[0].length - 1) == '/' ? '' : '/') + 'page/' + pg + '/?' + parts[1];
61			} else {
62				url = url + (url.charAt(url.length - 1) == '/' ? '' : '/') + 'page/' + pg + '/';
63			}
64			jQuery.ajax({
65				url: url,
66				data: { SGP: 1 },
67				type: 'GET',
68				success: function(html) {
69					bl.append(html);
70					ld.fadeOut(88);
71					if (bl.find('> li').length - count < parseInt(bl.attr('SGLMT'))) {
72						return;
73					}
74					bl.attr('PG', parseInt(bl.attr('PG') || 2) + 1);
75					sgScrolling = false;
76				},
77				error: function() {
78					ld.fadeOut(88);
79				},
80			});
81		}
82	});
83}
84
85jQuery(function($) {
86	//モーダル
87	$(".images").modaal({type:'image'});
88	//ハンバーガー
89	$(".inline").modaal({
90		background: '#fff' ,
91		hide_close:true ,
92		overlay_close: true ,
93		fullscreen: true 
94	});
95	$('.closeBT').on('click',function () {
96		$('.inline').modaal('close');
97	});
98	$('.humNavi').find('a').on('click',function () {
99		$('.inline').modaal('close');
100		return true;
101	});
102	//高さ揃え
103	$('.match').matchHeight();
104	$('.matchHeight').matchHeight();
105	//アコーディオン
106	$('.accDt').click(function(){
107		$(this).next('div').slideToggle().end().toggleClass('isActive');
108	});
109	//カルーセル
110	$('.topMv').slick({
111		arrows: false,
112		autoplay: true,
113		autoplaySpeed: 0,
114		cssEase: 'linear',
115		speed: 30000,
116		slidesToShow: 1,
117		slidesToScroll: 1,
118		swipe: false,
119		pauseOnFocus: false,
120		pauseOnHover: false,
121		pauseOnDotsHover: false,
122		useCSS: false,
123		responsive: [
124			{
125				breakpoint: 768,
126				settings: {
127					speed: 20000
128				}
129			}
130		]
131	});
132});

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.