ng-cw-v12
Version:
Angular UI Component Library
56 lines (55 loc) • 2.21 kB
TypeScript
import { OnInit, OnDestroy, AfterViewInit, ElementRef, OnChanges, SimpleChanges, NgZone } from '@angular/core';
import * as i0 from "@angular/core";
export declare class LetterGlitchBackgroundComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges {
private ngZone;
containerRef: ElementRef<HTMLDivElement>;
canvasRef: ElementRef<HTMLCanvasElement>;
/** 闪烁颜色数组 */
ncGlitchColors: string[];
/** 闪烁频率(毫秒)(1-100) */
ncGlitchSpeed: number;
/** 是否显示中心暗角 */
private _centerVignette;
set ncCenterVignette(val: boolean | string);
get ncCenterVignette(): boolean;
/** 是否显示边缘暗角 */
private _outerVignette;
set ncOuterVignette(val: boolean | string);
get ncOuterVignette(): boolean;
/** 是否开启平滑过渡 */
private _smooth;
set ncSmooth(val: boolean | string);
get ncSmooth(): boolean;
/** 字符集 */
ncCharacters: string;
private animationRef;
private letters;
private grid;
private context;
private lastGlitchTime;
private resizeTimeout;
private activeLetterIndices;
private fontSize;
private charWidth;
private charHeight;
constructor(ngZone: NgZone);
ngOnInit(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
ngOnChanges(changes: SimpleChanges): void;
onResize(): void;
private initCanvas;
private getRandomChar;
private getRandomColor;
private parseColor;
private interpolateColor;
private calculateGrid;
private initializeLetters;
private resizeCanvas;
private drawLetters;
private updateLetters;
private handleSmoothTransitions;
private animate;
static ɵfac: i0.ɵɵFactoryDeclaration<LetterGlitchBackgroundComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<LetterGlitchBackgroundComponent, "nc-letter-glitch-background", never, { "ncGlitchColors": "ncGlitchColors"; "ncGlitchSpeed": "ncGlitchSpeed"; "ncCenterVignette": "ncCenterVignette"; "ncOuterVignette": "ncOuterVignette"; "ncSmooth": "ncSmooth"; "ncCharacters": "ncCharacters"; }, {}, never, ["*"]>;
}