☰

Danbooru Smart Canvas

Creates an adaptive canvas to enable zoom & pan for images on Danbooru (when viewing original) using scroll & drag, and click to set zoom to 1x/reset zoom

יש גרסאות של סקריפט זה עם קוד מעודכן. הצג את כל הגרסאות

  • v1.3 06-10-2026

    Smoother zooming & bug fixes

    • Zooming with a trackpad is now smoother and scales with how far you scroll (mouse wheel zooms the same as before)
    • Panning and zooming are smoother, especially on images with lots of notes
    • Fixed horizontal scrolling (trackpad swipes, tilt wheels) zooming the image out
    • Resizing the browser window now keeps the image fitted and centered if it was at its default size
    • Fixed the script sometimes not starting if the page finished loading before the script did
    • Fixed duplicate canvases/controls if the image gets reloaded on the same page
    • Misc cleanup
  • v1.2 02-05-2026

    Video & ugoira fixes

    • Fixed video controls scaling up with the zoom level; they now stay at native size and stick to the bottom of the video
    • Clicking on a zoomed video no longer resets the canvas (background clicks still do)
    • Dragging a zoomed video no longer toggles play/pause when you release
    • Scrub bar and volume drags work properly while zoomed
    • Same fixes apply to ugoiras now that Danbooru serves them through the same player
    • Misc cleanup and a small bug fix in the resize handler
  • v1.1 05-06-2025

    Big update!

    • Lots of refactoring and tidying up
    • Added an Autoscroll option (enabled by default - you'll like it!)
    • Fixed a bug that was messing up CSS transitions on the canvas and enabled a smooth transition effect
    • The canvas & image now resizes with the browser seamlessly
    • Set the zoom indicator to show 2 decimals
    • Made clicking the zoom indicator trigger the autoscroll functionality on-demand (even if the option is disabled)
    • Miscellaneous styling tweaks
  • v1.0.2 02-06-2025

    Fixed an issue with annotations (notes) not appearing correctly on the canvas.

  • v1.0.1 02-06-2025

    Increased the default zoom display (top-right) font size, and added a constant to the top of the script to allow users to easily modify as desired.

  • v1 02-06-2025