1
+ /*
2
+ Stellar by HTML5 UP
3
+ html5up.net | @ajlkn
4
+ Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
5
+ */
6
+
7
+ var isMobileWidth = false ;
8
+
1
9
( function ( $ ) {
2
- "use strict" ; // Start of use strict
3
-
4
- var isMobileWidth = false ;
5
-
6
- // Smooth scrolling using jQuery easing
7
- $ ( 'a.js-scroll-trigger[href*="#"]:not([href="#"])' ) . click ( function ( ) {
8
- if ( location . pathname . replace ( / ^ \/ / , '' ) == this . pathname . replace ( / ^ \/ / , '' ) && location . hostname == this . hostname ) {
9
- var target = $ ( this . hash ) ;
10
- target = target . length ? target : $ ( '[name=' + this . hash . slice ( 1 ) + ']' ) ;
11
- if ( target . length ) {
12
- $ ( 'html, body' ) . animate ( {
13
- scrollTop : ( target . offset ( ) . top - 54 )
14
- } , 1000 , "easeInOutExpo" ) ;
15
- return false ;
16
- }
17
- }
18
- } ) ;
19
10
20
- // Closes responsive menu when a scroll trigger link is clicked
21
- $ ( '.js-scroll-trigger' ) . click ( function ( ) {
22
- $ ( '.navbar-collapse' ) . collapse ( 'hide' ) ;
23
- } ) ;
11
+ var $window = $ ( window ) ,
12
+ $body = $ ( 'body' ) ,
13
+ $main = $ ( '#main' ) ;
24
14
25
- // Activate scrollspy to add active class to navbar items on scroll
26
- $ ( 'body' ) . scrollspy ( {
27
- target : '#mainNav' ,
28
- offset : 54
29
- } ) ;
15
+ // Breakpoints.
16
+ breakpoints ( {
17
+ xlarge : [ '1281px' , '1680px' ] ,
18
+ large : [ '981px' , '1280px' ] ,
19
+ medium : [ '737px' , '980px' ] ,
20
+ small : [ '481px' , '736px' ] ,
21
+ xsmall : [ '361px' , '480px' ] ,
22
+ xxsmall : [ null , '360px' ]
23
+ } ) ;
24
+
25
+ // Play initial animations on page load.
26
+ $window . on ( 'load' , function ( ) {
27
+ window . setTimeout ( function ( ) {
28
+ $body . removeClass ( 'is-preload' ) ;
29
+ } , 100 ) ;
30
+ } ) ;
31
+
32
+ // Nav.
33
+ var $nav = $ ( '#nav' ) ;
34
+
35
+ if ( $nav . length > 0 ) {
36
+
37
+ // Shrink effect.
38
+ $main
39
+ . scrollex ( {
40
+ mode : 'top' ,
41
+ enter : function ( ) {
42
+ $nav . addClass ( 'alt' ) ;
43
+ } ,
44
+ leave : function ( ) {
45
+ $nav . removeClass ( 'alt' ) ;
46
+ } ,
47
+ } ) ;
48
+
49
+ // Links.
50
+ var $nav_a = $nav . find ( 'a' ) ;
51
+
52
+ $nav_a
53
+ . scrolly ( {
54
+ speed : 1000 ,
55
+ offset : function ( ) { return $nav . height ( ) ; }
56
+ } )
57
+ . on ( 'click' , function ( ) {
58
+
59
+ var $this = $ ( this ) ;
60
+
61
+ // External link? Bail.
62
+ if ( $this . attr ( 'href' ) . charAt ( 0 ) != '#' )
63
+ return ;
64
+
65
+ // Deactivate all links.
66
+ $nav_a
67
+ . removeClass ( 'active' )
68
+ . removeClass ( 'active-locked' ) ;
69
+
70
+ // Activate link *and* lock it (so Scrollex doesn't try to activate other links as we're scrolling to this one's section).
71
+ $this
72
+ . addClass ( 'active' )
73
+ . addClass ( 'active-locked' ) ;
74
+
75
+ } )
76
+ . each ( function ( ) {
77
+
78
+ var $this = $ ( this ) ,
79
+ id = $this . attr ( 'href' ) ,
80
+ $section = $ ( id ) ;
30
81
31
- let Keyboard = window . SimpleKeyboard . default ;
82
+ // No section for this link? Bail.
83
+ if ( $section . length < 1 )
84
+ return ;
85
+
86
+ // Scrollex.
87
+ $section . scrollex ( {
88
+ mode : 'middle' ,
89
+ initialize : function ( ) {
90
+
91
+ // Deactivate section.
92
+ if ( browser . canUse ( 'transition' ) )
93
+ $section . addClass ( 'inactive' ) ;
94
+
95
+ } ,
96
+ enter : function ( ) {
97
+
98
+ // Activate section.
99
+ $section . removeClass ( 'inactive' ) ;
100
+
101
+ // No locked links? Deactivate all links and activate this section's one.
102
+ if ( $nav_a . filter ( '.active-locked' ) . length == 0 ) {
103
+
104
+ $nav_a . removeClass ( 'active' ) ;
105
+ $this . addClass ( 'active' ) ;
106
+
107
+ }
108
+
109
+ // Otherwise, if this section's link is the one that's locked, unlock it.
110
+ else if ( $this . hasClass ( 'active-locked' ) )
111
+ $this . removeClass ( 'active-locked' ) ;
112
+
113
+ }
114
+ } ) ;
115
+
116
+ } ) ;
117
+
118
+ }
119
+
120
+ // Scrolly.
121
+ $ ( '.scrolly' ) . scrolly ( {
122
+ speed : 1000
123
+ } ) ;
124
+ } ) ( jQuery ) ;
125
+
126
+ let Keyboard = window . SimpleKeyboard . default ;
32
127
33
128
let keyboard = new Keyboard ( {
34
129
onChange : input => onChange ( input ) ,
40
135
$ ( 'body' ) . addClass ( 'keyboard-shown' ) ;
41
136
$ ( ".simple-keyboard-input" ) . focus ( ) ;
42
137
} ,
43
- layout : {
44
- 'default' : [
45
- '` 1 2 3 4 5 6 7 8 9 0 - = {backspace}' ,
46
- '{tab} q w e r t y u i o p [ ] \\' ,
47
- '{capslock} a s d f g h j k l ; \' {enter}' ,
48
- '{shiftleft} z x c v b n m , . / {shiftright}' ,
49
- '.com @ {space}'
50
- ] ,
51
- 'shift' : [
52
- '~ ! @ # $ % ^ & * ( ) _ + {backspace}' ,
53
- '{tab} Q W E R T Y U I O P { } |' ,
54
- '{capslock} A S D F G H J K L : " {enter}' ,
55
- '{shiftleft} Z X C V B N M < > ? {shiftright}' ,
56
- '.com @ {space}'
57
- ]
58
- } ,
138
+ layout : null ,
59
139
display : { }
60
140
} ) ;
61
141
62
142
resizeHandler ( ) ;
63
143
64
144
function onChange ( input ) {
65
- document . querySelector ( ".simple-keyboard-input " ) . value = input ;
145
+ document . querySelector ( ".tagSndLine " ) . innerHTML = input || "Compatible with your JS, React, Vue, Angular or jQuery projects." ;
66
146
console . log ( "Input changed" , input ) ;
67
147
}
68
148
72
152
/**
73
153
* If you want to handle the shift and caps lock buttons
74
154
*/
75
- if ( button === "{shiftleft}" || button === "{shiftright}" || button === "{capslock}" ) handleShift ( ) ;
155
+ if ( button === "{shiftleft}" || button === "{shiftright}" || button === "{capslock}" || button === "{shift}" || button === "{lock}" ) handleShift ( ) ;
76
156
if ( button === "{numbers}" || button === "{abc}" ) handleNumbers ( ) ;
77
157
78
158
if ( $ ( '.dot_icon' ) . hasClass ( 'circ_animate' ) ) {
98
178
} ) ;
99
179
}
100
180
101
- document . querySelector ( ".simple-keyboard-input" ) . addEventListener ( "change" , event => {
181
+ /* document.querySelector(".simple-keyboard-input").addEventListener("change", event => {
102
182
keyboard.setInput(event.target.value);
103
- } ) ;
183
+ });*/
104
184
105
- document . querySelector ( ".simple-keyboard-input" ) . addEventListener ( "keydown" , event => {
185
+ /* document.querySelector(".simple-keyboard-input").addEventListener("keydown", event => {
106
186
if($('.dot_icon').hasClass('circ_animate')){
107
187
$('.dot_icon').removeClass('circ_animate');
108
188
}
109
- } ) ;
189
+ });*/
110
190
111
191
document . addEventListener ( 'keydown' , ( e ) => {
112
192
if ( e . key === "Tab" ) {
128
208
'q w e r t y u i o p' ,
129
209
'a s d f g h j k l' ,
130
210
'{shiftleft} z x c v b n m {backspace}' ,
131
- '{numbers} {space} {enter }'
211
+ '{numbers} {space} {ent }'
132
212
] ,
133
213
'shift' : [
134
214
'Q W E R T Y U I O P' ,
135
215
'A S D F G H J K L' ,
136
216
'{shiftleft} Z X C V B N M {backspace}' ,
137
- '{numbers} {space} {enter }'
217
+ '{numbers} {space} {ent }'
138
218
] ,
139
219
'numbers' : [
140
220
"1 2 3" ,
145
225
} ,
146
226
display : {
147
227
"{numbers}" : "123" ,
148
- "{enter }" : "return" ,
228
+ "{ent }" : "return" ,
149
229
"{escape}" : "esc ⎋" ,
150
230
"{tab}" : "tab ⇥" ,
151
231
"{backspace}" : "⌫" ,
217
297
keyboard . setOptions ( {
218
298
physicalKeyboardHighlight : true
219
299
} ) ;
220
- }
221
-
222
- } ) ( jQuery ) ; // End of use strict
300
+ }
0 commit comments