@@ -82,7 +82,32 @@ <h1 style="margin: 0;">Create AI Attestation</h1>
8282 </ span >
8383 </ label >
8484
85- < div class ="import-url-container " style ="margin-top: 10px; display: flex; gap: 10px; align-items: center; ">
85+ < div class ="import-url-container " style ="margin-top: 10px; ">
86+ < style >
87+ .import-url-container {
88+ display : flex;
89+ gap : 10px ;
90+ align-items : center;
91+ }
92+ @media (max-width : 768px ) {
93+ .import-url-container {
94+ flex-direction : column;
95+ gap : 8px ;
96+ align-items : center;
97+ }
98+ .import-url-container input {
99+ width : 100% ;
100+ max-width : 100% ;
101+ }
102+ .import-url-container button {
103+ display : block;
104+ width : auto;
105+ max-width : 300px ;
106+ margin : 0 auto;
107+ padding : 12px 24px ;
108+ }
109+ }
110+ </ style >
86111 < input type ="url " id ="import-url " placeholder ="Or paste URL to import content... " style ="flex: 1; ">
87112 < button type ="button " id ="import-url-btn " class ="btn btn-secondary "> Import URL</ button >
88113 </ div >
@@ -208,7 +233,7 @@ <h1 style="margin: 0;">Create AI Attestation</h1>
208233 </ div >
209234 < div id ="wallet-section ">
210235 < div style ="padding: 15px; background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; ">
211- < button type ="button " id ="connect-wallet " class ="btn btn-secondary " style ="width: 100%; ">
236+ < button type ="button " id ="connect-wallet " class ="btn btn-secondary " style ="width: 100%; max-width: 100%; display: block; margin: 0 auto; ">
212237 < span id ="wallet-button-text "> Connect Ethereum Wallet</ span >
213238 < span id ="wallet-spinner " style ="display: none; margin-left: 10px; "> ⏳</ span >
214239 </ button >
@@ -229,8 +254,8 @@ <h1 style="margin: 0;">Create AI Attestation</h1>
229254 </ div >
230255 </ div >
231256
232- < div style ="margin-top: 30px; ">
233- < button type ="submit " class ="btn "> Generate Attestation</ button >
257+ < div style ="margin-top: 30px; text-align: center; ">
258+ < button type ="submit " class ="btn " style =" display: inline-block; " > Generate Attestation</ button >
234259 </ div >
235260 </ form >
236261
@@ -860,6 +885,31 @@ <h1 style="margin: 0;">Create AI Attestation</h1>
860885
861886 // Mobile detection
862887 const isMobile = / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i. test ( navigator . userAgent ) ;
888+ const isIOS = / i P h o n e | i P a d | i P o d / . test ( navigator . userAgent ) ;
889+
890+ // Special check for iOS - even if ethereum is undefined, check if we can detect MetaMask app
891+ if ( isIOS && ! window . ethereum ) {
892+ // On iOS, if user has MetaMask installed but we're in Safari/Chrome,
893+ // we need to use the deep link
894+ statusDiv . style . display = 'block' ;
895+ statusDiv . style . color = 'var(--color-warning)' ;
896+
897+ const currentUrl = window . location . href ;
898+ const metamaskDeepLink = `metamask://dapp/${ currentUrl . replace ( / ^ h t t p s ? : \/ \/ / , '' ) } ` ;
899+ const metamaskUniversalLink = `https://metamask.app.link/dapp/${ currentUrl . replace ( / ^ h t t p s ? : \/ \/ / , '' ) } ` ;
900+
901+ statusDiv . innerHTML = `
902+ 📱 MetaMask Mobile Detection<br><br>
903+ If you have MetaMask installed:<br>
904+ <a href="${ metamaskDeepLink } " class="btn btn-secondary" style="display: block; margin: 10px auto; max-width: 300px;">Open in MetaMask App</a>
905+ <br>
906+ If the button above doesn't work:<br>
907+ <a href="${ metamaskUniversalLink } " class="btn btn-secondary" style="display: block; margin: 10px auto; max-width: 300px;">Try Universal Link</a>
908+ <br>
909+ Or use <strong>"Local Signature"</strong> below for a simpler option.
910+ ` ;
911+ return ;
912+ }
863913
864914 // Check if any ethereum provider exists
865915 if ( typeof window . ethereum === 'undefined' ) {
@@ -883,16 +933,16 @@ <h1 style="margin: 0;">Create AI Attestation</h1>
883933 const currentUrl = window . location . href ;
884934 const metamaskDeepLink = `https://metamask.app.link/dapp/${ currentUrl . replace ( / ^ h t t p s ? : \/ \/ / , '' ) } ` ;
885935
886- mobileMessage += `<a href="${ metamaskDeepLink } " class="btn btn-secondary" style="margin: 10px 0; ">Open in MetaMask Browser</a><br ><br>` ;
936+ mobileMessage += `<a href="${ metamaskDeepLink } " class="btn btn-secondary" style="display: block; margin: 10px auto; max-width: 300px; ">Open in MetaMask Browser</a><br>` ;
887937
888938 mobileMessage += 'Option 2: Install MetaMask<br>' ;
889939 if ( isIOS ) {
890- mobileMessage += '<a href="https://apps.apple.com/app/metamask/id1438144202" target="_blank" class="btn btn-secondary">Get MetaMask for iOS</a>' ;
940+ mobileMessage += '<a href="https://apps.apple.com/app/metamask/id1438144202" target="_blank" class="btn btn-secondary" style="display: block; margin: 10px auto; max-width: 300px;" >Get MetaMask for iOS</a>' ;
891941 } else {
892- mobileMessage += '<a href="https://play.google.com/store/apps/details?id=io.metamask" target="_blank" class="btn btn-secondary">Get MetaMask for Android</a>' ;
942+ mobileMessage += '<a href="https://play.google.com/store/apps/details?id=io.metamask" target="_blank" class="btn btn-secondary" style="display: block; margin: 10px auto; max-width: 300px;" >Get MetaMask for Android</a>' ;
893943 }
894944
895- mobileMessage += '<br><br> Option 3: Use <strong>"Local Signature"</strong> below for a simpler option.' ;
945+ mobileMessage += '<br>Option 3: Use <strong>"Local Signature"</strong> below for a simpler option.' ;
896946 } else {
897947 mobileMessage += 'MetaMask browser detected but provider not available.<br>' ;
898948 mobileMessage += 'Please try refreshing the page or use <strong>"Local Signature"</strong> below.' ;
0 commit comments