mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
dev
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
export function CreateBackground() {
|
||||
var bkCheck = document.getElementsByClassName("bg")
|
||||
if (bkCheck.length !== 0) {
|
||||
return
|
||||
}
|
||||
// Creating and inserting 3 divs containing the background applied to the pages
|
||||
var bklocation = document.getElementById("container")
|
||||
var menu = document.getElementById("menu")
|
||||
var bk = document.createElement("div")
|
||||
bk.classList.add("bg")
|
||||
|
||||
bklocation!.insertBefore(bk, menu)
|
||||
|
||||
var bk2 = document.createElement("div")
|
||||
bk2.classList.add("bg")
|
||||
bk2.classList.add("bg2")
|
||||
bklocation!.insertBefore(bk2, menu)
|
||||
|
||||
var bk3 = document.createElement("div")
|
||||
bk3.classList.add("bg")
|
||||
bk3.classList.add("bg3")
|
||||
bklocation!.insertBefore(bk3, menu)
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { settingsState } from "../listeners/SettingsState"
|
||||
import { CreateBackground } from "./CreateBackground"
|
||||
import { RemoveBackground } from "../DisableRemove/RemoveBackground"
|
||||
|
||||
export function enableAnimatedBackground() {
|
||||
if (settingsState.animatedbk) {
|
||||
CreateBackground()
|
||||
} else {
|
||||
RemoveBackground()
|
||||
document.getElementById("container")!.style.background =
|
||||
"var(--background-secondary)"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
export function RemoveBackground() {
|
||||
var bk = document.getElementsByClassName("bg")
|
||||
var bk2 = document.getElementsByClassName("bg2")
|
||||
var bk3 = document.getElementsByClassName("bg3")
|
||||
|
||||
if (bk.length == 0 || bk2.length == 0 || bk3.length == 0) return
|
||||
bk[0].remove()
|
||||
bk2[0].remove()
|
||||
bk3[0].remove()
|
||||
}
|
||||
@@ -3,14 +3,11 @@ import { updateAllColors } from '@/seqta/ui/colors/Manager';
|
||||
|
||||
|
||||
import { addShortcuts } from "@/seqta/utils/Adders/AddShortcuts";
|
||||
import { CreateBackground } from "@/seqta/utils/CreateEnable/CreateBackground";
|
||||
import { CreateCustomShortcutDiv } from "@/seqta/utils/CreateEnable/CreateCustomShortcutDiv";
|
||||
import { FilterUpcomingAssessments } from "@/seqta/utils/FilterUpcomingAssessments";
|
||||
import { RemoveBackground } from "@/seqta/utils/DisableRemove/RemoveBackground";
|
||||
import { RemoveShortcutDiv } from "@/seqta/utils/DisableRemove/RemoveShortcutDiv";
|
||||
|
||||
|
||||
import { updateBgDurations } from '@/seqta/ui/Animation';
|
||||
import browser from 'webextension-polyfill';
|
||||
import type { CustomShortcut } from '@/types/storage';
|
||||
|
||||
@@ -25,8 +22,6 @@ export class StorageChangeHandler {
|
||||
settingsState.register('onoff', this.handleOnOffChange.bind(this));
|
||||
settingsState.register('shortcuts', this.handleShortcutsChange.bind(this));
|
||||
settingsState.register('customshortcuts', this.handleCustomShortcutsChange.bind(this));
|
||||
settingsState.register('bksliderinput', updateBgDurations.bind(this));
|
||||
settingsState.register('animatedbk', this.handleAnimatedBkChange.bind(this));
|
||||
settingsState.register('transparencyEffects', this.handleTransparencyEffectsChange.bind(this));
|
||||
settingsState.register('subjectfilters', FilterUpcomingAssessments.bind(this));
|
||||
}
|
||||
@@ -83,15 +78,6 @@ export class StorageChangeHandler {
|
||||
RemoveShortcutDiv(removedShortcuts);
|
||||
}
|
||||
|
||||
private handleAnimatedBkChange(newValue: boolean) {
|
||||
if (newValue) {
|
||||
CreateBackground();
|
||||
} else {
|
||||
RemoveBackground();
|
||||
document.getElementById('container')!.style.background = 'var(--background-secondary)';
|
||||
}
|
||||
}
|
||||
|
||||
private handleTransparencyEffectsChange(newValue: boolean) {
|
||||
if (newValue) {
|
||||
document.documentElement.classList.add('transparencyEffects');
|
||||
|
||||
Reference in New Issue
Block a user