File tree Expand file tree Collapse file tree 3 files changed +92
-13
lines changed Expand file tree Collapse file tree 3 files changed +92
-13
lines changed Original file line number Diff line number Diff line change
1
+ @media screen and (min-width : 769px ) {
2
+ /* Position relative on the container to create a stacking context */
3
+ .post-content {
4
+ position : relative;
5
+ }
6
+
7
+ /* Hide the checkbox visually */
8
+ .post-content input [type = "checkbox" ] {
9
+ position : absolute;
10
+ opacity : 0 ;
11
+ }
12
+
13
+ /* When checkbox is checked, create a fullscreen overlay */
14
+ .post-content input [type = "checkbox" ]: checked ~ label ::before {
15
+ content : "" ;
16
+ position : fixed;
17
+ top : 0 ;
18
+ left : 0 ;
19
+ right : 0 ;
20
+ bottom : 0 ;
21
+ background-color : rgba (255 , 255 , 255 , 0.8 );
22
+ backdrop-filter : blur (5px );
23
+ -webkit-backdrop-filter : blur (5px );
24
+ z-index : 998 ;
25
+ }
26
+
27
+ /* Style for the zoomed image */
28
+ .post-content input [type = "checkbox" ]: checked ~ label > img {
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 */
35
+ width : auto;
36
+ height : auto;
37
+ object-fit : contain;
38
+ cursor : zoom-out;
39
+ z-index : 999 ;
40
+ box-shadow : 0 5px 15px rgba (0 , 0 , 0 , 0.2 );
41
+ }
42
+
43
+ /* Normal image style */
44
+ .post-content img .zoomCheck {
45
+ transition : all 0.3s ease;
46
+ cursor : zoom-in;
47
+ max-width : 100% ;
48
+ height : auto;
49
+ }
50
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ {{- $random := (substr (md5 (.Get "src")) 0 5) }}
2
+ < figure {{ if or (.Get "class") (eq (.Get "align") "center") }} class="
3
+ {{- if eq (.Get "align ") "center" }}align-center {{ end }}
4
+ {{- with .Get "class" }}{{ . }}{{- end }}"
5
+ {{- end -}}>
6
+ {{- if .Get "link" -}}
7
+ < a href ="{{ .Get "link " }}"{{ with .Get "target" }} target="{{ . }} "{{ end }}{{ with .Get "rel" }} rel="{{ . }} "{{ end }} >
8
+ {{- end }}
9
+
10
+ <!-- Zoom functionality start -->
11
+ < input type ="checkbox " id ="zoomCheck-{{$random}} " hidden >
12
+ < label for ="zoomCheck-{{$random}} ">
13
+ <!-- Zoom functionality end -->
14
+
15
+ < img class ="zoomCheck " loading ="lazy " src ="{{ .Get "src " }}{{- if eq (.Get "align") "center" }}#center{{- end }}"
16
+ {{- if or (.Get "alt") (.Get "caption") }}
17
+ alt="{{ with .Get "alt " }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
18
+ {{- end -}}
19
+ {{- with .Get "width" }} width="{{ . }} "{{ end -}}
20
+ {{- with .Get "height" }} height="{{ . }} "{{ end -}}
21
+ /> <!-- Closing img tag -->
22
+
23
+ <!-- Closing label for zoom -->
24
+ </ label >
25
+
26
+ {{- if .Get "link" }}</ a > {{ end -}}
27
+ {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
28
+ < figcaption >
29
+ {{ with (.Get "title") -}}
30
+ {{ . }}
31
+ {{- end -}}
32
+ {{- if or (.Get "caption") (.Get "attr") -}}< p >
33
+ {{- .Get "caption" | markdownify -}}
34
+ {{- with .Get "attrlink" }}
35
+ < a href ="{{ . }} ">
36
+ {{- end -}}
37
+ {{- .Get "attr" | markdownify -}}
38
+ {{- if .Get "attrlink" }}</ a > {{ end }}</ p >
39
+ {{- end }}
40
+ </ figcaption >
41
+ {{- end }}
42
+ </ figure >
You can’t perform that action at this time.
0 commit comments