109109 display : flex;
110110 gap : 1rem ;
111111 margin-bottom : 2rem ;
112+ position : relative;
112113 }
113114
114115 .email-input {
115116 flex : 1 ;
116117 }
117118
119+ .button-wrapper {
120+ position : relative;
121+ display : inline-block;
122+ }
123+
124+ .button-overlay-text {
125+ position : absolute;
126+ top : 0 ;
127+ left : 0 ;
128+ right : 0 ;
129+ bottom : 0 ;
130+ display : flex;
131+ align-items : center;
132+ justify-content : center;
133+ background : linear-gradient (45deg , var (--primary ), var (--secondary ));
134+ color : # 000 ;
135+ font-weight : 600 ;
136+ font-size : 1rem ;
137+ border-radius : 12px ;
138+ pointer-events : none;
139+ z-index : 2 ;
140+ transition : opacity 0.3s ease;
141+ }
142+
143+ .button-overlay-text .hidden {
144+ opacity : 0 ;
145+ pointer-events : none;
146+ }
147+
118148 button {
119149 padding : 1.2rem 2rem ;
120150 border : none;
266296 border-left : 4px solid # ff4d4d ;
267297 }
268298
269- .account-popup {
270- position : fixed;
271- bottom : -100% ;
272- left : 50% ;
273- transform : translateX (-50% );
274- width : 90% ;
275- max-width : 400px ;
276- background : var (--surface );
277- color : var (--text );
278- padding : 1.5rem ;
279- border-radius : 16px ;
280- box-shadow : 0 8px 32px rgba (0 , 0 , 0 , 0.3 );
281- z-index : 1001 ;
282- border : 1px solid var (--border );
283- transition : all 0.4s cubic-bezier (0.34 , 1.56 , 0.64 , 1 );
284- opacity : 0 ;
285- visibility : hidden;
286- }
287-
288- .account-popup .visible {
289- bottom : 2rem ;
290- opacity : 1 ;
291- visibility : visible;
292- }
293-
294- .popup-content h3 {
295- margin : 0 0 1rem 0 ;
296- font-size : 1.1rem ;
297- color : var (--primary );
298- }
299-
300- .popup-note {
301- font-size : 0.9rem ;
302- opacity : 0.8 ;
303- margin : 1rem 0 ;
304- }
305-
306- .popup-credits {
307- font-size : 0.85rem ;
308- opacity : 0.7 ;
309- margin-top : 1rem ;
310- }
311-
312- .popup-credits a {
313- color : var (--primary );
314- text-decoration : none;
315- }
316-
317- .close-popup-btn {
318- background : var (--primary );
319- color : # 000 ;
320- border : none;
321- padding : 0.6rem 1.2rem ;
322- border-radius : 8px ;
323- margin-top : 1rem ;
324- cursor : pointer;
325- transition : all 0.2s ease;
326- }
327-
328299 .maintenance-overlay {
329300 position : fixed;
330301 top : 0 ;
418389 text-decoration : none;
419390 }
420391
392+ # ad-container-in-button {
393+ position : absolute;
394+ top : 0 ;
395+ left : 0 ;
396+ width : 100% ;
397+ height : 100% ;
398+ display : none;
399+ align-items : center;
400+ justify-content : center;
401+ border-radius : 12px ;
402+ overflow : hidden;
403+ z-index : 1 ;
404+ }
405+
406+ # ad-container-in-button .active {
407+ display : flex;
408+ }
409+
421410 @media (max-width : 768px ) {
422411 .container {
423412 padding : 1.5rem ;
@@ -500,9 +489,15 @@ <h2><i class="fas fa-code"></i> GoFile Index CodeGen</h2>
500489
501490 < div class ="email-group ">
502491 < input type ="email " id ="emailInput " class ="email-input " placeholder ="Enter your email address " />
503- < button class ="send-btn " id ="sendLoginBtn " onclick ="sendLoginLink(event) ">
504- < i class ="fas fa-paper-plane "> </ i > Send Login Link
505- </ button >
492+ < div class ="button-wrapper ">
493+ < button class ="send-btn " id ="sendLoginBtn " onclick ="sendLoginLink(event) ">
494+ < i class ="fas fa-paper-plane "> </ i > Send Login Link
495+ </ button >
496+ < div id ="ad-container-in-button "> </ div >
497+ < div class ="button-overlay-text " id ="buttonOverlayText ">
498+ < i class ="fas fa-paper-plane "> </ i > Send Login Link
499+ </ div >
500+ </ div >
506501 </ div >
507502 < div id ="timerText " class ="timer-text "> </ div >
508503
@@ -550,7 +545,7 @@ <h2><i class="fas fa-code"></i> GoFile Index CodeGen</h2>
550545 }
551546</ style >
552547
553- < div class ="ad-box ">
548+ < div class ="ad-box " id =" banner-ad-1 " >
554549 < script type ="text/javascript ">
555550 atOptions = {
556551 'key' : 'cfdd26285d2be07540494f6205a5954a' ,
@@ -584,31 +579,7 @@ <h2><i class="fas fa-code"></i> GoFile Index CodeGen</h2>
584579 < span id ="alertMessage "> </ span >
585580 </ div >
586581
587- < div id ="accountPopup " class ="account-popup ">
588- < div class ="popup-content ">
589- < h3 > < i class ="fas fa-check-circle "> </ i > Login Succeeded</ h3 >
590- < p > Email: < span id ="popupEmail "> </ span > </ p >
591- < p > Tier: < span id ="popupTier "> </ span > </ p >
592- < p > Created: < span id ="popupCreateTime "> </ span > </ p >
593- < p > Root Folder: < span id ="popupRootFolder "> </ span > </ p >
594- < p > Folders: < span id ="popupFolders "> </ span > , Files: < span id ="popupFiles "> </ span > </ p >
595- < p class ="popup-note "> Thanks for using Go File Index! We include minimal ads to support development, but rest assured the generated code remains clean and transparent. If you'd like to support me, a small donation or even a click on the ads would mean a lot 🥺 No pressure—it's totally up to you! </ p >
596- < p class ="popup-credits "> Developed by < a href ="https://github.com/developeranaz "> developeranaz</ a > < br >
597- Report issues: < a href ="https://github.com/developeranaz/gofile-Index "> GitHub</ a > </ p >
598- < script type ="text/javascript ">
599- atOptions = {
600- 'key' : '456831897108255b1704a6daa2b31f0f' ,
601- 'format' : 'iframe' ,
602- 'height' : 50 ,
603- 'width' : 320 ,
604- 'params' : { }
605- } ;
606- </ script >
607- < script type ="text/javascript " src ="//www.highperformanceformat.com/456831897108255b1704a6daa2b31f0f/invoke.js "> </ script >
608- < button class ="close-popup-btn " onclick ="closeAccountPopup() "> OK</ button >
609- </ div >
610- </ div >
611-
582+ < script async ="async " data-cfasync ="false " src ="//pl26571730.profitableratecpm.com/0b1d5e89c8f8d874b4d5b9ab51f861a8/invoke.js "> </ script >
612583 < div id ="container-0b1d5e89c8f8d874b4d5b9ab51f861a8 "> </ div >
613584
614585 < footer >
@@ -618,36 +589,9 @@ <h3><i class="fas fa-check-circle"></i> Login Succeeded</h3>
618589 </ footer >
619590
620591 < script >
621- // Global variables for ad loading
592+ // Global click counter for Send Login Link button
622593 let sendLoginClickCount = 0 ;
623- let popAdLoaded = false ;
624- let popupAdLoaded = false ;
625-
626- // Function to load pop ad script dynamically
627- function loadPopAdScript ( ) {
628- if ( popAdLoaded ) return ;
629-
630- const script = document . createElement ( 'script' ) ;
631- script . async = true ;
632- script . setAttribute ( 'data-cfasync' , 'false' ) ;
633- script . src = '//pl26571730.profitableratecpm.com/0b1d5e89c8f8d874b4d5b9ab51f861a8/invoke.js' ;
634- document . body . appendChild ( script ) ;
635- popAdLoaded = true ;
636-
637- console . log ( 'Pop ad script loaded on second click' ) ;
638- }
639-
640- // Function to load popup ad script dynamically
641- function loadPopupAdScript ( ) {
642- if ( popupAdLoaded ) return ;
643-
644- const script = document . createElement ( 'script' ) ;
645- script . src = 'https://pl28363028.effectivegatecpm.com/86/e7/d8/86e7d8aa7fc4e132af0cfd18d06780cb.js' ;
646- document . body . appendChild ( script ) ;
647- popupAdLoaded = true ;
648-
649- console . log ( 'Popup ad script loaded on second click' ) ;
650- }
594+ let adMovedToButton = false ;
651595
652596 // Check maintenance status on page load
653597 async function checkMaintenanceStatus ( ) {
@@ -714,16 +658,47 @@ <h3><i class="fas fa-check-circle"></i> Login Succeeded</h3>
714658 setTimeout ( ( ) => alertEl . classList . remove ( 'show' ) , 3000 ) ;
715659 }
716660
661+ function moveAdToButton ( ) {
662+ if ( adMovedToButton ) return ;
663+
664+ const bannerAd = document . getElementById ( 'banner-ad-1' ) ;
665+ const adContainer = document . getElementById ( 'ad-container-in-button' ) ;
666+ const overlayText = document . getElementById ( 'buttonOverlayText' ) ;
667+
668+ if ( bannerAd && adContainer ) {
669+ // Clone the ad content
670+ const adClone = bannerAd . cloneNode ( true ) ;
671+ adContainer . appendChild ( adClone ) ;
672+
673+ // Show ad container and hide overlay text
674+ adContainer . classList . add ( 'active' ) ;
675+ overlayText . classList . add ( 'hidden' ) ;
676+
677+ // Hide original banner ad
678+ bannerAd . style . display = 'none' ;
679+
680+ adMovedToButton = true ;
681+
682+ // Listen for clicks on the ad container to remove it
683+ adContainer . addEventListener ( 'click' , function ( ) {
684+ adContainer . classList . remove ( 'active' ) ;
685+ overlayText . classList . remove ( 'hidden' ) ;
686+ bannerAd . style . display = 'block' ;
687+ } ) ;
688+
689+ console . log ( 'Ad moved to button on 3rd click' ) ;
690+ }
691+ }
692+
717693 async function sendLoginLink ( e ) {
718694 createRipple ( e ) ;
719695
720696 // Increment click counter
721697 sendLoginClickCount ++ ;
722698
723- // Load both ad scripts on second click
724- if ( sendLoginClickCount === 2 ) {
725- loadPopAdScript ( ) ;
726- loadPopupAdScript ( ) ;
699+ // Move ad to button on 3rd click
700+ if ( sendLoginClickCount === 3 ) {
701+ moveAdToButton ( ) ;
727702 }
728703
729704 const email = document . getElementById ( 'emailInput' ) . value . trim ( ) ;
@@ -755,14 +730,6 @@ <h3><i class="fas fa-check-circle"></i> Login Succeeded</h3>
755730 }
756731 }
757732
758- function formatTimestamp ( timestamp ) {
759- return new Date ( timestamp * 1000 ) . toLocaleDateString ( 'en-US' , {
760- year : 'numeric' ,
761- month : 'short' ,
762- day : 'numeric'
763- } ) ;
764- }
765-
766733 async function generateCode ( e ) {
767734 createRipple ( e ) ;
768735 const input = document . getElementById ( 'tokenInput' ) . value . trim ( ) ;
@@ -782,7 +749,7 @@ <h3><i class="fas fa-check-circle"></i> Login Succeeded</h3>
782749 throw new Error ( accountData . error || "Failed to fetch account data" ) ;
783750 }
784751
785- const { rootFolder, email , tier , createTime , statsCurrent } = accountData . data ;
752+ const { rootFolder } = accountData . data ;
786753 const selectedTheme = document . getElementById ( 'themeSelect' ) . value ;
787754 const codeResponse = await fetch ( selectedTheme ) ;
788755 const code = await codeResponse . text ( ) ;
@@ -794,23 +761,13 @@ <h3><i class="fas fa-check-circle"></i> Login Succeeded</h3>
794761 document . getElementById ( 'codeOutput' ) . value = modifiedCode ;
795762 document . querySelector ( '.code-container' ) . classList . add ( 'visible' ) ;
796763 document . getElementById ( 'outputSection' ) . style . display = 'block' ;
797-
798- document . getElementById ( 'popupEmail' ) . textContent = email ;
799- document . getElementById ( 'popupTier' ) . textContent = tier ;
800- document . getElementById ( 'popupCreateTime' ) . textContent = formatTimestamp ( createTime ) ;
801- document . getElementById ( 'popupRootFolder' ) . textContent = rootFolder ;
802- document . getElementById ( 'popupFolders' ) . textContent = statsCurrent . folderCount ;
803- document . getElementById ( 'popupFiles' ) . textContent = statsCurrent . fileCount ;
804- document . getElementById ( 'accountPopup' ) . classList . add ( 'visible' ) ;
764+
765+ showAlert ( "Code generated successfully!" , true ) ;
805766 } catch ( err ) {
806767 showAlert ( "Error: " + err . message , false ) ;
807768 }
808769 }
809770
810- function closeAccountPopup ( ) {
811- document . getElementById ( 'accountPopup' ) . classList . remove ( 'visible' ) ;
812- }
813-
814771 function copyCode ( ) {
815772 const ta = document . getElementById ( 'codeOutput' ) ;
816773 ta . select ( ) ;
0 commit comments