Library for creating custom image elements on Furaffinity
This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/492931/1803337/Furaffinity-Submission-Image-Viewer.js
Library for creating image elements on FurAffinity.
See documentation on Furaffinity-Submission-Image-Viewer.
@require this script
Create a new Custom Image Viewer:
const baseElem = document.createElement("div");
const faImageViewer = new FAImageViewer(baseElem, imgSrc, prevSrc);
faImageViewer.load(); // starts loading the image
Optional: Subscribe to Events:
faImageViewer.onImageLoad(() => doSomething()); // occurs if the image is fully loaded
faImageViewer.onImageLoadStart(() => doSomething()); // occurs if the image started loading
faImageViewer.onPreviewImageLoad(() => doSomething()); // occurs if the preview image fully loaded
⠀
faImageViewer.addEventListener("image-load", () => doSomething()); // alternative to onImageLoad
faImageViewer.addEventListener("image-load-start", () => doSomething()); // alternative to onImageLoadStart
faImageViewer.addEventListener("preview-image-load", () => doSomething()); // alternative to onPreviewImageLoad
| Feature | Status |
|---|---|
| Support preview image | ✅ Completed |
| Have different events for image loading | ✅ Completed |
| Zooming and panning via panzoom | ✅ Completed |