File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 88<!-- attribution appreciated. github: zjeaton web: https://froglegs.co -->
99
1010< 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; " />
1213</ div >
Original file line number Diff line number Diff line change 3434 document . getElementById ( "myModal" ) . style . display = "none" ;
3535}
3636
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+
3744</ script >
3845
3946<!-- To attach onclick attribute to all <img> -->
You can’t perform that action at this time.
0 commit comments