mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat(settings): Add light mode support to buttons in settings menu
This commit is contained in:
@@ -257,7 +257,16 @@ ul.magicDelete > li.deleting {
|
||||
background: transparent !important;
|
||||
color: var(--text-color) !important;
|
||||
}
|
||||
#media-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#media-container video, #media-container img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
#menu li,
|
||||
#menu section {
|
||||
margin: 8px auto !important;
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function AddBetterSEQTAElements() {
|
||||
handleStudentData();
|
||||
createNewsButton();
|
||||
setupEventListeners();
|
||||
appendBackgroundToUI();
|
||||
await appendBackgroundToUI();
|
||||
await addDarkLightToggle();
|
||||
customizeMenuToggle();
|
||||
}
|
||||
|
||||
@@ -2,14 +2,6 @@ import { getDataById, isIndexedDBSupported } from '@/svelte-interface/hooks/Back
|
||||
|
||||
export async function appendBackgroundToUI() {
|
||||
const parent = document.getElementById('container');
|
||||
|
||||
// embed background.html - old method
|
||||
/* const background = document.createElement('iframe');
|
||||
background.id = 'background';
|
||||
background.classList.add('imageBackground');
|
||||
background.setAttribute('excludeDarkCheck', 'true');
|
||||
background.src = browser.runtime.getURL('seqta/ui/background/background.html');
|
||||
parent!.appendChild(background); */
|
||||
if (!parent) return;
|
||||
|
||||
const backgroundContainer = document.createElement('div');
|
||||
@@ -21,25 +13,8 @@ export async function appendBackgroundToUI() {
|
||||
backgroundContainer.appendChild(mediaContainer);
|
||||
|
||||
parent.appendChild(backgroundContainer);
|
||||
|
||||
// Add styles
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
#media-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#media-container video, #media-container img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
|
||||
// Load and display the background
|
||||
await loadBackground();
|
||||
return;
|
||||
}
|
||||
|
||||
export async function loadBackground() {
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
transition={springTransition}
|
||||
>
|
||||
<button
|
||||
class="w-full px-4 py-2 mb-4 text-[13px] text-white transition rounded-xl bg-zinc-700/50"
|
||||
class="w-full px-4 py-2 mb-4 text-[13px] dark:text-white transition rounded-xl bg-zinc-200 dark:bg-zinc-700/50"
|
||||
onclick={isFormVisible ? addNewCustomShortcut : toggleForm}
|
||||
>
|
||||
{#if isFormVisible}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<div class="py-4">
|
||||
<button
|
||||
onclick={() => selectNoBackground()}
|
||||
class="w-full px-4 py-2 mb-4 text-[13px] text-white transition rounded-xl bg-zinc-700/50">
|
||||
{ clearTheme ? 'Clear Theme' : 'Select Theme' }
|
||||
class="w-full px-4 py-2 mb-4 text-[13px] dark:text-white transition rounded-xl bg-zinc-200 dark:bg-zinc-700/50">
|
||||
{ clearTheme ? 'Clear Theme' : 'Select a Theme' }
|
||||
</button>
|
||||
<BackgroundSelector isEditMode={editMode} bind:selectedBackground={selectedBackground} bind:selectNoBackground={selectNoBackground} />
|
||||
<ThemeSelector isEditMode={editMode} />
|
||||
|
||||
Reference in New Issue
Block a user