PageSourceSearch

https://www.komazawa.net/lib/wp-content/themes/my-theme/assets/js/cmn.js

js komazawa.net collected 2026-10-05 18:36:38 UTC 9,187 bytes, 267 lines download raw bytes

1
2
3$(function(){
4	
5	// main-container内の target="_blank" を持つすべてのリンクを取得
6    $('.main-container a[target="_blank"]').each(function() {
7        // link-pdf または link-exe クラスを持っている場合、または .pdf-list クラス内に存在する場合、または <img> タグを含む場合は処理をスキップ
8        if (!$(this).hasClass('link-pdf') && 
9            !$(this).hasClass('link-exe') && 
10            !$(this).closest('.pdf-list').length &&
11            !$(this).find('img').length) {
12            // リンクのテキストを取得してspanタグで包む
13            $(this).html('<span>' + $(this).html() + '</span>');
14        }
15    });
16	/*---bm---*/
17	
18	var bm = 0;
19	$('#bm a').on('click', function(){
20		$('body').toggleClass('open');
21		if($('body').hasClass('open')){
22			bm ++;
23			if(bm%3 == 0){
24				$('#nav .container').removeClass('bg1 bg2');
25				$('#nav .container').addClass('bg0');
26			}else if(bm%3 == 1){
27				$('#nav .container').removeClass('bg2 bg0');
28				$('#nav .container').addClass('bg1');
29			}else if(bm%3 == 2){
30				$('#nav .container').removeClass('bg0 bg1');
31				$('#nav .container').addClass('bg2');
32			}
33		}
34		return false;
35	});
36	$('#nav dt').on('click', function(){
37		if(window.innerWidth <= 768){
38			if($(this).hasClass('open')){
39				$(this).removeClass('open');
40				$(this).parent().children('dd').slideUp();
41			}else{
42				$('#nav dt').removeClass('open');
43				$('#nav dd').slideUp();
44				$(this).addClass('open');
45				$(this).parent().children('dd').css({opacity: 0}).animate({opacity: 1}, 800, 'easeInOutQuad').slideDown({queue: false});
46			}
47			return false;
48		}
49	});
50	/*---a_nav---*/
51	$(document).ready(function() {
52		// 最初にすべてのサブメニューをスライドアップして非表示にする
53		$('#a_nav ul > li > ul').hide();
54		
55		// aria-current="page" 属性を持つリンクが含まれるサブメニューを表示する
56		$('#a_nav a[aria-current="page"]').each(function() {
57			var $link = $(this);
58			var $submenu = $link.closest('li').children('ul'); // サブメニューの親ULを取得
59	
60			// 現在のページのリンクにクラスを追加
61			$link.addClass('disabled');
62			
63			// サブメニューを表示
64			$submenu.show();
65	
66			// 上位のUL(親サブメニュー)も表示する
67			var $currentLi = $link.closest('li');
68			while ($currentLi.length) {
69				var $parentUl = $currentLi.closest('ul');
70				if ($parentUl.length) {
71					$parentUl.show();
72				}
73				$currentLi = $parentUl.closest('li');
74			}
75		});
76	});
77	
78	/*---snav stickbtn---*/
79	$(window).scroll(function(){
80		var sc = $(this).scrollTop();
81		if(sc >= 500){
82			$('#snav').removeClass('show');
83		}else{
84			$('#snav').addClass('show');
85		}
86		if(sc >= window.innerHeight){
87			$('#stickbtn').addClass('show');
88		}else{
89			$('#stickbtn').css({'transition': '0.5s transform'}).removeClass('show');
90		}
91	});
92	
93	/*---delay---*/
94	$('.delay').on('inview', function(event, isInView, visiblePartX, visiblePartY){
95		if(isInView){
96			$(this).stop().addClass('delayActive');
97		}else{
98			//$(this).stop().removeClass('delayActive');
99		}
100	});
101	
102	/*---pagelink---*/
103	var hash = location.hash;
104	if(hash){
105		$('body,html').stop().scrollTop(0);
106		$(window).load(function(){
107			pageScroll(hash, 0);
108		});
109	}
110	$('a[href*=#][href!=#]:not(.no):not([target="_blank"])').click(function(){
111		var url = location.pathname;
112		var href = $(this).attr("href");
113		var path = href.split('#');//path[0]
114		if(url == path[0] || path[0] == ''){
115			pageScroll('#'+path[1], 1);
116			return false;
117		}
118	});
119	function pageScroll(i, t){
120		var target = $(i === "#" || i === "" ? 'html' : i);
121		var position = target.offset().top;
122		var offset = 60;
123		position = position - offset;
124		$('body,html').animate({scrollTop: position}, 1000, 'easeInOutCubic');
125	}
126	
127	/*---sc---*/
128	$(window).scroll(function(){
129		var sc = $(this).scrollTop();
130		if(sc >= window.innerHeight){
131			$('body').addClass('sc');
132		}else{
133			$('body').removeClass('sc');
134		}
135	});
136	
137	/*---slick--*/
138	$('#s_manga .sl').slick({
139		autoplay: false,
140		infinite: false,
141		adaptiveHeight: false,
142		arrows: true,
143		rtl: true,
144		speed: 400,
145		slidesToShow: 2,
146		slidesToScroll: 2,
147		responsive: [
148			{
149				breakpoint: 1000,
150				settings:{
151					slidesToShow: 1,
152					slidesToScroll: 1,
153				}
154			},
155		],
156	});
157	/*---slick--*/
158	$('.club-slide .sl').slick({
159		autoplay: false,
160		infinite: true,
161		adaptiveHeight: false,
162		dots: true,
163		dotsClass: 'dots',
164		speed: 400,
165		slidesToShow: 1,
166		slidesToScroll: 1,
167		responsive: [
168			{
169				breakpoint: 1000,
170				settings:{
171					slidesToShow: 1,
172					slidesToScroll: 1,
173				}
174			},
175		],
176	});
177	$('.admission #bn .sl').slick({
178		autoplay: true,
179		adaptiveHeight: false,
180		arrows: false,
181		autoplaySpeed: 3500,
182		dots: true,
183		dotsClass: 'dots',
184		slidesToScroll: 1,
185		slidesToShow: 5,
186		speed: 400,
187		responsive: [
188			{
189				breakpoint: 1300,
190				settings:{
191					slidesToShow: 4,
192				}
193			},
194			{
195				breakpoint: 1000,
196				settings:{
197					slidesToShow: 3,
198				}
199			},
200			{
201				breakpoint: 768,
202				settings:{
203					slidesToShow: 2,
204					centerMode: true,
205					centerPadding: '40px',
206				}
207			},
208			{
209				breakpoint: 500,
210				settings:{
211					slidesToShow: 1,
212					centerMode: true,
213					centerPadding: '50px',
214				}
215			},
216		],
217	});
218	/*---郵便番号自動入力---*/
219	jQuery('#zip').keyup(function(event){
220		AjaxZip3.zip2addr(this,'','your_pref','your_address');
221	});
222	
223	/*---aichatbot--*/
224
225	$('#aibot>a').on('click', function(){
226		$('#aibot').toggleClass('open');
227		return false;
228	});
229	$(document).on('click', function(event){
230		if(!$(event.target).closest('#aibot.open').length){
231			$('#aibot').removeClass('open');
232		}
233	});
234})
235$(document).ready(function() {
236    $("#imageModal").hide();
237    $(".club-album .object-fit-cover").on("click", function() {
238        var imgSrc = $(this).attr("src");
239        $("#modalImage").attr("src", imgSrc);
240        $("#imageModal").fadeIn(); 
241    });
242    $(".modal-close").on("click", function() {
243        $("#imageModal").fadeOut();
244    });
245    $("#imageModal").on("click", function(event) {
246        if ($(event.target).is("#imageModal")) {
247            $("#imageModal").fadeOut(); 
248        }
249    });
250});
251$(window).load(function(){
252	/*---loading---*/
253	$('body').addClass('loaded');
254});
255
256/*!
257 * @copyright Copyright (c) 2017 IcoMoon.io
258 * @license   Licensed under MIT license
259 *            See https://github.com/Keyamoon/svgxuse
260 * @version   1.2.6
261 */
262(function(){if("undefined"!==typeof window&&window.addEventListener){var e=Object.create(null),l,d=function(){clearTimeout(l);l=setTimeout(n,100)},m=function(){},t=function(){window.addEventListener("resize",d,!1);window.addEventListener("orientationchange",d,!1);if(window.MutationObserver){var k=new MutationObserver(d);k.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0});m=function(){try{k.disconnect(),window.removeEventListener("resize",d,!1),window.removeEventListener("orientationchange",
263d,!1)}catch(v){}}}else document.documentElement.addEventListener("DOMSubtreeModified",d,!1),m=function(){document.documentElement.removeEventListener("DOMSubtreeModified",d,!1);window.removeEventListener("resize",d,!1);window.removeEventListener("orientationchange",d,!1)}},u=function(k){function e(a){if(void 0!==a.protocol)var c=a;else c=document.createElement("a"),c.href=a;return c.protocol.replace(/:/g,"")+c.host}if(window.XMLHttpRequest){var d=new XMLHttpRequest;var m=e(location);k=e(k);d=void 0===
264d.withCredentials&&""!==k&&k!==m?XDomainRequest||void 0:XMLHttpRequest}return d};var n=function(){function d(){--q;0===q&&(m(),t())}function l(a){return function(){!0!==e[a.base]&&(a.useEl.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+a.hash),a.useEl.hasAttribute("href")&&a.useEl.setAttribute("href","#"+a.hash))}}function p(a){return function(){var c=document.body,b=document.createElement("x");a.onload=null;b.innerHTML=a.responseText;if(b=b.getElementsByTagName("svg")[0])b.setAttribute("aria-hidden",
265"true"),b.style.position="absolute",b.style.width=0,b.style.height=0,b.style.overflow="hidden",c.insertBefore(b,c.firstChild);d()}}function n(a){return function(){a.onerror=null;a.ontimeout=null;d()}}var a,c,q=0;m();var f=document.getElementsByTagName("use");for(c=0;c<f.length;c+=1){try{var g=f[c].getBoundingClientRect()}catch(w){g=!1}var h=(a=f[c].getAttribute("href")||f[c].getAttributeNS("http://www.w3.org/1999/xlink","href")||f[c].getAttribute("xlink:href"))&&a.split?a.split("#"):["",""];var b=
266h[0];h=h[1];var r=g&&0===g.left&&0===g.right&&0===g.top&&0===g.bottom;g&&0===g.width&&0===g.height&&!r?(f[c].hasAttribute("href")&&f[c].setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),b.length&&(a=e[b],!0!==a&&setTimeout(l({useEl:f[c],base:b,hash:h}),0),void 0===a&&(h=u(b),void 0!==h&&(a=new h,e[b]=a,a.onload=p(a),a.onerror=n(a),a.ontimeout=n(a),a.open("GET",b),a.send(),q+=1)))):r?b.length&&e[b]&&setTimeout(l({useEl:f[c],base:b,hash:h}),0):void 0===e[b]?e[b]=!0:e[b].onload&&(e[b].abort(),
267delete e[b].onload,e[b]=!0)}f="";q+=1;d()};var p=function(){window.removeEventListener("load",p,!1);l=setTimeout(n,0)};"complete"!==document.readyState?window.addEventListener("load",p,!1):p()}})();

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.