contact-pix.html (3014B)
1 {{ $pixKey := "pix@sivaldodavi.com.br" }} 2 {{ $pixName := "Sivaldo Davi Pereira" }} 3 {{ $pixBank := "Nubank" }} 4 5 <section style="margin-top: 2rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;"> 6 <h2 style="margin-top: 0; font-size: 1.25rem; color: var(--text);">PIX</h2> 7 8 <div style="display: flex; flex-direction: column; gap: 1rem; align-items: center;"> 9 <!-- QR Code --> 10 <div id="pix-qrcode" style="width: 200px; height: 200px;"></div> 11 12 <!-- PIX Key with copy button --> 13 <div style="display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; justify-content: center; width: 100%;"> 14 <code id="pix-key" style="flex: 1; min-width: 200px; background: var(--bg); padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 6px; font-family: var(--sans); font-size: 1rem; color: var(--text); text-align: center; user-select: all;">{{ $pixKey }}</code> 15 <button 16 onclick="copyPixKey()" 17 style="padding: 0.75rem 1.25rem; background: var(--blue); color: var(--bg); border: none; border-radius: 6px; font-weight: 500; font-family: var(--sans); font-size: 0.9rem; cursor: pointer; white-space: nowrap;" 18 onmouseover="this.style.opacity='0.9'" 19 onmouseout="this.style.opacity='1'" 20 aria-label="Copiar chave PIX"> 21 Copiar 22 </button> 23 </div> 24 25 <!-- Info --> 26 <p style="margin: 0; font-size: 0.9rem; color: var(--muted); text-align: center;"> 27 <strong>{{ $pixName }}</strong> ยท {{ $pixBank }} 28 </p> 29 </div> 30 </section> 31 32 <script> 33 // Simple QR code generation using QRCode.js (loaded from CDN) 34 (function() { 35 var script = document.createElement('script'); 36 script.src = 'https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js'; 37 script.onload = function() { 38 new QRCode(document.getElementById('pix-qrcode'), { 39 text: '{{ $pixKey }}', 40 width: 200, 41 height: 200, 42 colorDark: '#e7e7e4', 43 colorLight: '#17181a', 44 correctLevel: QRCode.CorrectLevel.M 45 }); 46 }; 47 document.head.appendChild(script); 48 })(); 49 50 function copyPixKey() { 51 var key = document.getElementById('pix-key').textContent; 52 navigator.clipboard.writeText(key).then(function() { 53 var btn = event.target; 54 var original = btn.textContent; 55 btn.textContent = 'Copiado!'; 56 btn.style.background = '#22c55e'; 57 setTimeout(function() { 58 btn.textContent = original; 59 btn.style.background = ''; 60 }, 2000); 61 }).catch(function() { 62 // Fallback for older browsers 63 var textarea = document.createElement('textarea'); 64 textarea.value = key; 65 document.body.appendChild(textarea); 66 textarea.select(); 67 document.execCommand('copy'); 68 document.body.removeChild(textarea); 69 var btn = event.target; 70 var original = btn.textContent; 71 btn.textContent = 'Copiado!'; 72 btn.style.background = '#22c55e'; 73 setTimeout(function() { 74 btn.textContent = original; 75 btn.style.background = ''; 76 }, 2000); 77 }); 78 } 79 </script>