PageSourceSearch

https://visitmatsumoto.com/common/js/base.js

js visitmatsumoto.com collected 2026-10-02 04:21:50 UTC 3,015 bytes, 92 lines download raw bytes

1// JavaScript Document
2
3// #navButton
4document.querySelector('#navButton').innerHTML = '<i></i><i></i><i></i>';
5document.querySelector('#header').appendChild(document.querySelector('#navButton'));
6document.querySelector('#navButton').addEventListener('click', function(){
7	var sel = document.querySelector('#navButton');
8	if (sel.classList.contains('on')) {
9		sel.classList.remove('on');
10		sel.classList.add('off');
11	} else {
12		sel.classList.remove('off');
13		sel.classList.add('on');
14	}
15});
16
17
18// #nav
19//var start = 0;
20//var end = 0;
21//document.querySelector('#nav').addEventListener('touchstart', (e) => {
22//	start = e.changedTouches[0].screenX;
23//}, { passive: true });
24//document.querySelector('#nav').addEventListener('touchend', (e) => {
25//	end = e.changedTouches[0].screenX;
26//	if (end - start > 100){
27//		document.querySelector('#navButton').click();
28//	}
29//});
30document.querySelector('#nav').insertAdjacentHTML('afterbegin', '<menu>close</menu>');
31document.querySelector('#nav menu').addEventListener('click', function(){
32	document.querySelector('#navButton').click();
33});
34document.querySelector('#nav h2').addEventListener('click', function(){
35	document.querySelector('#siteName a').click();
36});
37function nav_copy(id, cts) {
38	const source = document.getElementById(id);
39	if (!source) return;
40	const clone = source.cloneNode(true);
41	const cid = id.replace('nav', cts);
42	clone.id = cid;
43	document.getElementById(cts).append(clone);
44}
45nav_copy('navPickup', 'hNav');
46nav_copy('navFavorite', 'hNav');
47nav_copy('navLanguage', 'hNav');
48nav_copy('navSearch', 'hNav');
49
50
51$(document).on('click', function(e){
52	const areas = ['#navSearch'];
53	areas.forEach(selector => {
54		if (!$(e.target).closest(selector).length){
55			$(selector + ' details[open]').prop('open', false);
56		}
57	});
58	if ($('body').hasClass('nav') && !$(e.target).closest('#nav, #navButton').length){
59		$('body').removeClass('nav');
60	}
61});
62
63
64// スクロール位置調整
65function setPagePathTop(){
66	var h = document.querySelector('#header').offsetHeight;
67	document.querySelector('html').style.scrollPaddingTop = h +'px';
68}
69window.addEventListener('load', () => {
70	setPagePathTop();
71});
72let timer;
73window.addEventListener('resize', () => {
74	clearTimeout(timer);
75	timer = setTimeout(setPagePathTop, 0);
76});
77
78
79// Adobe Fonts
80(function(d) {
81    var config = {
82      kitId: 'hob3ece',
83      scriptTimeout: 3000,
84      async: true
85    },
86    h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
87  })(document);
88
89
90
91
92

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.