mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 02:56:16 +08:00
parent
131b6c7c1f
commit
c4bd171f1a
2 changed files with 6 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as UpdateConfig from "../config";
|
||||
import * as Notifications from "./notifications";
|
||||
import * as ConfigEvent from "../observables/config-event";
|
||||
import { debounce } from "throttle-debounce";
|
||||
|
||||
const filters = {
|
||||
blur: {
|
||||
|
@ -116,12 +116,15 @@ $(".section.customBackgroundFilter .opacity input").on("input", () => {
|
|||
apply();
|
||||
});
|
||||
|
||||
$(".section.customBackgroundFilter .save.button").on("click", () => {
|
||||
$(".section.customBackgroundFilter input").on("input", () => {
|
||||
debouncedSave();
|
||||
});
|
||||
|
||||
const debouncedSave = debounce(2000, async () => {
|
||||
const arr = Object.keys(filters).map(
|
||||
(filterKey) => filters[filterKey as keyof typeof filters].value
|
||||
) as MonkeyTypes.CustomBackgroundFilter;
|
||||
UpdateConfig.setCustomBackgroundFilter(arr, false);
|
||||
Notifications.add("Custom background filters saved", 1);
|
||||
});
|
||||
|
||||
ConfigEvent.subscribe((eventKey, eventValue) => {
|
||||
|
|
|
@ -1734,12 +1734,6 @@
|
|||
<div class="value"></div>
|
||||
<input type="range" min="0" max="1" value="1" step="0.1" />
|
||||
</div>
|
||||
<div class="saveContainer">
|
||||
<div class="save button" style="grid-column: 3">
|
||||
<!-- <i class="fas fa-save fa-fw"></i> -->
|
||||
save
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section autoSwitchTheme">
|
||||
|
|
Loading…
Add table
Reference in a new issue