Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
sphere-viewer
Advanced tools
A simple JavaScript library for displaying spherical images on desktop and mobile browsers
Displays photo spheres created with Ricoh Theta or Google Street View App on mobile and desktop browsers.
Live demo is available on CodePen.io http://codepen.io/knee-cola/pen/vxQYNL
There is none ... you can figure it out from provided example files in the examples folder @ GitHub. The code inside the HTML files is well documented.
Four examples are provided:
To install it via NPM run:
npm i -D --save-dev sphere-viewer
Then just import it in your JavaScript ... for example, like this:
import SphereViewer from 'sphere-viewer'
If you use the vanilla JavaScript, link the lib from HTML like this (the code bellow also includes dependencies):
<script src="//code.jquery.com/jquery-3.2.1.slim.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/three.js/85/three.min.js"></script>
<script type="text/javascript" src="//cdn.rawgit.com/knee-cola/SphereViewer/042c4c83/dist/sphereViewer.min.js"></script>
If you want to store files localy on yout server, you can download the minified file from GitHub repository.
SphereViewer was build with:
var isMobile = window.devicePixelRatio!==1;
// defining options
var config = {
// providing multiple images for the pre-loader
sphere: ['img/sphere/preloader.jpg', 'img/sphere/hd.jpg'],
// (optional) setting up a logo, which will be displayed at the bottom
// of the sphere, which is usefull for hiding the triopod
logo:'img/logo.png',
// (optional) defining hint, which will be displayed in the center
// of the screen and is hidden after the user clicks/taps the screen
hint: isMobile ? 'img/sphere-icon-mobile.png' : 'img/sphere-icon-desktop.png',
// (optional) overriding the default control config
control: {
autoRotate: true
},
// (optional) overidding the default spinner config
spinner: {
groupRadius: 20
},
// (optional) defining what the close button should contain
//
// The HTML specified here will be placed inside a <div>
// we can the style it as we wish via CSS.
// When user clicks/taps the button, the sphere will close
// and dispatch 'closed' event
// If this param is ommited from config, the close button will not be displayed
closeButton: {
html: '<i class="cmdCloseSphere material-icons">highlight_off</i>'
},
// (optional) Here we could override the default THREE.js UV mapping, by providing a mapper function
// uvMapper: (geometry) => { ... doing some custom UV mapping ... }
};
// creating a new instance of the viewer
// ... the viewer will automaticall be appended to <body> and displayed
var viewer = new SphereViewer.Viewer(config);
// adding event handlers:
viewer.addEventListener('close', function() { console.log('sphere closed'); });
SphereViewer is licensed under the MIT License.
FAQs
A simple JavaScript library for displaying spherical images on desktop and mobile browsers
The npm package sphere-viewer receives a total of 0 weekly downloads. As such, sphere-viewer popularity was classified as not popular.
We found that sphere-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.