Skip to content

Commit

Permalink
add toggleDarkMode() function
Browse files Browse the repository at this point in the history
  • Loading branch information
JG916 committed Oct 1, 2017
1 parent ede976a commit dd664bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,14 @@ var OSGC = window.OSGC = {};

return Promise.resolve().then(queue).then(showResults);
}

function toggleDarkMode() {
if (document.body.classList.contains('darkMode')) {
document.body.classList.remove('darkMode');
} else {
document.body.classList.add('darkMode');
}
}

document.getElementById('darkModeButton').addEventListener('click', toggleDarkMode)
})();

0 comments on commit dd664bc

Please sign in to comment.