Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

photo-sphere-viewer-lensflare-plugin

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

photo-sphere-viewer-lensflare-plugin

Plugin to add lens flares on a 360° pano built with photo-sphere-viewer

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
933
decreased by-42.26%
Maintainers
1
Weekly downloads
 
Created
Source

photo-sphere-viewer-lensflare-plugin

Plugin to add lens flares to a Photo Sphere Viewer (Library: PhotoSphereViewer) by mistic100

lensflare

Installation

NPM

npm install photo-sphere-viewer-lensflare-plugin

Yarn

yarn add photo-sphere-viewer-lensflare-plugin

Usage

HTML

<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer-lensflare-plugin/dist/index.min.js"></script>

JavaScript

import PhotoSphereViewerLensflarePlugin from 'photo-sphere-viewer-lensflare-plugin';
const viewer = new PhotoSphereViewer.Viewer({
    container: document.querySelector('#viewer'),
    panorama: 'pano.jpg',
    plugins: [
        [PhotoSphereViewerLensflarePlugin, {
            lensflares: [
                {
                    id: 'sun',
                    position: { yaw: '145deg', pitch: '2deg' },
                    type: 0,
                }
            ]
        }]
    ]
});

Options

OptionTypeDefaultDescription
lensflaresArray[]Array of lens flares

Lens Flare Options

OptionTypeDefaultDescription
idString''ID of the lens flare
positionObject{ yaw: '0deg', pitch: '0deg' }Position of the lens flare
typeNumber0Type of the lens flare (available: 0)
colorHSL{ h: 0.08, s: 0.2, l: 0.5 }Color of the lens flare

Examples

Run the provided example

npm run test

Add multiple lens flares

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 },
                }
            ]
        }]
    ]
});

Result of the example

multilens

Keywords

FAQs

Package last updated on 18 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc