Compare commits

...

2 Commits

Author SHA1 Message Date
0d295c6361 Scroll lamps to 255 as they should be 2024-12-29 00:45:24 +01:00
fbffdc40f6 Shift = scroll smaller 2024-12-29 00:43:58 +01:00
2 changed files with 5 additions and 2 deletions

View File

@@ -15,7 +15,8 @@
function handleWheel(event: WheelEvent) {
event.preventDefault();
const delta = event.deltaY > 0 ? -4 : 4;
const increment = event.shiftKey ? 1 : 4;
const delta = event.deltaY > 0 ? -increment : increment;
const newBrightness = Math.max(0, Math.min(100, brightness + delta));
if (newBrightness !== brightness) {
brightness = newBrightness;

View File

@@ -11,7 +11,9 @@
});
function handleBrightnessChange(lamp: number, brightness: number) {
SetLampBrightness(lamp, brightness);
// Brightness is actually 1-255 and not 1-100
// But we want the frontend to show 1-100 as in %
SetLampBrightness(lamp, Math.round(brightness * 2.55));
}
</script>