Conversation
|
Partially related to #56 with regards to the layout but not the viewport issue (the void). |
website/src/Layout.svelte
Outdated
| // @ts-expect-error: `document` can't be null. | ||
| document.querySelector('#search-box').appendChild(searchBox); | ||
| const container = document.querySelector('#search-widget'); | ||
| if (container) { |
There was a problem hiding this comment.
nit:
I initially thought this was to solve a render-order bug, meaning that #search-widget hadn't been rendered before this code was called, or was outside of Svelte's sphere of rendering.
I now realize it is because it is display: none.
Could a small comment along the lines of "only instantiate the searchbox for on non-mobile devices?" to clarify?
There was a problem hiding this comment.
Sure, is the following satisfactory?
// #search-widget is hidden (display: none) on mobile until the user expands search;
// we still mount here so the box is ready. Guard in case the node isn't available yet.
const container = document.querySelector('#search-widget');
if (container) {
// @ts-expect-error: MapboxSearchBox is a custom element
container.appendChild(searchBox);
}
});
There was a problem hiding this comment.
Yeah, that sounds good to me! Thanks!
|
Nice! I've deployed the branch to a dev URL https://0a4b5a44-viewview.tom-364.workers.dev This is great and pretty much good to go, just some minor cleanup:
|
|
<style lang="scss">
@use "./styles/variables.scss" as *;
.foo {
color: $primary-colour;
}
</style> |
|
Oh, just saw your comment on 5. It would still be good to not use the deprecated function. Can everything you need be done with just the global |
- Add search toggle and isSearchOpen/isInfoOpen state - CollapsableModal dispatches open/close so opening info closes search and vice versa - Mobile: search is icon-only until expanded
1-corrected typo on index.scss ::root -> :root 2-createEventDispatcher is deprecated and replaced with callback prop
instead of fixed width break now we have css processor var controlled in variable.scss
|
Let's go! Deployed dev build to https://40018157-viewview.tom-364.workers.dev |
- Controlled info modal that closes search box if opened
- Smaller info block and layer toggles
- Layer toggles in a column
- Compact credits attribution
Things to highlight:
Could not achieve a clean solution without introducing a new mobile layout under Home.svelte 170
The solution i attempted involved spreading the btns in a single row ( on the height level of btn id="info") but only when the collapsableModal is opened and when the modal is closed, they return to their column stack. This saved vertical space and solved the overflow. This issue arises only on tiny screens such as the iphone SE Dimensions: 375X667