-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ae0b8c
commit cf4dc7c
Showing
6 changed files
with
121 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
:root { | ||
--primary-color: #ffffff; | ||
--background-color: #393b3d; | ||
--seperator-color: rgb(172, 172, 172); | ||
} | ||
body { | ||
margin: 5px; | ||
min-width: 257px; | ||
min-height: 250px; | ||
overflow-x: hidden; | ||
color: var(--primary-color); | ||
background-color: var(--background-color); | ||
font-family: HCo Gotham SSm, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
font-size: large; | ||
} | ||
ul { | ||
padding: 0; | ||
} | ||
li { | ||
list-style-type: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
chrome.storage.local.get(["checked"], (result) => { | ||
document.getElementById("autologin").checked = result.checked; | ||
}) | ||
chrome.storage.local.get(["light"], (result) => { | ||
document.getElementById("light").checked = result.light; | ||
}) | ||
chrome.storage.local.get(["fri"], (result) => { | ||
document.getElementById("fri").checked = result.fri; | ||
}) | ||
chrome.storage.local.get(["antiAFK"], (result) => { | ||
document.getElementById("antiAFK").checked = result.antiAFK; | ||
}) | ||
document.getElementById("autologin").addEventListener("change", (e) => { | ||
chrome.storage.local.set({ checked: e.target.checked }); | ||
}) | ||
document.getElementById("light").addEventListener("change", (e) => { | ||
chrome.storage.local.set({ light: e.target.checked }); | ||
}) | ||
document.getElementById("fri").addEventListener("change", (e) => { | ||
chrome.storage.local.set({ fri: e.target.checked }); | ||
}) | ||
document.getElementById("antiAFK").addEventListener("change", (e) => { | ||
chrome.storage.local.set({ antiAFK: e.target.checked }); | ||
}) | ||
|
||
for (const category of Object.values(defaultSettings)) { | ||
for (const setting in category) { | ||
const nameWithNoSpace = setting.replace(/\s/g, ""); | ||
const settingElement = document.createElement("li"); | ||
settingElement.innerHTML = ` | ||
<input type="checkbox" name="${nameWithNoSpace}" id="${nameWithNoSpace}" checked="checked"> | ||
<label for="${nameWithNoSpace}">${setting}</label> | ||
`; | ||
document.querySelector("ul").appendChild(settingElement); | ||
getSetting(setting).then((result) => { | ||
document.getElementById(nameWithNoSpace).checked = result; | ||
}) | ||
document.getElementById(nameWithNoSpace).addEventListener("change", (e) => { | ||
setSetting(setting, e.target.checked); | ||
}) | ||
} | ||
} |