made night mode work using javascript