Skip to content

Commit

Permalink
Better mobile experience
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-dziurdziak committed Nov 21, 2023
1 parent dcd6f9e commit d27064d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/components/VideoDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ onMounted(() => {
.then(responseJson => videoDetails.value = responseJson)
})
function getThumbnailUrl(videoDetails: any): string {
if (window.innerWidth > 1000) {
return videoDetails.videoSnippet.thumbnail.high.url
}
return videoDetails.videoSnippet.thumbnail.medium.url
}
</script>

<template>
Expand Down Expand Up @@ -58,7 +65,7 @@ onMounted(() => {
</table>
</div>
<div class="col">
<img :src="videoDetails.videoSnippet.thumbnail.standard.url">
<img :src="getThumbnailUrl(videoDetails)">
</div>
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/components/VideoTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ defineProps({
})
const expandedRows = ref([]);
const publishedVisible = ref(true)
const publishedVisible = ref(window.innerWidth > 1000)
const titleVisible = ref(true)
const whiteVisible = ref(true)
const blackVisible = ref(true)
const gamesDatesVisible = ref(true)
const gamesDatesVisible = ref(window.innerWidth > 1000)
const resultVisible = ref(false)
const openingsVisible = ref(false)
Expand Down

0 comments on commit d27064d

Please sign in to comment.