import './global.scss' ; export default async function ( userinfo ) { let night = false ; if ( ! userinfo || userinfo && userinfo . theme == 0 ) { let res ; let hours = new Date ( ) . getHours ( ) ; if ( hours >= 21 || hours <= 6 ) { night = true ; } } if ( userinfo ) { let theme = 'light-theme' ; if ( userinfo . theme == 0 ) { theme = night ? 'dark-theme' : 'light-theme' ; } else if ( userinfo . theme == 2 ) { theme = 'dark-theme' ; } $ ( 'html' ) . attr ( 'id' , theme ) ; } else { $ ( 'html' ) . attr ( 'id' , night ? 'dark-theme' : 'light-theme' ) ; } }