fix: settings fix, keybinds fix (WIP), modal ui fix

This commit is contained in:
David Ralph
2021-11-11 10:51:45 +00:00
parent 8966336b93
commit 8aca9ae31c
8 changed files with 78 additions and 42 deletions

View File

@@ -209,7 +209,7 @@
},
{
"name": "backgroundFilter",
"value": "grayscale"
"value": "none"
},
{
"name": "apiQuality",

View File

@@ -115,13 +115,15 @@ export function loadSettings(hotreload) {
return;
}
const js = localStorage.getItem('customjs');
if (js) {
try {
// eslint-disable-next-line no-eval
eval(js);
} catch (e) {
console.error('Failed to run custom JS: ', e);
if (window.location.href.startsWith('http://') || window.location.href.startsWith('https://')){
const js = localStorage.getItem('customjs');
if (js) {
try {
// eslint-disable-next-line no-eval
eval(js);
} catch (e) {
console.error('Failed to run custom JS: ', e);
}
}
}

View File

@@ -42,10 +42,30 @@ export function importSettings(e) {
export function values(type) {
const marks = {
zoom: [{ value: 10, label: '0.1x' }, { value: 100, label: '1x' }, { value: 200, label: '2x' }, { value: 400, label: '4x' }],
toast: [{ value: 500, label: '0.5s' }, { value: 1000, label: '1s' }, { value: 1500, label: '1.5s' }, { value: 2000, label: '2s' }, { value: 2500, label: '2.5s' }, { value: 3000, label: '3s' }, { value: 4000, label: '4s' }, { value: 5000, label: '5s'}],
background: [{ value: 0, label: '0%'}, { value: 25, label: '25%' }, { value: 50, label: '50%' }, { value: 75, label: '75%' }, { value: 100, label: '100%' }]
}
zoom: [
{ value: 10, label: '0.1x' },
{ value: 100, label: '1x' },
{ value: 200, label: '2x' },
{ value: 400, label: '4x' }
],
toast: [
{ value: 500, label: '0.5s' },
{ value: 1000, label: '1s' },
{ value: 1500, label: '1.5s' },
{ value: 2000, label: '2s' },
{ value: 2500, label: '2.5s' },
{ value: 3000, label: '3s' },
{ value: 4000, label: '4s' },
{ value: 5000, label: '5s'}
],
background: [
{ value: 0, label: '0%'},
{ value: 25, label: '25%' },
{ value: 50, label: '50%' },
{ value: 75, label: '75%' },
{ value: 100, label: '100%' }
]
};
return marks[type];
}