npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svelte-panorama-component

v1.0.2

Published

Small footprint fast responsive 360 degree equirectangular image viewer

Downloads

15

Readme

svelte-panorama-component

Lightweight standalone responsive 360 degree panorama web component that leverages webgl to project an equirectangular image onto an HTML canvas. This is web component so it can be leveraged in any project (react, vue, angular, svelte, or just plain HTML). The intent of this component is to be small in final size, very fast, and easy to use. Minified it is under 63KB. Compare this to three.js (commonly used to achieve the same effect, or most similar panorama only libraries that actually use three.js under the hood) which sits minified at 588KB. It should be noted this is not a replacement for three.js which functions as an excellent 3d framework since this has a very specific use case.

Attributes

  • src: exactly the same as src for an image formats that should work are listed in OGL's TextureLoader it is required. For the component to work correctly it needs to be an equirectangular image.
  • alt: an aria-label applied to the element, this defaults to "Panoramic View" and can be ignored.
  • class: exactly what you would expect, puts a class on the canvas wrapper this can be used to override the default 100% width and height
  • fov: accepts an integer and indicates the field of view in degrees of the projection defaults to 30.

Usage

Svelte

<script>
  import Panorama from 'svelte-panorama-component';
</script>

<Panorama src="some-equirectangular-360-image.jpg" alt="Pretty Sky" />

Anything else as a web component

custom elements everywhere

Add .js or .mjs file however you want, either in a bundler or directly to the page via Script tag, then...

<svelte-panorama src="some-equirectangular-360-image.jpg" alt="Pretty Sky"></svelte-panorama>

A sample of the web component working can be found on here using the following images outdoor 360 and indoor 360

Feel free to check out the source of that page at docs/index.html