This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
caea80a
commit 06a24c3
Showing
10 changed files
with
153 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.api-key-container { | ||
margin: 24px 12px 0; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.api-key-container .button { | ||
color: var(--colour-3); | ||
} | ||
|
||
.api-key-container #api-key-ok-button { | ||
width: 30%; | ||
} | ||
|
||
.api-key-container input { | ||
color: var(--colour-3); | ||
margin: 0px 4px; | ||
border: 1px solid var(--conversations); | ||
border-radius: var(--border-radius-1); | ||
background: transparent; | ||
width: 70%; | ||
} |
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 |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
@import "./select.css"; | ||
@import "./options.css"; | ||
@import "./theme-toggler.css"; | ||
@import "./api-key.css"; |
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,5 +1,5 @@ | ||
.theme-toggler-container { | ||
margin: 24px 0px 8px 0px; | ||
margin: 12px 0px 8px 0px; | ||
justify-content: center; | ||
} | ||
|
||
|
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,33 @@ | ||
const showApiKeyButton = document.getElementById("show-api-key-button"); | ||
const apiKeyInput = document.getElementById("API-key"); | ||
const apiKeyOkButton = document.getElementById("api-key-ok-button"); | ||
|
||
showApiKeyButton.addEventListener("click", () => { | ||
showApiKeyButton.classList.add("hidden"); | ||
|
||
apiKeyInput.classList.remove("hidden"); | ||
apiKeyOkButton.classList.remove("hidden"); | ||
}); | ||
|
||
apiKeyOkButton.addEventListener("click", () => { | ||
localStorage.setItem("API-key", apiKeyInput.value); | ||
|
||
apiKeyInput.classList.add("hidden"); | ||
apiKeyOkButton.classList.add("hidden"); | ||
|
||
showApiKeyButton.classList.remove("hidden"); | ||
}); | ||
|
||
window.addEventListener("DOMContentLoaded", () => { | ||
const apiKey = localStorage.getItem("API-key"); | ||
if (apiKey) { | ||
apiKeyInput.value = apiKey; | ||
} | ||
}); | ||
|
||
(function () { | ||
function getApiKeyFromLocalStorage() { | ||
return localStorage.getItem("API-key"); | ||
} | ||
window.getApiKeyFromLocalStorage = getApiKeyFromLocalStorage; | ||
})(); |
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