mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
prepare for release
This commit is contained in:
@@ -6,7 +6,8 @@ import logoDark from './assets/betterseqta-light-full.png';
|
||||
import Shortcuts from './pages/Shortcuts';
|
||||
import { useSettingsContext } from './SettingsContext';
|
||||
import Picker from './components/Picker';
|
||||
import Themes from './pages/Themes';
|
||||
//import Themes from './pages/Themes';
|
||||
import About from './pages/About';
|
||||
//import About from './pages/About';
|
||||
|
||||
const App: React.FC = () => {
|
||||
@@ -31,8 +32,8 @@ const App: React.FC = () => {
|
||||
content: <Shortcuts />
|
||||
},
|
||||
{
|
||||
title: 'Themes',
|
||||
content: <Themes />
|
||||
title: 'About',
|
||||
content: <About />
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
.dark #rbgcp-wrapper [style="height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;\ box-sizing\:\ border-box\;"] {
|
||||
background-color: #37373b !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;\ box-sizing\:\ border-box\;"] [style="padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ display\:\ flex\;\ align-items\:\ center\;\ justify-content\:\ center\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;"] {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;\ box-sizing\:\ border-box\;"] [style="padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 140\,\ 245\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ display\:\ flex\;\ align-items\:\ center\;\ justify-content\:\ center\;\ background\:\ white\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.2\)\ 1px\ 1px\ 3px\;"] {
|
||||
background-color: #4b4b53 !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ justify-content\:\ space-between\;\ margin-top\:\ 12px\;\ margin-bottom\:\ -4px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ box-sizing\:\ border-box\;\ padding-left\:\ 0px\;"]:has(svg) {
|
||||
background-color: #37373b !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;\ height\:\ 28px\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ width\:\ 30px\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;\ margin-right\:\ 1px\;"] svg {
|
||||
filter: invert();
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ justify-content\:\ space-between\;\ margin-top\:\ 12px\;\ margin-bottom\:\ -4px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ box-sizing\:\ border-box\;\ padding-left\:\ 0px\;"] [style="position\:\ relative\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ align-items\:\ center\;"]:has(svg) {
|
||||
background: transparent !important;
|
||||
filter: invert();
|
||||
color: #39393b !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ justify-content\:\ space-between\;\ margin-top\:\ 12px\;\ margin-bottom\:\ -4px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ box-sizing\:\ border-box\;\ padding-left\:\ 0px\;"] [style^="display\: "]:has(svg) {
|
||||
background-color: #3f3f44 !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ box-sizing\:\ border-box\;"] [style="padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 140\,\ 245\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ display\:\ flex\;\ align-items\:\ center\;\ justify-content\:\ center\;\ background\:\ white\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.2\)\ 1px\ 1px\ 3px\;"]:has(svg) {
|
||||
background-color: #4b4b53 !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ box-sizing\:\ border-box\;"] [style="padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ display\:\ flex\;\ align-items\:\ center\;\ justify-content\:\ center\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;"] svg {
|
||||
filter: invert();
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\ 2px\ 2px\ 8px\;"] svg {
|
||||
filter: invert();
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\ 2px\ 2px\ 8px\;"] input {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="align-items\:\ center\;\ justify-content\:\ flex-end\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ box-sizing\:\ border-box\;"]:has(svg) {
|
||||
background-color: #37373b !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style^="width\: "] [style^="width\: "] {
|
||||
color: white !important;
|
||||
}
|
||||
.dark #rbgcp-wrapper [style="align-items\:\ center\;\ justify-content\:\ flex-end\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ box-sizing\:\ border-box\;"] [style="width\:\ 30px\;\ height\:\ 24px\;\ border-radius\:\ 4px\;\ display\:\ flex\;\ align-items\:\ center\;\ justify-content\:\ center\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;"]:has(svg) svg,
|
||||
.dark #rbgcp-wrapper [style="align-items\:\ center\;\ justify-content\:\ flex-end\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ box-sizing\:\ border-box\;"] [style="width\:\ 30px\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;\ height\:\ 24px\;\ border-radius\:\ 4px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;\ position\:\ relative\;"]:has(svg) svg,
|
||||
.dark #rbgcp-wrapper [style="align-items\:\ center\;\ justify-content\:\ flex-end\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ box-sizing\:\ border-box\;"] [style="width\:\ 30px\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;\ height\:\ 24px\;\ border-radius\:\ 4px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;"]:has(svg) svg {
|
||||
filter: invert();
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ justify-content\:\ center\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;"] {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ position\:\ relative\;\ padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 86\,\ 86\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ justify-content\:\ center\;\ background\:\ rgba\(255\,\ 255\,\ 255\,\ 0\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\)\ 1px\ 1px\ 3px\;"] {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper :last-child > [style$=" relative\;"] [style$=" \31 px\;"] {
|
||||
filter: none !important;
|
||||
background-color: #37373b !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ position\:\ relative\;\ padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 140\,\ 245\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ justify-content\:\ center\;\ background\:\ white\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.2\)\ 1px\ 1px\ 3px\;"],
|
||||
.dark #rbgcp-wrapper [style="display\:\ flex\;\ align-items\:\ center\;\ padding-left\:\ 8px\;\ padding-right\:\ 8px\;\ line-height\:\ 1\;\ border-radius\:\ 4px\;\ font-weight\:\ 700\;\ color\:\ rgb\(86\,\ 140\,\ 245\)\;\ font-size\:\ 12px\;\ height\:\ 24px\;\ transition\:\ all\ 160ms\ ease\ 0s\;\ justify-content\:\ center\;\ background\:\ white\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.2\)\ 1px\ 1px\ 3px\;"] {
|
||||
background-color: #3f3f44 !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="align-items\:\ center\;\ justify-content\:\ flex-end\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ box-sizing\:\ border-box\;"] [style="width\:\ 30px\;\ background\:\ white\;\ color\:\ rgb\(86\,\ 140\,\ 245\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.2\)\ 1px\ 1px\ 3px\;\ height\:\ 24px\;\ border-radius\:\ 4px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;\ position\:\ relative\;"]:has(svg) {
|
||||
background-color: #3f3f44 !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="height\:\ 216px\;\ width\:\ 100\%\;\ transition\:\ all\ 120ms\ linear\ 0s\;"] [style="text-align\:\ center\;\ color\:\ rgb\(50\,\ 49\,\ 54\)\;\ font-size\:\ 12px\;\ font-weight\:\ 500\;\ margin-top\:\ 3px\;"],
|
||||
.dark #rbgcp-wrapper [style="height\:\ 216px\;\ width\:\ 100\%\;\ transition\:\ all\ 120ms\ linear\ 0s\;"] [style="text-align\:\ center\;\ color\:\ rgb\(50\,\ 49\,\ 54\)\;\ font-size\:\ 13px\;\ font-weight\:\ 600\;\ position\:\ absolute\;\ top\:\ 6\.5px\;\ left\:\ 2px\;"] {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="height\:\ 98px\;\ width\:\ 100\%\;\ transition\:\ all\ 120ms\ linear\ 0s\;"] [style="cursor\:\ ew-resize\;\ position\:\ relative\;"] [style="text-align\:\ center\;color\:\ rgb\(255\,\ 255\,\ 255\)\;font-size\:\ 12px\;font-weight\:\ 500\;line-height\:\ 1\;position\:\ absolute\;left\:\ 50\%\;transform\:\ translate\(-50\%\,\ 0\%\)\;top\:\ 0px\;z-index\:\ 10\;text-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.6\)\ 1px\ 1px\ 1px\;"] {
|
||||
text-shadow: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.dark #rbgcp-wrapper [style="align-items\:\ center\;\ justify-content\:\ flex-end\;\ height\:\ 28px\;\ background\:\ rgb\(233\,\ 233\,\ 245\)\;\ border-radius\:\ 6px\;\ padding\:\ 2px\;\ display\:\ flex\;\ box-sizing\:\ border-box\;"] [style="width\:\ 30px\;\ background\:\ white\;\ color\:\ rgb\(86\,\ 140\,\ 245\)\;\ box-shadow\:\ rgba\(0\,\ 0\,\ 0\,\ 0\.2\)\ 1px\ 1px\ 3px\;\ height\:\ 24px\;\ border-radius\:\ 4px\;\ display\:\ flex\;\ justify-content\:\ center\;\ align-items\:\ center\;"]:has(svg) {
|
||||
background-color: #3f3f44 !important;
|
||||
}
|
||||
@@ -3,6 +3,8 @@ import ColorPicker from 'react-best-gradient-color-picker';
|
||||
import { useSettingsContext } from '../SettingsContext';
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import "./Picker.css";
|
||||
|
||||
export default function Picker() {
|
||||
const { settingsState, setSettingsState, showPicker, setShowPicker } = useSettingsContext();
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ const Settings: React.FC = () => {
|
||||
description: "Customise the overall theme colour of SEQTA Learn.",
|
||||
modifyElement: <PickerSwatch />
|
||||
},
|
||||
{
|
||||
/* {
|
||||
title: "Transparency Effects",
|
||||
description: "Enables transparency effects on certain elements such as blur. (May impact battery life)",
|
||||
modifyElement: <Switch state={settingsState.betterSEQTAPlus} onChange={(isOn: boolean) => switchChange('betterSEQTAPlus', isOn)} />
|
||||
},
|
||||
}, */
|
||||
{
|
||||
title: "BetterSEQTA+",
|
||||
description: "Enables BetterSEQTA+ features",
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
from svgpathtools import svg2paths, wsvg # you need ``pip install svgpathtools``
|
||||
from svgpathtools.path import Path as CombinePath
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
TEST_SVG = Path('test.svg')
|
||||
|
||||
|
||||
def main():
|
||||
path_list, data_list = svg2paths(str(Path(TEST_SVG)))
|
||||
|
||||
if not 'analysis path':
|
||||
for idx, cur_path in enumerate(path_list):
|
||||
wsvg(cur_path, filename=f'result_{idx}.svg',
|
||||
attributes=[dict(fill="#000000", stroke="none", stroke_width=1)])
|
||||
|
||||
path_list = [path_list[idx] for idx in (1, 3)] # After analyzing the paths, we find that the paths index 1 and 3 seem to be redundant.
|
||||
single_path = CombinePath() # combine: 0, 2 together.
|
||||
for combine_path in path_list:
|
||||
for curve in combine_path:
|
||||
single_path.append(curve)
|
||||
|
||||
wsvg(single_path, filename=f'result.svg',
|
||||
attributes=[dict(fill="#000000", stroke="none", stroke_width=1)],
|
||||
openinbrowser=True # default is False,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -66,6 +66,10 @@
|
||||
{
|
||||
"resources": ["client/*"],
|
||||
"matches": ["*://*/*"]
|
||||
},
|
||||
{
|
||||
"resources": ["resources/*"],
|
||||
"matches": ["*://*/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
.hide {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.outside-container {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 80px;
|
||||
height: 590px;
|
||||
z-index: 20;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" ?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="full" height="600px" version="1.1" viewBox="4.425358206338695 10.109853742009532 167.75614842212613 167.76529918293508" width="600px">
|
||||
<defs/>
|
||||
<path d="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" fill="#000000" stroke="none" stroke-width="1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
+78
-66
@@ -73,10 +73,16 @@ function OpenWhatsNewPopup() {
|
||||
|
||||
let imagecont = document.createElement("div");
|
||||
imagecont.classList.add("whatsnewImgContainer");
|
||||
var image = document.createElement("img");
|
||||
image.src = chrome.runtime.getURL("icons/betterseqta-dark-icon.png");
|
||||
image.classList.add("whatsnewImg");
|
||||
imagecont.append(image);
|
||||
let video = document.createElement("video");
|
||||
let source = document.createElement("source");
|
||||
source.setAttribute("src", chrome.runtime.getURL("resources/update-video.mp4"));
|
||||
source.setAttribute("type", "video/mp4");
|
||||
video.autoplay = true;
|
||||
video.muted = true;
|
||||
video.loop = true;
|
||||
video.appendChild(source);
|
||||
video.classList.add("whatsnewImg");
|
||||
imagecont.appendChild(video);
|
||||
|
||||
let textcontainer = document.createElement("div");
|
||||
textcontainer.classList.add("whatsnewTextContainer");
|
||||
@@ -91,7 +97,8 @@ function OpenWhatsNewPopup() {
|
||||
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: scroll;">
|
||||
<li>Custom backgrounds and themes coming soon!</li>
|
||||
<h1>3.1.2 - New settings menu!</h1>
|
||||
<li>Overhauled the settings menu!!!</li>
|
||||
<li>Overhauled the settings menu</li>
|
||||
<li>Added custom gradients</li>
|
||||
<h1>3.1.1 - Minor Bug fixes</h1>
|
||||
<li>Fixed assessments overlapping</li>
|
||||
<li>Fixed houses not displaying if they aren't a specific color</li>
|
||||
@@ -199,7 +206,7 @@ async function DeleteWhatsNew() {
|
||||
popup.remove();
|
||||
}
|
||||
|
||||
function CreateBackground() {
|
||||
export function CreateBackground() {
|
||||
// Creating and inserting 3 divs containing the background applied to the pages
|
||||
var bklocation = document.getElementById("container");
|
||||
var menu = document.getElementById("menu");
|
||||
@@ -219,7 +226,7 @@ function CreateBackground() {
|
||||
bklocation.insertBefore(bk3, menu);
|
||||
}
|
||||
|
||||
function RemoveBackground() {
|
||||
export function RemoveBackground() {
|
||||
var bk = document.getElementsByClassName("bg");
|
||||
var bk2 = document.getElementsByClassName("bg2");
|
||||
var bk3 = document.getElementsByClassName("bg3");
|
||||
@@ -780,6 +787,12 @@ document.addEventListener(
|
||||
);
|
||||
|
||||
function addExtensionSettings() {
|
||||
let link = document.createElement("link");
|
||||
link.href = chrome.runtime.getURL("popup/popup.css");
|
||||
link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
document.getElementsByTagName("html")[0].appendChild(link);
|
||||
|
||||
let Settings =
|
||||
stringToHTML(
|
||||
String.raw`
|
||||
@@ -852,7 +865,6 @@ function dragDrop() {
|
||||
|
||||
// Save position of all menu items
|
||||
let children = parentA.childNodes;
|
||||
// console.log(children)
|
||||
let listorder = [];
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
@@ -1206,7 +1218,6 @@ function AddBetterSEQTAElements(toggle) {
|
||||
houseelement.innerText =
|
||||
students[index].year + students[index].house;
|
||||
} catch (error) {
|
||||
console.log(students[index]);
|
||||
houseelement.innerText = students[index].house;
|
||||
}
|
||||
} else {
|
||||
@@ -1264,7 +1275,6 @@ function AddBetterSEQTAElements(toggle) {
|
||||
SendNewsPage();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
appendBackgroundToUI();
|
||||
@@ -1611,7 +1621,6 @@ function callHomeTimetable(date, change) {
|
||||
// If items in response:
|
||||
if (serverResponse.payload.items.length > 0) {
|
||||
if (!DayContainer.innerText || change) {
|
||||
// console.log(serverResponse.payload.items.length);
|
||||
for (let i = 0; i < serverResponse.payload.items.length; i++) {
|
||||
lessonArray.push(serverResponse.payload.items[i]);
|
||||
}
|
||||
@@ -2099,7 +2108,7 @@ chrome.storage.onChanged.addListener(function (changes) {
|
||||
}
|
||||
});
|
||||
|
||||
function GetLessonColours() {
|
||||
async function GetLessonColours() {
|
||||
let func = fetch(`${location.origin}/seqta/student/load/prefs?`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -2148,18 +2157,26 @@ export function CreateCustomShortcutDiv(element) {
|
||||
document.getElementById("shortcuts").append(shortcut);
|
||||
}
|
||||
|
||||
export function RemoveCustomShortcutDiv(element) {
|
||||
// Iterate through each shortcut
|
||||
export function RemoveShortcutDiv(elements) {
|
||||
elements.forEach((element) => {
|
||||
const shortcuts = document.querySelectorAll(".shortcut");
|
||||
shortcuts.forEach((shortcut) => {
|
||||
const anchorElement = shortcut.parentElement; // the <a> element is the parent
|
||||
const textElement = shortcut.querySelector("p"); // <p> is a direct child of .shortcut
|
||||
const title = textElement ? textElement.textContent : "";
|
||||
|
||||
if (anchorElement.getAttribute("href") === element.url && title === element.name) {
|
||||
let shouldRemove = title === element.name;
|
||||
|
||||
// Check href only if element.url exists
|
||||
if (element.url) {
|
||||
shouldRemove = shouldRemove && (anchorElement.getAttribute("href") === element.url);
|
||||
}
|
||||
|
||||
if (shouldRemove) {
|
||||
anchorElement.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function AddCustomShortcutsToPage() {
|
||||
@@ -2282,57 +2299,10 @@ function SendHomePage() {
|
||||
changeTimetable(1);
|
||||
});
|
||||
|
||||
function createNewShortcut(link, icon, viewBox, title) {
|
||||
// Creates the stucture and element information for each seperate shortcut
|
||||
var shortcut = document.createElement("a");
|
||||
shortcut.setAttribute("href", link);
|
||||
shortcut.setAttribute("target", "_blank");
|
||||
var shortcutdiv = document.createElement("div");
|
||||
shortcutdiv.classList.add("shortcut");
|
||||
|
||||
let image = stringToHTML(
|
||||
`<svg style="width:39px;height:39px" viewBox="${viewBox}"><path fill="currentColor" d="${icon}" /></svg>`,
|
||||
).firstChild;
|
||||
image.classList.add("shortcuticondiv");
|
||||
var text = document.createElement("p");
|
||||
text.textContent = title;
|
||||
shortcutdiv.append(image);
|
||||
shortcutdiv.append(text);
|
||||
shortcut.append(shortcutdiv);
|
||||
|
||||
document.getElementById("shortcuts").append(shortcut);
|
||||
}
|
||||
// Adds the shortcuts to the shortcut container
|
||||
chrome.storage.local.get(["shortcuts"], function (result) {
|
||||
var shortcuts = Object.values(result)[0];
|
||||
|
||||
for (let i = 0; i < shortcuts.length; i++) {
|
||||
const currentShortcut = shortcuts[i];
|
||||
|
||||
if (currentShortcut?.enabled) {
|
||||
const Itemname = currentShortcut?.name;
|
||||
|
||||
const linkDetails = ShortcutLinks?.[Itemname];
|
||||
if (linkDetails) {
|
||||
createNewShortcut(
|
||||
linkDetails.link,
|
||||
linkDetails.icon,
|
||||
linkDetails.viewBox,
|
||||
Itemname
|
||||
);
|
||||
} else {
|
||||
console.warn(`No link details found for '${Itemname}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
AddCustomShortcutsToPage();
|
||||
|
||||
// Checks if shortcut container is empty
|
||||
if (document.getElementById("shortcuts").childElementCount == 0) {
|
||||
// If there are no shortcuts, hide the container
|
||||
document.getElementsByClassName("shortcut-container")[0].style.display =
|
||||
"none";
|
||||
}
|
||||
const shortcuts = Object.values(result)[0];
|
||||
addShortcuts(shortcuts);
|
||||
});
|
||||
|
||||
// Creates the upcoming container and appends to the home container
|
||||
@@ -2462,7 +2432,6 @@ function SendHomePage() {
|
||||
enableNotificationCollector();
|
||||
}
|
||||
});
|
||||
console.log("Getting assessments");
|
||||
let activeClassList;
|
||||
GetUpcomingAssessments().then((assessments) => {
|
||||
GetActiveClasses().then((classes) => {
|
||||
@@ -2494,7 +2463,6 @@ function SendHomePage() {
|
||||
}
|
||||
|
||||
CurrentAssessments.sort(comparedate);
|
||||
console.log(CurrentAssessments, activeSubjects);
|
||||
|
||||
CreateUpcomingSection(CurrentAssessments, activeSubjects);
|
||||
|
||||
@@ -2504,6 +2472,29 @@ function SendHomePage() {
|
||||
}, 8);
|
||||
}
|
||||
|
||||
export function addShortcuts(shortcuts) {
|
||||
for (let i = 0; i < shortcuts.length; i++) {
|
||||
const currentShortcut = shortcuts[i];
|
||||
|
||||
if (currentShortcut?.enabled) {
|
||||
const Itemname = currentShortcut?.name.replace(/\s/g, "");
|
||||
|
||||
const linkDetails = ShortcutLinks?.[Itemname];
|
||||
if (linkDetails) {
|
||||
createNewShortcut(
|
||||
linkDetails.link,
|
||||
linkDetails.icon,
|
||||
linkDetails.viewBox,
|
||||
currentShortcut?.name
|
||||
);
|
||||
} else {
|
||||
console.warn(`No link details found for '${Itemname}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
AddCustomShortcutsToPage();
|
||||
}
|
||||
|
||||
export function enableNotificationCollector() {
|
||||
var xhr3 = new XMLHttpRequest();
|
||||
xhr3.open("POST", `${location.origin}/seqta/student/heartbeat?`, true);
|
||||
@@ -2544,6 +2535,27 @@ export function disableNotificationCollector() {
|
||||
}
|
||||
}
|
||||
|
||||
function createNewShortcut(link, icon, viewBox, title) {
|
||||
// Creates the stucture and element information for each seperate shortcut
|
||||
let shortcut = document.createElement("a");
|
||||
shortcut.setAttribute("href", link);
|
||||
shortcut.setAttribute("target", "_blank");
|
||||
let shortcutdiv = document.createElement("div");
|
||||
shortcutdiv.classList.add("shortcut");
|
||||
|
||||
let image = stringToHTML(
|
||||
`<svg style="width:39px;height:39px" viewBox="${viewBox}"><path fill="currentColor" d="${icon}" /></svg>`,
|
||||
).firstChild;
|
||||
image.classList.add("shortcuticondiv");
|
||||
let text = document.createElement("p");
|
||||
text.textContent = title;
|
||||
shortcutdiv.append(image);
|
||||
shortcutdiv.append(text);
|
||||
shortcut.append(shortcutdiv);
|
||||
|
||||
document.getElementById("shortcuts").appendChild(shortcut);
|
||||
}
|
||||
|
||||
function SendNewsPage() {
|
||||
setTimeout(function () {
|
||||
// Sends the html data for the home page
|
||||
|
||||
+5
-23
@@ -20,16 +20,12 @@ export const openDB = () => {
|
||||
};
|
||||
|
||||
export const writeData = async (type, data) => {
|
||||
console.log("Reading Data");
|
||||
const db = await openDB();
|
||||
console.log("Opened DB");
|
||||
|
||||
const tx = db.transaction("backgrounds", "readwrite");
|
||||
const store = tx.objectStore("backgrounds");
|
||||
const request = await store.put({ id: "customBackground", type, data });
|
||||
|
||||
console.log("Data written successfully");
|
||||
|
||||
return request.result;
|
||||
};
|
||||
|
||||
@@ -37,17 +33,14 @@ export const readData = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
openDB()
|
||||
.then(db => {
|
||||
console.log("Database, typeof", typeof db, "Is: ", db);
|
||||
const tx = db.transaction("backgrounds", "readonly");
|
||||
const store = tx.objectStore("backgrounds");
|
||||
console.log("Current store: ", store);
|
||||
|
||||
// Retrieve the custom background
|
||||
const getRequest = store.get("customBackground");
|
||||
|
||||
// Attach success and error event handlers
|
||||
getRequest.onsuccess = function(event) {
|
||||
console.log("CustomBackground", event.target.result);
|
||||
resolve(event.target.result);
|
||||
};
|
||||
|
||||
@@ -99,8 +92,6 @@ const handleAddPermissions = () => {
|
||||
|
||||
// Main message listener
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
console.log("Message received in background script", request);
|
||||
|
||||
switch (request.type) {
|
||||
case "reloadTabs":
|
||||
ReloadSEQTAPages();
|
||||
@@ -115,7 +106,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
break;
|
||||
|
||||
case "setDefaultStorage":
|
||||
console.log("Setting default values");
|
||||
SetStorageValue(DefaultValues);
|
||||
break;
|
||||
|
||||
@@ -156,9 +146,6 @@ function HandleIntexedDB(request, sendResponse) {
|
||||
function GetNews(sendResponse) {
|
||||
// Gets the current date
|
||||
const date = new Date();
|
||||
// Formats the current date used send a request for timetable and notices later
|
||||
const TodayFormatted =
|
||||
date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
|
||||
|
||||
const from =
|
||||
date.getFullYear() +
|
||||
@@ -166,12 +153,9 @@ function GetNews(sendResponse) {
|
||||
(date.getMonth() + 1) +
|
||||
"-" +
|
||||
(date.getDate() - 1);
|
||||
console.log(TodayFormatted);
|
||||
console.log(from);
|
||||
|
||||
let url = `https://newsapi.org/v2/everything?domains=abc.net.au&from=${from}&apiKey=17c0da766ba347c89d094449504e3080`;
|
||||
|
||||
console.log("Fetching news from " + url);
|
||||
fetch(url)
|
||||
.then((result) => result.json())
|
||||
.then((response) => {
|
||||
@@ -179,7 +163,6 @@ function GetNews(sendResponse) {
|
||||
url += "%00";
|
||||
GetNews();
|
||||
} else {
|
||||
console.log(response);
|
||||
sendResponse({ news: response });
|
||||
}
|
||||
});
|
||||
@@ -244,7 +227,7 @@ const DefaultValues = {
|
||||
},
|
||||
{
|
||||
name: "Education Perfect",
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
},
|
||||
],
|
||||
customshortcuts: [],
|
||||
@@ -256,9 +239,7 @@ function SetStorageValue(object) {
|
||||
}
|
||||
}
|
||||
|
||||
function UpdateCurrentValues(details) {
|
||||
console.log(details);
|
||||
|
||||
function UpdateCurrentValues() {
|
||||
chrome.storage.local.get(null, function (items) {
|
||||
var CurrentValues = items;
|
||||
|
||||
@@ -310,9 +291,9 @@ function migrateOldStorage() {
|
||||
// Check for "educationperfect" and convert it to "Education Perfect"
|
||||
if (items.shortcuts && items.shortcuts.length > 0) {
|
||||
for (let shortcut of items.shortcuts) {
|
||||
if (shortcut.name === "educationperfect") {
|
||||
if (shortcut.name === "educationperfect" || shortcut.name === "Education Perfect") {
|
||||
shouldUpdate = true;
|
||||
shortcut.name = "Education Perfect"; // Convert to "Education Perfect"
|
||||
shortcut.name = "Education Perfect";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -329,6 +310,7 @@ function migrateOldStorage() {
|
||||
chrome.runtime.onInstalled.addListener(function (event) {
|
||||
chrome.storage.local.remove(["justupdated"]);
|
||||
UpdateCurrentValues();
|
||||
chrome.storage.local.set({ justupdated: true });
|
||||
if ( event.reason == "install" ) {
|
||||
chrome.storage.local.set({ justupdated: true });
|
||||
migrateOldStorage();
|
||||
|
||||
@@ -2825,16 +2825,15 @@ body {
|
||||
.whatsnewImgContainer {
|
||||
width: 96%;
|
||||
display: flex;
|
||||
padding: 2em 0;
|
||||
margin: 0 auto;
|
||||
background: #141414;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.whatsnewImg {
|
||||
margin: 0 auto;
|
||||
width: 30%;
|
||||
margin: 0.5rem 0.5rem;
|
||||
width: 90%;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.whatsnewTextContainer {
|
||||
|
||||
@@ -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"];
|
||||
let reversedValue;
|
||||
|
||||
if (speed.bksliderinput === undefined) {
|
||||
// Reverse the slider direction to align with the animation
|
||||
const reversedValue = 150 - item.bksliderinput;
|
||||
|
||||
console.log("reversedValue:", reversedValue);
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg enable-background="new 0 0 184 184" viewBox="0 0 184 184" xmlns="http://www.w3.org/2000/svg"><path d="m101 185c-33.666664 0-66.833328 0-99.999995 0-.000002-61.333328-.000002-122.666656-.000004-183.999987 61.333323-.000005 122.666648-.000005 183.999968-.000009.000016 61.333313.000016 122.66663.000031 183.999965-27.833328.000031-55.666672.000031-84 .000031m-59.440784-24.948242c6.112323 3.691803 12.742961 4.304458 19.671573 3.441452 22.92688-2.855606 45.837845-5.859192 68.797394-8.426026 18.808762-2.102798 29.907242-14.716247 27.877518-33.464241-2.630081-24.293335-5.669998-48.547622-8.924668-72.766143-2.194732-16.331261-16.706344-26.551194-33.037986-24.40462-23.238823 3.054438-46.506653 5.906464-69.792916 8.576006-18.835638 2.159325-29.676538 15.580689-27.383007 34.370041 2.819826 23.100937 5.577522 46.20945 8.377596 69.312798 1.176178 9.704651 5.076037 17.805923 14.414496 23.360733z" fill="#fff"/><path d="m41.218842 159.903778c-8.998085-5.40683-12.897944-13.508102-14.074122-23.212753-2.800074-23.103348-5.55777-46.211861-8.377596-69.312798-2.293531-18.789352 8.547369-32.210716 27.383007-34.370041 23.286263-2.669542 46.554093-5.521568 69.792916-8.576006 16.331642-2.146574 30.843254 8.073359 33.037986 24.40462 3.25467 24.218521 6.294587 48.472808 8.924668 72.766143 2.029724 18.747994-9.068756 31.361443-27.877518 33.464241-22.959549 2.566834-45.870514 5.57042-68.797394 8.426026-6.928612.863006-13.55925.250351-20.011947-3.589432m48.94271-55.403862c.002961 7.318321.004189 14.636643.009499 21.954964.003418 4.703735 3.499359 3.869064 6.382492 4.032715 3.019585.171402 4.651329-.82695 4.502983-4.257348-.212578-4.915367-.054191-9.846771-.054191-15.381607 1.03553.665093 1.543762.984246 2.044769 1.314385 9.820808 6.471626 21.935943 3.269981 26.492554-7.533211 1.67662-3.97509 2.165069-8.630409 2.359771-13.012581.357132-8.038009-2.756714-14.762275-9.997642-18.701835-7.067574-3.845246-14.029198-2.657753-20.492661 2.08818-1.250145-5.271736-5.468536-3.507103-8.461204-3.160759-1.114884.129029-2.602364 3.3592-2.661331 5.215248-.279755 8.806397-.125016 17.626587-.125039 27.441849m-43.026416-1.658424c.369491.743873.731357 1.491661 1.109607 2.231048 7.39008 14.445778 27.17762 12.445442 35.053696 2.775368.794968-.976044 1.153313-2.809715.827873-4.003777-.188469-.691474-2.203033-1.364685-3.301742-1.236969-3.055001.355095-6.228546.709145-9.053643 1.82634-7.544296 2.983406-14.427726.138001-14.511234-6.595451 7.985165 0 15.975063.161796 23.948284-.130867 1.677796-.061585 4.427376-1.505173 4.754822-2.799698 2.091042-8.266937-3.885231-19.155823-11.891266-22.535011-9.154594-3.863968-19.212498-.93351-24.600097 7.169304-4.698796 7.066871-4.370629 14.701164-2.3363 23.299713z" fill="#1b2854"/><path d="m90.16156 103.999924c.000015-9.31527-.154724-18.13546.125031-26.941857.058967-1.856048 1.546447-5.086219 2.661331-5.215248 2.992668-.346344 7.211059-2.110977 8.461204 3.160759 6.463463-4.745933 13.425087-5.933426 20.492661-2.08818 7.240928 3.93956 10.354774 10.663826 9.997642 18.701835-.194702 4.382172-.683151 9.037491-2.359771 13.012581-4.556611 10.803192-16.671746 14.004837-26.492554 7.533211-.501007-.330139-1.009239-.649292-2.044769-1.314385 0 5.534836-.158387 10.46624.054191 15.381607.148346 3.430398-1.483398 4.42875-4.502983 4.257348-2.883133-.163651-6.379074.67102-6.382492-4.032715-.00531-7.318321-.006538-14.636643-.009491-22.454956m22.958481 1.06755c7.309852-2.052963 10.510864-10.767517 6.956863-18.69387-1.605262-3.580177-4.388328-5.285759-8.14833-5.518051-6.558533-.405175-10.633057 3.59732-10.929207 10.626144-.409149 9.710327 2.666755 13.453522 12.120674 13.585777z" fill="#fbfbfc"/><path d="m47.035309 102.444016c-1.934502-8.201073-2.262669-15.835366 2.436127-22.902237 5.387599-8.102814 15.445503-11.033272 24.600097-7.169304 8.006035 3.379188 13.982308 14.268074 11.891266 22.535011-.327446 1.294525-3.077026 2.738113-4.754822 2.799698-7.973221.292663-15.963119.130867-23.948284.130867.083508 6.733452 6.966938 9.578857 14.511234 6.595451 2.825097-1.117195 5.998642-1.471245 9.053643-1.82634 1.098709-.127716 3.113273.545495 3.301742 1.236969.32544 1.194062-.032905 3.027733-.827873 4.003777-7.876076 9.670074-27.663616 11.67041-35.053696-2.775368-.37825-.739387-.740116-1.487175-1.209434-2.628524m21.855301-21.387627c-8.312378-.500054-11.116432 1.139831-11.648991 6.963692h17.399792c.303978-.341423.607948-.682854.911926-1.024277-1.951652-1.925232-3.903305-3.850456-6.662727-5.939415z" fill="#fbfbfc"/><path d="m112.705078 105.144684c-9.038956-.209465-12.11486-3.95266-11.705711-13.662987.29615-7.028824 4.370674-11.031319 10.929207-10.626144 3.760002.232292 6.543068 1.937874 8.14833 5.518051 3.554001 7.926353.352989 16.640907-7.371826 18.77108z" fill="#1e2a56"/><path d="m69.294495 81.13826c2.355537 2.007088 4.30719 3.932312 6.258842 5.857544-.303978.341423-.607948.682854-.911926 1.024277-5.795151 0-11.590309 0-17.399792 0 .532559-5.823861 3.336613-7.463746 12.052876-6.881821z" fill="#212e59"/></svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
Reference in New Issue
Block a user