File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change 24
24
z-index : 998 ;
25
25
}
26
26
27
- /* Style for the zoomed image */
28
- .post-content input [type = "checkbox" ]: checked ~ label > img {
27
+ /* The zoomed state - make label take up full viewport */
28
+ .post-content input [type = "checkbox" ]: checked ~ label {
29
29
position : fixed;
30
- top : 50% ;
31
- left : 50% ;
32
- transform : translate (-50% , -50% ) scale (1 );
33
- max-height : 90vh ; /* Maximum height: 90% of viewport height */
34
- max-width : 90vw ; /* Maximum width: 90% of viewport width */
30
+ top : 0 ;
31
+ left : 0 ;
32
+ width : 100% ;
33
+ height : 100% ;
34
+ display : flex;
35
+ /* Centers the image within that container using flexbox */
36
+ align-items : center;
37
+ justify-content : center;
38
+ z-index : 999 ;
39
+ }
40
+
41
+ /* Style for the zoomed image */
42
+ .post-content input [type = "checkbox" ]: checked ~ label > img .zoomCheck {
43
+ max-height : 95vh ;
44
+ max-width : 95vw ;
35
45
width : auto;
36
46
height : auto;
37
47
object-fit : contain;
42
52
43
53
/* Normal image style */
44
54
.post-content img .zoomCheck {
45
- transition : all 0.3s ease;
55
+ transition : transform 0.3s ease;
46
56
cursor : zoom-in;
57
+ display : block;
47
58
max-width : 100% ;
48
59
height : auto;
60
+ transform-origin : center;
61
+ z-index : 1 ;
49
62
}
50
63
}
You can’t perform that action at this time.
0 commit comments