vyleung / logseq-helium-plugin

a Logseq plugin to float items (e.g. videos) for an improved note-taking experience
MIT License
84 stars 6 forks source link

Increasing video width and diagonal makes balloon jump around #11

Open teun95 opened 1 year ago

teun95 commented 1 year ago

When pressing + to increase the video height and width, the balloon and controls move to the right as much as the video becomes larger.

When wanting to increase the video size multiple "clicks", it's not possible to double or triple click a few fimes as the controls will have moved after each click.

To prevent this behaviour, perhaps it is possible to fix the position of the controls relative to the right side of the screen instead of relative to the video?

t-hex commented 7 months ago

This is exactly what I also have a problem with. When I insert a video, it is always very small on bigger screen monitor so I am taking advantage of resize controls to enlarge it. However, clicking the buttons to increase width always moves controls and I have to chase it with cursor.

I think quite simple approach could be to add keyboard shortcuts to trigger resize functions instead of clicking.

Or move controls as @teun95 suggested, either fixed position to the right of the window -or- somewhere above top-left corner of the video (which might require some padding added to the video to not overlap blocks of text above the video with controls).

t-hex commented 7 months ago

So I am not a JavaScript developer but following up what already is in the code, these mappings work for me just fine. Resizing video using CTRL+ALT+.

logseq.App.registerCommandPalette({
  key:"helium-video-dimension-controls-IW",
  label:"Increase video width",
  keybinding:{
    binding:"mod+alt+right",
    mode:"global"
  }
},async()=>{logseq.Editor.exitEditingMode(!0),video_dimensions="increase width",videoDimensionsControls()});
logseq.App.registerCommandPalette({
  key:"helium-video-dimension-controls-DW",
  label:"Decrease video width",
  keybinding:{
    binding:"mod+alt+left",
    mode:"global"
  }
},async()=>{logseq.Editor.exitEditingMode(!0),video_dimensions="decrease width",videoDimensionsControls()});
logseq.App.registerCommandPalette({
  key:"helium-video-dimension-controls-DH",
  label:"Decrease video height",
  keybinding:{
    binding:"mod+alt+up",
    mode:"global"
  }
},async()=>{logseq.Editor.exitEditingMode(!0),video_dimensions="decrease height",videoDimensionsControls()});
logseq.App.registerCommandPalette({
  key:"helium-video-dimension-controls-IH",
  label:"Incraese video height",
  keybinding:{
    binding:"mod+alt+down",
    mode:"global"
  }
},async()=>{logseq.Editor.exitEditingMode(!0),video_dimensions="increase height",videoDimensionsControls()});