File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 22 <div>
33 {{{include "build/templates/languages.template"}}}
44 <a href="#toc">{{langInfo.toc}}</a>
5+ <input type="search" placeholder="?" id="search">
56 </div>
67</div>
78<div class="webgl_header">
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ a>img {
132132.webgl_navbar {
133133 background : black;
134134 color : white;
135+ color-scheme : dark;
135136}
136137.webgl_navbar a {
137138 color : white;
@@ -506,6 +507,9 @@ pre.prettyprint, code.prettyprint {
506507 li {
507508 margin-left : 5px ;
508509 }
510+ # search {
511+ display : none;
512+ }
509513}
510514
511515@media (max-width : 720px ) {
Original file line number Diff line number Diff line change @@ -84,6 +84,17 @@ $(document).ready(function($) {
8484 window . location . href = this . dataset . href ;
8585 } ) ;
8686
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+ } ) ;
8798} ) ;
8899} ( jQuery ) ) ;
89100
You can’t perform that action at this time.
0 commit comments