@@ -1079,7 +1079,8 @@ <h1 class="mb-3">{{ page.title }}</h1>
10791079
10801080 < div class ="text-center ">
10811081 < h5 class ="fw-bold "> Need Job Support or Interview Assistance?</ h5 >
1082- < a href ="https://wa.me/919660614469 " class ="btn btn-success mt-3 ">
1082+ < a href ="https://wa.me/919660614469 " class ="btn btn-success mt-3 " target ="_blank "
1083+ rel ="noopener noreferrer ">
10831084 < i class ="fab fa-whatsapp me-2 "> </ i > Chat on WhatsApp
10841085 </ a >
10851086 </ div >
@@ -1243,6 +1244,94 @@ <h3 class="modal-title">Need IT Job or Interview Support? We’re Here to Help!<
12431244 link . classList . add ( 'active' ) ;
12441245 }
12451246 } ) ;
1247+
1248+ // Engagement Modal Popup
1249+ let modalShown = false ;
1250+ let scrollTriggered = false ;
1251+ let timeTriggered = false ;
1252+
1253+ // Check if modal was shown recently (24 hours)
1254+ function shouldShowModal ( ) {
1255+ const lastShown = localStorage . getItem ( 'engagementModalLastShown' ) ;
1256+ if ( ! lastShown ) return true ;
1257+
1258+ const timeDiff = Date . now ( ) - parseInt ( lastShown ) ;
1259+ const hoursPassed = timeDiff / ( 1000 * 60 * 60 ) ;
1260+ return hoursPassed >= 24 ; // Show again after 24 hours
1261+ }
1262+
1263+ function showEngagementModal ( ) {
1264+ if ( modalShown || ! shouldShowModal ( ) ) return ;
1265+
1266+ const modal = document . getElementById ( 'engagementModal' ) ;
1267+ if ( modal ) {
1268+ modal . classList . add ( 'active' ) ;
1269+ modalShown = true ;
1270+ document . body . style . overflow = 'hidden' ; // Prevent background scroll
1271+
1272+ // Save timestamp
1273+ localStorage . setItem ( 'engagementModalLastShown' , Date . now ( ) . toString ( ) ) ;
1274+
1275+ // Track event
1276+ if ( typeof gtag !== 'undefined' ) {
1277+ gtag ( 'event' , 'engagement_modal_shown' , {
1278+ 'event_category' : 'engagement' ,
1279+ 'event_label' : 'modal_displayed'
1280+ } ) ;
1281+ }
1282+ }
1283+ }
1284+
1285+ function closeEngagementModal ( ) {
1286+ const modal = document . getElementById ( 'engagementModal' ) ;
1287+ if ( modal ) {
1288+ modal . classList . remove ( 'active' ) ;
1289+ document . body . style . overflow = '' ; // Restore scroll
1290+ }
1291+ }
1292+
1293+ // Close on overlay click
1294+ document . addEventListener ( 'click' , function ( e ) {
1295+ const modal = document . getElementById ( 'engagementModal' ) ;
1296+ if ( e . target === modal ) {
1297+ closeEngagementModal ( ) ;
1298+ }
1299+ } ) ;
1300+
1301+ // Close on Escape key
1302+ document . addEventListener ( 'keydown' , function ( e ) {
1303+ if ( e . key === 'Escape' ) {
1304+ closeEngagementModal ( ) ;
1305+ }
1306+ } ) ;
1307+
1308+ // Trigger after 5 seconds on page
1309+ // setTimeout(function () {
1310+ // if (!modalShown && shouldShowModal()) {
1311+ // timeTriggered = true;
1312+ // showEngagementModal();
1313+ // }
1314+ // }, 5000);
1315+
1316+ // Trigger on scroll (when user scrolls 10% down)
1317+ let scrollTriggeredFired = false ;
1318+ window . addEventListener ( 'scroll' , function ( ) {
1319+ if ( scrollTriggeredFired || modalShown ) return ;
1320+
1321+ const scrollPercentage = ( window . scrollY / ( document . documentElement . scrollHeight - window . innerHeight ) ) * 100 ;
1322+
1323+ if ( scrollPercentage >= 10 && shouldShowModal ( ) ) {
1324+ scrollTriggeredFired = true ;
1325+ scrollTriggered = true ;
1326+
1327+ // Small delay to not be too aggressive
1328+ setTimeout ( function ( ) {
1329+ if ( ! modalShown ) {
1330+ showEngagementModal ( ) ;
1331+ }
1332+ } , 500 ) ;
1333+ }
1334+ } ) ;
12461335 </ script >
12471336
12481337
0 commit comments