File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,25 @@ systemTheme.addEventListener('change', event => {
102102 if ( ! themeOverride ) applyTheme ( event . matches ? 'dark' : 'light' ) ;
103103} ) ;
104104
105+ const featurePalette = document . querySelector ( '.feature-palette' ) ;
106+ let themeFadeFrame = 0 ;
107+
108+ function updateThemeToggleVisibility ( ) {
109+ themeFadeFrame = 0 ;
110+ const distance = featurePalette . getBoundingClientRect ( ) . top ;
111+ const opacity = Math . max ( 0 , Math . min ( 1 , ( distance - 64 ) / 240 ) ) ;
112+ themeToggle . style . opacity = opacity ;
113+ themeToggle . inert = opacity === 0 ;
114+ }
115+
116+ function queueThemeToggleVisibility ( ) {
117+ if ( ! themeFadeFrame ) themeFadeFrame = requestAnimationFrame ( updateThemeToggleVisibility ) ;
118+ }
119+
120+ window . addEventListener ( 'scroll' , queueThemeToggleVisibility , { passive : true } ) ;
121+ window . addEventListener ( 'resize' , queueThemeToggleVisibility ) ;
122+ updateThemeToggleVisibility ( ) ;
123+
105124const latestZipCacheKey = 'commando-site-latest-zip' ;
106125const latestZipCacheAge = 60 * 60 * 1000 ;
107126
Original file line number Diff line number Diff line change @@ -239,3 +239,13 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
239239 . keys { flex-wrap : wrap; }
240240 }
241241}
242+
243+ @media ( max-width : 500px ) {
244+ . overview , . movie , . feature-palette {
245+ width : calc ( 100% + 48px ) ;
246+ margin-inline : -24px ;
247+ border-radius : 0 ;
248+ }
249+
250+ . palette-header , . search-bar { border-radius : 0 ; }
251+ }
You can’t perform that action at this time.
0 commit comments