Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/apps/block_scout_web/assets/js/app_extra.js

33 lines
1.1 KiB

import { isDarkMode } from './lib/dark_mode'
function applyDarkMode () {
if (isDarkMode()) {
document.body.className += ' ' + 'dark-theme-applied'
document.body.style.backgroundColor = '#1c1d31'
}
}
window.onload = applyDarkMode()
if (isDarkMode()) {
if (document.getElementById('top-navbar')) {
document.getElementById('top-navbar').style.backgroundColor = '#282945'
}
if (document.getElementById('navbar-logo')) {
document.getElementById('navbar-logo').style.filter = 'brightness(0) invert(1)'
}
const modeChanger = document.getElementById('dark-mode-changer')
if (modeChanger) {
modeChanger.className += ' ' + 'dark-mode-changer--dark'
}
const search = document.getElementById('main-search-autocomplete')
const searchMobile = document.getElementById('main-search-autocomplete-mobile')
if (search && search.style) {
search.style.backgroundColor = '#22223a'
search.style.borderColor = '#22223a'
}
if (searchMobile && searchMobile.style) {
searchMobile.style.backgroundColor = '#22223a'
searchMobile.style.borderColor = '#22223a'
}
}