starfield-react
Version:
A React component that draws an animated Starfield on a canvas dom element.
20 lines (19 loc) • 656 B
TypeScript
import { ColorFunction, StarState } from './StarState';
export declare type DrawState = {
context: CanvasRenderingContext2D;
stars: StarState[];
width: number;
height: number;
z: number;
x: number;
y: number;
starLineWidthRatio: number;
speed: number;
starRatio: number;
starSize: number;
strokeStyle: ColorFunction | string;
bgStyle: string;
clear: boolean;
noBackground: boolean;
};
export declare function drawStarField({ context, stars, width, height, z, x, y, starLineWidthRatio, speed, starRatio, starSize, strokeStyle, bgStyle, clear, noBackground, }: DrawState): void;