File tree 2 files changed +10
-1
lines changed
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
9
9
<img width =" 1753 " alt =" image " src =" https://user-images.githubusercontent.com/5733032/192616453-aa1774b1-12bf-495c-8706-4707c1185e8c.png " >
10
10
11
11
## Todo for this page:
12
- - Add ability to resize and recalculate number of circles
13
12
- Add links to pages
14
13
- Update favicon to be an ico
15
14
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ var mouse = {
37
37
const useCanvas = ( ) => {
38
38
const canvasRef : React . MutableRefObject < HTMLCanvasElement | null > = useRef ( null ) ;
39
39
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
+
40
50
useEffect ( ( ) => {
41
51
42
52
const canvas = canvasRef . current
You can’t perform that action at this time.
0 commit comments