Attempt to improve responsive loading and sizes on mobile

pull/12/merge
Manuel Kasper 2022-10-15 21:36:44 +01:00
rodzic cc20e47f42
commit 12f64b1f3e
2 zmienionych plików z 16 dodań i 8 usunięć

Wyświetl plik

@ -78,6 +78,14 @@ export default {
type: Object type: Object
} }
}, },
computed: {
thumbMaxW () {
return this.$mq.mobile ? 242 : 300
},
thumbMaxH () {
return this.$mq.mobile ? 104 : 128
}
},
methods: { methods: {
open (index, disableAnimation = false) { open (index, disableAnimation = false) {
let that = this let that = this
@ -117,13 +125,13 @@ export default {
thumbSize (item) { thumbSize (item) {
let thumbW = item.w let thumbW = item.w
let thumbH = item.h let thumbH = item.h
if (thumbW > 256) { if (thumbW > this.thumbMaxW) {
thumbH = (thumbH * 256) / thumbW thumbH = (thumbH * this.thumbMaxW) / thumbW
thumbW = 256 thumbW = this.thumbMaxW
} }
if (thumbH > 128) { if (thumbH > this.thumbMaxH) {
thumbW = (thumbW * 128) / thumbH thumbW = (thumbW * this.thumbMaxH) / thumbH
thumbH = 128 thumbH = this.thumbMaxH
} }
return { w: Math.round(thumbW), h: Math.round(thumbH) } return { w: Math.round(thumbW), h: Math.round(thumbH) }
} }

Wyświetl plik

@ -170,7 +170,7 @@ export default {
} }
.photos >>> figure img { .photos >>> figure img {
max-height: 128px; max-height: 128px;
max-width: 256px; max-width: 300px;
background-color: #e7e7e7; background-color: #e7e7e7;
} }
>>> .photo-title { >>> .photo-title {
@ -206,7 +206,7 @@ export default {
} }
.photos >>> figure img { .photos >>> figure img {
max-height: 104px; max-height: 104px;
width: auto; max-width: 242px;
} }
.photo-group { .photo-group {
padding: 0.25rem 0 0 0.5rem; padding: 0.25rem 0 0 0.5rem;