File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 8
8
<!-- attribution appreciated. github: zjeaton web: https://froglegs.co -->
9
9
10
10
< div class ="md__image ">
11
- < img id ="{{ first 6 (shuffle (seq 1 500)) }} " src ="{{ .Destination | safeURL }} " onclick ="openModal(this.id) " alt ="{{ .Text }} " {{ with .Title}} class ="{{ . }} " {{ end }} />
11
+ < img id ="{{ first 6 (shuffle (seq 1 500)) }} " src ="{{ .Destination | safeURL }} " onclick ="openModal(this.id) " alt ="{{ .Text }} " {{ with .Title}} class ="{{ . }} " {{ end }}
12
+ style ="max-width: 70%; max-height: 80vh; height: auto; display: block; margin: 0 auto; object-fit: contain; " />
12
13
</ div >
Original file line number Diff line number Diff line change 34
34
document . getElementById ( "myModal" ) . style . display = "none" ;
35
35
}
36
36
37
+ // Listen for the Escape key to close the modal
38
+ document . addEventListener ( "keydown" , function ( event ) {
39
+ if ( event . key === "Escape" ) {
40
+ closeModal ( ) ;
41
+ }
42
+ } ) ;
43
+
37
44
</ script >
38
45
39
46
<!-- To attach onclick attribute to all <img> -->
You can’t perform that action at this time.
0 commit comments