|
42 | 42 | const micrio = $state(<HTMLMicrioElement>getContext('micrio')); |
43 | 43 | /** Destructure needed stores and properties from the micrio instance. */ |
44 | 44 | const { current, state: micrioState, isMuted, _lang } = micrio; |
45 | | - /** Reference to the active tour store. */ |
46 | | - const tour = micrioState.tour; |
| 45 | + /** Reference to the active tour and popup store. */ |
| 46 | + const { tour, popup } = micrioState; |
47 | 47 | /** Destructure UI state stores. */ |
48 | 48 | const { controls, zoom, hidden } = micrio.state.ui; |
49 | 49 |
|
|
162 | 162 | const hasFullscreen = $derived(showFullscreen && !isActiveSerialTour); |
163 | 163 | /** Determine if the entire controls container should be shown. */ |
164 | 164 | const hasControls = $derived($controls && !$hidden && (showMute || hasCultures || hasSocial || $zoom || hasFullscreen)); |
| 165 | + /** Show only fullscreen button when having popup on mobile screen */ |
| 166 | + const onlyFullscreen = $derived($popup && micrio.canvas.$isMobile); |
165 | 167 |
|
166 | 168 | </script> |
167 | 169 |
|
168 | 170 | <!-- Render the controls container only if `hasControls` is true --> |
169 | 171 | {#if hasControls} |
170 | 172 | <aside> |
171 | | - <!-- Mute Button --> |
172 | | - {#if showMute} |
173 | | - <Button |
174 | | - type={$isMuted ? 'volume-off' : 'volume-up'} |
175 | | - title={$isMuted ? $i18n.audioUnmute : $i18n.audioMute} |
176 | | - onclick={() => isMuted.set(!$isMuted)} |
177 | | - /> |
178 | | - {/if} |
| 173 | + {#if !onlyFullscreen} |
| 174 | + <!-- Mute Button --> |
| 175 | + {#if showMute} |
| 176 | + <Button |
| 177 | + type={$isMuted ? 'volume-off' : 'volume-up'} |
| 178 | + title={$isMuted ? $i18n.audioUnmute : $i18n.audioMute} |
| 179 | + onclick={() => isMuted.set(!$isMuted)} |
| 180 | + /> |
| 181 | + {/if} |
179 | 182 |
|
180 | | - <!-- Language Switch Menu --> |
181 | | - {#if hasCultures} |
182 | | - <menu class="popout"> |
183 | | - <Button title={$i18n.switchLanguage} type="a11y" /><!-- Accessibility icon --> |
184 | | - {#each cultures as l} |
185 | | - <Button |
186 | | - onclick={() => micrio.lang = l} |
187 | | - title={languageNames?.of(l) ?? l} |
188 | | - active={l==$_lang} |
189 | | - > |
190 | | - {l.toUpperCase()} |
191 | | - </Button> |
192 | | - {/each} |
193 | | - </menu> |
194 | | - {/if} |
| 183 | + <!-- Language Switch Menu --> |
| 184 | + {#if hasCultures} |
| 185 | + <menu class="popout"> |
| 186 | + <Button title={$i18n.switchLanguage} type="a11y" /><!-- Accessibility icon --> |
| 187 | + {#each cultures as l} |
| 188 | + <Button |
| 189 | + onclick={() => micrio.lang = l} |
| 190 | + title={languageNames?.of(l) ?? l} |
| 191 | + active={l==$_lang} |
| 192 | + > |
| 193 | + {l.toUpperCase()} |
| 194 | + </Button> |
| 195 | + {/each} |
| 196 | + </menu> |
| 197 | + {/if} |
195 | 198 |
|
196 | | - <!-- Share Button --> |
197 | | - {#if hasSocial} |
198 | | - <Button type="share" title={$i18n.share} onclick={share} /> |
| 199 | + <!-- Share Button --> |
| 200 | + {#if hasSocial} |
| 201 | + <Button type="share" title={$i18n.share} onclick={share} /> |
| 202 | + {/if} |
199 | 203 | {/if} |
200 | 204 |
|
201 | 205 | <!-- Zoom and Fullscreen Buttons --> |
202 | 206 | <ButtonGroup> |
203 | | - {#if $zoom} |
| 207 | + {#if $zoom && !onlyFullscreen} |
204 | 208 | <!-- Render secondary zoom controls if active, otherwise primary --> |
205 | 209 | {#if secondaryControls} |
206 | 210 | <ZoomButtons image={secondaryControls} /> |
|
0 commit comments