99 < link rel ="shortcut icon " href ="{{ "/assets/favicons/favicon.ico" | relative_url}}">
1010 < link rel ="stylesheet " href ="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
1111
12+ < style >
13+ .lightbox-overlay {
14+ display : none; position : fixed; inset : 0 ;
15+ background : rgba (0 , 0 , 0 , 0.9 ); z-index : 9999 ;
16+ align-items : center; justify-content : center; cursor : zoom-out;
17+ }
18+ .lightbox-overlay .active { display : flex; }
19+ .lightbox-overlay img { max-width : 95vw ; max-height : 95vh ; object-fit : contain; }
20+ </ style >
21+
1222<!-- for github edit ribbon; main include is in `assets/css/style.scss` -->
1323<!--[if lt IE 9]>
1424 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.0/gh-fork-ribbon.ie.min.css" />
@@ -27,8 +37,32 @@ <h1><img align="center" height="60" style="margin:0px 20px 0px 0px" src="{{ "/as
2737 {{ content }}
2838
2939 </ div >
40+ < div class ="lightbox-overlay " id ="lightbox ">
41+ < img id ="lightbox-img " src ="" alt ="">
42+ </ div >
43+
3044 < script src ="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js " integrity ="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg= " crossorigin ="anonymous "> </ script >
3145 < script > anchors . add ( ) ; </ script >
46+ < script >
47+ ( function ( ) {
48+ var overlay = document . getElementById ( 'lightbox' ) ;
49+ var lbImg = document . getElementById ( 'lightbox-img' ) ;
50+
51+ document . querySelectorAll ( '.markdown-body img' ) . forEach ( function ( img ) {
52+ img . style . cursor = 'zoom-in' ;
53+ img . addEventListener ( 'dblclick' , function ( ) {
54+ lbImg . src = img . src ;
55+ lbImg . alt = img . alt ;
56+ overlay . classList . add ( 'active' ) ;
57+ } ) ;
58+ } ) ;
59+
60+ overlay . addEventListener ( 'click' , function ( ) { overlay . classList . remove ( 'active' ) ; } ) ;
61+ document . addEventListener ( 'keydown' , function ( e ) {
62+ if ( e . key === 'Escape' ) overlay . classList . remove ( 'active' ) ;
63+ } ) ;
64+ } ) ( ) ;
65+ </ script >
3266 {% if site.google_analytics %}
3367 < script >
3468 ( function ( i , s , o , g , r , a , m ) { i [ 'GoogleAnalyticsObject' ] = r ; i [ r ] = i [ r ] || function ( ) {
0 commit comments