fixed themes to only be local

This commit is contained in:
Guy Sandler 2026-01-20 13:17:13 -08:00
parent 5162c9dad6
commit 9ae4ef6e7d
2 changed files with 17 additions and 27 deletions

View File

@ -429,18 +429,7 @@
</div>
</div>
<div style="position:relative">
<div id="opt-in">
<div id="opt-in-box" style="background:#0e0e0e;border-radius:10px;padding:24px;">
<p style="font-size:14px;font-weight:600;">The theme browser has been updated to allow you to like themes, see real-time submissions, and easily submit new themes!</p>
<p style="margin-top:6px;font-size:11px;color:#a4a4a4;font-weight:600">If you choose to use the new browser, an ID will be registered to you in order to save your likes, but your ID is anonymous for your privacy. <a target="_blank" href="https://diditupe.dev/bettercanvas/privacy">More info here</a></p>
<div style="display:flex;margin-top: 14px;gap: 5px;">
<button class="big-button" id="new_browser_in">Use new browser</button>
<button class="big-button" id="new_browser_out">Continue using old</button>
</div>
</div>
</div>
<div id="premade-themes">
</div>
<div id="premade-themes"></div>
</div>
</div>
<div class="option-container">
@ -502,7 +491,7 @@
</div>
</div>
</div>
<div class="option-container">
<!-- <div class="option-container">
<div class="theme-header">
<h3 class="header-small" style="margin:0;flex:100">Theme browser opt-in reset</h3>
</div>
@ -510,7 +499,7 @@
<button id="reset-optin" class="customization-button">Reset opt-in status</button>
<p style="color:#a7a7a7">This will bring back the opt-in message so you can select a different option.</p>
</div>
</div>
</div> -->
</div>
<div class="customize-dark tab" style="display: none">
@ -1087,8 +1076,8 @@
</div>
<script type="text/javascript" src="../js/popup.js"></script>
<script type="text/javascript" src="../js/themes.js"></script>
<script type="text/javascript" src="../js/popup.js"></script>
</body>

View File

@ -545,12 +545,12 @@ function setup() {
});
// activate theme browser opt out
document.getElementById("new_browser_out").addEventListener("click", () => {
// document.getElementById("new_browser_out").addEventListener("click", () => {
chrome.storage.sync.set({ "new_browser": false });
current_page_num = 1;
displayThemeList(0);
displayAlert(false, "Success! You are now viewing the old theme browser. This one will no longer recieve updates, but there is still plenty to choose from.");
});
// displayAlert(false, "Success! You are now viewing the old theme browser. This one will no longer recieve updates, but there is still plenty to choose from.");
// });
// activate theme browser opt in
// document.getElementById("new_browser_in").addEventListener("click", registerUser);
@ -571,10 +571,10 @@ function setup() {
document.getElementById("browser-settings-popup").classList.remove("open");
});
document.getElementById("reset-optin").addEventListener("click", () => {
chrome.storage.sync.set({ "new_browser": null });
document.getElementById("opt-in").style.display = "block";
});
// document.getElementById("reset-optin").addEventListener("click", () => {
// chrome.storage.sync.set({ "new_browser": null });
// document.getElementById("opt-in").style.display = "block";
// });
// document.getElementById("view-submissions-btn").addEventListener("click", displayMySubmissions);
document.getElementById("submit-form-btn").addEventListener("click", displayThemeSubmissionForm);
@ -829,10 +829,10 @@ async function submitTheme() { //TODO: remake
const sync = await chrome.storage.sync.get(null);
if (sync["new_browser"] !== true) {
displayAlert(true, "You'll need to opt in to the new browser if you want to submit your theme. If you've opted out and want to opt in, you can scroll down to the bottom of this page and opt back in.");
return;
}
// if (sync["new_browser"] !== true) {
// displayAlert(true, "You'll need to opt in to the new browser if you want to submit your theme. If you've opted out and want to opt in, you can scroll down to the bottom of this page and opt back in.");
// return;
// }
const theme = await getExport(sync, ["custom_cards", "card_colors", "dark_preset", "custom_font", "gradient_cards", "disable_color_overlay"]);
const title = document.getElementById("submit-title");
@ -1215,6 +1215,7 @@ function displaySavedThemes() {
function getTheme(name) {
// get localThemes from themes.js
console.log(themes);
if (name === "all") return themes;
for (const theme in themes) if (theme.title === name) return theme
@ -1429,7 +1430,7 @@ function displayAdvancedCards() {
};
});
} else {
document.querySelector(".advanced-cards").innerHTML = `<div class="option-container"><h3>Couldn't find your cards!<br/>You may need to refresh your Canvas page and/or this menu page.<br/><br/>If you're having issues please contact me - ksucpea@gmail.com</h3></div>`;
document.querySelector(".advanced-cards").innerHTML = `<div class="option-container"><h3>Couldn't find your cards!<br/>You may need to refresh your Canvas page and/or this menu page.<br/><br/>If you're having issues please contact me - sandlerguy5@gmail.com</h3></div>`;
}
});
}