PageSourceSearch

https://cocon-jewelry.com/assets/js/libs.js

js cocon-jewelry.com collected 2026-10-04 19:11:49 UTC 6,607 bytes, 252 lines download raw bytes

1$(function () {
2
3
4
5	// ロールオーバー
6	$('.imgover').not('[src*="' + '_ov' + '."]').hover(function () {
7		$(this).stop().attr('src', $(this).attr('src').replace(/\.(gif|jpe?g|png)$/, '_ov.$1'));
8	}, function () {
9		$(this).stop().attr('src', $(this).attr('src').replace(/_ov\.(gif|jpe?g|png)$/, '.$1'));
10	});
11
12	// ナビゲーションのカレント表示
13	if ($('#pageID').length == 1) {
14		var ides = $('#pageID').val().split(',');
15		for (var idx = 0; idx < ides.length; idx++) {
16			var id = '#' + ides[idx];
17			if ($(id).length == 1) {
18				$(id).removeClass('imgover').attr('src', $(id).attr('src').replace(/\.(gif|jpe?g|png)$/, '_ov.$1'));
19			}
20		}
21	}
22	let hh;
23	function headerHeight() {
24		hh = $('.l-header').outerHeight() - 20;
25	}
26	$(window).on("orientationchange resize", function () {
27		headerHeight();
28	});
29	// ページ内スクロールリンク
30	$('a[href*=\\#]').click(function () {
31		if ($(this.hash).length > 0) {
32			$(this.hash).each(function () {
33				$('html, body').animate({ scrollTop: $(this).offset().top - hh }, 500);
34			});
35		}
36	});
37
38	// 別ページからの遷移スクロールリンク
39	if (location.hash) {
40		var anchor = $(location.hash).offset().top - hh;
41		$('html, body').scrollTop(0).animate({ scrollTop: anchor }, 500);
42	}
43
44	/* Functionの実行
45	------------------------------*/
46	responsive();
47	imageWidth();
48	linkTel();
49	headerHeight();
50});
51
52/* リサイズ
53------------------------------*/
54var timer = false;
55$(window).resize(function () {
56	if (timer !== false) { clearTimeout(timer); }
57	timer = setTimeout(function () {
58		responsive();
59		imageWidth();
60		linkTel();
61	}, 10);
62});
63
64/* Function
65------------------------------*/
66// ブレイクポイント
67function responsive() {
68	var widthCurrent = window.innerWidth ? window.innerWidth : $(window).width();
69	var widthSmartphone = 768;
70
71	if (widthCurrent < widthSmartphone) {
72		modeSmartphone = true;
73	} else {
74		modeSmartphone = false;
75	}
76}
77
78// PC・SP:画像幅切り替え
79function imageWidth() {
80	$('[data-width]').each(function () {
81		var dataWidth = $(this).data('width');
82
83		if (modeSmartphone) {
84			$(this).css('max-width', dataWidth + 'px');
85		} else {
86			$(this).removeAttr('style');
87		}
88	});
89}
90
91// SP:電話番号にリンク付与
92function linkTel() {
93	$('[data-tel]').each(function () {
94		var dataTel = $(this).data('tel');
95
96		if (modeSmartphone) {
97			$(this).attr('href', 'tel:' + dataTel);
98		} else {
99			$(this).removeAttr('href');
100		}
101	});
102}
103
104let navFlag = false;
105$(function () {
106	//ハンバーガーメニュー
107	$('.m-menu-btn').on('click', function () {
108		navOpen();
109	});
110	$('.m-close-button').on('click', function () {
111		navClose();
112	})
113
114
115	function navOpen() {
116		$('.l-header').addClass('is-open');
117		let scrollpos = $(window).scrollTop();
118		/* $('body').addClass('is-fixed').css({ 'top': -scrollpos }); */
119		navFlag = true;
120	};
121	function navClose() {
122		$('.l-header').removeClass('is-open');
123		/* $('body').removeClass('is-fixed').css({ 'top': 0 }); */
124		window.scrollTo(0, scrollpos);
125		navFlag = false;
126	};
127
128	$('.bl_faq__button').on('click', function () {
129		$(this).parent('.bl_faq_q').toggleClass('is_faq_open');
130		$(this).parent('.bl_faq_q').next('.bl_faq_a').slideToggle();
131	})
132
133	//inview
134	$('.fade-up').on('inview', function (event, isInView) {
135		if (isInView) {
136			// .visibleがビューポートに入った場合
137			$(this).addClass('effect');
138		}
139	});
140
141	//フッター背景画像切り替え
142	let bgNum = 18; //フッター背景画像の枚数
143	$(window).on('load', function () {
144		let num = 1 + Math.floor(Math.random() * bgNum);
145		if (num < 10) {
146			num = '0' + num;
147		}
148		let bgClassName = 'l-bg' + num;
149		$('.l-footer-bg-text__wrapper').addClass(bgClassName);
150	});
151	$('body').removeClass('preload');
152});
153
154/*
155* css swicher
156*/
157function css_browser_selector(u) {
158	var ua = u.toLowerCase(),
159		is = function (t) { return ua.indexOf(t) > -1 },
160		e = 'edge', g = 'gecko', w = 'webkit', s = 'safari', o = 'opera', m = 'mobile',
161		h = document.documentElement,
162		b = [
163			(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + RegExp.$1) :
164				!(/opera|webtv/i.test(ua)) && is('trident') && /rv:(\d+)/.test(ua) ? ('ie ie' + RegExp.$1) :
165					is('edge/') ? e :
166						is('firefox/2') ? g + ' ff2' :
167							is('firefox/3.5') ? g + ' ff3 ff3_5' :
168								is('firefox/3.6') ? g + ' ff3 ff3_6' : is('firefox/3') ? g + ' ff3' :
169									is('gecko/') ? g :
170										is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 :
171											(/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) :
172											is('konqueror') ? 'konqueror' :
173												is('blackberry') ? m + ' blackberry' :
174													is('android') ? m + ' android' :
175														is('chrome') ? w + ' chrome' :
176															is('iron') ? w + ' iron' :
177																is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') :
178																	is('mozilla/') ? g :
179																		'',
180			is('j2me') ? m + ' j2me' :
181				is('iphone') ? m + ' iphone' :
182					is('ipod') ? m + ' ipod' :
183						is('ipad') ? m + ' ipad' :
184							is('mac') ? 'mac' :
185								is('darwin') ? 'mac' :
186									is('webtv') ? 'webtv' :
187										is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : '') :
188											is('freebsd') ? 'freebsd' :
189												(is('x11') || is('linux')) ? 'linux' :
190													'',
191			'js'];
192	c = b.join(' ');
193	h.className += ' ' + c;
194	return c;
195};
196css_browser_selector(navigator.userAgent);
197
198
199const setFillHeight = function sf() {
200	const vh = window.innerHeight * 0.01;
201	document.documentElement.style.setProperty('--vh', vh + 'px');
202}
203
204let vw = window.innerWidth;
205
206window.addEventListener('resize', function () {
207	if (vw === window.innerWidth) {
208		// 画面の横幅にサイズ変動がないので処理を終える
209		return;
210	}
211
212	// 画面の横幅のサイズ変動があった時のみ高さを再計算する
213	vw = window.innerWidth;
214	setFillHeight();
215});
216
217// 初期化
218setFillHeight();
219
220
221$('.l-creator .swiper').each(function (i) {
222	let num = i + 1;
223	let sliderNum = 'slider' + num;
224	let sliderName = '.slider' + num;
225	let pagenationName = '.swiper-pagination' + num;
226	sliderNum = new Swiper(sliderName, {
227		preloadImages:!!0,
228		loop: true,
229		autoplay: {
230			number: 8000
231		},
232		speed: 2000,
233		effect: 'fade',
234		pagination: {
235			el: pagenationName,
236			type: 'fraction', //ページネーションの種類
237			clickable: true, //クリックに反応させる
238		},
239		navigation: {
240			nextEl: '.swiper-button-next',
241			prevEl: '.swiper-button-prev',
242		},
243		breakpoints: {
244			767.98: {
245				pagination: {
246					type: 'bullets',
247				}
248			},
249		},
250	});
251
252})

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.