PageSourceSearch

https://corp.asahi.co.jp/Portals/0/js/common.js

js asahi.co.jp collected 2026-09-24 08:43:34 UTC 40,379 bytes, 1,181 lines download raw bytes

1/* =============================================
2
3infoNet common.js   ver2.0.4
4
5============================================= */
6(function ($) {
7	'use strict';
8	$(function () {
9		/* =============================================
10			global variable declaration
11		============================================= */
12		const $BODY = $('body');
13		let deviceType = 'pc';
14		let viewType = 'pc';
15		let tbWidth = 1000;
16		let spWidth = 768;
17		let animSpd = 300;
18		let headerPosition = $('#header').css('position') == 'fixed' || $('#header').css('position') == 'absolute' ? true : false;
19		let responsiveMode = true;
20
21		/* =============================================
22			deviceType / viewType
23		============================================= */
24		// deviceType
25		if ($BODY.hasClass('spMode')) {
26			deviceType = 'sp';
27		} else if ($BODY.hasClass('tbMode')) {
28			deviceType = 'sp';
29		}
30
31		/* =============================================
32			plugin options
33		============================================= */
34		// megaMenu option list.
35		// bodyのクラス属性を取得
36		const bodyClass = $('body').attr('class') || '';
37		// 「-en」という文字列が含まれているかどうかを判定
38		const skinEnglish = bodyClass.includes('-en');
39		// "_ABC" で始まるクラスを探す(正規表現を使用)
40		const currentSkin = bodyClass.match(/_ABC[^\s]*/)?.[0] || '_ABC';
41
42		const OPT_MEGA = [{
43			name: 'corporate',
44			target: '.token_menu ul li a',
45			skinName: currentSkin,
46			triggerMode: 'hover',
47			pullDown: false,
48			item: '.megamenu_wrap > *',
49			overlayPosi: '#skin',
50			close_opts: {
51				closeBtn: true,
52				closeTag: skinEnglish ? '<p><span>Close</span></p>' : '<p><span>閉じる</span></p>',
53				closeTagPosi: '.megamenu_wrap'
54			},
55			spd: animSpd / 2,
56			openDelay: 300,
57			closeDelay: 0,
58			scrollHide: true,
59			existJudg: false,
60			activeAndo: true,
61			outSideClose: true
62		}];
63
64		// const OPT_MEGA = [{
65		// 	name: 'corporate',// Meaning of name only.
66		// 	target: '.token_menu ul li a',// Enter the selector that fires the event.
67		// 	skinName: '_ABC',// Enter the name of the skin to run.
68		// 	// option list.
69		// 	triggerMode: 'hover',
70		// 	pullDown: false,
71		// 	item: '.megamenu_wrap > *',
72		// 	overlayPosi: '#skin',
73		// 	close_opts: {
74		// 		closeBtn: true,
75		// 		closeTag: '<p><span>閉じる</span></p>',
76		// 		closeTagPosi: '.megamenu_wrap '
77		// 	},
78		// 	spd: animSpd / 2,
79		// 	openDelay: 300,
80		// 	closeDelay: 0,
81		// 	scrollHide: true,
82		// 	existJudg: false,
83		// 	activeAndo: true,
84		// 	outSideClose: true
85		// }, {
86		// 	name: 'corporate',// Meaning of name only.
87		// 	target: '.token_menu ul li a',// Enter the selector that fires the event.
88		// 	skinName: '_ABC-en',// Enter the name of the skin to run.
89		// 	// option list.
90		// 	triggerMode: 'hover',
91		// 	pullDown: false,
92		// 	item: '.megamenu_wrap > *',
93		// 	overlayPosi: '#skin',
94		// 	close_opts: {
95		// 		closeBtn: true,
96		// 		closeTag: '<p><span>Close</span></p>',
97		// 		closeTagPosi: '.megamenu_wrap'
98		// 	},
99		// 	spd: animSpd,
100		// 	spd: animSpd / 2,
101		// 	closeDelay: 0,
102		// 	scrollHide: true
103		// }];
104
105		// burgerMenu option list.
106		const OPT_BURGER = [{
107			name: 'main',// linkClass
108			target: '#header .right',// Enter the selector that fires the event.
109			skinName: '',// Enter the name of the skin to run.
110			runPC: false,// Activated on PC.
111			runSP: true,// Activated on SP.
112			// option list.
113			posi: '#header',
114			html: '<p><span></span></p>',
115			spd: animSpd,
116			moveType: 'default',
117			toggle_opts: {
118				toggleBtn: true,
119				toggleSwitch: false,
120				toggleReset: true,
121				spd: animSpd
122			},
123			close_opts: {
124				close: false,
125				posi: '.head_bottom',
126				html: '<p><span>close</span></p>'
127			},
128			overlay_opts: {
129				posi: '#skin'
130			}
131		}, {
132			name: 'sub',// linkClass
133			target: '#sub_burger_wrap .sub_burger',// Enter the selector that fires the event.
134			skinName: '',// Enter the name of the skin to run.
135			runPC: false,// Activated on PC.
136			runSP: true,// Activated on SP.
137			posi: '#sub_burger_wrap .sub_burger_btn_wrap',
138			close_opts: {
139				close: true,
140				posi: '.sub_burger',
141				html: '<p><span>close</span></p>'
142			},
143			overlay_opts: {
144				overlay: false
145			}
146		}];
147
148		/* =============================================
149			load & resize
150		============================================= */
151		if (responsiveMode) {
152			if (window.innerWidth <= spWidth) {
153				viewType = 'sp';
154			} else if (window.innerWidth <= tbWidth) {
155				viewType = 'pc';
156			} else {
157				viewType = 'pc';
158			}
159		} else {
160			if ($BODY.hasClass('pcView')) {
161				viewType = 'pc';
162			} else if ($BODY.hasClass('spView')) {
163				viewType = 'sp';
164			}
165		}
166		$BODY.attr('view-mode', viewType);
167		responsiveMotion('load');
168
169		if (responsiveMode) {
170			$(window).on({
171				'resize': function (event) {
172					if (window.innerWidth <= spWidth) {
173						if (viewType !== 'sp') {
174							viewType = 'sp';
175							$BODY.attr('view-mode', viewType);
176							responsiveMotion('resize');
177						}
178					} else if (window.innerWidth <= tbWidth) {
179						if (viewType !== 'pc') {
180							viewType = 'pc';
181							$BODY.attr('view-mode', viewType);
182							responsiveMotion('resize');
183						}
184					} else {
185						if (viewType !== 'pc') {
186							viewType = 'pc';
187							$BODY.attr('view-mode', viewType);
188							responsiveMotion('resize');
189						}
190					}
191					responsiveMotion('always');
192				}
193			});
194		}
195
196		/* =============================================
197			responsive function
198		============================================= */
199		function responsiveMotion(event_mode) {
200			switch (event_mode) {
201				case 'load':
202					if ($BODY.attr('view-mode') == 'pc') { } else if ($BODY.attr('view-mode') == 'sp') {
203						tableControlMotion();
204					}
205					initialize();
206					cookie();
207					fileiconMotion();
208					placeholderMotion();
209					toTopMotion();
210					fontSizeMotion();
211					editSlick();
212					lightcaseMotion();
213					modaalMotion();
214					accordionMotion(event_mode);
215					megaMenuMotion(event_mode, OPT_MEGA);
216					burgerMotion(event_mode, OPT_BURGER);
217					headerAllMotion();
218					headerFixMotion(event_mode);// description: 余白を追加するのでsmoothより先に
219					editorTabMotion();// 高さ算出するのでDOM生成後に
220					smoothScrollMotion();// 高さ算出するのでDOM生成後に
221					moduleAnimation();
222					indexKvAnim();
223					businessGroupMvAnim();
224					scrollAnim();
225					break;
226				case 'resize':
227					accordionMotion(event_mode);
228					megaMenuMotion(event_mode, OPT_MEGA);
229					burgerMotion(event_mode, OPT_BURGER);
230					break;
231				case 'always':
232					headerFixMotion(event_mode);
233					break;
234			}
235		}
236
237		/* =============================================
238			placeholderMotion
239		============================================= */
240		// function placeholderMotion() {
241		// 	$('.h_search_wrap input[type="text"]').placeholder({
242		// 		attrMode: true,
243		// 		text: 'サイト内検索'
244		// 	});
245		// }
246		function placeholderMotion() {
247			const isEnglish = $('body').attr('class').match(/-en(\s|$)/);
248
249			$('.h_search_wrap input[type="text"]').placeholder({
250				attrMode: true,
251				text: isEnglish ? 'Site Search' : 'サイト内検索'
252			});
253		}
254		/* =============================================
255			fileiconMotion
256		============================================= */
257		function fileiconMotion() {
258			const path = '/Portals/0/images/common/';
259			const selector = '#skin a:not(:where(.no_icon))[href]';
260
261			let iconUrl = {};
262			if ($('body').hasClass('_ABC-en, ._ABC-tv-en, ._ABC-radio-en')) {
263				iconUrl = {
264					pdf: `<img src="${path}ico_pdf.png" alt="PDF file (opens in new window)">`,
265					word: `<img src="${path}ico_word.png" alt="Word document">`,
266					excel: `<img src="${path}ico_excel.png" alt="Excel spreadsheet">`,
267					zip: `<img src="${path}ico_zip.png" alt="ZIP archive">`,
268					external: `<img src="${path}ico_external.png" alt="External link (opens in new window)">`,
269				};
270			} else {
271				iconUrl = {
272					pdf: `<img src="${path}ico_pdf.png" alt="PDFファイルを別窓で表示します">`,
273					word: `<img src="${path}ico_word.png" alt="Wordファイル">`,
274					excel: `<img src="${path}ico_excel.png" alt="Excelファイル">`,
275					zip: `<img src="${path}ico_zip.png" alt="Zipファイル">`,
276					external: `<img src="${path}ico_external.png" alt="外部リンクを別窓で表示します">`,
277				};
278			}
279			$(selector).fileicon({
280				filesize: true,
281				fileicon: true,
282				icon_url: iconUrl
283			});
284		}
285
286		/* =============================================
287			burger_motion
288		============================================= */
289		function burgerMotion(func_mode, opt) {
290			const UNDEFINED = 'undefined';
291			switch (func_mode) {
292				case 'load':
293					for (let i = 0; i < opt.length; i++) {
294						let flag = false;
295						if (viewType == 'pc' && opt[i].runPC) {
296							flag = true;
297						}
298						if (viewType == 'sp' && opt[i].runSP) {
299							flag = true;
300						}
301						if (flag) {
302							if ($BODY.hasClass(opt[i]?.skinName) || opt[i]?.skinName == '' || typeof opt[i]?.skinName == UNDEFINED) {
303								plugin_burger_exe(opt[i]);
304							}
305						}
306					}
307					break;
308				case 'resize':
309					for (let i = 0; i < opt.length; i++) {
310						if ($BODY.hasClass(opt[i]?.skinName) || opt[i]?.skinName == '' || typeof opt[i]?.skinName == UNDEFINED) {
311							if (typeof opt[i]?.runPC != UNDEFINED && viewType == 'pc') {
312								if (opt[i].runPC) {
313									if (!$(`.burger_motion.${opt[i].name}`)[0]) {
314										if ($BODY.hasClass(opt[i]?.skinName) || opt[i]?.skinName == '' || typeof opt[i]?.skinName == UNDEFINED) {
315											plugin_burger_exe(opt[i]);
316										}
317									} else {
318										$(opt[i].target).burgerMenu('reset');
319										$(opt[i].target).burgerMenu('rebind');
320									}
321								} else {
322									$(opt[i].target).burgerMenu('reset');
323								}
324							}
325							if (typeof opt[i]?.runSP != UNDEFINED && viewType == 'sp') {
326								if (opt[i].runSP) {
327									if (!$(`.burger_motion.${opt[i].name}`)[0]) {
328										if ($BODY.hasClass(opt[i]?.skinName) || opt[i]?.skinName == '' || typeof opt[i]?.skinName == UNDEFINED) {
329											plugin_burger_exe(opt[i]);
330										}
331									} else {
332										$(opt[i].target).burgerMenu('reset');
333										$(opt[i].target).burgerMenu('rebind');
334									}
335								} else {
336									$(opt[i].target).burgerMenu('reset');
337								}
338							}
339						}
340					}
341					break;
342			}
343			function plugin_burger_exe(option) {
344				$(option.target).burgerMenu({
345					posi: typeof option?.posi != UNDEFINED ? option.posi : '#header',
346					html: typeof option?.html != UNDEFINED ? option.html : '<p><span></span></p>',
347					spd: typeof option?.spd != UNDEFINED ? option.spd : animSpd,
348					moveType: typeof option?.moveType != UNDEFINED ? option.moveType : 'default',
349					linkClass: typeof option?.name != UNDEFINED ? option.name : 'main',
350					toggle_opts: {
351						toggleBtn: typeof option.toggle_opts?.toggleBtn != UNDEFINED ? option.toggle_opts.toggleBtn : true,
352						toggleSwitch: typeof option.toggle_opts?.toggleSwitch != UNDEFINED ? option.toggle_opts.toggleSwitch : false,
353						toggleReset: typeof option.toggle_opts?.toggleReset != UNDEFINED ? option.toggle_opts.toggleReset : false,
354						spd: typeof option?.toggle_opts?.spd != UNDEFINED ? option.toggle_opts.spd : animSpd
355					},
356					close_opts: {
357						close: typeof option.close_opts?.close != UNDEFINED ? option.close_opts.close : false,
358						posi: typeof option.close_opts?.posi != UNDEFINED ? option.close_opts.posi : '.head_bottom',
359						html: typeof option.close_opts?.html != UNDEFINED ? option.close_opts.html : '<p><span>close</span></p>'
360					},
361					overlay_opts: {
362						overlay: typeof option.overlay_opts?.overlay != UNDEFINED ? option.overlay_opts.overlay : true,
363						posi: typeof option.overlay_opts?.posi != UNDEFINED ? option.overlay_opts.posi : '#header'
364					}
365				});
366				let url_path = location.pathname;
367				if ($(`${option.target} a[href^="${url_path}#"]`)[0]) {
368					$(`${option.target} a[href^="${url_path}#"]`).on('click', function (event) {
369						$(option.target).burgerMenu('close', option.name);
370					});
371				}
372			}
373		}
374
375		/* =============================================
376			megaMenuMotion
377		============================================= */
378		function megaMenuMotion(func_mode, opt) {
379			const UNDEFINED = 'undefined';
380			switch (func_mode) {
381				case 'load':
382					for (let i = 0; i < opt.length; i++) {
383						if (viewType == 'pc') {
384							if ($BODY.hasClass(opt[i]?.skinName) || opt[i]?.skinName == '' || typeof opt[i]?.skinName == UNDEFINED) {
385								plugin_megaMenu_exe(opt[i]);
386							}
387						}
388						if (viewType == 'sp') {
389							if ($(opt[i].target).parent('li').hasClass('mega_trigger')) {
390								$(opt[i].target).megaMenu('reset');
391							}
392						}
393					}
394					break;
395				case 'resize':
396					for (let i = 0; i < opt.length; i++) {
397						if ($BODY.hasClass(opt[i]?.skinName) || opt[i]?.skinName == '' || typeof opt[i]?.skinName == UNDEFINED) {
398							if (viewType == 'pc') {
399								if ($(opt[i].target).parent('li').hasClass('mega_trigger')) {
400									$(opt[i].target).megaMenu('rebind');
401								} else {
402									plugin_megaMenu_exe(opt[i]);
403								}
404							} else if (viewType == 'sp') {
405								if ($(opt[i].target).parent('li').hasClass('mega_trigger')) {
406									$(opt[i].target).megaMenu('reset');
407								}
408							}
409						}
410					}
411					break;
412			}
413			function plugin_megaMenu_exe(option) {
414				$(option.target).megaMenu({
415					deviceType: deviceType,
416					triggerMode: typeof option?.triggerMode != UNDEFINED ? option.triggerMode : 'hover',
417					pullDown: typeof option?.pullDown != UNDEFINED ? option.pullDown : false,
418					item: typeof option?.item != UNDEFINED ? option.item : '.megamenu_wrap > *',
419					overlayPosi: typeof option?.overlayPosi != UNDEFINED ? option.overlayPosi : '#skin',
420					close_opts: {
421						closeBtn: typeof option?.close_opts.closeBtn != UNDEFINED ? option.close_opts.closeBtn : false,
422						closeTag: typeof option?.close_opts.closeTag != UNDEFINED ? option.close_opts.closeTag : '<p><span>close</span></p>',
423						closeTagPosi: typeof option?.close_opts.closeTagPosi != UNDEFINED ? option.close_opts.closeTagPosi : '.megamenu_wrap > *'
424					},
425					spd: typeof option?.spd != UNDEFINED ? option.spd : animSpd,
426					openDelay: typeof option?.openDelay != UNDEFINED ? option.openDelay : animSpd / 2,
427					closeDelay: typeof option?.closeDelay != UNDEFINED ? option.closeDelay : animSpd / 2,
428					scrollHide: typeof option?.scrollHide != UNDEFINED ? option.scrollHide : false,
429					existJudg: typeof option?.existJudg != UNDEFINED ? option.existJudg : false,
430					activeAndo: typeof option?.activeAndo != UNDEFINED ? option.activeAndo : false,
431					outSideClose: typeof option?.outSideClose != UNDEFINED ? option.outSideClose : false
432				});
433			}
434		}
435
436		/* =============================================
437			accordionMotion
438		============================================= */
439		function accordionMotion(func_mode) {
440			// sample HTML description
441			// <div class="acc_wrap">
442			//   <div class="acc_title acc_trig"></div>
443			//   <div class="acc_item"></div>
444			// </div>
445			switch (func_mode) {
446				case 'load':
447					$('.acc_title').infoAccordion({
448						mode: 'pc',
449						triggerMode: 'click',
450						item: '.acc_item',
451						openSpeed: 300,
452						delaySpeed: 0,
453						allOpenBtn: '.all_open',
454						allCloseBtn: '.all_close',
455						interlocking: false,
456						parentClass: '.acc_wrap'
457					});
458					break;
459				case 'resize':
460					$('.acc_title.is-open').removeClass('is-open').next('.acc_item').hide();
461					break;
462			}
463		}
464
465		/* =============================================
466			headFix
467		============================================= */
468		function headerFixMotion(func_mode) {
469			if (headerPosition) {
470				if (func_mode == 'load') {
471					$('#header').headFix({
472						mode: viewType,
473						headerMargin: headerPosition,
474						responsive: responsiveMode,
475						targetMargin: '#main',
476						fixMode: 'default',
477						headScrollX: '#header',
478						scrollBefore: function () { },
479						scrollAfter: function () { }
480					});
481				} else {
482					$('#header').headFix('reMargin', {
483						targetMargin: '#main',
484						cssMargin: 'padding-top'
485					});
486				}
487			}
488		}
489
490		/* =============================================
491			toTop
492		============================================= */
493		function toTopMotion() {
494			$('.pagetop').toTop({
495				showStart: 100,
496				fix: headerPosition,
497				fixPosi: '#footer .pagetop_wrap',
498				addNum: -190,
499				fixStyle: { 'position': 'absolute' }
500			});
501		}
502
503		/* =============================================
504			fontSizeMotion
505		============================================= */
506		function fontSizeMotion() {
507			if ($('#font_sizer')[0]) {
508				$('#font_sizer').fontsizeChange({
509					target: $('html'),
510				});
511			}
512		}
513		/* =============================================
514			headerAllMotion font/lang/search
515		============================================= */
516		function headerAllMotion() {
517			// 対象となるセレクタをまとめて定義
518			const groups = [
519				{ $wrap: $('.h_search_wrap'), $btn: $('.h_search_btn') },
520				{ $wrap: $('.head_font_wrap'), $btn: $('.h_font_btn') },
521				{ $wrap: $('.h_lang_wrap'), $btn: $('.h_lang_btn') }
522			];
523
524			groups.forEach(group => {
525				const { $wrap, $btn } = group;
526
527				if (!$wrap.length) return;
528
529				$btn.on('click', function (e) {
530					e.stopPropagation();
531
532					// すでに自分が開いているなら、閉じる
533					if ($wrap.hasClass('open')) {
534						closeAll();
535						return;
536					}
537					// 他のすべてを一旦閉じてから、自分を開く
538					closeAll();
539					$wrap.addClass('open');
540					$btn.css('pointer-events', 'none');
541					// 外側クリックで閉じる設定
542					$('body').on('click', accClose);
543				});
544			});
545
546			// すべてを閉じる関数
547			function closeAll() {
548				$('.h_search_wrap, .head_font_wrap, .h_lang_wrap').removeClass('open');
549				$('.h_search_btn, .h_font_btn, .h_lang_btn').css('pointer-events', '');
550				$('body').off('click', accClose);
551			}
552
553			// 外側クリック判定
554			function accClose(e) {
555				// どのメニュー内でもない場所をクリックした場合のみ閉じる
556				if (!$(e.target).closest('.h_search_wrap, .head_font_wrap, .h_lang_wrap').length) {
557					closeAll();
558				}
559			}
560		}
561
562
563		/* =============================================
564			scroll table
565		============================================= */
566		function tableControlMotion() {
567			const TARGET_TABLE = '.scroll_table';
568			const TABLE_WRAP = 'scroll_wrap';
569			let offset = 20;
570			if ($(TARGET_TABLE)[0]) {
571				$(TARGET_TABLE).each(function () {
572					var $this = $(this);
573					if (!$this.closest('.' + TABLE_WRAP)[0]) {
574						$this.wrap('<div class="' + TABLE_WRAP + '"></div>');
575					}
576					new ScrollHint('.scroll_wrap', {
577						i18n: {
578							scrollable: $('body').hasClass('_ABC-en') ? 'Scrollable' : 'スクロールできます'
579						},
580						suggestiveShadow: true
581					});
582				});
583			}
584		}
585
586
587		/* =============================================
588			smoothScrollMotion
589		============================================= */
590		function smoothScrollMotion() {
591			$(`a[href*="#"]:not([href="#"]):not(.noSmooth):not([href*="TabModule"]):not([data-rel*="lightcase"]):not(a[modaal-type]),
592			area[href*="#"]:not([href="#"]):not(.noSmooth):not([href*="TabModule"]):not([data-rel*="lightcase"]):not(a[modaal-type])`).smoothScroll({
593				speed: animSpd,
594				fix: headerPosition,
595				fixItem: '#header',
596				animedAfter: function () {
597					// let href = $(location).attr('href');
598					// if (href.indexOf('#') != -1) {
599					// 	$('#header').headFix('scrollUp', '#header');
600					// }
601				}
602			});
603		}
604
605		/* =============================================
606			editorTabMotion
607		============================================= */
608		function editorTabMotion() {
609			// description
610			// sample HTML
611			// <div class="editTabParent">
612			//   <ul class="editTabNav"><li><a href="#hoge01" class="no_smooth">hogehoge</a></li></ul>
613			//   <div class="editTabItem">
614			//     <div id="item01" class="no_smoothAnchor"></div>  no_smoothAnchorはsmoothの対策(非表示だと座標取得がズレるため)
615			//   </div>
616			// </div>
617			const PARENT_CLASS = '.editTabParent';
618			const NAV_CLASS = '.editTabNav';
619			const ITEM_CLASS = '.editTabItem';
620			const ANCHOR_URL = location.href;
621			let loadScroll = false;
622			let scrollDistance;
623			let scrollOffset;
624			let hashTag;
625			if ($(PARENT_CLASS)[0]) {
626				$(PARENT_CLASS).each(function (index, el) {
627					const $this = $(this);
628					$this.attr('tab-num', index);
629					// Initial display.
630					hashTag = `#${ANCHOR_URL.split('#')[1]}`;
631					if (ANCHOR_URL.indexOf('#') != -1) {
632						if ($(`${PARENT_CLASS}[tab-num="${index}"] ${hashTag}`)[0]) {
633							// There is an anchor destination.
634							$(`${PARENT_CLASS}[tab-num="${index}"] ${NAV_CLASS} li a[href="${hashTag}"]`).parent('li').addClass('active');
635							$(`${PARENT_CLASS}[tab-num="${index}"] ${ITEM_CLASS}`).children(hashTag).addClass('active').show();
636							loadScroll = true;
637						} else {
638							// Show the first.
639							$(`${PARENT_CLASS}[tab-num="${index}"] ${NAV_CLASS}`).children('li').eq(0).addClass('active').children('a');
640							$(`${PARENT_CLASS}[tab-num="${index}"] ${ITEM_CLASS}`).children('div').eq(0).addClass('active').show();
641						}
642					} else {
643						// Show the first.
644						$(`${PARENT_CLASS}[tab-num="${index}"] ${NAV_CLASS}`).children('li').eq(0).addClass('active').children('a');
645						$(`${PARENT_CLASS}[tab-num="${index}"] ${ITEM_CLASS}`).children('div').eq(0).addClass('active').show();
646					}
647				});
648				// Scroll to the tab.
649				if (loadScroll) {
650					scrollDistance = $(hashTag).offset().top;
651					if (headerPosition) {
652						scrollOffset = scrollDistance - $('#header').innerHeight() - $(hashTag).parents(PARENT_CLASS).children(NAV_CLASS).innerHeight();
653					}
654					$('html').animate({ scrollTop: 0 }, 1);
655					$('html').animate({
656						scrollTop: scrollOffset
657					}, animSpd, 'linear');
658				}
659				// event listener
660				$(`${PARENT_CLASS} a[href^="#"], ${PARENT_CLASS} area[href^="#"]`).off().on({
661					'click keypress': function (event) {
662						const $this = $(this);
663						if (eventBoolean(event)) {
664							event.preventDefault();
665							tabExe($this);
666						}
667					}
668				});
669			}
670			function tabExe(click_target) {
671				const $this = $(click_target),
672					target_path = $this.attr('href'),
673					tab_num = $this.parents(PARENT_CLASS).attr('tab-num');
674				let target_offset = $(`${PARENT_CLASS}[tab-num="${tab_num}"]`).offset().top;
675				if ($(`${PARENT_CLASS} ${target_path}`)[0] && !$this.parents('li').hasClass('active')) {
676					$(`${PARENT_CLASS}[tab-num="${tab_num}"] ${NAV_CLASS} li`).removeClass('active');
677					$(`${PARENT_CLASS}[tab-num="${tab_num}"] ${NAV_CLASS} a[href="${target_path}"]`).parent('li').addClass('active');
678					$(`${PARENT_CLASS}[tab-num="${tab_num}"] ${ITEM_CLASS}`).children('div').removeClass('active').stop().fadeOut(animSpd / 2, function () { animCssReset(this); });
679					$(`${PARENT_CLASS}[tab-num="${tab_num}"] ${ITEM_CLASS}`).children(target_path).addClass('active').stop().delay(animSpd / 2).fadeIn(animSpd / 2, function () { animCssReset(this); });
680					if (headerPosition) {
681						target_offset -= $('#header').innerHeight();
682					}
683					const targetPosi = $(`${PARENT_CLASS}[tab-num="${tab_num}"] ${ITEM_CLASS}`).offset().top,
684						targetHeight = targetPosi - $(window).height();
685					if ($(window).scrollTop() < targetHeight + $(window).height() / 4) {
686						$('html, body').animate({
687							scrollTop: target_offset
688						}, animSpd, 'linear');
689					}
690				}
691			}
692		}
693
694		/* =============================================
695			pluginExists
696		============================================= */
697		function pluginExists(pluginName) {
698			return $.fn[pluginName] ? true : false;
699		}
700
701		/* =============================================
702			modaalMotion
703		============================================= */
704		function modaalMotion() {
705			if (pluginExists('modaal') && $('a[modaal-type]')[0]) {
706				$('a[modaal-type="inline"]').modaal({
707					type: 'inline',
708				});
709				// data-group="images" でグループ化
710				$('a[modaal-type="image"]').modaal({
711					type: 'image',
712				});
713				$('a[modaal-type="video"]').modaal({
714					type: 'video',
715				});
716				$('a[modaal-type="iframe"]').modaal({
717					type: 'iframe',
718					width: 1400,
719					height: 900
720				});
721			}
722		}
723
724		/* =============================================
725			lightcaseMotion
726		============================================= */
727		function lightcaseMotion() {
728			if (pluginExists('lightcase') && $('a[data-rel^="lightcase"]')[0]) {
729				$('a[data-rel^="lightcase"]').each(function (index, el) {
730					var $this = $(this);
731					$this.lightcase({
732						maxWidth: 1200,
733						maxHeight: 640,
734						inline: {
735							width: 1200,
736							height: 640
737						},
738						iframe: {
739							width: 1200,
740							height: 640,
741							frameborder: 0
742						}
743					});
744				});
745			}
746		}
747
748
749		/* =============================================
750								edit_slick
751		============================================= */
752		function editSlick() {
753			let opt_accessibility = true,
754				opt_arrows = true,
755				opt_asNavFor = null,
756				opt_autoplay = false,
757				opt_autoplaySpeed = animSpd * 10,
758				opt_centerMode = false,
759				opt_centerPadding = '0px',
760				opt_dots = true,
761				opt_draggable = true,
762				opt_fade = false,
763				opt_focusOnSelect = false,
764				opt_infinite = true,
765				opt_slidesToScroll = 1,
766				opt_slidesToShow = 1,
767				opt_slidesToShow_sp = 1,
768				opt_variableWidth = false,
769				opt_controls = true,
770				opt_responsiveSettings = [],
771				opt_breakpointWidth = spWidth;
772			if ($('.edit_slick')[0]) {
773				$('.edit_slick').each(function (index, el) {
774					$(this).addClass('edit_slick' + index);
775					if ($(this).attr('slick-spOnly') && $('body').hasClass('spView') || !$(this).attr('slick-spOnly')) {
776						let $slide = $('.edit_slick' + index);
777						let item = $(this).children().length;
778						option($slide);
779						slickMotion($slide, index);
780						if ($slide.hasClass('main_image')) {
781							$slide.on('beforeChange', function (event, slick, currentSlide, nextSlide) {
782								if (item <= opt_slidesToShow) {
783									$('#' + $slide.attr('slick-asnavfor')).slick('slickSetOption', 'infinite', true, true);
784								}
785							});
786						}
787					}
788					// option reset
789					opt_accessibility = true;
790					opt_arrows = true;
791					opt_asNavFor = null;
792					opt_autoplay = false;
793					opt_autoplaySpeed = animSpd * 10;
794					opt_centerMode = false;
795					opt_centerPadding = '0px';
796					opt_dots = true;
797					opt_draggable = true;
798					opt_fade = false;
799					opt_focusOnSelect = false;
800					opt_infinite = true;
801					opt_slidesToScroll = 1;
802					opt_slidesToShow = 1;
803					opt_variableWidth = false;
804					opt_responsiveSettings = [];
805					opt_controls = true;
806
807				});
808			}
809
810			function slick_boolean(data) { return (data == 'true') ? true : false; }
811			// Option definition.
812			function option(slide) {
813				if (slide.attr('slick-arrows')) { opt_arrows = slick_boolean(slide.attr('slick-arrows')); }
814				if (slide.attr('slick-asnavfor')) { opt_asNavFor = '#' + slide.attr('slick-asnavfor'); }
815				if (slide.attr('slick-autoplay')) { opt_autoplay = slick_boolean(slide.attr('slick-autoplay')); }
816				if (slide.attr('slick-autoplayspeed')) { opt_autoplaySpeed = slide.attr('slick-autoplayspeed'); }
817				if (slide.attr('slick-centermode')) { opt_centerMode = slick_boolean(slide.attr('slick-centermode')); }
818				if (slide.attr('slick-centerpadding')) { opt_centerPadding = slide.attr('slick-centerpadding'); }
819				if (slide.attr('slick-dots')) { opt_dots = slick_boolean(slide.attr('slick-dots')); }
820				if (slide.attr('slick-draggable')) { opt_draggable = slick_boolean(slide.attr('slick-draggable')); }
821				if (slide.attr('slick-fade')) { opt_fade = slick_boolean(slide.attr('slick-fade')); }
822				if (slide.attr('slick-focusonselect')) { opt_focusOnSelect = slick_boolean(slide.attr('slick-focusonselect')); }
823				if (slide.attr('slick-infinite')) { opt_infinite = slick_boolean(slide.attr('slick-infinite')); }
824				if (slide.attr('slick-slidestoscroll')) { opt_slidesToScroll = Number(slide.attr('slick-slidestoscroll')); }
825				if (slide.attr('slick-variablewidth')) { opt_variableWidth = slick_boolean(slide.attr('slick-variablewidth')); }
826				if (slide.attr('slick-slidestoshow')) {
827					if (Number(slide.attr('slick-slidestoshow')) >= slide.children().length) {
828						opt_slidesToShow = Number(slide.children().length);
829					} else {
830						opt_slidesToShow = Number(slide.attr('slick-slidestoshow'));
831					}
832				}
833				if (viewType == 'sp') {
834					if (slide.attr('slick-slidestoshow-sp')) {
835						if (Number(slide.attr('slick-slidestoshow-sp')) >= slide.children().length) {
836							opt_slidesToShow = Number(slide.children().length);
837						} else {
838							opt_slidesToShow = Number(slide.attr('slick-slidestoshow-sp'));
839						}
840					} else {
841						opt_slidesToShow = 1;
842					}
843				}
844				if (slide.attr('slick-controls')) {
845					opt_controls = slick_boolean(slide.attr('slick-controls'));
846				}
847				if (responsiveMode) {
848					opt_responsiveSettings = [{
849						breakpoint: opt_breakpointWidth + 1,
850						settings: {
851							slidesToShow: opt_slidesToShow
852						}
853					}, {
854						breakpoint: opt_breakpointWidth,
855						settings: {
856							slidesToShow: opt_slidesToShow
857						}
858					}, {
859						breakpoint: opt_breakpointWidth - 1,
860						settings: {
861							slidesToShow: opt_slidesToShow_sp
862						}
863					}];
864				}
865
866			}
867
868			function slickMotion(slideTarget, index) {
869				let targetClass = slideTarget.attr('slick-target'); // HTMLで指定
870				// 例:slick-target="arrow_box"
871				let navHtml = `<div class="slick-navigation contrNum${index}"></div>`;
872
873				if (targetClass && $('.' + targetClass).length > 0) {
874					// 指定されたクラス(arrow_boxなど)があれば、その中へ
875					$('.' + targetClass).append(navHtml);
876				} else {
877					// 指定がなければ、今まで通りスライダーの直前へ
878					slideTarget.before(navHtml);
879				}
880				slideTarget.slick({
881					accessibility: opt_accessibility,
882					arrows: opt_arrows,
883					prevArrow: '<div class="slick-prev slick-arrow" tabindex="0">Prev</div>',
884					nextArrow: '<div class="slick-next slick-arrow" tabindex="0">Next</div>',
885					asNavFor: opt_asNavFor,
886					autoplay: opt_autoplay,
887					autoplaySpeed: opt_autoplaySpeed,
888					centerMode: opt_centerMode,
889					centerPadding: opt_centerPadding,
890					dots: opt_dots,
891					draggable: opt_draggable,
892					fade: opt_fade,
893					focusOnSelect: opt_focusOnSelect,
894					infinite: opt_infinite,
895					slidesToScroll: opt_slidesToScroll,
896					slidesToShow: opt_slidesToShow,
897					variableWidth: opt_variableWidth,
898					responsive: opt_responsiveSettings,
899					appendArrows: (targetClass) ? $('.' + targetClass) : slideTarget.parent(),
900				});
901				if (opt_controls) {
902					$(`.slick-navigation.contrNum${index}`).append('<div class="controls-btn pause-btn" tabindex="0"></div>');
903					$(`.contrNum${index} .controls-btn`).on('click keydown', e => {
904						if (!(e.type === 'click' || e.which === 13)) {
905							return;
906						}
907						if ($(e.target).hasClass('pause-btn')) {
908							slideTarget.slick('slickPause');
909							$(e.target).removeClass('pause-btn').addClass('play-btn');
910						} else if ($(e.target).hasClass('play-btn')) {
911							slideTarget.slick('slickPlay');
912							$(e.target).removeClass('play-btn').addClass('pause-btn');
913						}
914					});
915
916					if (opt_arrows) {
917						$(`.edit_slick${index} + .arrow_box .slick-arrow`).attr('tabindex', 0).on('keydown', e => {
918							if (e.which !== 13) {
919								return;
920							}
921							if ($(e.target).hasClass('slick-prev')) {
922								slideTarget.slick('slickPrev');
923							} else if ($(e.target).hasClass('slick-next')) {
924								slideTarget.slick('slickNext');
925							}
926						});
927					}
928				}
929			}
930
931			let $slider = $('.slick-slider');
932			let $currentSlide = $slider.find('.slick-current');
933			$slider.find('a').attr('tabindex', '-1');
934			$currentSlide.find('a').attr('tabindex', '0');
935			let SetTabIndex = function () {
936				$currentSlide = $slider.find('.slick-current');
937				$slider.find('a').attr('tabindex', '-1');
938				$currentSlide.find('a').attr('tabindex', '0');
939			};
940			$slider.on('init', function (e, slick) {
941				SetTabIndex();
942			});
943			$slider.on('afterChange', function (e, slick, currentSlide) {
944				SetTabIndex();
945			});
946		}
947		/* =============================================
948			eventBoolean
949		============================================= */
950		function eventBoolean(e) {
951			let flag = false;
952			if (e.type == 'click') { flag = true; }
953			if (e.type == 'keypress') {
954				var keycode = (e.keyCode ? e.keyCode : e.which);
955				if (keycode == '13') {
956					flag = true;
957				}
958			}
959			return flag;
960		}
961
962		/* =============================================
963			animCssReset
964		============================================= */
965		function animCssReset(target) {
966			$(target).css({ 'height': '', 'padding-top': '', 'margin-top': '', 'padding-bottom': '', 'margin-bottom': '' });
967		}
968
969
970
971
972		/*=============================================
973				module animation
974		=============================================*/
975		function moduleAnimation() {
976			// init
977			var $target = $('.js_animate_section');
978			if ($target[0]) {
979				var targetPosi = [];
980				var targetItem = [];
981				var setPosi = $(window).innerHeight() / 8;
982				$target.each(function (index) {
983					index = index + 1;
984					var $this = $(this);
985					var posi = $this.offset().top + $('#header').outerHeight();
986					targetPosi.push(posi);
987					targetItem.push('.animation _content_' + index);
988					$this.addClass('animation_content_' + index);
989					if (setPosi >= posi) {
990						$this.addClass('show');
991					}
992				});
993			}
994
995			// scroll
996			$(window).on('load scroll', function () {
997				if ($target[0]) {
998					targetPosi = [];
999					setPosi = $(window).innerHeight() / 8;
1000					$target.each(function (index) {
1001						var $this = $(this);
1002						var posi = ($this.offset().top + setPosi) - $(window).height();
1003						targetPosi.push(posi);
1004						if (!$this.hasClass('show')) {
1005							positionControl(targetPosi[index], targetItem[index], $this);
1006						}
1007					});
1008				}
1009			});
1010			// positionControl
1011			function positionControl(posi, item, ele) {
1012				if ($(window).scrollTop() > posi && !$(item).hasClass('show')) {
1013					$(item).addClass('show');
1014					ele.addClass('show');
1015				}
1016			}
1017		}
1018
1019		/*=============================================
1020				indexKvAnim
1021		=============================================*/
1022		function indexKvAnim() {
1023			const $kv = $('.index_kv');
1024			if (!$kv.length) {
1025				return;
1026			}
1027
1028			const swiper = new Swiper('.index_kv', {
1029				loop: true,
1030				speed: 1000,
1031				effect: 'cube',
1032				cubeEffect: {
1033					shadow: false,
1034					slideShadows: false,
1035				},
1036				autoplay: {
1037					delay: 3000,
1038					pauseOnMouseEnter: true,
1039				},
1040				pagination: {
1041					el: '.index_kv_controll_pagination',
1042					clickable: true,
1043				},
1044				navigation: {
1045					nextEl: ".index_kv_controll_button-next",
1046					prevEl: ".index_kv_controll_button-prev",
1047				},
1048			});
1049
1050			const $btnAutoplay = $kv.find('.index_kv_controll_button-autoplay');
1051			$btnAutoplay.on('click', () => {
1052				if ($btnAutoplay.hasClass('pause')) {
1053					swiper.autoplay.start();
1054					$btnAutoplay.removeClass('pause');
1055				} else {
1056					swiper.autoplay.stop();
1057					$btnAutoplay.addClass('pause');
1058				}
1059			})
1060
1061			const $items = $($kv.find('.index_kv_item'));
1062			$items.each((i, el) => {
1063				const $item = $(el);
1064				const $img = $item.find('.img');
1065				const $popup = $item.find('.popup');
1066				const $close = $popup.find('.close');
1067				$img.on('click', () => {
1068					$popup.fadeIn();
1069					swiper.autoplay.stop();
1070				});
1071				$close.on('click', () => {
1072					$popup.fadeOut();
1073					swiper.autoplay.start();
1074				});
1075			});
1076		}
1077
1078		/*=============================================
1079				businessGroupMvAnim
1080		=============================================*/
1081		function businessGroupMvAnim() {
1082			const $mv = $('.business_group_top.video .mv');
1083			if (!$mv.length) {
1084				return;
1085			}
1086
1087			const $items = $($mv.find('.item'));
1088			const $mainText = $($mv.find('.main img'));
1089			$items.each((i, el) => {
1090				const $item = $(el);
1091				const viewport = viewType === 'pc' ? 1920 : 375;
1092				const dataY = viewType === 'pc' ? $item.data('y') : $item.data('spy');
1093				const dataX = viewType === 'pc' ? $item.data('x') : $item.data('spx');
1094				const posY = dataY / viewport * $mv.width();
1095				const posX = dataX / viewport * $mv.width();
1096				$item.css({ 'top': `calc(50% - ${$item.height() / 2}px)`, 'left': `calc(50% - ${$item.width() / 2}px)` });
1097				$item.animate({ 'top': posY, 'left': posX }, 900, 'swing');
1098			});
1099			$mainText.each((i, el) => {
1100				const $text = $(el);
1101				setTimeout(() => {
1102					$text.addClass('onLoad');
1103				}, 30 * i + 900)
1104			});
1105
1106			$(window).on('resize', () => {
1107				$items.each((i, el) => {
1108					const $item = $(el);
1109					const viewport = viewType === 'pc' ? 1920 : 375;
1110					const dataY = viewType === 'pc' ? $item.data('y') : $item.data('spy');
1111					const dataX = viewType === 'pc' ? $item.data('x') : $item.data('spx');
1112					const posY = dataY / viewport * $mv.width();
1113					const posX = dataX / viewport * $mv.width();
1114					$item.css({ 'top': posY, 'left': posX });
1115				})
1116			});
1117
1118			$(window).on('mousemove', (e) => {
1119				const cursorY = e.clientY - $(window).innerHeight() / 2;
1120				const cursorX = e.clientX - $(window).innerWidth() / 2;
1121				$items.each((i, el) => {
1122					const $item = $(el);
1123					$item.css({ 'transform': `translate(${cursorX / ((i % 4 + 1) * 20)}px, ${cursorY / ((i % 4 + 1) * 20)}px)` });
1124				})
1125			})
1126		}
1127
1128		/* =============================================
1129			scrollAnim
1130		============================================= */
1131		function scrollAnim() {
1132			const $target = $('.js-scrollAnim');
1133			const scrollOffset = viewType === 'pc' ? 100 : 60;
1134			if ($target.length) {
1135				$(window).on('scroll', () => {
1136					const scrollPos = $(window).scrollTop();
1137					$target.each((i, el) => {
1138						const targetPos = $(el).offset().top - $(window).innerHeight() + scrollOffset;
1139						if (scrollPos > targetPos) {
1140							$(el).addClass('visible');
1141						}
1142					});
1143				});
1144			}
1145		}
1146
1147		/* =============================================
1148			cookie
1149		============================================= */
1150		function cookie() {
1151			if ($('#cookie_license .consent_btn')[0]) {
1152				if (!$.cookie('cookie_license')) {
1153					$.cookie('cookie_license', 'show', { expires: 1, path: '/' });
1154				}
1155				if ($.cookie('cookie_license') == 'consent' || $.cookie('cookie_license') == 'cancel') {
1156					$('#cookie_license').hide(0);
1157				}
1158				$('#cookie_license .consent_btn').on('click', function (event) {
1159					event.preventDefault();
1160					$.cookie('cookie_license', 'consent', { expires: 90, path: '/' });
1161					$('#cookie_license').fadeOut(animSpd);
1162				});
1163				$('#cookie_license .cancel_btn').on('click', function (event) {
1164					event.preventDefault();
1165					$.cookie('cookie_license', 'cancel', { expires: 90, path: '/' });
1166					$('#cookie_license').fadeOut(animSpd);
1167				});
1168			}
1169		}
1170
1171
1172		/* =============================================
1173			Initialize
1174		============================================= */
1175		function initialize() {
1176			$('a[href="#"]').on('click', function (event) {
1177				event.preventDefault();
1178			});
1179		}
1180	});
1181})(jQuery);

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.