Improved <img> centering on mobile devices
This commit is contained in:
parent
31cef31672
commit
e5734dec13
@ -17,11 +17,11 @@
|
|||||||
// ImageView -------------------------------------------------------------- //
|
// ImageView -------------------------------------------------------------- //
|
||||||
#image {
|
#image {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 30px;
|
top: 60px;
|
||||||
right: 0;
|
right: 30px;
|
||||||
bottom: 0;
|
bottom: 30px;
|
||||||
left: 0;
|
left: 30px;
|
||||||
transition: top .3s;
|
transition: top .3s, right .3s, bottom .3s, left .3s;
|
||||||
will-change: transform;
|
will-change: transform;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -31,10 +31,19 @@
|
|||||||
animation-name: zoomIn;
|
animation-name: zoomIn;
|
||||||
animation-duration: .3s;
|
animation-duration: .3s;
|
||||||
animation-timing-function: $timingBounce;
|
animation-timing-function: $timingBounce;
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
right: 20px;
|
||||||
|
bottom: 20px;
|
||||||
|
left: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.full #image {
|
&.full #image {
|
||||||
top: 0;
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#image > div {
|
#image > div {
|
||||||
@ -43,17 +52,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#image img {
|
#image img {
|
||||||
max-width: calc(100vw - 60px);
|
position: absolute;
|
||||||
max-height: calc(100vh - 90px);
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
transition: max-width .3s, max-height .3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.full #image img {
|
|
||||||
max-width: 100vw;
|
|
||||||
max-height: 100vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Previous/Next Buttons -------------------------------------------------------------- //
|
// Previous/Next Buttons -------------------------------------------------------------- //
|
||||||
@ -67,6 +71,10 @@
|
|||||||
|
|
||||||
&--next { right: 0; }
|
&--next { right: 0; }
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
@media only screen and (max-width: 640px) {
|
|
||||||
|
|
||||||
#imageview .arrow_wrapper {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -78,4 +78,3 @@ input {
|
|||||||
@import 'loading';
|
@import 'loading';
|
||||||
@import 'message';
|
@import 'message';
|
||||||
@import 'multiselect';
|
@import 'multiselect';
|
||||||
@import 'mediaquery';
|
|
Loading…
Reference in New Issue
Block a user