Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
photo-sphere-viewer-lensflare-plugin
Advanced tools
Plugin to add lens flares on a 360° pano built with photo-sphere-viewer
Plugin to add lens flares to a Photo Sphere Viewer (Library: PhotoSphereViewer) by mistic100
npm install photo-sphere-viewer-lensflare-plugin
yarn add photo-sphere-viewer-lensflare-plugin
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer-lensflare-plugin/dist/index.min.js"></script>
import { LensflarePlugin } from 'photo-sphere-viewer-lensflare-plugin';
const viewer = new PhotoSphereViewer.Viewer({
container: document.querySelector('#viewer'),
panorama: 'pano.jpg',
plugins: [
[LensflarePlugin, {
lensflares: [
{
id: 'sun',
position: { yaw: '145deg', pitch: '2deg' },
type: 0,
}
]
}]
]
});
Option | Type | Default | Description |
---|---|---|---|
lensflares | Array | [] | Array of lens flares |
Option | Type | Default | Description |
---|---|---|---|
id | String | '' | ID of the lens flare |
position | Object | { yaw: '0deg', pitch: '0deg' } | Position of the lens flare |
type | Number | 0 | Type of the lens flare (available: 0) |
color | HSL | { h: 0.08, s: 0.2, l: 0.5 } | Color of the lens flare |
To call methods you need to get the plugin instance.
const lensflaresPlugin = viewer.getPlugin(LensflarePlugin);
and then you can call the methods.
toggleAllLensflares
Toggle all lens flares.
lensflaresPlugin.toggleAllLensflares();
showAllLensflares
Show all lens flares.
lensflaresPlugin.showAllLensflares();
hideAllLensflares
Hide all lens flares.
lensflaresPlugin.hideAllLensflares();
getNbLensflares
Get the number of lens flares.
const nb = lensflaresPlugin.getNbLensflares();
getLensflares
Get all the lens flares.
const lensflares: LensflareObject[] = lensflaresPlugin.getLensflares();
getLensflare
Get a lens flare.
const lensflare: LensflareObject = lensflaresPlugin.getLensflare('sun');
addLensflare
Add a lens flare.
lensflaresPlugin.addLensflare({
id: 'sun',
position: { yaw: '145deg', pitch: '2deg' },
type: 0,
});
updateLensflare
Update a lens flare.
lensflaresPlugin.updateLensflare({
id: 'sun',
position: { yaw: '145deg', pitch: '2deg' },
type: 0,
});
removeLensflare
Remove a lens flare.
lensflaresPlugin.removeLensflare('sun');
removeLensflares
Remove multiple lens flares.
lensflaresPlugin.removeLensflares(['sun', 'moon']);
setLensflares
Clear all lens flares and add new ones.
lensflaresPlugin.setLensflares([
{
id: 'sun',
position: { yaw: '145deg', pitch: '2deg' },
type: 0,
},
{
id: 'moon',
position: { yaw: '30.6deg', pitch: '41.2deg' },
type: 0,
}
]);
clearLensflares
Clear all lens flares.
lensflaresPlugin.clearLensflares();
npm run test
const viewer = new PhotoSphereViewer.Viewer({
container: document.querySelector('#viewer'),
panorama: 'pano.jpg',
defaultYaw: 20.75,
defaultPitch: 0.17,
plugins: [
[PhotoSphereViewerLensflarePlugin, {
lensflares: [
{
id: 'sun',
position: { yaw: '145deg', pitch: '2deg' },
},
{
id: 'moon',
position: { yaw: '30.6deg', pitch: '41.2deg' },
color: { h: 0.6, s: 0.5, l: 0.2 },
}
]
}]
]
});
FAQs
Plugin to add lens flares on a 360° pano built with photo-sphere-viewer
The npm package photo-sphere-viewer-lensflare-plugin receives a total of 711 weekly downloads. As such, photo-sphere-viewer-lensflare-plugin popularity was classified as not popular.
We found that photo-sphere-viewer-lensflare-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.