Furaffinity-Submission-Image-Viewer

Library for creating custom image elements on Furaffinity

Stan na 19-04-2024. Zobacz najnowsza wersja.

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greatest.deepsurf.us/scripts/492931/1362749/Furaffinity-Submission-Image-Viewer.js

Autor
Midori Tsume
Wersja
1.0.1
Utworzono
19-04-2024
Zaktualizowano
19-04-2024
Rozmiar
4,38 KB
Licencja
MIT

Furaffinity Custom Image Viewer

Library for creating image elements on Furaffinity. Also see this Script on Github as Furaffinity-Submission-Image-Viewer

How to use

  • @require this script
  • Create a new Custom Image Viewer:
  const baseElem = document.createElement("div");
  const faImageViewer = new CustomImageViewer(imgSrc, prevSrc);
  faImageViewer.load(baseElem);
  • Optional: Subscribe to Events:
  faImageViewer.onImageLoad(() => doSomthing()); // occurs if the image is fully loaded
  faImageViewer.onImageLoadStart(() => doSomthing()); // occurs if the image started loading
  faImageViewer.onPreviewImageLoad(() => doSomthing()); // occurs if the preview image fully loaded

Documentation

CustomImageViewer

The CustomImageViewer class contains following Properties:

  • imageUrl - the image url
  • previewUrl - the preview image url
  • parentContainer - the parent container on which the image will be created
  • faImage - the image element
  • faImagePreview - the preview image element
  • onImageLoad - the callback for when the image is fully loaded
  • onImageLoadStart - the callback for when the image starts loading
  • onPreviewImageLoad - the callback for when the preview image is fully loaded
  • hasReset - if the image has been reset

Functions:

  • load() - starts loading the image
  • reset() - resets the image