PageSourceSearch

https://bclover.jp/assets/js/jquery.common.js?1790274794

js bclover.jp collected 2026-09-24 18:35:44 UTC 6,398 bytes, 235 lines download raw bytes

1/*-----------------------------------------------
2 * Root
3-------------------------------------------------*/
4var root = $("body").data('root');
5var page = $("body").data('page');
6
7const pcOnly = window.matchMedia('(min-width: 768px)');
8const spOnly = window.matchMedia('(max-width: 767px)');
9
10/*-----------------------------------------------
11 * MOVIE
12-------------------------------------------------*/
13function movie(_ytid) {
14	$('#youtubeModal').fadeIn(500);
15	$('.modalBox').fadeIn(500);
16	var ytURL = 'https://www.youtube.com/embed/' + _ytid + '?autoplay=1&rel=0';
17	setTimeout(function () {
18		$('.js-youtubeIframe').attr('src', ytURL);
19	}, 100);
20	$('body').css({ 'overflow': 'hidden' });
21}
22
23// YouTube Iframe 二重再生防止 [movie1つのみ]
24$(".js-moviePlay").on('click', function () {
25	if(page === 'top'){
26		player.stopVideo();
27	}
28	$('body').addClass('--yt-apmov-stop');
29	$(".js-modalBox").addClass('js-modalplayClose');
30});
31
32$(document).on('click', '.js-modalplayClose a.js-modalClose', function () {
33	 if(page === 'top'){
34		player.playVideo();
35	 }
36	$(".modalBox").removeClass('js-modalplayClose');
37	$('body').removeClass('--yt-apmov-stop');
38});
39
40$(document).on('click', '.js-modalplayClose .js-oneModalIn', function (e) {
41	 if(page === 'top'){
42		player.playVideo();
43	 }
44	$(".modalBox").removeClass('js-modalplayClose');
45	$('body').removeClass('--yt-apmov-stop');
46});
47/*-----------------------------------------------
48 * COMMON
49-------------------------------------------------*/
50$(function(){
51	// Anchor Smooth Scroll
52	$('.js-anchor').on('click', function(){
53		var speed = 1000;
54		var href= $(this).attr("href");
55		var target = $(href == "#" || href == "" ? 'html' : href);
56		var position = target.offset().top;
57		$('body,html').animate({scrollTop:position}, speed, 'easeOutQuart');
58		return false;
59	});
60
61	// Menu
62	$('.js-menu').on('click', function(){
63		$(this).toggleClass('is-active');
64		
65		if($(this).hasClass('is-active')){
66			$('.js-header').addClass('is-active');
67		} else {
68			$('.js-header').removeClass('is-active');
69		}
70	});
71
72	$(".headerNav-Link").on('click', function(){
73		$('.js-header').removeClass('is-active');
74		$('.js-menu').removeClass('is-active');
75	});
76
77
78	/**
79	 * Modal open
80	 */
81	// Common
82	$('.js-modalOpen').on('click', function(){
83		var modalID = $(this).data('modal');
84		$('#' + modalID).fadeIn(500);
85		$('.modalBox').fadeIn(500);
86		$('body,html').css({'overflow':'hidden'});
87	});
88
89	// Youtube
90	$('.js-youtubePlay').on('click', function(){
91		var ytID = $(this).data('ytid');
92		var ytURL = 'https://www.youtube.com/embed/'+ytID+'?autoplay=1&rel=0';
93		setTimeout(function(){
94			$('.js-youtubeIframe').attr('src',ytURL);
95		},100);
96	});
97
98	// Goods
99	if($('.js-goodsModal')[0]) {
100		$('.js-goodsModal').on('click', function(e){
101			e.preventDefault();
102			var goodsURL = $(this).attr('href');
103			$('.js-goodsIframe').attr('src',goodsURL);
104		});
105	}
106
107	/**
108	 * Modal close
109	 * iframeのsrcをcloseの際に消す
110	 */
111	var $modalIF = $('.js-youtubeIframe, .js-goodsIframe');
112
113	// Close処理
114	function modalClose() {
115		$('.modalBox').fadeOut(500);
116		$('.modalBox .oneModal').fadeOut(500);
117		setTimeout(function(){
118			$modalIF.attr('src','');
119		},500);
120		$('body,html').css({'overflow':''});
121	}
122
123	// Closeボタン
124	$('.js-modalClose').on('click', function(){
125		modalClose();
126	});
127
128	// Close エリア外
129	$('.js-oneModalIn').on('click touchend', function(e) {
130		if (!$(e.target).closest('.js-oneModalIn__cont').length) {
131			modalClose();
132		}
133	});
134
135	// アクセス時自動モーダル
136	if($("#test")[0]){
137		// $("#test").click()
138	}
139
140
141});
142
143
144/*-----------------------------------------------
145* imageModal
146-------------------------------------------------*/
147function imageModal(_i){
148	if(_i){
149	  var img = _i;
150	}else{
151	  var img = $(this).html();
152	}
153}
154  $(".js-imageModal").on('click',function(){
155	var img = $(this).html();
156	$(".js-imageModal_cont").html(img);
157	$('#imageModal .oneModal').css({'display':'block'});
158	$('#imageModal').fadeIn(500).css({'display':'flex'});
159	$('body,html').css({'overflow':'hidden'});
160  });
161  
162  function imageModalClose(){
163	$('#imageModal').fadeOut(500);
164	$('body,html').css({'overflow':''});
165  }
166  
167  $(".js-imageModalClose").on('click',function(){
168	imageModalClose();
169  });
170  
171  $('.js-imageModalin').on('click touchend', function (e) {
172	if (!$(e.target).closest('.js-imageModal_cont').length) {
173	  imageModalClose();
174	}
175  });
176  
177
178/*-----------------------------------------------
179 * ACCESS HISTORY [セッションストレージを使用して初回アクセスか判定するやつ]
180----------------------------------------------- */
181function accessHistory() {
182	const keyName = 'visited';
183	const keyValue = true;
184	if (!sessionStorage.getItem(keyName)) {
185		//FIRST ACCESS
186		sessionStorage.setItem(keyName, keyValue);
187		return true;
188	} else {
189		$('body').addClass('is-visited'); 
190		return false;
191	}
192}
193$(document).ready(accessHistory());
194
195
196/*-----------------------------------------------
197 * ScrollAnimation for IntersectionObserver [.js-scrani 要素が見えたら is-ani をaddclass するやつ]
198-------------------------------------------------*/
199const set_scrani = () =>{
200	const SCRANI_ACTIVE_CLASSNAME = 'is-ani';
201	const scrani_callback = (entries) => {
202		//各 entry(IntersectionObserverEntry オブジェクト)に対して
203		entries.forEach( (entry) => {
204			//監視対象の要素が領域内に入った場合の処理
205			if (entry.isIntersecting) {
206				//監視対象の要素(entry.target)に is-ani クラスを追加
207				entry.target.classList.add(SCRANI_ACTIVE_CLASSNAME);
208			}
209		});
210	}
211	const scrani_option = {
212		rootMargin: '-10% 0px',
213	}
214	const scrani_observer = new IntersectionObserver(scrani_callback, scrani_option);
215
216	const target_scrani = document.querySelectorAll('.js-scrani');
217	//全ての監視対象要素を observe() メソッドに指定
218	target_scrani.forEach( (elem) => {
219		//observe() に監視対象の要素を指定
220		scrani_observer.observe(elem);
221	});
222}
223
224setTimeout(function(){
225	//set_scrani();
226},200);
227
228$(window).on('load', function(){
229	setTimeout(function(){
230		$('body').addClass('-loaded');
231		setTimeout(function(){
232			set_scrani();
233		},1200);
234	},400);
235});

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.