ng-cw-v12
Version:
Angular UI Component Library
48 lines (47 loc) • 2.1 kB
TypeScript
import { OnInit, AfterViewInit, OnDestroy, ElementRef, NgZone } from '@angular/core';
import * as i0 from "@angular/core";
export declare type NcDirectionType = 'right' | 'left' | 'up' | 'down' | 'diagonal';
export declare type NcShapeType = 'square' | 'hexagon' | 'triangle' | 'circle';
export declare class ShapeGridBackgroundComponent implements OnInit, AfterViewInit, OnDestroy {
private ngZone;
canvasRef: ElementRef<HTMLCanvasElement>;
/** 动画移动方向,可选值:right, left, up, down, diagonal */
ncDirection: NcDirectionType;
/** 动画移动速度(0.1-2) */
ncSpeed: number;
/** 网格边框颜色 */
ncBorderColor: string;
/** 形状大小(10-100) */
ncSquareSize: number;
/** 悬停时的填充颜色 */
ncHoverFillColor: string;
/** 形状类型,可选值:square, hexagon, triangle, circle */
ncShape: NcShapeType;
/** 鼠标悬停尾迹长度(0-20) */
ncHoverTrailAmount: number;
/** 背景色 */
ncBgColor: string;
private ctx;
private rafId;
private resizeObserver;
private gridOffset;
private hoveredSquare;
private trailCells;
private cellOpacities;
constructor(ngZone: NgZone);
ngOnInit(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
private setupResizeObserver;
private resizeCanvas;
private drawHex;
private drawCircle;
private drawTriangle;
private drawGrid;
private updateAnimation;
private updateCellOpacities;
onMouseMove(event: MouseEvent): void;
onMouseLeave(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ShapeGridBackgroundComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ShapeGridBackgroundComponent, "nc-shape-grid-background", never, { "ncDirection": "ncDirection"; "ncSpeed": "ncSpeed"; "ncBorderColor": "ncBorderColor"; "ncSquareSize": "ncSquareSize"; "ncHoverFillColor": "ncHoverFillColor"; "ncShape": "ncShape"; "ncHoverTrailAmount": "ncHoverTrailAmount"; "ncBgColor": "ncBgColor"; }, {}, never, ["*"]>;
}