PageSourceSearch

https://www.mallage-shobu.com/js/common.js?1791429127

js mallage-shobu.com collected 2026-10-08 03:12:18 UTC 8,346 bytes, 301 lines download raw bytes

1/*//////////////////////////////////////////////////
2
3	共通js
4
5//////////////////////////////////////////////////*/
6
7///--------------------------------------------------
8///
9///	ウィンドウ幅判定
10///
11///--------------------------------------------------
12const $mobile = 769; //スマホ
13const $tablet = 961; //タブレット
14//const $desktop = 1200; //デスクトップ
15
16$(window).on('load resize', function(){
17	//ウィンドウ幅判定
18	let win_width = window.innerWidth;
19
20	//ウィンドウの広さに合わせてbodyにclass設定
21	if(win_width <= $mobile){
22		if($('body').hasClass('view-sp')) return false;
23		$('body').addClass('view-sp').removeClass('view-tablet view-pc');
24	}
25	else if(win_width <= $tablet){
26		if($('body').hasClass('view-tablet')) return false;
27		$('body').addClass('view-tablet').removeClass('view-sp view-pc');
28		$('.header__search').fadeOut(0);
29	}
30	else{
31		if($('body').hasClass('view-pc')) return false;
32		$('body').addClass('view-pc').removeClass('view-sp view-tablet open');
33		$('.header__nav').css('display','');
34	}
35});
36
37///--------------------------------------------------
38///
39///	ナビゲーション
40///
41///--------------------------------------------------
42$(document).on('click', '.header__menu_btn', function(){
43	$(this).toggleClass('active');
44	$('body').toggleClass('open');
45	$('.header__nav').fadeToggle(300);
46	if($(this).hasClass('active')){
47		$(this).find('.header__menu_btn-txt').text('CLOSE');
48	}
49	else{
50		$(this).find('.header__menu_btn-txt').text('MENU');
51	}
52
53	return false;
54});
55
56///--------------------------------------------------
57///
58///	ヘッダー内検索ボタンをクリック時に検索フォームを展開
59///
60///--------------------------------------------------
61$(document).on('click', '#header .header__nav-item.search', function(){
62	$('.header__search').toggleClass('searching');
63});
64
65/*	ページ内スクロールの動作設定
66---------------------------------------------------------------- */
67$('a[href^="#"]:not(a[href="#"])').click(function(e){
68	e.preventDefault();
69	let speed = 2000;
70	let href = $(this).attr("href");
71	let target = $(href == "#" || href == "" ? 'html' : href);
72	let position = target.offset().top;
73	let numerical = 0;
74	if($('body').hasClass('view-sp')){
75		numerical = 80;
76	}
77	else if($('body').hasClass('view-tablet')){
78		numerical = 100;
79	}
80	else if($('body').hasClass('view-pc')){
81		numerical = 140;
82	}
83
84	$('html, body').stop().animate({
85		'scrollTop': (position - numerical)
86	}, speed, 'swing', function() {
87		//window.location.hash = target;
88	});
89
90	return false;
91});
92
93// ページ外アンカーのページ付きリンクへのスムーススクロール
94$(function(){
95	var urlHash = location.hash;
96	if(urlHash) {
97		$('body,html').stop().scrollTop(0);
98		setTimeout(function(){
99			var headerHeight = $('#header').outerHeight();
100			var target = $(urlHash);
101			var position = target.offset().top - headerHeight;
102			var numerical = 0;
103			if($('body').hasClass('view-sp')){
104				numerical = 60;
105			}
106			else if($('body').hasClass('view-tablet')){
107				numerical = 100;
108			}
109			else if($('body').hasClass('view-pc')){
110				numerical = 140;
111			}
112			$('body,html').stop().animate({
113				'scrollTop': (position + numerical)
114			}, 2000, 'swing');
115		}, 100);
116
117		// let speed = 2000;
118		// let target = $(urlHash);
119		// let position = target.offset().top;
120		// let numerical = 0;
121		// if($('body').hasClass('view-sp')){
122		// 	numerical = 60;
123		// }
124		// else if($('body').hasClass('view-tablet')){
125		// 	numerical = 100;
126		// }
127		// else if($('body').hasClass('view-pc')){
128		// 	numerical = 140;
129		// }
130
131		// $('html, body').stop().animate({
132		// 	'scrollTop': (position - numerical)
133		// }, speed, 'swing', function() {
134		// 	//window.location.hash = target;
135		// });
136	}
137});
138
139// ページ内アンカーのページ付きリンクへのスムーススクロール
140// $(function(){
141//     $('a[href*="#"], area[href*="#"]').not(".noScroll").click(function() {
142//
143//         var speed = 400, // ミリ秒(この値を変えるとスピードが変わる)
144//             href = $(this).prop("href"), //リンク先を絶対パスとしてå
144–å¾—
145//             hrefPageUrl = href.split("#")[0], //リンク先を絶対パスについて、#より前のURLを取得
146//             currentUrl = location.href, //現在のページの絶対パスを取得
147//             currentUrl = currentUrl.split("#")[0]; //現在のページの絶対パスについて、#より前のURLを取得
148//
149//         //#より前の絶対パスが、リンク先と現在のページで同じだったらスムーススクロールを実行
150//         if(hrefPageUrl == currentUrl){
151//
152//             //リンク先の#からあとの値を取得
153//             href = href.split("#");
154//             href = href.pop();
155//             href = "#" + href;
156//
157//             //スムースクロールの実装
158//             var target = $(href == "#" || href == "" ? 'html' : href),
159//                 position = target.offset().top - headerHeight; //targetの位置を取得
160//                $('body,html').stop().animate({scrollTop:position}, 400);
161//
162//             return false;
163//         }
164//
165//     });
166// });
167
168/*	topへの動作設定
169---------------------------------------------------------------- */
170$(window).on("scroll", function() {
171	if ($(this).scrollTop() > 100) {
172		$("#pageTop").fadeIn();
173	} else {
174		$("#pageTop").fadeOut();
175	}
176})
177$('#pageTop').click(function () {
178	$('body,html').animate({
179	scrollTop: 0
180	}, 400);
181	return false;
182})
183
184///--------------------------------------------------
185///
186///	トグル開閉(footer)
187///
188///--------------------------------------------------
189$(document).on('click', '.header__nav_mobile-switch', function(){
190	if($('body').hasClass('view-pc')) return false;
191	$(this).toggleClass('active');
192	$(this).next('.header__nav_mobile-switcher').slideToggle();
193});
194$(document).on('click', '.footer__nav-switch', function(){
195	if($('body').hasClass('view-pc')) return false;
196	$(this).toggleClass('active');
197	$(this).next('.footer__nav-switcher').slideToggle();
198});
199
200///--------------------------------------------------
201///
202///	バナー(footer)
203///
204///--------------------------------------------------
205var $bnr_slide = '';
206if($('.footbnr_slider .footbnr_slider-box').length > 1){
207	$bnr_slide = $('.footbnr_slider').not('.slick-initialized').slick({
208		arrows: true,
209		prevArrow: '<div class="footbnr_arrow prev"></div>',
210		nextArrow: '<div class="footbnr_arrow next"></div>',
211		autoplay: false,
212		adaptiveHeight: true,
213		centerMode: true,
214		dots: true,
215		centerPadding: '0%',
216		slidesToShow: 1,
217		mobileFirst: true,
218		responsive: [
219			{
220				breakpoint: 769,
221				settings: {
222					centerPadding: '8%',
223					slidesToShow: 1,
224					dots: false,
225				},
226			},
227			{
228				breakpoint: 961,
229				settings: {
230					centerPadding: '11.6%',
231					slidesToShow: 3,
232					dots: false,
233				},
234			},
235		]
236	});
237}
238
239/*	フォーム入力チェック
240---------------------------------------------------------------- */
241// if($("form").length>0){
242// 	$('form').validationEngine('attach',{
243// //		validationEventTrigger : 'change',
244// 		promptPosition:'topLeft',
245// 	});
246// }
247
248/*	AOSの初期化
249---------------------------------------------------------------- */
250AOS.init({
251	duration: 1200,
252	once: true,
253});
254
255/*	Cookie
256---------------------------------------------------------------- */
257const $expire = 1;
258let cc = document.querySelector('.cookie-consent');
259let ca = document.querySelector('.cookie-agree');
260let c_pop = document.querySelector('#popup_modal');
261let c_pop_close = document.querySelector('#popup_modal .modal_close');
262
263if(!Cookies.get('cookie_agree')){
264	cc_popup();
265}
266if(!Cookies.get('cookie_popup')){
267	popup();
268}
269
270ca.addEventListener('click', () => {
271    cc.classList.add('is-hide');
272	set_cookie_agree('cookie_agree', '1', 'set')
273});
274
275if(c_pop_close){
276	c_pop_close.addEventListener('click', (e) => {
277		e.preventDefault();
278		c_pop.classList.add('is-hide');
279		set_cookie_agree('cookie_popup', '1', 'set')
280	});
281}
282
283function set_cookie_agree(key, value='', action){
284	if(action == 'set'){
285		Cookies.set(key, value, { expires: $expire, path: '/' });
286	}
287	else if(action == 'remove'){
288		Cookies.remove(key);
289	}
290}
291
292function cc_popup(){
293	if(cc){
294		cc.classList.add('is-show');
295	}
296}
297function popup(){
298	if(c_pop){
299		c_pop.classList.add('is-show');
300	}
301}

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.