|
3 | 3 |
|
4 | 4 | const body = document.body; |
5 | 5 | const base = (body?.getAttribute('data-base') || '.').trim(); |
6 | | - const assetVersion = '20260320e'; |
| 6 | + const assetVersion = '20260320h'; |
7 | 7 | const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches; |
8 | 8 |
|
9 | 9 | const projects = [ |
|
118 | 118 |
|
119 | 119 | function clearPortraitMenuLayoutVars(){ |
120 | 120 | const root = document.documentElement; |
| 121 | + root.style.removeProperty('--menu-blur-top'); |
| 122 | + root.style.removeProperty('--menu-blur-height'); |
121 | 123 | root.style.removeProperty('--mobile-row-inline'); |
122 | 124 | root.style.removeProperty('--mobile-menu-inline'); |
123 | 125 | root.style.removeProperty('--mobile-menu-top'); |
|
136 | 138 | } |
137 | 139 |
|
138 | 140 | const vv = window.visualViewport; |
| 141 | + const scrollTop = Math.round(window.scrollY || window.pageYOffset || 0); |
139 | 142 | const viewportTop = Math.round(vv?.offsetTop ?? 0); |
140 | 143 | const viewportHeight = Math.round(vv?.height ?? window.innerHeight); |
141 | 144 | const viewportWidth = Math.round(vv?.width ?? window.innerWidth); |
142 | 145 | const viewportBottom = viewportTop + viewportHeight; |
143 | 146 |
|
| 147 | + root.style.setProperty('--menu-blur-top', `${scrollTop + viewportTop}px`); |
| 148 | + root.style.setProperty('--menu-blur-height', `${Math.max(0, viewportHeight)}px`); |
| 149 | + |
144 | 150 | const rowInline = Math.round(Math.min(Math.max(viewportWidth * 0.118, 50), 60)); |
145 | 151 | const menuInline = Math.round(Math.min(Math.max(viewportWidth * 0.084, 36), 46)); |
146 | 152 | root.style.setProperty('--mobile-row-inline', `${rowInline}px`); |
|
0 commit comments