3 ms·
Prompt 1: Write a react component that is basically a starfield webpage background, and supports a property to enable and disable the animation Prompt 2: Can y
by rhacker 4y ago
Prompt 1: Write a react component that is basically a starfield webpage background, and supports a property to enable and disable the animation
Prompt 2: Can you answer the same question but with Typescript and using React Hooks instead of a class.
Prompt 3: Ok, using the same concept, now render the stars using html5 canvas, but still in a react component
Result: I changed two lines (it was missing a useState import, and there was a null check issue - but that was only because of my TS settings)
Other than that, it loaded and displayed an animated top-view downward scrolling of stars going at different speeds.
You'll all think I'm crazy but I literally feel like I have access to the computer on TNG.