|
135 | 135 | </noscript> |
136 | 136 | <header> |
137 | 137 | <div id="loading-image-container" |
138 | | - style="position: fixed; top: 0; left: 0; width: 100%; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #FFFFFF; z-index: 9999; contain: paint;"> |
| 138 | + style="position: fixed; top: 0; left: 0; width: 100%; height: calc(var(--vh) * 100); display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #FFFFFF; z-index: 9999; contain: paint;"> |
139 | 139 | <div id="loading-media" style="width: 100%; padding: 0 20px; box-sizing: border-box;"></div> |
140 | 140 | <div class="loading-text" id="loadingText" |
141 | 141 | style="color:#333; margin-top: 2rem; min-height: 1.5em; font-size: 1.2rem;"> |
|
190 | 190 | <label for="fixed">Fixed</label> |
191 | 191 | </div> |
192 | 192 | <!-- #92B5C8 width = 3790 height = 1743--> |
193 | | - <canvas id="canvas" width="100%" height="100%" style="background-color:#FFFFFF; width:100%;"></canvas> |
| 193 | + <canvas id="canvas" style="background-color:#FFFFFF; width:100%; height:100%;"></canvas> |
194 | 194 |
|
195 | 195 | <!--hidden at the beginning whilst everything loads--> |
196 | 196 | <div id="hideContents" style="display: none;" tabindex="-1"> |
|
946 | 946 | window.addEventListener("resize", togglePlayOnlyMode); |
947 | 947 | }); |
948 | 948 |
|
949 | | - </script> |
| 949 | + (function () { |
| 950 | + function setAppHeight() { |
| 951 | + const vh = window.innerHeight * 0.01; |
| 952 | + document.documentElement.style.setProperty('--vh', `${vh}px`); |
| 953 | + } |
| 954 | + |
| 955 | + window.addEventListener('resize', setAppHeight); |
| 956 | + document.addEventListener('fullscreenchange', setAppHeight); |
| 957 | + setAppHeight(); |
| 958 | + })(); |
| 959 | + |
| 960 | +(function () { |
| 961 | + function resizeCanvasesToScreen() { |
| 962 | + const canvases = document.querySelectorAll("canvas"); |
| 963 | + const width = window.innerWidth; |
| 964 | + const height = window.innerHeight; |
| 965 | + |
| 966 | + canvases.forEach(c => { |
| 967 | + c.width = width; |
| 968 | + c.height = height; |
| 969 | + c.style.width = "100%"; |
| 970 | + c.style.height = "100%"; |
| 971 | + }); |
| 972 | + } |
| 973 | + |
| 974 | + window.addEventListener("resize", resizeCanvasesToScreen); |
| 975 | + document.addEventListener("fullscreenchange", resizeCanvasesToScreen); |
| 976 | + |
| 977 | + setTimeout(resizeCanvasesToScreen, 150); |
| 978 | +})(); |
| 979 | + |
| 980 | +</script> |
| 981 | + |
950 | 982 |
|
951 | 983 | </body> |
952 | 984 |
|
|
0 commit comments