File tree 3 files changed +16
-0
lines changed
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2
2
<div>
3
3
{{{include "build/templates/languages.template"}}}
4
4
<a href="#toc">{{langInfo.toc}}</a>
5
+ <input type="search" placeholder="?" id="search">
5
6
</div>
6
7
</div>
7
8
<div class="webgl_header">
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ a>img {
132
132
.webgl_navbar {
133
133
background : black;
134
134
color : white;
135
+ color-scheme : dark;
135
136
}
136
137
.webgl_navbar a {
137
138
color : white;
@@ -506,6 +507,9 @@ pre.prettyprint, code.prettyprint {
506
507
li {
507
508
margin-left : 5px ;
508
509
}
510
+ # search {
511
+ display : none;
512
+ }
509
513
}
510
514
511
515
@media (max-width : 720px ) {
Original file line number Diff line number Diff line change @@ -84,6 +84,17 @@ $(document).ready(function($) {
84
84
window . location . href = this . dataset . href ;
85
85
} ) ;
86
86
87
+ $ ( '#search' ) . on ( 'keyup' , function ( e ) {
88
+ if ( e . key !== 'Enter' ) {
89
+ return ;
90
+ }
91
+ const a = document . createElement ( 'a' ) ;
92
+ a . target = '_blank' ;
93
+ const u = new URL ( 'https://google.com/search' ) ;
94
+ u . searchParams . set ( 'q' , `site:webgl2fundamentals.org ${ this . value } ` ) ;
95
+ a . href = u . toString ( ) ;
96
+ a . click ( ) ;
97
+ } ) ;
87
98
} ) ;
88
99
} ( jQuery ) ) ;
89
100
You can’t perform that action at this time.
0 commit comments