Skip to content

Commit

Permalink
Merge pull request #104 from earthrise-media/mobile-tooltip-update
Browse files Browse the repository at this point in the history
Fix mobile tooltip position
  • Loading branch information
Martin Bernard authored Dec 1, 2023
2 parents 7ae4bdf + eb42e6f commit 058dd81
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 4 deletions.
17 changes: 15 additions & 2 deletions vacs-map-app/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script setup>
import { onMounted } from 'vue'
import { onMounted, onUnmounted } from 'vue'
import { RouterView } from 'vue-router'
import { useCropYieldsStore } from '@/stores/cropYields'
import { useCropInformationStore } from '@/stores/cropInformation'
Expand All @@ -17,22 +17,35 @@ const cropInformationStore = useCropInformationStore()
const gridStore = useGridStore()
const filtersStore = useFiltersStore()
const documentHeight = () => {
const doc = document.documentElement
doc.style.setProperty('--doc-height', `${window.innerHeight}px`)
}
onMounted(() => {
gridStore.load()
cropYieldsStore.load()
cropInformationStore.load()
// initialize so pages load
filtersStore.selectedCrop = filtersStore.availableCrops[0]
window.addEventListener('resize', documentHeight)
documentHeight
})
onUnmounted(() => {
window.removeEventListener('resize')
})
</script>

<style scoped>
main {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
height: 100vh;
height: var(--doc-height);
overflow: hidden;
}
</style>
3 changes: 3 additions & 0 deletions vacs-map-app/src/LandingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const openModal = () => {
display: flex;
flex-direction: row;
height: 100vh;
height: var(--doc-height);
width: 100vw;
background: var(--black);
justify-content: space-between;
Expand All @@ -155,6 +156,7 @@ video {
height: 100vh;
min-width: 100vw;
height: 100vh;
height: var(--doc-height);
}
.overlay {
Expand All @@ -163,6 +165,7 @@ video {
left: 0;
width: 100vw;
height: 100vh;
height: var(--doc-height);
display: flex;
flex-direction: column;
Expand Down
4 changes: 3 additions & 1 deletion vacs-map-app/src/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
--font-family-header: PPeiko-heavy;
--font-family-h2: PPeiko-medium;
--font-family-body: 'Work Sans';

--shadow: 0px 0px 20px 0px rgba(255, 254, 254, 0.1);


--doc-height: 100%
}

*,
Expand Down
11 changes: 11 additions & 0 deletions vacs-map-app/src/components/TooltipWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,15 @@ const setPosition = (px, py) => {
.top.left {
transform: translateX(-100%) translateY(-100%);
}
@media only screen and (max-width: 720px) {
.tooltip {
top: unset !important;
bottom: 8rem !important;
left: 1rem !important;
transform: unset !important;
}
}
</style>


4 changes: 3 additions & 1 deletion vacs-map-app/src/components/layouts/LayoutOpen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

<style scoped>
.layout-open {
min-height: 100vh;
height: 100vh;
max-height: var(--doc-height);
min-height: var(--doc-height);
width: 100vw;
}
</style>
2 changes: 2 additions & 0 deletions vacs-map-app/src/components/layouts/LayoutOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const topic = computed(() => topicUrlOptions.find(({ label }) => label === topic
<style scoped>
.layout-overview {
height: 100vh;
max-height: var(--doc-height);
min-height: var(--doc-height);
width: 100vw;
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 058dd81

Please sign in to comment.