PageSourceSearch

https://takayamaseihun.co.jp/common/js/main.js

js takayamaseihun.co.jp collected 2026-10-05 01:10:39 UTC 4,390 bytes, 212 lines download raw bytes

1;(function () {
2	
3	'use strict';
4
5	var mobileMenuOutsideClick = function() {
6
7		$(document).click(function (e) {
8	    var container = $("#fh5co-offcanvas, .js-fh5co-nav-toggle");
9	    if (!container.is(e.target) && container.has(e.target).length === 0) {
10
11	    	if ( $('body').hasClass('offcanvas') ) {
12
13    			$('body').removeClass('offcanvas');
14    			$('.js-fh5co-nav-toggle').removeClass('active');
15				
16	    	}
17	    
18	    	
19	    }
20		});
21
22	};
23
24
25	var offcanvasMenu = function() {
26
27		$('#page').prepend('<div id="fh5co-offcanvas" />');
28		$('#page').prepend('<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle fh5co-nav-white"><i></i></a>');
29		var clone1 = $('.menu-1 > ul').clone();
30		$('#fh5co-offcanvas').append(clone1);
31		var clone2 = $('.menu-2 > ul').clone();
32		$('#fh5co-offcanvas').append(clone2);
33
34		$('#fh5co-offcanvas .has-dropdown').addClass('offcanvas-has-dropdown');
35		$('#fh5co-offcanvas')
36			.find('li')
37			.removeClass('has-dropdown');
38
39		// Hover dropdown menu on mobile
40		$('.offcanvas-has-dropdown').mouseenter(function(){
41			var $this = $(this);
42
43			$this
44				.addClass('active')
45				.find('ul')
46				.slideDown(500, 'easeOutExpo');				
47		}).mouseleave(function(){
48
49			var $this = $(this);
50			$this
51				.removeClass('active')
52				.find('ul')
53				.slideUp(500, 'easeOutExpo');				
54		});
55
56
57		$(window).resize(function(){
58
59			if ( $('body').hasClass('offcanvas') ) {
60
61    			$('body').removeClass('offcanvas');
62    			$('.js-fh5co-nav-toggle').removeClass('active');
63				
64	    	}
65		});
66	};
67
68
69	var burgerMenu = function() {
70
71		$('body').on('click', '.js-fh5co-nav-toggle', function(event){
72			var $this = $(this);
73
74
75			if ( $('body').hasClass('overflow offcanvas') ) {
76				$('body').removeClass('overflow offcanvas');
77			} else {
78				$('body').addClass('overflow offcanvas');
79			}
80			$this.toggleClass('active');
81			event.preventDefault();
82
83		});
84	};
85
86
87
88	var contentWayPoint = function() {
89		var i = 0;
90		$('.animate-box').waypoint( function( direction ) {
91
92			if( direction === 'down' && !$(this.element).hasClass('animated-fast') ) {
93				
94				i++;
95
96				$(this.element).addClass('item-animate');
97				setTimeout(function(){
98
99					$('body .animate-box.item-animate').each(function(k){
100						var el = $(this);
101						setTimeout( function () {
102							var effect = el.data('animate-effect');
103							if ( effect === 'fadeIn') {
104								el.addClass('fadeIn animated-fast');
105							} else if ( effect === 'fadeInLeft') {
106								el.addClass('fadeInLeft animated-fast');
107							} else if ( effect === 'fadeInRight') {
108								el.addClass('fadeInRight animated-fast');
109							} else {
110								el.addClass('fadeInUp animated-fast');
111							}
112
113							el.removeClass('item-animate');
114						},  k * 200, 'easeInOutExpo' );
115					});
116					
117				}, 100);
118				
119			}
120
121		} , { offset: '85%' } );
122	};
123
124
125	var dropdown = function() {
126
127		$('.has-dropdown').mouseenter(function(){
128
129			var $this = $(this);
130			$this
131				.find('.dropdown')
132				.css('display', 'block')
133				.addClass('animated-fast fadeInUpMenu');
134
135		}).mouseleave(function(){
136			var $this = $(this);
137
138			$this
139				.find('.dropdown')
140				.css('display', 'none')
141				.removeClass('animated-fast fadeInUpMenu');
142		});
143
144	};
145
146
147	var goToTop = function() {
148
149		$('.js-gotop').on('click', function(event){
150			
151			event.preventDefault();
152
153			$('html, body').animate({
154				scrollTop: $('html').offset().top
155			}, 500, 'easeInOutExpo');
156			
157			return false;
158		});
159
160		$(window).scroll(function(){
161
162			var $win = $(window);
163			if ($win.scrollTop() > 200) {
164				$('.js-top').addClass('active');
165			} else {
166				$('.js-top').removeClass('active');
167			}
168
169		});
170	
171	};
172
173
174	// Loading page
175	var loaderPage = function() {
176		$(".fh5co-loader").fadeOut("slow");
177	};
178
179	var counter = function() {
180		$('.js-counter').countTo({
181			 formatter: function (value, options) {
182	      return value.toFixed(options.decimals);
183	    },
184		});
185	};
186
187	var counterWayPoint = function() {
188		if ($('#fh5co-counter').length > 0 ) {
189			$('#fh5co-counter').waypoint( function( direction ) {
190										
191				if( direction === 'down' && !$(this.element).hasClass('animated') ) {
192					setTimeout( counter , 400);					
193					$(this.element).addClass('animated');
194				}
195			} , { offset: '90%' } );
196		}
197	};
198
199	
200	$(function(){
201		mobileMenuOutsideClick();
202		offcanvasMenu();
203		burgerMenu();
204		contentWayPoint();
205		dropdown();
206		goToTop();
207		loaderPage();
208		counterWayPoint();
209	});
210
211
212}());

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.