@ -10,11 +10,22 @@ navbarList.className = "navbarList"
navigation . appendChild ( navbarList )
navigation . appendChild ( navbarList )
document . body . appendChild ( navigation )
document . body . appendChild ( navigation )
// opacity
var opacity = c ( "div" )
opacity . className = "opacityMenu lowerIndex menu"
document . body . appendChild ( opacity )
// Search
// Search
d ( "googleSearchBar" ) . addEventListener ( "keyup" , searchGoogleEnter )
var search = c ( "input" )
function searchGoogleEnter ( key ) {
search . className = "searchMove searchBar"
search . placeholder = "Vul een zoek opdracht of url in"
search . type = "text"
document . body . prepend ( search )
g ( ".searchBar" ) . addEventListener ( "keyup" , searchEnter )
function searchEnter ( key ) {
if ( key . key == "Enter" ) {
if ( key . key == "Enter" ) {
var search = d ( "googleSearchBar" ) . value ;
var search = g( ".s earchBar") . value ;
var containsDot = search . indexOf ( "." ) ;
var containsDot = search . indexOf ( "." ) ;
if ( search !== "" ) {
if ( search !== "" ) {
if ( containsDot > - 1 ) {
if ( containsDot > - 1 ) {
@ -31,7 +42,7 @@ function searchGoogleEnter(key) {
}
}
function showSearch ( ) {
function showSearch ( ) {
var open = ! d( "googleS earchBar") . classList . contains ( "searchMove" )
var open = ! g( ".s earchBar") . classList . contains ( "searchMove" )
if ( open ) {
if ( open ) {
closeSearch ( ) ;
closeSearch ( ) ;
}
}
@ -41,15 +52,15 @@ function showSearch() {
}
}
function closeSearch ( ) {
function closeSearch ( ) {
$ ( " # opacityMenu") . addClass ( "lowerIndex" )
$ ( " . opacityMenu") . addClass ( "lowerIndex" )
d( "googleS earchBar") . blur ( )
g( ".s earchBar") . blur ( )
d( "googleS earchBar") . classList . add ( "searchMove" )
g( ".s earchBar") . classList . add ( "searchMove" )
}
}
function openSearch ( e ) {
function openSearch ( e ) {
$ ( " # opacityMenu") . removeClass ( "lowerIndex" )
$ ( " . opacityMenu") . removeClass ( "lowerIndex" )
d( "googleS earchBar") . classList . remove ( "searchMove" )
g( ".s earchBar") . classList . remove ( "searchMove" )
d( "googleS earchBar") . focus ( )
g( ".s earchBar") . focus ( )
}
}
// Create Navbar
// Create Navbar
@ -95,17 +106,6 @@ Navbar.forEach(i=>{
dropdownList . appendChild ( dropdownListItem ) ;
dropdownList . appendChild ( dropdownListItem ) ;
} )
} )
}
}
$( navList) .appen d( dropdownList )
navList .appen dChil d( dropdownList )
navbarList . appendChild ( navList ) ;
navbarList . appendChild ( navList ) ;
} )
} )
// Appearance changer
var appearanceSwitch = c ( "label" )
appearanceSwitch . className = "appearance"
appearanceSwitch . title = "Dark/Light mode"
var appearanceInput = c ( "input" )
appearanceInput . type = "checkbox"
var appearanceSpan = c ( "span" )
appearanceSpan . className = "appearanceSlider"
$ ( appearanceSwitch ) . append ( appearanceInput , appearanceSpan )
navigation . appendChild ( appearanceSwitch )