PageSourceSearch

https://airsleep.jp/js/script.js

js airsleep.jp collected 2026-09-25 21:06:12 UTC 20,371 bytes, 744 lines download raw bytes

1"use strict";
2(function () {
3	let ready_fn = function () {
4		// scroll
5		(function () {
6			$('a[href^="#"]').on("click", function () {
7				var speed = 500;
8				var href = $(this).attr("href");
9				var target = $(href == "#" || href == "" ? "html" : href);
10				var position = target.offset().top;
11				$("html, body").animate({ scrollTop: position }, speed, "swing");
12				return false;
13			});
14		})();
15
16		/* slider */
17		(function () {
18			if (typeof jQuery.fn.nivoSlider == "function") {
19				$("#slider").nivoSlider({
20					effect: "slideInLeft",
21					animSpeed: 500,
22					pauseTime: 4000,
23				});
24
25				$("#slider_sp").nivoSlider({
26					effect: "slideInLeft",
27					animSpeed: 500,
28					pauseTime: 4000,
29				});
30
31				$(".prd_slider").nivoSlider({
32					effect: "slideInLeft",
33					animSpeed: 500,
34					pauseTime: 4000,
35				});
36			}
37		})();
38
39		/* slick */
40		(function () {
41			var w = $(window).innerWidth();
42
43			if (typeof jQuery.fn.slick == "function") {
44				$(".lineup_prod").slick({
45					autoplay: true,
46					infinite: true,
47					speed: 300,
48					autoplaySpeed: 4000,
49					slidesToShow: 1,
50					variableWidth: true,
51				});
52
53				// if (w <= 900) {
54				// 	$(".style_clm_sp").slick({
55				// 		autoplay: true,
56				// 		infinite: true,
57				// 		speed: 300,
58				// 		autoplaySpeed: 4000,
59				// 		slidesToShow: 1,
60				// 		variableWidth: true,
61				// 	});
62				// }
63			}
64		})();
65
66		// width height
67		(function () {
68			var h = $(window).innerHeight();
69			var w = $(window).innerWidth();
70
71			var posi_about = w - (w / 2 + 310);
72			var posi_lineup = w - (w / 2 + 203);
73			var posi_style = w - (w / 2 + 96);
74			var posi_voice = w - (w / 2 - 10);
75			var posi_shop = w - (w / 2 - 116);
76			var posi_faq = w - (w / 2 - 222);
77
78			/*
79			var posi_about = w-((w/2)+257);
80			var posi_lineup = w-((w/2)+150);
81			var posi_style = w-((w/2)+43);
82			var posi_voice = w-((w/2)-64);
83			var posi_shop = w-((w/2)-171);
84			*/
85
86			var style_mov_h = h - 80 - 56;
87
88			if (w <= 900) {
89				var slick_w = w * 0.95;
90
91				$(".lineup_prod").css("width", slick_w + "px");
92				// $(".style_clm").css("width", slick_w + "px");
93
94				$(".style_main").css("height", style_mov_h + "px");
95			} else {
96				var slick_w = w - (w - 1160) / 2;
97
98				// $(".sub_about").css("width", w);
99				// $(".sub_about").css("left", -posi_about) + "px";
100
101				// $(".sub_lineup").css("width", w);
102				// $(".sub_lineup").css("left", -posi_lineup + "px");
103
104				// $(".sub_column").css("width", w);
105				// $(".sub_column").css("left", -posi_style + "px");
106
107				// $(".sub_voice").css("width", w);
108				// $(".sub_voice").css("left", -posi_voice + "px");
109
110				// $(".sub_shop").css("width", w);
111				// $(".sub_shop").css("left", -posi_shop + "px");
112
113				// $(".sub_faq").css("width", w);
114				// $(".sub_faq").css("left", -posi_faq + "px");
115
116				$(".lineup_prod").css("width", slick_w + "px");
117			}
118
119			if (w <= 540) {
120				$(".lineup_main").css("height", w + "px");
121			} else {
122				$(".lineup_main").css("height", "");
123			}
124
125			$(".sub_about, .sub_lineup, .sub_column, .sub_voice, .sub_shop, .sub_faq").each(function () {
126				let pleft = $(this).parents("li").offset().left;
127				let swidth = Math.max(1160, $(window).innerWidth());
128				$(this).css("width", swidth);
129				$(this).css("left", -pleft);
130			});
131		})();
132
133		// inview
134		(function () {
135			$(".inviewfadeIn").on("inview", function (event, isInView, visiblePartX, visiblePartY) {
136				if (isInView) {
137					$(this).stop().addClass("fadeIn");
138				} else {
139				}
140			});
141		})();
142
143		// 販売店
144		(function () {
145			$(".shop_select").on("change", function () {
146				var area_url = $(".shop_select").val();
147				let areaArr = [
148					"/shop/area_01.html",
149					"/shop/area_03.html",
150					"/shop/area_05.html",
151					"/shop/area_06.html",
152					"/shop/area_07.html",
153					"/shop/area_08.html",
154					"/shop/area_09.html",
155					"https://shop.nishikawa1566.com/shop/r/rair/",
156					"/shop/area_10.html",
157				];
158				if (!areaArr.includes(area_url)) {
159					$(".shop_link").attr("href", "#");
160					$(".shop_select_btn").hide();
161					return false;
162				}
163				$(".shop_link").attr("href", area_url);
164
165				if (area_url == "https://shop.nishikawa1566.com/shop/r/rair/") {
166					$(".shop_link").attr("target", "_blank");
167				} else {
168					$(".shop_link").removeAttr("target");
169				}
170
171				if (area_url == "") {
172					$(".shop_select_btn").hide();
173				} else {
174					$(".shop_select_btn").show();
175				}
176			});
177		})();
178
179		/* more(lineup) */
180		(function () {
181			if (
182				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
183				navigator.userAgent.indexOf("A1_07") > 0 ||
184				navigator.userAgent.indexOf("SC-01C") > 0 ||
185				navigator.userAgent.indexOf("iPad") > 0
186			) {
187				$(".size_open").on("touchend", function () {
188					$(this).siblings(".size_more").slideToggle();
189
190					if ($(this).hasClass("on")) {
191						$(this).removeClass("on");
192					} else {
193						$(this).addClass("on");
194					}
195				});
196			} else if (
197				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
198				navigator.userAgent.indexOf("iPod") > 0 ||
199				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
200			) {
201				$(".size_open").on("touchend", function () {
202					$(this).siblings(".size_more").slideToggle();
203
204					if ($(this).hasClass("on")) {
205						$(this).removeClass("on");
206					} else {
207						$(this).addClass("on");
208					}
209				});
210			} else {
211				$(".size_open").on("click", function () {
212					$(this).siblings(".size_more").slideToggle();
213
214					if ($(this).hasClass("on")) {
215						$(this).removeClass("on");
216					} else {
217						$(this).addClass("on");
218					}
219				});
220			}
221		})();
222
223		/* more(ラグビー) */
224		(function () {
225			if (
226				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
227				navigator.userAgent.indexOf("A1_07") > 0 ||
228				navigator.userAgent.indexOf("SC-01C") > 0 ||
229				navigator.userAgent.indexOf("iPad") > 0
230			) {
231				$(".btn_area").on("touchend", function () {
232					$(this).siblings(".more_area").slideToggle();
233
234					if ($(this).hasClass("on")) {
235						$(this).removeClass("on");
236					} else {
237						$(this).addClass("on");
238					}
239				});
240			} else if (
241				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
242				navigator.userAgent.indexOf("iPod") > 0 ||
243				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
244			) {
245				$(".btn_area").on("touchend", function () {
246					$(this).siblings(".more_area").slideToggle();
247
248					if ($(this).hasClass("on")) {
249						$(this).removeClass("on");
250					} else {
251						$(this).addClass("on");
252					}
253				});
254			} else {
255				$(".btn_area").on("click", function () {
256					$(this).siblings(".more_area").slideToggle();
257
258					if ($(this).hasClass("on")) {
259						$(this).removeClass("on");
260					} else {
261						$(this).addClass("on");
262					}
263				});
264			}
265		})();
266
267		/* coment(VOICE) */
268		(function () {
269			if (
270				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
271				navigator.userAgent.indexOf("A1_07") > 0 ||
272				navigator.userAgent.indexOf("SC-01C") > 0 ||
273				navigator.userAgent.indexOf("iPad") > 0
274			) {
275				$(".open_com a").on("touchend", function () {
276					$(this).parent(".open_com").siblings(".comment").slideDown();
277					$(this).parent(".open_com").slideUp();
278				});
279
280				$(".close_com a").on("touchend", function () {
281					$(this).parents(".comment").slideUp();
282					$(this).parents(".comment").siblings(".open_com").slideDown();
283				});
284			} else if (
285				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
286				navigator.userAgent.indexOf("iPod") > 0 ||
287				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
288			) {
289				$(".open_com a").on("touchend", function () {
290					$(this).parent(".open_com").siblings(".comment").slideDown();
291					$(this).parent(".open_com").slideUp();
292				});
293
294				$(".close_com a").on("touchend", function () {
295					$(this).parents(".comment").slideUp();
296					$(this).parents(".comment").siblings(".open_com").slideDown();
297				});
298			} else {
299				$(".open_com a").on("click", function () {
300					$(this).parent(".open_com").siblings(".comment").slideDown();
301					$(this).parent(".open_com").slideUp();
302				});
303
304				$(".close_com a").on("click", function () {
305					$(this).parents(".comment").slideUp();
306					$(this).parents(".comment").siblings(".open_com").slideDown();
307				});
308			}
309		})();
310
311		/* gnaviタブ */
312		(function () {
313			if (
314				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
315				navigator.userAgent.indexOf("A1_07") > 0 ||
316				navigator.userAgent.indexOf("SC-01C") > 0 ||
317				navigator.userAgent.indexOf("iPad") > 0
318			) {
319				$(".lineup_tab a").on("touchend", function () {
320					var bt_class = $(this).parent("li").attr("class");
321
322					$(this).addClass("cur");
323					$(this)
324						.parent("li")
325						.siblings("li")
326						.children("a")
327						.each(function () {
328							$(this).removeClass("cur");
329						});
330					$(this)
331						.parents(".lineup_tab")
332						.siblings(".lineup_sub")
333						.each(function () {
334							if ($(this).hasClass(bt_class)) {
335								$(this).addClass("cur");
336							} else {
337								$(this).removeClass("cur");
338							}
339						});
340				});
341			} else if (
342				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
343				navigator.userAgent.indexOf("iPod") > 0 ||
344				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
345			) {
346				$(".lineup_tab a").on("touchend", function () {
347					var bt_class = $(this).parent("li").attr("class");
348
349					$(this).addClass("cur");
350					$(this)
351						.parent("li")
352						.siblings("li")
353						.children("a")
354						.each(function () {
355							$(this).removeClass("cur");
356						});
357					$(this)
358						.parents(".lineup_tab")
359						.siblings(".lineup_sub")
360						.each(function () {
361							if ($(this).hasClass(bt_class)) {
362								$(this).addClass("cur");
363							} else {
364								$(this).removeClass("cur");
365							}
366						});
367				});
368			} else {
369				$(".lineup_tab a").on("click", function () {
370					var bt_class = $(this).parent("li").attr("class");
371
372					$(this).addClass("cur");
373					$(this)
374						.parent("li")
375						.siblings("li")
376						.children("a")
377						.each(function () {
378							$(this).removeClass("cur");
379						});
380					$(this)
381						.parents(".lineup_tab")
382						.siblings(".lineup_sub")
383						.each(function () {
384							if ($(this).hasClass(bt_class)) {
385								$(this).addClass("cur");
386							} else {
387								$(this).removeClass("cur");
388							}
389						});
390				});
391			}
392		})();
393
394		/* language */
395		(function () {
396			if (
397				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
398				navigator.userAgent.indexOf("A1_07") > 0 ||
399				navigator.userAgent.indexOf("SC-01C") > 0 ||
400				navigator.userAgent.indexOf("iPad") > 0
401			) {
402				$(".btn_area").on("touchend", function () {
403					$(this).siblings(".more_area").slideToggle();
404
405					if ($(this).hasClass("on")) {
406						$(this).removeClass("on");
407					} else {
408						$(this).addClass("on");
409					}
410				});
411			} else if (
412				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
413				navigator.userAgent.indexOf("iPod") > 0 ||
414				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
415			) {
416				$(".btn_area").on("touchend", function () {
417					$(this).siblings(".more_area").slideToggle();
418
419					if ($(this).hasClass("on")) {
420						$(this).removeClass("on");
421					} else {
422						$(this).addClass("on");
423					}
424				});
425			} else {
426				$(".lang_change").on("click", function () {
427					$(this).siblings("ul").slideToggle();
428					if ($(this).hasClass("active")) {
429						$(this).removeClass("active");
430					} else {
431						$(this).addClass("active");
432					}
433				});
434			}
435		})();
436
437		/* lineupタブ */
438		(function () {
439			if (
440				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
441				navigator.userAgent.indexOf("A1_07") > 0 ||
442				navigator.userAgent.indexOf("SC-01C") > 0 ||
443				navigator.userAgent.indexOf("iPad") > 0
444			) {
445				$(".prd_tab02 a").on("touchend", function () {
446					var bt_class = $(this).parent("li").attr("class");
447
448					$(this).addClass("cur");
449					$(this)
450						.parents("li")
451						.siblings("li")
452						.children("a")
453						.each(function () {
454							$(this).removeClass("cur");
455						});
456					$(this)
457						.parents("nav")
458						.siblings(".item_box")
459						.each(function () {
460							if ($(this).hasClass(bt_class)) {
461								$(this).addClass("cur");
462							} else {
463								$(this).removeClass("cur");
464							}
465						});
466				});
467			} else if (
468				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
469				navigator.userAgent.indexOf("iPod") > 0 ||
470				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
471			) {
472				$(".prd_tab02 a").on("touchend", function () {
473					var bt_class = $(this).parent("li").attr("class");
474
475					$(this).addClass("cur");
476					$(this)
477						.parents("li")
478						.siblings("li")
479						.children("a")
480						.each(function () {
481							$(this).removeClass("cur");
482						});
483					$(this)
484						.parents("nav")
485						.siblings(".item_box")
486						.each(function () {
487							if ($(this).hasClass(bt_class)) {
488								$(this).addClass("cur");
489							} else {
490								$(this).removeClass("cur");
491							}
492						});
493				});
494			} else {
495				$(".prd_tab02 a").on("click", function () {
496					var bt_class = $(this).parent("li").attr("class");
497
498					$(this).addClass("cur");
499					$(this)
500						.parents("li")
501						.siblings("li")
502						.children("a")
503						.each(function () {
504							$(this).removeClass("cur");
505						});
506					$(this)
507						.parents("nav")
508						.siblings(".item_box")
509						.each(function () {
510							if ($(this).hasClass(bt_class)) {
511								$(this).addClass("cur");
512							} else {
513								$(this).removeClass("cur");
514							}
515						});
516				});
517			}
518		})();
519
520		/* スマホメニュー */
521		(function () {
522			if (
523				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") == -1) ||
524				navigator.userAgent.indexOf("A1_07") > 0 ||
525				navigator.userAgent.indexOf("SC-01C") > 0 ||
526				navigator.userAgent.indexOf("iPad") > 0
527			) {
528				$("#sp_menu").on("touchend", function () {
529					var scrollPosition;
530					$("#gnavi_sp").slideToggle();
531
532					if ($(".menu-trigger").hasClass("active")) {
533						$(".menu-trigger").removeClass("active");
534
535						scrollPosition = $("body").css("top");
536						scrollPosition = -parseInt(scrollPosition);
537						$("body").removeClass("fixed").css({ top: 0 });
538						window.scrollTo(0, scrollPosition);
539					} else {
540						$(".menu-trigger").addClass("active");
541
542						scrollPosition = $(window).scrollTop();
543						$("body").addClass("fixed").css({ top: -scrollPosition });
544					}
545				});
546
547				$(".open").on("touchend", function () {
548					$(this).parent("a").siblings("ul").slideToggle();
549
550					if ($(this).hasClass("active")) {
551						$(this).removeClass("active");
552					} else {
553						$(this).addClass("active");
554					}
555				});
556
557				$(".open_faq").on("touchend", function () {
558					$(this).parent("span").siblings("ul").slideToggle();
559
560					if ($(this).hasClass("active")) {
561						$(this).removeClass("active");
562					} else {
563						$(this).addClass("active");
564					}
565				});
566			} else if (
567				(navigator.userAgent.indexOf("iPhone") > 0 && navigator.userAgent.indexOf("iPad") == -1) ||
568				navigator.userAgent.indexOf("iPod") > 0 ||
569				(navigator.userAgent.indexOf("Android") > 0 && navigator.userAgent.indexOf("Mobile") > 0)
570			) {
571				$("#sp_menu").on("touchend", function () {
572					var scrollPosition;
573					$("#gnavi_sp").slideToggle();
574
575					if ($(".menu-trigger").hasClass("active")) {
576						$(".menu-trigger").removeClass("active");
577
578						scrollPosition = $("body").css("top");
579						scrollPosition = -parseInt(scrollPosition);
580						$("body").removeClass("fixed").css({ top: 0 });
581						window.scrollTo(0, scrollPosition);
582					} else {
583						$(".menu-trigger").addClass("active");
584
585						scrollPosition = $(window).scrollTop();
586						$("body").addClass("fixed").css({ top: -scrollPosition });
587					}
588				});
589
590				$(".open").on("touchend", function () {
591					$(this).parent("a").siblings("ul").slideToggle();
592
593					if ($(this).hasClass("active")) {
594						$(this).removeClass("active");
595					} else {
596						$(this).addClass("active");
597					}
598				});
599
600				$(".open_faq").on("touchend", function () {
601					$(this).parent("span").siblings("ul").slideToggle();
602
603					if ($(this).hasClass("active")) {
604						$(this).removeClass("active");
605					} else {
606						$(this).addClass("active");
607					}
608				});
609			} else {
610				$("#sp_menu").on("click", function () {
611					var scrollPosition;
612					$("#gnavi_sp").slideToggle();
613
614					if ($(".menu-trigger").hasClass("active")) {
615						$(".menu-trigger").removeClass("active");
616
617						scrollPosition = $("body").css("top");
618						scrollPosition = -parseInt(scrollPosition);
619						$("body").removeClass("fixed").css({ top: 0 });
620						window.scrollTo(0, scrollPosition);
621					} else {
622						$(".menu-trigger").addClass("active");
623
624						scrollPosition = $(window).scrollTop();
625						$("body").addClass("fixed").css({ top: -scrollPosition });
626					}
627				});
628
629				$(".open").on("click", function () {
630					$(this).parent("a").siblings("ul").slideToggle();
631
632					if ($(this).hasClass("active")) {
633						$(this).removeClass("active");
634					} else {
635						$(this).addClass("active");
636					}
637				});
638
639				$(".open_faq").on("click", function () {
640					$(this).parent("span").siblings("ul").slideToggle();
641
642					if ($(this).hasClass("active")) {
643						$(this).removeClass("active");
644					} else {
645						$(this).addClass("active");
646					}
647				});
648			}
649			//
650			(function () {
651				let query = window.matchMedia("(min-width:901px)");
652				function _check() {
653					if (query.matches) {
654						//pc
655						if ($(".menu-trigger").hasClass("active")) {
656							$("#gnavi_sp").slideToggle();
657							$(".menu-trigger").removeClass("active");
658							$("body").removeClass("fixed").css({ top: 0 });
659						}
660					}
661				}
662				$(query).on("change", () => {
663					_check();
664				});
665				_check();
666			})();
667		})();
668	};
669	if (document.readyState === "loading") {
670		document.addEventListener("DOMContentLoaded", ready_fn);
671	} else {
672		ready_fn();
673	}
674
675	$(window).on("resize", function () {
676		var h = $(window).innerHeight();
677		var w = $(window).innerWidth();
678
679		var posi_about = w - (w / 2 + 310);
680		var posi_lineup = w - (w / 2 + 203);
681		var posi_style = w - (w / 2 + 96);
682		var posi_voice = w - (w / 2 - 11);
683		var posi_shop = w - (w / 2 - 118);
684		var posi_faq = w - (w / 2 - 225);
685
686		/*
687		var posi_about = w-((w/2)+257);
688		var posi_lineup = w-((w/2)+150);
689		var posi_style = w-((w/2)+43);
690		var posi_voice = w-((w/2)-64);
691		var posi_shop = w-((w/2)-171);
692		*/
693
694		var style_mov_h = h - 80 - 56;
695
696		var slick_w = w - (w - 1160) / 2;
697
698		if (w <= 900) {
699			var slick_w = w * 0.95;
700
701			$(".lineup_prod").css("width", slick_w + "px");
702			// $(".style_clm").css("width", slick_w + "px");
703
704			$(".style_main").css("height", style_mov_h + "px");
705		} else {
706			var slick_w = w - (w - 1160) / 2;
707
708			// $(".sub_about").css("width", w);
709			// $(".sub_about").css("left", -posi_about) + "px";
710
711			// $(".sub_lineup").css("width", w);
712			// $(".sub_lineup").css("left", -posi_lineup + "px");
713
714			// $(".sub_column").css("width", w);
715			// $(".sub_column").css("left", -posi_style + "px");
716
717			// $(".sub_voice").css("width", w);
718			// $(".sub_voice").css("left", -posi_voice + "px");
719
720			// $(".sub_shop").css("width", w);
721			// $(".sub_shop").css("left", -posi_shop + "px");
722
723			// $(".sub_faq").css("width", w);
724			// $(".sub_faq").css("left", -posi_faq + "px");
725
726			$(".lineup_prod").css("width", slick_w + "px");
727
728			$(".style_main").css("height", "");
729		}
730
731		if (w <= 540) {
732			$(".lineup_main").css("height", w + "px");
733		} else {
734			$(".lineup_main").css("height", "");
735		}
736
737		$(".sub_about, .sub_lineup, .sub_column, .sub_voice, .sub_shop, .sub_faq").each(function () {
738			let pleft = $(this).parents("li").offset().left;
739			let swidth = Math.max(1160, $(window).innerWidth());
740			$(this).css("width", swidth);
741			$(this).css("left", -pleft);
742		});
743	});
744})();

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.