File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1414 < link rel ="icon " type ="image/png " href ="/assets/header/ravioli.png "/>
1515 < script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js "> </ script >
1616 < script src ="/shared/JS/script.js "> </ script >
17- < script src ="/ index.js "> </ script >
17+ < script src ="index.js "> </ script >
1818 < script src ="/shared/JS/slideshow.js "> </ script >
1919 < link rel ="stylesheet " href ="/shared/css/fonts.css "/>
2020 < link rel ="stylesheet " href ="/shared/css/style.css "/>
Original file line number Diff line number Diff line change @@ -3,14 +3,20 @@ const CALENDAR_MINIMUM_WIDTH = 850; // I found this number by shrinking the page
33
44// runs when the page is done loading
55// calls on the on_resize function for loading page
6- window . addEventListener ( 'load' , function ( ) {
6+ window . addEventListener ( 'resize' , showhide ) ;
7+ window . addEventListener ( 'load' , showhide ) ;
8+
9+ function showhide ( ) {
710 let current_screen_width = window . innerWidth
811
912 // if the windows width is less then the minimum calender width,
1013 // remove the calendar and display alternate text that the page is too small
1114 // and redirect them to the calendar externally
1215 if ( current_screen_width <= CALENDAR_MINIMUM_WIDTH ) {
13- document . getElementById ( "google calendar" ) . remove ( )
14- document . getElementById ( "alt calendar text" ) . classList . toggle ( "hidden" )
15- }
16- } )
16+ document . getElementById ( "google calendar" ) . classList . add ( "hidden" )
17+ document . getElementById ( "alt calendar text" ) . classList . remove ( "hidden" )
18+ } else {
19+ document . getElementById ( "google calendar" ) . classList . remove ( "hidden" )
20+ document . getElementById ( "alt calendar text" ) . classList . add ( "hidden" )
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments