feat: TurboSu initial release - racing telemetry dashboard
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const Theme = {
|
||||
_current: 'dark',
|
||||
|
||||
init() {
|
||||
this._current = localStorage.getItem('turbosu-theme') || 'dark';
|
||||
this.apply();
|
||||
},
|
||||
|
||||
toggle() {
|
||||
this._current = this._current === 'dark' ? 'light' : 'dark';
|
||||
this.apply();
|
||||
},
|
||||
|
||||
apply() {
|
||||
document.body.classList.remove('theme-dark', 'theme-light');
|
||||
document.body.classList.add(`theme-${this._current}`);
|
||||
localStorage.setItem('turbosu-theme', this._current);
|
||||
},
|
||||
|
||||
get current() { return this._current; }
|
||||
};
|
||||
|
||||
window.Theme = Theme;
|
||||
Reference in New Issue
Block a user