This post is addressed to who ever is in charge of the main site design. But if you're just a member like me, feel free to weigh in as well.
I frequently make use of the zoom buttons on the main gallery, mostly because my screen is a high-DPI display, and certain elements tend to be pretty small.
Also due to my High-DPI display, the default 1x zoom on pixel art
is often too small to read clearly, so I have to usually press the Zoom
[+] button at least once to even see anything. Having an option in our user settings to set our "Default Zoom Level" would be really nice.
But the one thing that bothers me about the Zoom buttons, is that since they're below the image, when the image expands it pushes the Zoom buttons down with it. So if I want to click the button to quickly Zoom 2 or 3 times on a really small piece, I have to click, then chase the moved button down with my cursor, then click again, and chase it again, etc.
Aesthetically, I think the buttons look good below the image, but just due to how HTML works, the buttons move. And there's nothing more annoying than when an interface button just moves from under your cursor.
I figure the Zoom buttons would be a bit more functional above the image, because they won't move down the page when the image expands.
Since I'm currently learning JavaScript, I decided to try and tackle this problem myself.
I copied PixelJoint's layout, then removed anything unnecessary to my task. Then I set out to modify the buttons and reverse engineer the Zoom script:
https://jameso2.neocities.org/experiments/pj/pj.html - https://jameso2.neocities.org/experiments/pj/pj.html
(Note, my sample page above is using a Dark Theme CSS mod.)
I decided that since I'm doing the Zoom script from scratch, I might as well add a few features: - The buttons are a bit bigger, making them easier to press (again, my High-DPI display makes the buttons really tiny and hard to line up my cursor on)
- In the code, you can specify a "default zoom level" so that gallery items start at 2x, or 3x, or whatever your preferred zoom level is.
- "Default Zoom Level" can be set independently for the Main Image and the Small Image (preview). So you can have the main images open up at 2x, and leave the preview default at 1x -- or vice versa.
- I added a middle button between the [-] and [+] buttons. The middle button will reset the Zoom to 1x.
- If you are already at 1x zoom, pressing the middle button again will switch you to double the default zoom (2x by default, but if your default zoom is 2x it sets to 4x). -- So this button basically acts as a quick-toggle.
- The middle button also displays your current Zoom level as text.
You can check out the bare-bones clean code here: https://codepen.io/jameso2/pen/YzpedJB - https://codepen.io/jameso2/pen/YzpedJB
Since the image defaults are stored in an array, this script could theoretically support any number of images on a page at once, not just the two.
So, what does everyone think?
If this doesn't get implemented into the PixelJoint code, I might try to convert this to a Grease Monkey script. But that'd take a bit more time to figure out.
|