@omnedia/ngx-light-rays
Version:
A simple component library to create an underwater light ray background effect.
48 lines (44 loc) • 2.32 kB
TypeScript
import * as i0 from '@angular/core';
import { AfterViewInit, OnDestroy, ElementRef } from '@angular/core';
type RaysOrigin = 'top-center' | 'top-left' | 'top-right' | 'right' | 'left' | 'bottom-center' | 'bottom-right' | 'bottom-left';
declare class NgxLightRaysComponent implements AfterViewInit, OnDestroy {
private platformId;
containerRef: ElementRef<HTMLDivElement>;
raysOrigin: RaysOrigin;
raysColor: string;
raysSpeed: number;
lightSpread: number;
rayLength: number;
pulsating: boolean;
fadeDistance: number;
saturation: number;
followMouse: boolean;
mouseInfluence: number;
noiseAmount: number;
distortion: number;
styleClass?: string;
private renderer?;
private program?;
private mesh?;
private animationId;
private intersectionObserver?;
private uniforms;
private mouse;
private smoothMouse;
private mouseMoveHandler?;
isInView: i0.WritableSignal<boolean>;
constructor(platformId: object);
private readonly vert;
private readonly frag;
ngAfterViewInit(): void;
private initAndStart;
private stopAndCleanup;
ngOnDestroy(): void;
private hexToRgb;
private getAnchorAndDir;
private _cleanupFns;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxLightRaysComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgxLightRaysComponent, "om-light-rays", never, { "raysOrigin": { "alias": "raysOrigin"; "required": false; }; "raysColor": { "alias": "raysColor"; "required": false; }; "raysSpeed": { "alias": "raysSpeed"; "required": false; }; "lightSpread": { "alias": "lightSpread"; "required": false; }; "rayLength": { "alias": "rayLength"; "required": false; }; "pulsating": { "alias": "pulsating"; "required": false; }; "fadeDistance": { "alias": "fadeDistance"; "required": false; }; "saturation": { "alias": "saturation"; "required": false; }; "followMouse": { "alias": "followMouse"; "required": false; }; "mouseInfluence": { "alias": "mouseInfluence"; "required": false; }; "noiseAmount": { "alias": "noiseAmount"; "required": false; }; "distortion": { "alias": "distortion"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; }, {}, never, ["*"], true, never>;
}
export { NgxLightRaysComponent };
export type { RaysOrigin };