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 - npm Package Compare versions

Comparing version 0.9.2 to 1.0.1

71

dist/index.d.ts

@@ -16,4 +16,11 @@ import { AbstractPlugin, Viewer, ExtendedPosition, Position, Size, TypedEvent } from '@photo-sphere-viewer/core';

id: string;
type: number;
/**
* Type of the lensflare
* currently-supported: 0
*
* @default 0
* @see LensflareType
*/
type?: number;
/**
* Position of the lensflare (required but for `polygon` and `polyline`)

@@ -59,10 +66,2 @@ */

/**
* CSS class(es) added to the lensflare element (ignored for `imageLayer`)
*/
className?: string;
/**
* CSS properties to set on the lensflare (background, border, etc.) (ignored for `imagerLayer`)
*/
style?: Record<string, string>;
/**
* Defines where the lensflare is placed toward its defined position

@@ -73,7 +72,2 @@ * @default 'center center'

/**
* The zoom level which will be applied when calling `gotoLensflare()` method or when clicking on the lensflare in the list
* @default `current zoom level`
*/
zoomLvl?: number;
/**
* Initial visibility of the lensflare

@@ -101,2 +95,3 @@ * @default true

constructor(viewer: Viewer, config: LensflareConfig);
private refreshAfterLoad;
destroy(): void;

@@ -125,25 +120,2 @@ addLight(h: number, s: number, l: number, x: number, y: number, z: number): PointLight;

/**
* @event Triggered when the user puts the cursor away from a lensflare
*/
declare class LeaveLensflareEvent extends LensflaresPluginEvent {
readonly lensflare: LensflareObject;
static readonly type = "leave-lensflare";
constructor(lensflare: LensflareObject);
}
/**
* @event Triggered when the user puts the cursor hover a lensflare
*/
declare class EnterLensflareEvent extends LensflaresPluginEvent {
readonly lensflare: LensflareObject;
static readonly type = "enter-lensflare";
constructor(lensflare: LensflareObject);
}
/**
* @event Triggered when the lensflares are hidden
*/
declare class HideLensflaresEvent extends LensflaresPluginEvent {
static readonly type = "hide-lensflares";
constructor();
}
/**
* @event Triggered when the lensflares change

@@ -156,19 +128,3 @@ */

}
/**
* @event Triggered when the lensflares are shown
*/
declare class ShowLensflaresEvent extends LensflaresPluginEvent {
static readonly type = "show-lensflares";
constructor();
}
/**
* @event Used to alter the list of lensflares displayed in the side-panel
*/
declare class RenderLensflaresListEvent extends LensflaresPluginEvent {
lensflares: LensflareObject[];
static readonly type = "render-lensflares-list";
constructor(/** the list of lensflares to display, can be modified */
lensflares: LensflareObject[]);
}
type LensflaresPluginEvents = LensflareVisibilityEvent | LeaveLensflareEvent | EnterLensflareEvent | HideLensflaresEvent | SetLensflaresEvent | ShowLensflaresEvent | RenderLensflaresListEvent;
type LensflaresPluginEvents = LensflareVisibilityEvent | SetLensflaresEvent;
declare class LensflarePlugin extends AbstractPlugin<LensflaresPluginEvents> {

@@ -308,10 +264,3 @@ static readonly id = "lensflare";

private __afterChangerLensflares;
/**
* Adds or remove the objects observer if there are 3D lensflares
*/
/**
* Adds or remove the objects observer if there are 3D lensflares
*/
private __checkObjectsObserver;
}
export { LensflarePlugin };

@@ -16,4 +16,11 @@ import { AbstractPlugin, Viewer, ExtendedPosition, Position, Size, TypedEvent } from '@photo-sphere-viewer/core';

id: string;
type: number;
/**
* Type of the lensflare
* currently-supported: 0
*
* @default 0
* @see LensflareType
*/
type?: number;
/**
* Position of the lensflare (required but for `polygon` and `polyline`)

@@ -59,10 +66,2 @@ */

/**
* CSS class(es) added to the lensflare element (ignored for `imageLayer`)
*/
className?: string;
/**
* CSS properties to set on the lensflare (background, border, etc.) (ignored for `imagerLayer`)
*/
style?: Record<string, string>;
/**
* Defines where the lensflare is placed toward its defined position

@@ -73,7 +72,2 @@ * @default 'center center'

/**
* The zoom level which will be applied when calling `gotoLensflare()` method or when clicking on the lensflare in the list
* @default `current zoom level`
*/
zoomLvl?: number;
/**
* Initial visibility of the lensflare

@@ -101,2 +95,3 @@ * @default true

constructor(viewer: Viewer, config: LensflareConfig);
private refreshAfterLoad;
destroy(): void;

@@ -125,25 +120,2 @@ addLight(h: number, s: number, l: number, x: number, y: number, z: number): PointLight;

/**
* @event Triggered when the user puts the cursor away from a lensflare
*/
declare class LeaveLensflareEvent extends LensflaresPluginEvent {
readonly lensflare: LensflareObject;
static readonly type = "leave-lensflare";
constructor(lensflare: LensflareObject);
}
/**
* @event Triggered when the user puts the cursor hover a lensflare
*/
declare class EnterLensflareEvent extends LensflaresPluginEvent {
readonly lensflare: LensflareObject;
static readonly type = "enter-lensflare";
constructor(lensflare: LensflareObject);
}
/**
* @event Triggered when the lensflares are hidden
*/
declare class HideLensflaresEvent extends LensflaresPluginEvent {
static readonly type = "hide-lensflares";
constructor();
}
/**
* @event Triggered when the lensflares change

@@ -156,19 +128,3 @@ */

}
/**
* @event Triggered when the lensflares are shown
*/
declare class ShowLensflaresEvent extends LensflaresPluginEvent {
static readonly type = "show-lensflares";
constructor();
}
/**
* @event Used to alter the list of lensflares displayed in the side-panel
*/
declare class RenderLensflaresListEvent extends LensflaresPluginEvent {
lensflares: LensflareObject[];
static readonly type = "render-lensflares-list";
constructor(/** the list of lensflares to display, can be modified */
lensflares: LensflareObject[]);
}
type LensflaresPluginEvents = LensflareVisibilityEvent | LeaveLensflareEvent | EnterLensflareEvent | HideLensflaresEvent | SetLensflaresEvent | ShowLensflaresEvent | RenderLensflaresListEvent;
type LensflaresPluginEvents = LensflareVisibilityEvent | SetLensflaresEvent;
declare class LensflarePlugin extends AbstractPlugin<LensflaresPluginEvents> {

@@ -308,10 +264,3 @@ static readonly id = "lensflare";

private __afterChangerLensflares;
/**
* Adds or remove the objects observer if there are 3D lensflares
*/
/**
* Adds or remove the objects observer if there are 3D lensflares
*/
private __checkObjectsObserver;
}
export { LensflarePlugin };

2

dist/package.json
{
"name": "photo-sphere-viewer-lensflare-plugin",
"version": "0.9.2",
"version": "1.0.1",
"description": "Plugin to add lens flares on a 360° pano built with photo-sphere-viewer",

@@ -5,0 +5,0 @@ "main": "index.js",

{
"name": "photo-sphere-viewer-lensflare-plugin",
"version": "0.9.2",
"version": "1.0.1",
"description": "Plugin to add lens flares on a 360° pano built with photo-sphere-viewer",

@@ -15,3 +15,4 @@ "main": "dist/index.js",

"predeploy": "cd example && npm install && npm run build",
"deploy": "gh-pages -d example/build"
"deploy": "gh-pages -d example/build",
"test": "npx concurrently \"npm run start\" \"serve -p 3000 -s dist\" \"serve -p 8080 -s example\" \"start http://localhost:8080\""
},

@@ -18,0 +19,0 @@ "repository": {

@@ -10,3 +10,3 @@ # photo-sphere-viewer-lensflare-plugin

```bash
```sh
npm install photo-sphere-viewer-lensflare-plugin

@@ -17,3 +17,3 @@ ```

```bash
```sh
yarn add photo-sphere-viewer-lensflare-plugin

@@ -27,3 +27,3 @@ ```

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

@@ -54,1 +54,55 @@

```
## Options
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `lensflares` | `Array` | `[]` | Array of lens flares |
### Lens Flare Options
| 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 |
## Examples
### Run the provided example
```sh
npm run test
```
### Add multiple lens flares
```js
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](https://user-images.githubusercontent.com/14907987/212864401-fa0861c7-b089-4681-b290-dce7a4a7c669.gif)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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