ng-cw-v12
Version:
Angular UI Component Library
63 lines (62 loc) • 2.34 kB
TypeScript
import { ElementRef, Renderer2, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, NgZone } from '@angular/core';
import * as i0 from "@angular/core";
export declare class ElectricBorderDirective implements OnInit, OnDestroy, OnChanges {
private el;
private renderer;
private ngZone;
/** 边框圆角半径 单位px */
ncBorderRadius: number;
/** 边框线宽 单位px */
ncBorderWidth: number;
/** 电弧宽度 单位px */
ncElectricWidth: number;
/** 颜色 */
ncColor: string;
/** 动画速度倍率 */
ncSpeed: number;
/** 扰动强度(振幅) */
ncChaos: number;
/** 停止动画时间,ms,0表示不停止 */
ncStopTime: number;
/** 是否启用动画 */
private _enabled;
set ncEnabled(val: boolean | string);
get ncEnabled(): boolean;
/** 双向绑定输出事件 */
ncEnabledChange: EventEmitter<boolean>;
private canvasEl;
private canvasContainerEl;
private glow1El;
private glow2El;
private bgGlowEl;
private layersEl;
private styleEl;
private animationId;
private resizeObserver;
private time;
private lastFrameTime;
private isInitialized;
private stopTimer;
constructor(el: ElementRef, renderer: Renderer2, ngZone: NgZone);
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
private setupHost;
private applyBorderRadius;
private applyBorderWidth;
private applyColorVar;
private createDom;
private injectStyles;
private startAnimation;
private stopAnimation;
private updateCanvasSize;
private drawFrame;
private random;
private noise2D;
private octavedNoise;
private getCornerPoint;
private getRoundedRectPoint;
private setStyles;
static ɵfac: i0.ɵɵFactoryDeclaration<ElectricBorderDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<ElectricBorderDirective, "[ncElectricBorder]", never, { "ncBorderRadius": "ncBorderRadius"; "ncBorderWidth": "ncBorderWidth"; "ncElectricWidth": "ncElectricWidth"; "ncColor": "ncColor"; "ncSpeed": "ncSpeed"; "ncChaos": "ncChaos"; "ncStopTime": "ncStopTime"; "ncEnabled": "ncEnabled"; }, { "ncEnabledChange": "ncEnabledChange"; }, never>;
}