mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
prepare for release
This commit is contained in:
@@ -53,5 +53,10 @@
|
||||
"link": "https://netflix.com",
|
||||
"viewBox": "0 0 24 24",
|
||||
"icon": "M6.5,2H10.5L13.44,10.83L13.5,2H17.5V22C16.25,21.78 14.87,21.64 13.41,21.58L10.5,13L10.43,21.59C9.03,21.65 7.7,21.79 6.5,22V2Z"
|
||||
},
|
||||
"EducationPerfect": {
|
||||
"link": "https://app.educationperfect.com/",
|
||||
"viewBox": "4.425358206338695 10.109853742009532 167.75614842212613 167.76529918293508",
|
||||
"icon": "M 41.218842,159.903778 C 32.220757000000006,154.49694799999997 28.320898,146.39567599999998 27.144720000000003,136.691025 C 24.344646000000004,113.587677 21.58695,90.479164 18.767124000000003,67.378227 C 16.473593,48.588874999999994 27.314493000000002,35.167511 46.150131,33.008185999999995 C 69.436394,30.338643999999995 92.70422400000001,27.486617999999993 115.943047,24.432179999999995 C 132.274689,22.285605999999994 146.786301,32.505539 148.981033,48.8368 C 152.235703,73.05532099999999 155.27562,97.309608 157.905701,121.602943 C 159.93542499999998,140.350937 148.836945,152.964386 130.02818299999998,155.067184 C 107.06863399999999,157.634018 84.15766899999998,160.637604 61.23078899999999,163.49321 C 54.302176999999986,164.35621600000002 47.67153899999999,163.743561 41.21884199999999,159.90377800000002 M 90.16155199999999,104.49991600000001 C 90.16451299999999,111.81823700000001 90.16574099999998,119.136559 90.17105099999999,126.45488000000002 C 90.17446899999999,131.15861500000003 93.67040999999999,130.323944 96.55354299999999,130.48759500000003 C 99.573128,130.65899700000003 101.204872,129.66064500000002 101.05652599999999,126.23024700000002 C 100.843948,121.31488000000002 101.00233499999999,116.38347600000002 101.00233499999999,110.84864000000002 C 102.03786499999998,111.51373300000002 102.54609699999999,111.83288600000002 103.04710399999999,112.16302500000002 C 112.86791199999999,118.63465100000002 124.983047,115.43300600000002 129.53965799999997,104.62981400000002 C 131.216278,100.65472400000003 131.70472699999996,95.99940500000002 131.89942899999997,91.61723300000003 C 132.25656099999998,83.57922400000002 129.14271499999998,76.85495800000002 121.90178699999997,72.91539800000002 C 114.83421299999998,69.07015200000002 107.87258899999998,70.25764500000002 101.40912599999997,75.00357800000002 C 100.15898099999997,69.73184200000001 95.94058999999997,71.49647500000002 92.94792199999998,71.84281900000002 C 91.83303799999997,71.97184800000002 90.34555799999998,75.20201900000002 90.28659099999997,77.05806700000002 C 90.00683599999998,85.86446400000003 90.16157499999997,94.68465400000002 90.16155199999997,104.49991600000003 M 47.135135999999974,102.84149200000003 C 47.50462699999997,103.58536500000002 47.86649299999998,104.33315300000002 48.24474299999997,105.07254000000003 C 55.63482299999997,119.51831800000004 75.42236299999998,117.51798200000003 83.29843899999997,107.84790800000003 C 84.09340699999997,106.87186400000003 84.45175199999997,105.03819300000004 84.12631199999997,103.84413100000003 C 83.93784299999997,103.15265700000003 81.92327899999997,102.47944600000004 80.82456999999997,102.60716200000003 C 77.76956899999996,102.96225700000004 74.59602399999997,103.31630700000004 71.77092699999997,104.43350200000003 C 64.22663099999997,107.41690800000003 57.34320099999997,104.57150300000004 57.25969299999997,97.83805100000004 C 65.24485799999997,97.83805100000004 73.23475599999998,97.99984700000003 81.20797699999997,97.70718400000004 C 82.88577299999997,97.64559900000005 85.63535299999997,96.20201100000004 85.96279899999998,94.90748600000003 C 88.05384099999998,86.64054900000004 82.07756799999997,75.75166300000004 74.07153299999997,72.37247500000004 C 64.91693899999997,68.50850700000004 54.85903499999998,71.43896500000004 49.47143599999997,79.54177900000003 C 44.77263999999997,86.60865000000004 45.10080699999997,94.24294300000004 47.13513599999997,102.84149200000003 L 47.135135999999974,102.84149200000003 M 47.035309,102.444016 C 45.100806999999996,94.24294300000001 44.772639999999996,86.60865000000001 49.471436,79.541779 C 54.859035,71.43896500000001 64.916939,68.50850700000001 74.071533,72.37247500000001 C 82.077568,75.75166300000001 88.053841,86.64054900000001 85.962799,94.907486 C 85.63535300000001,96.202011 82.885773,97.645599 81.207977,97.70718400000001 C 73.234756,97.99984700000002 65.244858,97.83805100000001 57.259693,97.83805100000001 C 57.343201,104.571503 64.226631,107.416908 71.770927,104.433502 C 74.596024,103.31630700000001 77.769569,102.96225700000001 80.82457,102.607162 C 81.923279,102.479446 83.937843,103.152657 84.126312,103.844131 C 84.451752,105.038193 84.093407,106.871864 83.298439,107.847908 C 75.422363,117.517982 55.634823,119.51831800000001 48.244743,105.07254 C 47.866493,104.33315300000001 47.504627,103.58536500000001 47.035309,102.444016 M 68.89061,81.05638900000001 C 60.57823199999999,80.556335 57.77417799999999,82.19622000000001 57.24161899999999,88.020081 L 74.64141099999999,88.020081 C 74.94538899999999,87.678658 75.24935899999998,87.337227 75.55333699999998,86.995804 C 73.60168499999999,85.07057200000001 71.65003199999998,83.14534800000001 68.89060999999998,81.05638900000001 L 68.89061,81.05638900000001"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,17 @@
|
||||
* @param {number} [minDuration=1] - The minimum animation duration in seconds.
|
||||
* @param {number} [maxDuration=10] - The maximum animation duration in seconds.
|
||||
*/
|
||||
export function updateBgDurations(item, minDuration = 1, maxDuration = 10) {
|
||||
export function updateBgDurations(speed, minDuration = 0.5, maxDuration = 10) {
|
||||
// Class names to look for
|
||||
const bgClasses = ["bg", "bg2", "bg3"];
|
||||
|
||||
// Reverse the slider direction to align with the animation
|
||||
const reversedValue = 150 - item.bksliderinput;
|
||||
let reversedValue;
|
||||
|
||||
console.log("reversedValue:", reversedValue);
|
||||
if (speed.bksliderinput === undefined) {
|
||||
// Reverse the slider direction to align with the animation
|
||||
reversedValue = 150 - speed;
|
||||
} else {
|
||||
reversedValue = 150 - speed.bksliderinput;
|
||||
}
|
||||
|
||||
// Range of possible animation durations
|
||||
const durationRange = maxDuration - minDuration;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
/* global chrome */
|
||||
|
||||
import {
|
||||
CreateBackground,
|
||||
CreateCustomShortcutDiv,
|
||||
RemoveCustomShortcutDiv,
|
||||
RemoveBackground,
|
||||
RemoveShortcutDiv,
|
||||
addShortcuts,
|
||||
disableNotificationCollector,
|
||||
enableNotificationCollector,
|
||||
} from "../../SEQTA.js";
|
||||
import { updateBgDurations } from "../ui/Animation.js";
|
||||
import { updateAllColors } from "../ui/Colors.js";
|
||||
|
||||
export default class StorageListener {
|
||||
@@ -18,6 +22,13 @@ export default class StorageListener {
|
||||
this.handleSelectedColorChange(changes.selectedColor.newValue);
|
||||
}
|
||||
|
||||
if (changes.shortcuts) {
|
||||
this.handleShortcutsChange(
|
||||
changes.shortcuts.oldValue,
|
||||
changes.shortcuts.newValue
|
||||
);
|
||||
}
|
||||
|
||||
if (changes?.customshortcuts?.newValue) {
|
||||
this.handleCustomShortcutsChange(
|
||||
changes.customshortcuts.oldValue,
|
||||
@@ -28,6 +39,19 @@ export default class StorageListener {
|
||||
if (changes.notificationcollector) {
|
||||
this.handleNotificationCollectorChange(changes.notificationcollector);
|
||||
}
|
||||
|
||||
if (changes.bksliderinput) {
|
||||
updateBgDurations(changes.bksliderinput.newValue);
|
||||
}
|
||||
|
||||
if (changes.animatedbk !== undefined) {
|
||||
if (changes.animatedbk.newValue) {
|
||||
CreateBackground();
|
||||
} else {
|
||||
RemoveBackground();
|
||||
document.getElementById("container").style.background = "var(--background-secondary)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleSelectedColorChange(newColor) {
|
||||
@@ -61,8 +85,41 @@ export default class StorageListener {
|
||||
);
|
||||
|
||||
if (removedElement) {
|
||||
RemoveCustomShortcutDiv(removedElement);
|
||||
RemoveShortcutDiv(removedElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleShortcutsChange(oldValue, newValue) {
|
||||
// Find Added Shortcuts
|
||||
const addedShortcuts = newValue.filter(newItem => {
|
||||
const isAdded = oldValue.some(oldItem => {
|
||||
const match = oldItem.name === newItem.name;
|
||||
const wasDisabled = !oldItem.enabled;
|
||||
const isEnabled = newItem.enabled;
|
||||
return match && wasDisabled && isEnabled;
|
||||
});
|
||||
|
||||
return isAdded;
|
||||
});
|
||||
|
||||
// Find Removed Shortcuts
|
||||
const removedShortcuts = newValue.filter(newItem => {
|
||||
const isRemoved = oldValue.some(oldItem => {
|
||||
const match = oldItem.name === newItem.name;
|
||||
const wasEnabled = oldItem.enabled; // Was enabled in the old array
|
||||
const isDisabled = !newItem.enabled; // Is disabled in the new array
|
||||
|
||||
return match && wasEnabled && isDisabled;
|
||||
});
|
||||
|
||||
return isRemoved;
|
||||
});
|
||||
|
||||
// Add new shortcuts to the UI
|
||||
addShortcuts(addedShortcuts);
|
||||
|
||||
// Remove deleted shortcuts from the UI
|
||||
RemoveShortcutDiv(removedShortcuts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user