Deathamns / Viewhance

Enhancements for the browser's default media viewer
https://deathamns.github.io/Viewhance/
Other
99 stars 23 forks source link

[FR] Floating menu over the top-left image corner #79

Closed eadmaster closed 2 years ago

eadmaster commented 3 years ago

when opening small images i have to move the mouse a lot to reach the floating menu. Can you add an option to always showing over the image itself?

dnknn commented 3 years ago

@eadmaster I personally disagree with your opinion, but maybe you can implement it yourself :

      #menu#menu {
          ....your custom CSS style.....
      }
eadmaster commented 3 years ago

ok, i'll try but i won't send a PR with an user option for that.

The file to change is this, right?

dnknn commented 3 years ago

The file to change is this, right?

no... no need to change file chrome-extension://impppjchnpfgknmbaaghfeopcgfoilac/options.html

eadmaster commented 3 years ago

oh i see now, it's in the addon settings :-)

eadmaster commented 3 years ago

to have the floating menu in the top-left image corner which Css properties should i set? (sorry, i'm a backend guy :-))

dnknn commented 3 years ago
#menu#menu#menu {
        display: inline-flex!important;
        opacity:1!important;
        left:22% !important;  /*For example:...*/
        /*👆 Absolute position ! */
}

CSS is also very powerful, but for this kind of demand scenario you want, you need to judge the position of the image, and CSS is estimated to be unable to meet your needs. CSS can change the position or appearance, etc., but if it is a dynamic judgment of complex logic, JavaScript can be used.

The scene you need is complicated, for example, zooming out can zoom in/out, for example, the image can also be large/small.

ps: In fact, I think your need is meaningless, The floating menu is the most perfect place in the upper left corner, because it will not interfere with our normal image viewing or operation. Take a step back: if it really resembles your needs, then you will also find that it is not perfect.

Deathamns commented 2 years ago

The implementation would be unnecessary complicated and inconsistent (different sizes, rotated images...). The current way is fine.