@@ -246,6 +246,12 @@ permalink: /publications/
246246 </div >
247247</div >
248248
249+ <!-- Image Modal -->
250+ <div id =" imageModal " style =" display :none ; position :fixed ; z-index :1000 ; left :0 ; top :0 ; width :100% ; height :100% ; background-color :rgba (0 ,0 ,0 ,0.9 ); cursor :pointer ;" >
251+ <span style =" position :absolute ; top :20px ; right :40px ; color :#fff ; font-size :40px ; font-weight :bold ; cursor :pointer ;" >× ; </span >
252+ <img id =" modalImage " style =" margin :auto ; display :block ; max-width :90% ; max-height :90% ; position :absolute ; top :50% ; left :50% ; transform :translate (-50% , -50% );" >
253+ </div >
254+
249255<script >
250256 // Publication filtering functionality
251257 document .addEventListener (' DOMContentLoaded' , function () {
@@ -288,5 +294,31 @@ permalink: /publications/
288294 });
289295 });
290296 });
297+
298+ // Image modal functionality
299+ const modal = document .getElementById (' imageModal' );
300+ const modalImg = document .getElementById (' modalImage' );
301+ const pubImages = document .querySelectorAll (' .pub-thumbnail img' );
302+
303+ pubImages .forEach (img => {
304+ img .style .cursor = ' pointer' ;
305+ img .addEventListener (' click' , function (e ) {
306+ e .preventDefault ();
307+ modal .style .display = ' block' ;
308+ modalImg .src = this .src ;
309+ });
310+ });
311+
312+ // Close modal on click
313+ modal .addEventListener (' click' , function () {
314+ modal .style .display = ' none' ;
315+ });
316+
317+ // Close modal on Escape key
318+ document .addEventListener (' keydown' , function (e ) {
319+ if (e .key === ' Escape' && modal .style .display === ' block' ) {
320+ modal .style .display = ' none' ;
321+ }
322+ });
291323 });
292324</script >
0 commit comments