optimize coding style of image.scss

This commit is contained in:
Spedon
2023-03-16 00:08:16 +08:00
parent 27d4cb0277
commit 96b75abc7d

View File

@@ -3,40 +3,26 @@
position: absolute;
width: auto;
max-width: 100vw;
transform: translate(-50%, -50%);
transform: translate(-50%, -50%, 0);
opacity: 1;
display: flex;
align-items: center;
// prevent webkit from partly repainting the frame
box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
will-change: transform;
img {
max-height: 55vmin;
max-width: 100vw;
object-fit: contain;
width: auto;
// prevent webkit from partly repainting the frame
box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
}
&[data-status='t0'] {
transition: all 0.5s ease-in-out 1.5s;
max-height: calc(100vh - var(--footer-height));
width: auto;
max-width: 100vw;
display: flex;
align-items: center;
// prevent webkit from partly repainting the frame
box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
img {
transition: all 0.5s ease-in-out 2s;
max-height: calc(100vh - var(--footer-height));
width: auto;
max-width: 100vw;
object-fit: contain;
// prevent webkit from partly repainting the frame
box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
}
}
@@ -61,26 +47,12 @@
}
&[data-status='r0'] {
transition: all 0.5s ease-in-out 1s;
max-height: 55vmin;
position: absolute;
transform: translate(-50%, -50%);
opacity: 1;
width: auto;
max-width: 100vw;
display: flex;
align-items: center;
// prevent webkit from partly repainting the frame
box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
transition: all 0.5s ease-in-out 1s;
img {
transition: all 1s ease-in-out 0s;
max-height: 55vmin;
max-width: 100vw;
object-fit: contain;
width: auto;
// prevent webkit from partly repainting the frame
box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
}
}