header_sfy.js
7.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
///*!
// * classie - class helper functions
// * from bonzo https://github.com/ded/bonzo
// *
// * classie.has( elem, 'my-class' ) -> true/false
// * classie.add( elem, 'my-new-class' )
// * classie.remove( elem, 'my-unwanted-class' )
// * classie.toggle( elem, 'my-class' )
// */
//
///*jshint browser: true, strict: true, undef: true */
///*global define: false */
//
//setTimeout(function() {
//
// (function(window) {
//
// 'use strict';
//
// // class helper functions from bonzo https://github.com/ded/bonzo
//
// function classReg(className) {
// return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
// }
//
// // classList support for class management
// // altho to be fair, the api sucks because it won't accept multiple classes at once
// var hasClass, addClass, removeClass;
//
// if('classList' in document.documentElement) {
// hasClass = function(elem, c) {
// return elem.classList.contains(c);
// };
// addClass = function(elem, c) {
// elem.classList.add(c);
// };
// removeClass = function(elem, c) {
// elem.classList.remove(c);
// };
// } else {
// hasClass = function(elem, c) {
// return classReg(c).test(elem.className);
// };
// addClass = function(elem, c) {
// if(!hasClass(elem, c)) {
// elem.className = elem.className + ' ' + c;
// }
// };
// removeClass = function(elem, c) {
// elem.className = elem.className.replace(classReg(c), ' ');
// };
// }
//
// function toggleClass(elem, c) {
// var fn = hasClass(elem, c) ? removeClass : addClass;
// fn(elem, c);
// }
//
// var classie = {
// // full names
// hasClass: hasClass,
// addClass: addClass,
// removeClass: removeClass,
// toggleClass: toggleClass,
// // short names
// has: hasClass,
// add: addClass,
// remove: removeClass,
// toggle: toggleClass
// };
//
// // transport
// if(typeof define === 'function' && define.amd) {
// // AMD
// define(classie);
// } else {
// // browser global
// window.classie = classie;
// }
//
// })(window);
//
// (function() {
//// var triggerBttn = document.getElementById('trigger-overlay'),
//// overlay = document.querySelector('div.overlay'),
////
////
//// transEndEventNames = {
//// 'WebkitTransition': 'webkitTransitionEnd',
//// 'MozTransition': 'transitionend',
//// 'OTransition': 'oTransitionEnd',
//// 'msTransition': 'MSTransitionEnd',
//// 'transition': 'transitionend'
//// },
//// transEndEventName = transEndEventNames[Modernizr.prefixed('transition')],
//// support = {
//// transitions: Modernizr.csstransitions
//// };
//// var s = Snap(overlay.querySelector('svg')),
//// path = s.select('path'),
//// steps = overlay.getAttribute('data-steps').split(';'),
//// stepsTotal = steps.length;
////
//// var elehide;
//
// function hide() {
// clearTimeout(elehide)
// elehide = setTimeout(function() {
// hides();
// }, 50)
// }
//
// function hides() {
// if(classie.has(overlay, 'open')) {
// $('.overlay').removeClass('overlay_re')
// var pos = stepsTotal - 1;
// classie.remove(overlay, 'open');
// classie.add(overlay, 'close');
// var onEndTransitionFn = function(ev) {
// classie.remove(overlay, 'close');
// },
// nextStep = function(pos) {
// pos--;
// if(pos < 0) return;
// path.animate({
// 'path': steps[pos]
// }, 60, mina.linear, function() {
// if(pos === 0) {
// onEndTransitionFn();
// }
// nextStep(pos);
// });
// };
//
// nextStep(pos);
// }
// }
//
// function show() {
// clearTimeout(elehide)
// if(!classie.has(overlay, 'open')) {
// var pos = 0;
// classie.add(overlay, 'open');
//
// var nextStep = function(pos) {
// pos++;
// if(pos > stepsTotal - 1) return;
// path.animate({
// 'path': steps[pos]
// }, 60, mina.linear, function() {
// nextStep(pos);
// });
// };
// nextStep(pos);
//// $('.g_hea_ul').find('li').removeClass('current').eq(0).addClass('current');
//// $('.g_hea_tab').hide().eq(0).show().find(".g_hea_ul2 li").removeClass('current').eq(0).addClass('current');
//// $('.g_hea_tab').eq(0).find('.g_hea_tab2').removeClass('current').eq(0).addClass('current');
// }
// }
//// $('.g_hea_ul').find('li').removeClass('current').eq(0).addClass('current');
//// $('.g_hea_tab').hide().eq(0).show().find(".g_hea_ul2 li").removeClass('current').eq(0).addClass('current');
//// $('.g_hea_tab').eq(0).find('.g_hea_tab2').removeClass('current').eq(0).addClass('current');
//// triggerBttn.addEventListener('click', function() {
//// if(g_head_bool == 1) {
//// return;
//// }
//// show();
//// });
//
// //triggerBttn.addEventListener( 'mouseleave', hide );
// //closeBttn.addEventListener( 'mouseenter', show );
//// closeBttn.addEventListener('click', function() {
//// if(g_head_bool == 1) {
//// g_head_bool = 0;
//// localStorage.setItem('g_head_bool', g_head_bool);
//// $('.switch_large input').removeAttr('checked');
////
//// }
//// hide();
//// });
//// window.g_head_bool = 0;
//// window.g_headshow = show;
//// window.g_headhide = hide;
// })();
//
// $(function() {
//// $('.g_hea_ul').on('click', 'li', function() {
//// $(this).parent().find('li').removeClass('current');
//// $(this).addClass('current')
//// $('.g_hea_tab').hide().eq($(this).index()).show();
//// $('.g_hea_tab').eq($(this).index()).find('.g_hea_ul2').find('li').removeClass('current').eq(0).addClass('current');
//// $('.g_hea_tab').eq($(this).index()).find(".g_hea_tab2").removeClass('current').eq(0).addClass('current');
//// })
// // $('.g_hea_ul2').on('click', 'li', function () {
// // $(this).parent().find('li').removeClass('current');
// // $(this).addClass('current');
// // $(this).parents('.g_hea_tab').find('.g_hea_tab2').removeClass('current').eq($(this).index()).addClass('current');
// // })
//// $('.switch_large').on('click', 'input', function() {
//// g_head_bool = $(this).get(0).checked ? 1 : 0;
//// localStorage.setItem('g_head_bool', g_head_bool)
//// if(g_head_bool == 1) {
//// //$('.overlay').addClass('open')
//// $('.overlay').addClass('overlay_re');
//// g_headshow();
//// var largeb = $('.switch_largeb').find('input');
//// if(largeb.get(0).checked == false) {
//// // $('.g_He_bx').animate({marginLeft:'1000%',opacity:0},600,function(){
//// // $(this).hide();
//// // });
//// // $('.switch_largeb input').removeAttr('checked').attr('checked',true);
//// largeb.trigger('click')
//// }
//// } else {
//// g_headhide();
////
//// }
//// });
////
//// $('.switch_largeb').on('click', 'input', function() {
//// var a = $(this).get(0).checked ? 1 : 0;
//// if(a == 1) {
//// $('.g_He_bx').animate({
//// marginLeft: '1000%',
//// opacity: 0
//// }, 600, function() {
//// $(this).hide();
//// });
//// } else {
//// $('.g_He_bx').show().animate({
//// marginLeft: '0px',
//// opacity: 1
//// }, 600);
//// //if(g_head_bool){
//// $('.switch_large input').attr('checked', false);
//// g_head_bool = 0;
//// g_headhide();
//// //}
//// }
////
//// });
//
// })
//}, 1000)