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;
|
background: transparent !important;
|
||||||
color: var(--text-color) !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 li,
|
||||||
#menu section {
|
#menu section {
|
||||||
margin: 8px auto !important;
|
margin: 8px auto !important;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export async function AddBetterSEQTAElements() {
|
|||||||
handleStudentData();
|
handleStudentData();
|
||||||
createNewsButton();
|
createNewsButton();
|
||||||
setupEventListeners();
|
setupEventListeners();
|
||||||
appendBackgroundToUI();
|
await appendBackgroundToUI();
|
||||||
await addDarkLightToggle();
|
await addDarkLightToggle();
|
||||||
customizeMenuToggle();
|
customizeMenuToggle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,6 @@ import { getDataById, isIndexedDBSupported } from '@/svelte-interface/hooks/Back
|
|||||||
|
|
||||||
export async function appendBackgroundToUI() {
|
export async function appendBackgroundToUI() {
|
||||||
const parent = document.getElementById('container');
|
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;
|
if (!parent) return;
|
||||||
|
|
||||||
const backgroundContainer = document.createElement('div');
|
const backgroundContainer = document.createElement('div');
|
||||||
@@ -21,25 +13,8 @@ export async function appendBackgroundToUI() {
|
|||||||
backgroundContainer.appendChild(mediaContainer);
|
backgroundContainer.appendChild(mediaContainer);
|
||||||
|
|
||||||
parent.appendChild(backgroundContainer);
|
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();
|
await loadBackground();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function loadBackground() {
|
export async function loadBackground() {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
transition={springTransition}
|
transition={springTransition}
|
||||||
>
|
>
|
||||||
<button
|
<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}
|
onclick={isFormVisible ? addNewCustomShortcut : toggleForm}
|
||||||
>
|
>
|
||||||
{#if isFormVisible}
|
{#if isFormVisible}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
<div class="py-4">
|
<div class="py-4">
|
||||||
<button
|
<button
|
||||||
onclick={() => selectNoBackground()}
|
onclick={() => selectNoBackground()}
|
||||||
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">
|
||||||
{ clearTheme ? 'Clear Theme' : 'Select Theme' }
|
{ clearTheme ? 'Clear Theme' : 'Select a Theme' }
|
||||||
</button>
|
</button>
|
||||||
<BackgroundSelector isEditMode={editMode} bind:selectedBackground={selectedBackground} bind:selectNoBackground={selectNoBackground} />
|
<BackgroundSelector isEditMode={editMode} bind:selectedBackground={selectedBackground} bind:selectNoBackground={selectNoBackground} />
|
||||||
<ThemeSelector isEditMode={editMode} />
|
<ThemeSelector isEditMode={editMode} />
|
||||||
|
|||||||
Reference in New Issue
Block a user