Skip to content

Commit

Permalink
fix image issues #281
Browse files Browse the repository at this point in the history
  • Loading branch information
akdasa committed Jun 17, 2023
1 parent 2a5d6bf commit b0350b3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
7 changes: 1 addition & 6 deletions src/app/decks/inbox/components/InboxCardVerseTextSide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,9 @@ const isPortrait = computed(() => screenOrientation.isPortrait.value)

<style scoped>
:deep(.image-landscape) {
height: 277px;
max-height: 277px;
}
.image-portrait {
width: 100%;
}
</style>

<!-- :class="{
'image-portrait': isPortrait,
'image-landscape': !isPortrait
}" -->
30 changes: 29 additions & 1 deletion src/app/decks/review/components/ReviewCardTextSide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
:lines="props.lines"
:url="verseImage?.url"
style="width: 100%;"
:class="{
'image-portrait': (isPortrait || lines) && !props.verseImage,
'image-landscape': !isPortrait && props.verseImage
}"
/>
</template>

<script setup lang="ts">
import { VerseImage } from '@akdasa-studios/shlokas-core'
import { computed } from 'vue'
import VerseTextLines from '@/app/decks/shared/components/VerseTextLines.vue'
import { useScreenOrientation } from '@/app/shared'
/* -------------------------------------------------------------------------- */
Expand All @@ -20,4 +26,26 @@ const props = defineProps<{
lines: string[]
verseImage?: VerseImage
}>()
</script>
/* -------------------------------------------------------------------------- */
/* Dependencies */
/* -------------------------------------------------------------------------- */
const screenOrientation = useScreenOrientation()
/* -------------------------------------------------------------------------- */
/* State */
/* -------------------------------------------------------------------------- */
const isPortrait = computed(() => screenOrientation.isPortrait.value)
</script>


<style scoped>
:deep(.image-landscape) {
max-height: 277px;
}
.image-portrait {
width: 100%;
}
</style>
4 changes: 0 additions & 4 deletions src/app/decks/shared/components/VerseTextLines.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,4 @@ async function onOpened() {
.image {
padding: 3px;
}
.image-landscape {
max-height: 277px;
}
</style>

0 comments on commit b0350b3

Please sign in to comment.