PageSourceSearch

https://www.eikichiyazawa.com/wp-content/themes/yazawaeikichi/assets/js/common-service.js?ver=1.0.0

js eikichiyazawa.com collected 2026-10-02 07:46:28 UTC 4,394 bytes, 166 lines download raw bytes

1(function($) {
2function androidBrowser() {
3	var ua = navigator.userAgent;
4	function ios_ver (){
5	  var ios_ua = navigator.userAgent;
6	    if( ios_ua.indexOf("iPhone") > 0 ) {
7	      ios_ua.match(/iPhone OS (\w+){1,3}/g);
8	      var version = (RegExp.$1.replace(/_/g, '')+'00').slice(0,3);
9	      return version;
10	    }
11	  }
12		var ios_ua = navigator.userAgent;
13		var deviceH = $(window).height();
14		if( ios_ua.indexOf("iPhone") > 0 ) {
15			if(ios_ver() < 800 && deviceH <= 481) {
16				$('body').addClass('and-browser');
17			}
18		}
19	function and_ver() {
20	  var and_ua = navigator.userAgent;
21	  if( and_ua.indexOf("Android") > 0 ) {
22	    var version = parseFloat(and_ua.slice(and_ua.indexOf("Android")+8));
23	    return version;
24	  }
25	}
26	if( (and_ver() < 5 && ua.indexOf('Linux; U;') > 0 && ua.indexOf('chrome') < 0)||(and_ver() < 5 && ua.indexOf('Chrome') > 0 && ua.indexOf('Version') > 0)) {
27		$('body').addClass('android-browser');
28	}
29}
30
31function anchor() {
32	$('a[href^="#"]').not('.popup').click(function(){
33		var Hash = $(this.hash), $Hash = $(Hash);
34		if ($Hash.length > 0) {
35			var HashOffset = $Hash.offset().top;
36			$('html,body').animate({
37				scrollTop: HashOffset - 120
38			}, 300);
39		}
40		return false;
41	});
42}
43
44function drawer() {
45	$('.drawer__btn,.drawer__close,.drawer__cover,.g-nav a').on('click',function(){
46		$('body').toggleClass('drawer-visible');
47	});
48}
49// gnav current
50function gnavCurrent(){
51	var site = $('.site-nav li.current').attr('class');
52	if(site.indexOf('official') > 0){
53		$('.g-nav .g-nav__official').addClass('current');
54	}
55	if(site.indexOf('fc') > 0){
56		$('.g-nav .g-nav__fc').addClass('current');
57	}
58	if(site.indexOf('fs') > 0){
59		$('.g-nav .g-nav__fansite').addClass('current');
60	}
61	$('.current .nav--menu').show();
62	if (window.matchMedia('screen and (max-width:960px)').matches) {
63		$('.g-nav--tit').on('click',function(){
64			if($(this).parent('[class^="g-nav__"]').hasClass('current')){
65				$(this).next('.nav--menu').slideToggle();
66				$(this).parent('[class^="g-nav__"]').removeClass('current');
67				return false;
68			}else{
69				$('.current .nav--menu').slideUp();
70				$('[class^="g-nav__"]').removeClass('current');
71				$(this).parent('[class^="g-nav__"]').addClass('current');
72				$(this).next().slideToggle();
73				return false;
74			}
75		});
76	}
77}
78function loaded(){
79	$(window).on('load', function(){
80		setTimeout(function(){
81			$('body').addClass('loaded');
82		},10);
83		setTimeout(function(){
84			$('body').addClass('normalanim');
85		},900);
86	});
87}
88
89function fixedMenu(){
90	$(window).scroll(function () {
91		if ($(this).scrollTop() > 60) {
92			$('body').addClass('headerFixed');
93		}else{
94			$('body').removeClass('headerFixed');
95		}
96	});
97}
98
99function update(){
100	$(window).on('load', function(){
101		setTimeout(function(){
102			$('.drawer .g-nav li .date').each(function(){
103				var update = $(this).text();
104				if( update.length > 0 ){
105					$('.drawer__btn').addClass('update');
106				}
107			});
108		},1000);
109	});
110}
111
112function shopimg(){
113	$('.js-productImages').each(function(){
114		$(this).find('.productImages_thumbnail').click(function(){
115			var thumbImg = $(this).find('img:not(.dummy)').attr('src');
116			$(this).parents('.js-productImages').find('.productImages_main img:not(.dummy)').attr('src',thumbImg);
117		});
118	});
119	$('.box-products').each(function(){
120		$(this).find('.thumbnail-image li').click(function(){
121			var thumbImg = $(this).find('img:not(.dummy)').attr('src');
122			$(this).parents('.box-images').find('.main-image img:not(.dummy)').attr('src',thumbImg);
123		});
124	});
125}
126
127$(function(){
128	androidBrowser();
129	fixedMenu();
130	drawer();
131	gnavCurrent();
132	loaded();
133	update();
134	$(window).on('load', function(){
135		if( $('body').hasClass('page--profile')){
136
137			if (window.matchMedia('screen and (max-width:900px)').matches) {
138				$('.nav--bio__list a[href^="#"]').click(function(){
139					var Hash = $(this.hash), $Hash = $(Hash);
140					if ($Hash.length > 0) {
141						var HashOffset = ($Hash.offset().top) - 140;
142						$('html,body').animate({
143							scrollTop: HashOffset
144						}, 600);
145					}
146					return false;
147				});
148			}else{
149				$('.nav--bio__list a[href^="#"]').click(function(){
150					var Hash = $(this.hash), $Hash = $(Hash);
151					if ($Hash.length > 0) {
152						var HashOffset = ($Hash.offset().top) - 420;
153						$('html,body').animate({
154							scrollTop: HashOffset
155						}, 600);
156					}
157					return false;
158				});
159			}
160		}else{
161			anchor();
162		}
163	});
164	shopimg();
165});
166})(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.