PageSourceSearch

https://storystudio.tw/assets/js/main.js

js storystudio.tw collected 2026-10-02 03:12:52 UTC 5,987 bytes, 191 lines download raw bytes

1$(window).on('load',function(){
2	if($('body').hasClass('sdgs')){
3		$('.header, .menu-wrapper').removeClass('style1')
4	}
5	$('.overlay').fadeOut();
6});
7
8$(function(){
9	$('.lazy').Lazy({
10		effect: "fadeIn",
11        effectTime: 500
12	});
13
14	var isMobile = false;
15
16	$('.menu-btn').on('click',function(e){
17		e.stopPropagation();
18		if(!isMobile){
19			$(this).toggleClass('expand');
20			$('.menu-wrapper').stop().slideToggle();
21			var box2 = $('.menu-wrapper .tab-content:visible').css('height');
22			$('.menu-wrapper .box2').css('min-height',box2);
23		}else{
24			$('.menu-wrapper').stop().toggleClass('m-expand');
25		}
26	});
27
28	$('.menu-wrapper .menu-tab .tab-link').on('click',function(){
29		if(!isMobile){
30			$(this).addClass('active');
31			$(this).parent().siblings().find('.tab-link').removeClass('active');
32			$(this).parent().siblings().find('.tab-content').hide();
33			$(this).siblings('.tab-content').stop().fadeIn();
34			var box2 = $(this).siblings('.tab-content').css('height');
35			$('.menu-wrapper .box2').css('min-height',box2);
36		}else{
37			$(this).toggleClass('active');
38			$(this).parent().siblings().find('.tab-link').removeClass('active');
39			$(this).parent().siblings().find('.tab-content').stop().slideUp();
40			$(this).siblings('.tab-content').stop().slideToggle();
41		}
42	});
43	$('.menu-wrapper .tab-list .title').on('click',function(){
44		if(isMobile){
45			$(this).toggleClass('active');
46			$(this).siblings('.group').stop().slideToggle();
47			$(this).parent().siblings().children('.title').removeClass('active');
48			$(this).parent().siblings().children('.group').stop().slideUp();
49		}
50	});
51	$('body').on('click',function(){
52		if(!isMobile){
53			$('.menu-btn').removeClass('expand');
54			$('.menu-wrapper').stop().slideUp();
55		}
56
57		$('.member-select').stop().fadeOut();
58	});
59	$('.menu-close').on('click',function(){
60		$('.menu-wrapper').removeClass('m-expand');
61	});
62	$('.menu-wrapper').on('click',function(e){
63		if(isMobile){
64			$('.menu-wrapper').removeClass('m-expand');
65		}else{
66			e.stopPropagation();
67		}
68	});
69	$('.menu-wrapper .inner').on('click',function(e){
70		if(isMobile){
71			e.stopPropagation();
72		}
73	});
74
75	$('.header .member-btn').on('click',function(e){
76		e.stopPropagation();
77		$('.header .member-select').stop().fadeToggle();
78	});
79	
80	$(window).resize(function() {
81		isMobile = window.innerWidth < 921;
82		if(isMobile){
83			$('.menu-wrapper').removeAttr('style');
84			$('.menu-wrapper .tab-link').removeClass('active');
85			$('.menu-wrapper .tab-content').removeAttr('style');
86
87			$('.header .search-wrapper').removeClass('disabled').insertAfter('.menu-wrapper .login');
88		}else{
89			$('.menu-tab li:first-child .tab-content').css('display','block');
90			$('.menu-tab li:first-child .tab-link').addClass('active');
91			var box2 = $('.menu-wrapper .tab-content:visible').css('height');
92			$('.menu-wrapper .box2').css('min-height',box2);
93			$('.menu-wrapper .group').removeAttr('style');
94
95			$('.menu-wrapper .search-wrapper').addClass('disabled').insertAfter('.header .member-btn-wrapper');
96		}
97	});
98	$(window).resize();
99
100	//搜尋按鈕
101	$(document).on('click','.header .search-wrapper',function(e){
102	//$('.header .search-wrapper').on('click',function(e){
103		e.stopPropagation();
104		if($(this).hasClass('disabled')){
105			$(this).parents('.header').addClass('search-expand');
106			$(this).removeClass('disabled');
107			$('.header .search-wrapper input').focus();
108			$('.header .search-suggest').stop().fadeIn();
109		}
110	});
111	$('body').on('click',function(){
112		if(!$('.header .search-wrapper').hasClass('disabled')){
113			$('.header .search-wrapper').addClass('disabled');
114			$('.search-suggest').stop().fadeOut();
115			setTimeout(function(){
116				$('.header').removeClass('search-expand');
117			},500);
118		}
119	});
120
121	//回到頁首
122	$('.top-btn .back-to-top').on('click',function(){
123		$('html, body').animate({
124			scrollTop: 0
125		},1200);
126	});
127});
128
129var lastScrollTop = 0;
130$(window).on('load scroll',function(){
131	var scrollTop = $(window).scrollTop();
132	// if($('body').hasClass('index')){
133	// 	if($(window).width() > 767){
134	// 		if(scrollTop > 90){
135	// 			$('.header').addClass('fixed');
136	// 			$('.header, .menu-wrapper').removeClass('style1');
137
138	// 			$('.notify').css('top','');
139	// 		}else{
140	// 			$('.header').removeClass('fixed');
141	// 			$('.header, .menu-wrapper').addClass('style1');
142
143	// 			var headerbottom = $('.header.style1').height();
144	// 			$('.notify').css('top',headerbottom - scrollTop + 'px');
145	// 		}
146	// 		if(scrollTop > 150){
147	// 			$('.header').addClass('down');
148	// 		}else{
149	// 			$('.header').removeClass('down');
150	// 		}
151	// 	}else{
152	// 		$('.header, .menu-wrapper').removeClass('style1');
153	// 		$('.header').addClass('fixed down');
154
155	// 		$('.notify').css('top','');
156	// 	}
157	// }else{
158	// 	$('.header, .menu-wrapper').removeClass('style1');
159	// 	$('.header').addClass('fixed down');
160	// }
161	
162	// if(scrollTop + $(window).innerHeight() > $('.footer').offset().top){
163	// 	$('.top-btn .top-link').hide();
164	// 	$('.top-btn .back-to-top').fadeIn().css('display','block');
165	// }else{
166	// 	$('.top-btn .back-to-top').hide();
167	// 	$('.top-btn .top-link').fadeIn().css('display','block');
168	// }
169
170    var windowWidth = $(window).width();
171    var labelWidth = $('.enterprise').outerWidth() - 50;
172    if(windowWidth > 767){
173    	$('.enterprise').css('bottom','22px');
174        if(scrollTop < 701){
175            $('.enterprise').css('left', -$(window).scrollTop() * (labelWidth / 700) - 50 + 'px');
176        }else{
177            $('.enterprise').css('left', -(labelWidth + 52) + 'px');
178        }
179    }else{
180        var st = $(this).scrollTop();
181        if (st > lastScrollTop){
182			$('.enterprise').css({'bottom': -$('.enterprise').outerHeight() + 'px','top':'initial'});
183		}
184		else if(st == lastScrollTop){
185		
186		}else {
187			$('.enterprise').css({'bottom':'0','top':'initial'});
188		}
189		lastScrollTop = st;
190    }
191});

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.