Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This website will be the homepage for all of my projects. Any and all projects w
<img width="1753" alt="image" src="https://user-images.githubusercontent.com/5733032/192616453-aa1774b1-12bf-495c-8706-4707c1185e8c.png">

## Todo for this page:
- Add ability to resize and recalculate number of circles
- Add links to pages
- Update favicon to be an ico

Expand Down
10 changes: 10 additions & 0 deletions web/util/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ var mouse = {
const useCanvas = () => {
const canvasRef: React.MutableRefObject<HTMLCanvasElement | null> = useRef(null);

addEventListener("resize", () => {
const canvas = canvasRef.current;
if (canvas) {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// redo setup at frame 0
setup(canvas.getContext("2d")!, 0);
}
});

useEffect(() => {

const canvas = canvasRef.current
Expand Down