decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
60 stars 15 forks source link

Limit zoom in zoom plugin to 2x or 3x #91

Closed kno10 closed 8 months ago

kno10 commented 10 months ago

The decker zoom plugin (as opposed to the reveal.js zoom plugin) does not have a maximum zoom level.

It happens to me a lot that I click on a small equation, and then reveal.js zooms in way too much (e.g., if you end up clicking on a single math $x$). I have disabled the zoom plugin because of this behaviour - it fails me more often than I use it.

I suggest to add a configuration option to set a maximum zoom (e.g., 2 or 3), configurable.

salbeira commented 10 months ago

I also often see people presenting rapidly double clicking on anything they are currently focusing on. Short pieces of text can quickly turn into a fest of zoom ins and outs. This also always selects text which can turn into quite the visual overload.

Maybe we should add a few things to this:

These are things I played around with a bit to see what can be done with the current zoom-plugin.

Config options would be:

zoom:
    max: number
    outline: string -> e.g. '2px solid var(--foreground-color)'
    ping: true | false

omitting any values should keep current behaviour.

mbotsch commented 10 months ago

When the main problem is that people accidentially zoom through dbl click, what about simply mapping zoom to ctrl-click?

kno10 commented 10 months ago

Ctrl-Click / Alt-Click is the behavior of the standard reveal.js zoom plugin, with a fixed zoom factor, default value 2. I have not yet tried it, whether this behavior suits me better.

balochy commented 8 months ago

To add to this conversation, I usually copy and search for certain Terms by double clicking -> right-click -> search in google or Translate options . and the zoom operation is annoying in that regard as it zooms instantly and I miss my right click, no one really uses zoom on slides unless there is a picture under it so adding a function that determines to zoom or not based on cursor location is great.

mbotsch commented 8 months ago

I added two config options to the zoom plugin, to be defined in decker.yaml or default.yaml:

zoom:
    max: <number>
    trigger: "doubleClick" | "tripleClick" | "altClick" 

The default is max=100 and trigger=doubleClick.