@@ -1292,13 +1292,27 @@ document.addEventListener("DOMContentLoaded", function () {
12921292 }
12931293 setupModalInfoButton ( name ) ;
12941294
1295- // Inject info button
1295+ // Inject info button - FIXED for Tic Tac Toe and all projects
12961296 var projectContent = modalBody . querySelector ( ".project-content" ) ;
12971297 if ( projectContent ) {
1298+ // First, check if there's already an info button (to avoid duplicates)
1299+ if ( projectContent . querySelector ( ".inline-info-btn" ) ) {
1300+ // Info button already exists, skip injection
1301+ console . log ( 'ℹ️ Info button already exists for' , name ) ;
1302+ } else {
1303+ // Look for any heading element
12981304 var firstHeading = projectContent . querySelector ( "h2, h3, .resume-analyzer-copy h2, .pet-title" ) ;
1305+
1306+ // Special case for Tic Tac Toe - look for the heading inside project-content
1307+ if ( ! firstHeading ) {
1308+ firstHeading = projectContent . querySelector ( '[style*="display: flex"] h2' ) ;
1309+ }
1310+
12991311 if ( ! firstHeading ) {
1312+ // Look for any element that might be a title
13001313 firstHeading = projectContent . querySelector ( '[class*="title"], [class*="header"] h2' ) ;
13011314 }
1315+
13021316 if ( firstHeading && ! projectContent . querySelector ( ".inline-info-btn" ) ) {
13031317 var infoBtn = document . createElement ( "button" ) ;
13041318 infoBtn . className = "inline-info-btn" ;
@@ -1316,7 +1330,9 @@ document.addEventListener("DOMContentLoaded", function () {
13161330 e . stopPropagation ( ) ;
13171331 if ( typeof getProjectInstructions === "function" ) {
13181332 var info = getProjectInstructions ( name ) ;
1319- showInfoModal ( info . title , info . steps ) ;
1333+ if ( info && typeof showInfoModal === "function" ) {
1334+ showInfoModal ( info . title , info . steps ) ;
1335+ }
13201336 }
13211337 } ) ;
13221338
@@ -1326,7 +1342,8 @@ document.addEventListener("DOMContentLoaded", function () {
13261342 firstHeading . appendChild ( infoBtn ) ;
13271343 }
13281344 }
1329- } ) ;
1345+ }
1346+ } ) ;
13301347
13311348 // Setup focus trap
13321349 if ( removeTrap ) removeTrap ( ) ;
0 commit comments