Add FontAwesome
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
import Theme from './theme';
|
||||
|
||||
import { library, dom } from '@fortawesome/fontawesome-svg-core/index.es';
|
||||
import { fas } from '@fortawesome/free-solid-svg-icons/index.es';
|
||||
import { far } from '@fortawesome/free-regular-svg-icons/index.es';
|
||||
import { fab } from '@fortawesome/free-brands-svg-icons/index.es';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
Theme.init();
|
||||
|
||||
// FontAwesome
|
||||
library.add(fas, far, fab);
|
||||
dom.i2svg();
|
||||
|
||||
document.getElementById('theme-switch-btn').addEventListener('click', () => {
|
||||
Theme.swap();
|
||||
});
|
||||
|
||||
@@ -12,9 +12,6 @@ export default class {
|
||||
static init() {
|
||||
// Check LocalStorage for dark theme selection
|
||||
if (localStorage.getItem('darkTheme') === 'true') {
|
||||
// Update internal state
|
||||
this.#dark = true;
|
||||
|
||||
// Update page theme
|
||||
this.set(true);
|
||||
}
|
||||
@@ -31,6 +28,9 @@ export default class {
|
||||
|
||||
// Update local storage
|
||||
localStorage.setItem('darkTheme', dark);
|
||||
|
||||
// Update internal state
|
||||
this.#dark = dark;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user