UNPKG

ambient-cbg-ts

Version:

A React.js webpage backgrounds created using the HTML5 Canvas API and jwagner's Simplex Noise library

30 lines (29 loc) 915 B
import React, { Component, CSSProperties, RefObject } from "react"; export declare type CanvasBackgroundProps = { styles?: CSSProperties; }; declare class CanvasBackground<T extends CanvasBackgroundProps> extends Component<T, {}> { protected canvasA: RefObject<HTMLCanvasElement>; protected canvasB: RefObject<HTMLCanvasElement>; protected ctx: { a: CanvasRenderingContext2D | null; b: CanvasRenderingContext2D | null; } | null; protected center: number[]; protected frameId: number | null; protected tick: number; static defaultProps: { styles: React.CSSProperties; }; constructor(props: T); componentDidMount(): void; componentWillUnmount(): void; init(): void; draw(): void; render(): JSX.Element; createCanvas(): void; resize(): void; startLoop(): void; initDraw(): void; } export default CanvasBackground;