File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ This website will be the homepage for all of my projects. Any and all projects w
99<img width =" 1753 " alt =" image " src =" https://user-images.githubusercontent.com/5733032/192616453-aa1774b1-12bf-495c-8706-4707c1185e8c.png " >
1010
1111## Todo for this page:
12- - Add ability to resize and recalculate number of circles
1312- Add links to pages
1413- Update favicon to be an ico
1514
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ var mouse = {
3737const useCanvas = ( ) => {
3838 const canvasRef : React . MutableRefObject < HTMLCanvasElement | null > = useRef ( null ) ;
3939
40+ addEventListener ( "resize" , ( ) => {
41+ const canvas = canvasRef . current ;
42+ if ( canvas ) {
43+ canvas . width = window . innerWidth ;
44+ canvas . height = window . innerHeight ;
45+ // redo setup at frame 0
46+ setup ( canvas . getContext ( "2d" ) ! , 0 ) ;
47+ }
48+ } ) ;
49+
4050 useEffect ( ( ) => {
4151
4252 const canvas = canvasRef . current
You can’t perform that action at this time.
0 commit comments