PageSourceSearch

https://www.chateau-dor-nara.com/shared/js/shared.js

js chateau-dor-nara.com collected 2026-10-07 04:14:30 UTC 9,129 bytes, 341 lines download raw bytes

1/*!
2 * ScriptName: shared.js
3 *
4 */
5
6$(document).ready(function() {
7  $('.keyvisual').slick({
8    slidesToShow: 1,
9    slidesToScroll: 1,
10    arrows: false,
11    dots: false,
12    infinite: true,
13    autoplay: true,
14    autoplaySpeed: 2000,
15    speed: 2000,
16    fade: true,
17    responsive: [
18      {
19        breakpoint: 999,
20        settings: {
21          arrows: false,
22          variableWidth: false,
23          centerMode: false,
24        }
25      }
26    ]
27  });
28  $(window).on('load resize orientationchange', function() {
29    $('.keyvisual').slick('resize');
30  });
31    
32    $('.keyvisual').on('touchstart', function() {
33		$('.keyvisual').slick('slickPlay');
34	}); 
35    
36    
37});
38
39$(document).ready(function() {
40  $('.slickslide').slick({
41    slidesToShow: 1,
42    slidesToScroll: 1,
43    arrows: false,
44    dots: false,
45    infinite: true,
46    autoplay: true,
47    autoplaySpeed: 2000,
48    speed: 2000,
49    fade: true,
50    responsive: [
51      {
52        breakpoint: 999,
53        settings: {
54          arrows: false,
55          variableWidth: false,
56          centerMode: false,
57        }
58      }
59    ]
60  });
61  $(window).on('load resize orientationchange', function() {
62    $('.slickslide').slick('resize');
63  });
64    
65    $('.slickslide').on('touchstart', function() {
66		$('.slickslide').slick('slickPlay');
67	}); 
68    
69    
70});
71
72$(document).ready(function () {
73	var scrollSpeed = 0.3;
74	var imgWidth = 2168;
75	var posX = 0;
76	setInterval(function(){
77		if (posX >= imgWidth) posX= 0;
78		posX -= scrollSpeed;
79		$('.slide-h').css("background-position",posX+"px 0px");
80	}, 1);
81});
82
83$(document).ready(function() {
84  var height1 = $('.header-box').height();
85  var height2 = $('#key-box').height();
86  var height = height1 + height2;
87  $(window).scroll(function (){
88    if(height < $(window).scrollTop()){
89      $('body').addClass('fixed-btn');      
90    }
91    else {
92      $('body').removeClass('fixed-btn');    
93    }
94  });
95});
96
97$(document).ready(function() {
98  var offsetY;
99  $('.hamberger-btn').click(function() {
100    if ($('body').hasClass('menu-open')) {
101      $('body').removeClass('menu-open');
102      $('body').css('position', 'static');
103      
104      $(window).scrollTop(offsetY);
105    } else {
106      $('body').addClass('menu-open');
107      offsetY = window.pageYOffset;
108      $('body').css({
109        position: 'fixed',
110        width: '100%',
111        'top': -offsetY + 'px'
112      });
113    }
114    return false;
115  });
116  $('.nav a, .nav a, .js-scroll a').click(function() {
117    $('body').removeClass('menu-open');
118    $('body').css('position', 'static');
119    $(window).scrollTop(offsetY);
120  });
121  $('.hide-nav, .unsmooth').click(function() {
122    if ($('body').hasClass('menu-open')) {
123      $('body').removeClass('menu-open');
124      $('body').css('position', 'static');
125      $(window).scrollTop(offsetY);
126    }
127  });
128});
129
130var lastScrollTop = 0;
131$(window).scroll(function(){
132	var st = $(this).scrollTop();
133	if (lastScrollTop !=0 )
134	{
135		if (st < lastScrollTop){
136			$("#pagetop.style2").addClass("visible");
137			if(st < 10){
138				$("#pagetop.style2").removeClass("visible");
139			}
140		} 
141		else if (st > lastScrollTop){			
142			$("#pagetop.style2").removeClass("visible");
143		}
144	}
145	lastScrollTop = st;
146});
147
148$(document).ready(function() {
149	if($('.nav[scroll-active]').length && $('.nav').attr('scroll-active') === "true")
150  {
151    $(document).on('scroll', onScroll)
152    $('.nav a[href*="#"]').on('click', function(){
153      var e = $(this).attr('href')
154      var h = $('.nav').outerHeight()
155      var b = $(e).length ? $(e).offset().top : 0
156      console.log(b)
157      console.log(b + 1 - h)
158      $('html, body').animate({
159        scrollTop: (b + 1 - h)      
160      }, 500)
161    })
162  }
163});
164
165function onScroll(){
166	var scroll = $(window).scrollTop()
167  var header = $('.nav').outerHeight()
168  if($(window).width() > 999) {
169    var header = $('.nav').outerHeight()
170  } else {
171    var header = 60
172  }	
173  
174	$('.nav a[href^="#"]').each(function () {
175		var el = $(this).attr('href')
176		var offset = $(el).length ? $(el).offset().top : 0
177		if($(this).find('img').length){
178			var _src_ = $(this).find('img').attr("src");
179			_src_ = _src_.replace(/^(.*?)_on\.(.*)$/, "$1.$2");
180			$(this).find('img').attr("src", _src_)
181		}
182		if((scroll + header) >= offset && ($(el).outerHeight() + offset) > (scroll + header)){
183			$('.nav a[href^="#"]').removeClass('active')
184			$(this).addClass('active')
185				if($(this).find('img').length){
186				$('.nav a[href^="#"] img').addClass('btn')
187				$(this).find('img').removeClass('btn')
188				$('.nav a[href^="#"] img').each(function(){
189					var src = $(this).attr('src')
190					var newSrc = src.replace('_on', '')
191					$(this).attr('src', newSrc)
192				})
193
194				$(this).find('img').attr("src").match(/^(.*)(\.{1}.*)/g);
195				var newSrc = RegExp.$1 + "_on" + RegExp.$2;
196
197				$(this).find('img').attr("src", newSrc); // update src
198			}
199			// $(this).find('img').trigger('mouseout').trigger('mouseover')
200		}
201	})
202}
203
204
205function parAuto() {
206
207  if (window.matchMedia('(min-width: 999px)').matches) {
208    $('.img_parallax img').each(function (index, element) {
209      let src = $(element).attr('data-src');
210      if (src === undefined) {
211          src = $(element).attr('src')
212      }
213      $(element).css('display', 'none');
214      $(element).parent().parent().parent().css({
215          'background-image': "url('" + src + "')"
216      });
217    });
218  } else {
219    $('.img_parallax img').each(function (index, element) {
220      let src = $(element).attr('data-src');
221      if (src === undefined) {
222          src = $(element).attr('src')
223      }
224      $(element).css('display', 'block');
225      $(element).parent().parent().parent().css({
226          'background-image': "url('" + src + "')"
227      });
228    });
229  }
230  var isIE = /*@cc_on!@*/false || !!document.documentMode;
231  if (isIE === true) {
232    $('body').on("mousewheel", function (e) {
233      event.preventDefault();
234      var wd = event.wheelDelta;
235      var csp = window.pageYOffset;
236      window.scrollTo(0, csp - wd);
237    });
238    $('.unsmooth').click(function() {
239      $('body').on("mousewheel", function (e) {
240        if (e.wheelDelta) delta = e.wheelDelta;
241				else if (e.originalEvent) {
242					if (e.originalEvent.wheelDelta) delta = e.originalEvent.wheelDelta;
243					else if (e.originalEvent.deltaY) delta = 0 - e.originalEvent.deltaY;
244					else if (e.originalEvent.detail) delta = e.originalEvent.detail * -40;
245				} else if (event.originalEvent) {
246					if (event.originalEvent.wheelDelta) delta = event.originalEvent.wheelDelta;
247					else if (event.originalEvent.deltaY) delta = 0 - event.originalEvent.deltaY;
248					else if (event.originalEvent.detail) delta = event.originalEvent.detail * -40;
249				}
250      });
251    });
252  }
253
254}
255$(document).ready(function(){
256  parAuto()
257})
258
259$(document).load($(window).bind("resize orientationchange", parAuto));
260
261
262$(window).load(function(e) {
263  var hash1 = location.hash;
264  var $root = $('html, body');
265  if( hash1 != ""){  
266   var top01 = $(hash1).offset();  
267   //alert(hash1);
268       if($(window).width() < 767) {
269   $('html,body').animate({ scrollTop:top01.top}, 200);  
270       }
271  }
272});
273
274
275
276$(function(){
277	$('#loopslider').each(function(){
278		var loopsliderWidth = $(this).width();
279		var loopsliderHeight = $(this).height();
280		$(this).children('ul').wrapAll('<div id="loopslider_wrap"></div>');
281		var listWidth = $('#loopslider_wrap').children('ul').children('li').width();
282		var listCount = $('#loopslider_wrap').children('ul').children('li').length;
283		var loopWidth = (listWidth);
284		var loopsliderHeight = (loopsliderHeight)*(listCount);
285		$('#loopslider_wrap').css({
286			left: '0',
287			bottom: '0',
288			width: (loopWidth),
289			height: ((loopsliderHeight)*2),
290			overflow: 'hidden',
291			position: 'absolute'
292		});
293		$('#loopslider_wrap ul').css({
294			height: (loopsliderHeight)
295		});
296		loopsliderPosition();
297		function loopsliderPosition(){
298			$('#loopslider_wrap').css({bottom:'0'});
299			$('#loopslider_wrap').stop().animate({bottom:'-' + (loopsliderHeight) + 'px'},30000,'linear');
300			setTimeout(function(){
301				loopsliderPosition();
302			},30000);
303		};
304		$('#loopslider_wrap ul').clone().appendTo('#loopslider_wrap');
305	});
306});
307
308$(function(){
309	$('#loopslider2').each(function(){
310		var loopsliderWidth2 = $(this).width();
311		var loopsliderHeight2 = $(this).height();
312		$(this).children('ul').wrapAll('<div id="loopslider2_wrap"></div>');
313		var listWidth2 = $('#loopslider2_wrap').children('ul').children('li').width();
314		var listCount2 = $('#loopslider2_wrap').children('ul').children('li').length;
315		var loopWidth2 = (listWidth2);
316		var loopsliderHeight2 = (loopsliderHeight2)*(listCount2);
317		$('#loopslider2_wrap').css({
318			left: '0',
319			top: '0',
320			width: (loopWidth2),
321			height: ((loopsliderHeight2)*2),
322			overflow: 'hidden',
323			position: 'absolute'
324		});
325		$('#loopslider2_wrap ul').css({
326			height: (loopsliderHeight2)
327		});
328		loopsliderPosition2();
329		function loopsliderPosition2(){
330			$('#loopslider2_wrap').css({top:'0'});
331			$('#loopslider2_wrap').stop().animate({top:'-' + (loopsliderHeight2) + 'px'},30000,'linear');
332			setTimeout(function(){
333				loopsliderPosition2();
334			},30000);
335		};
336		$('#loopslider2_wrap ul').clone().appendTo('#loopslider2_wrap');
337	});
338});
339
340
341

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.