Initial commit
This commit is contained in:
commit
744e2063ae
22 changed files with 666 additions and 0 deletions
24
js/class/data.js
Normal file
24
js/class/data.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
const ANIMUS_DATA = "animusData";
|
||||
|
||||
class Data {
|
||||
constructor() {
|
||||
this.theme = "melanosis";
|
||||
}
|
||||
|
||||
load() {
|
||||
const data = window.localStorage.getItem(ANIMUS_DATA);
|
||||
if(!data) return;
|
||||
const obj = JSON.parse(data);
|
||||
|
||||
this.theme = obj.theme ?? "melanosis";
|
||||
}
|
||||
|
||||
save() {
|
||||
const data = JSON.stringify(this);
|
||||
window.localStorage.setItem(ANIMUS_DATA, data);
|
||||
}
|
||||
}
|
||||
|
||||
const themeData = new Data();
|
||||
themeData.load();
|
||||
themeData.save();
|
1
js/class/util.js
Normal file
1
js/class/util.js
Normal file
|
@ -0,0 +1 @@
|
|||
function $(c) { return document.querySelector(c); }
|
Loading…
Add table
Add a link
Reference in a new issue