Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>CVS Tap to Pay</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| :root { | |
| --cvs-red: #cc0000; | |
| --cvs-dark-red: #a00000; | |
| --success-green: #28a745; | |
| --bg-light: #f5f5f5; | |
| --text-dark: #333; | |
| --text-light: #666; | |
| --shadow: 0 4px 20px rgba(0, 0, 0, 0.1); | |
| } | |
| body { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%); | |
| min-height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| } | |
| header { | |
| width: 100%; | |
| background: var(--cvs-red); | |
| padding: 1rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| box-shadow: var(--shadow); | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .logo-text { | |
| font-size: 2rem; | |
| font-weight: bold; | |
| color: white; | |
| letter-spacing: 2px; | |
| } | |
| .logo-tagline { | |
| font-size: 0.7rem; | |
| color: rgba(255, 255, 255, 0.9); | |
| } | |
| .built-with { | |
| color: white; | |
| text-decoration: none; | |
| font-size: 0.8rem; | |
| opacity: 0.9; | |
| transition: opacity 0.3s; | |
| } | |
| .built-with:hover { | |
| opacity: 1; | |
| text-decoration: underline; | |
| } | |
| main { | |
| flex: 1; | |
| width: 100%; | |
| max-width: 500px; | |
| padding: 2rem 1rem; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 1.5rem; | |
| } | |
| .payment-card { | |
| background: white; | |
| border-radius: 20px; | |
| padding: 2rem; | |
| box-shadow: var(--shadow); | |
| text-align: center; | |
| } | |
| .amount-display { | |
| margin-bottom: 1.5rem; | |
| } | |
| .amount-label { | |
| font-size: 0.9rem; | |
| color: var(--text-light); | |
| margin-bottom: 0.5rem; | |
| } | |
| .amount { | |
| font-size: 3rem; | |
| font-weight: bold; | |
| color: var(--text-dark); | |
| } | |
| .tap-area { | |
| width: 180px; | |
| height: 180px; | |
| margin: 2rem auto; | |
| border-radius: 50%; | |
| background: linear-gradient(145deg, #ffffff, #e6e6e6); | |
| box-shadow: 8px 8px 20px #d1d1d1, -8px -8px 20px #ffffff; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .tap-area:hover { | |
| transform: scale(1.02); | |
| } | |
| .tap-area:active { | |
| transform: scale(0.98); | |
| box-shadow: 4px 4px 10px #d1d1d1, -4px -4px 10px #ffffff; | |
| } | |
| .tap-area.processing { | |
| animation: pulse 1.5s infinite; | |
| } | |
| .tap-area.success { | |
| background: linear-gradient(145deg, #2ecc71, #27ae60); | |
| box-shadow: 8px 8px 20px rgba(46, 204, 113, 0.3), -8px -8px 20px #ffffff; | |
| } | |
| @keyframes pulse { | |
| 0%, | |
| 100% { | |
| transform: scale(1); | |
| box-shadow: 8px 8px 20px #d1d1d1, -8px -8px 20px #ffffff; | |
| } | |
| 50% { | |
| transform: scale(1.05); | |
| box-shadow: 12px 12px 30px rgba(204, 0, 0, 0.2), -8px -8px 20px #ffffff; | |
| } | |
| } | |
| .tap-icon { | |
| font-size: 3rem; | |
| color: var(--cvs-red); | |
| margin-bottom: 0.5rem; | |
| transition: all 0.3s ease; | |
| } | |
| .tap-area.success .tap-icon { | |
| color: white; | |
| } | |
| .tap-text { | |
| font-size: 0.9rem; | |
| color: var(--text-light); | |
| font-weight: 500; | |
| } | |
| .tap-area.success .tap-text { | |
| color: white; | |
| } | |
| .ripple { | |
| position: absolute; | |
| border-radius: 50%; | |
| background: rgba(204, 0, 0, 0.3); | |
| animation: ripple-animation 1s ease-out; | |
| pointer-events: none; | |
| } | |
| @keyframes ripple-animation { | |
| from { | |
| width: 0; | |
| height: 0; | |
| opacity: 1; | |
| } | |
| to { | |
| width: 300px; | |
| height: 300px; | |
| opacity: 0; | |
| } | |
| } | |
| .payment-methods { | |
| display: flex; | |
| justify-content: center; | |
| gap: 1rem; | |
| margin-top: 1rem; | |
| } | |
| .payment-method { | |
| width: 50px; | |
| height: 35px; | |
| background: #f8f8f8; | |
| border-radius: 8px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-size: 1.2rem; | |
| color: var(--text-light); | |
| } | |
| .transaction-details { | |
| background: white; | |
| border-radius: 20px; | |
| padding: 1.5rem; | |
| box-shadow: var(--shadow); | |
| } | |
| .detail-row { | |
| display: flex; | |
| justify-content: space-between; | |
| padding: 0.75rem 0; | |
| border-bottom: 1px solid #eee; | |
| } | |
| .detail-row:last-child { | |
| border-bottom: none; | |
| } | |
| .detail-label { | |
| color: var(--text-light); | |
| font-size: 0.9rem; | |
| } | |
| .detail-value { | |
| color: var(--text-dark); | |
| font-weight: 500; | |
| } | |
| .rewards-card { | |
| background: linear-gradient(135deg, var(--cvs-red), var(--cvs-dark-red)); | |
| border-radius: 20px; | |
| padding: 1.5rem; | |
| color: white; | |
| box-shadow: var(--shadow); | |
| } | |
| .rewards-header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| margin-bottom: 1rem; | |
| } | |
| .rewards-title { | |
| font-size: 1.1rem; | |
| font-weight: 600; | |
| } | |
| .rewards-badge { | |
| background: rgba(255, 255, 255, 0.2); | |
| padding: 0.3rem 0.8rem; | |
| border-radius: 20px; | |
| font-size: 0.8rem; | |
| } | |
| .rewards-points { | |
| font-size: 2rem; | |
| font-weight: bold; | |
| margin-bottom: 0.5rem; | |
| } | |
| .rewards-subtitle { | |
| font-size: 0.85rem; | |
| opacity: 0.9; | |
| } | |
| .progress-bar { | |
| height: 8px; | |
| background: rgba(255, 255, 255, 0.3); | |
| border-radius: 4px; | |
| margin-top: 1rem; | |
| overflow: hidden; | |
| } | |
| .progress-fill { | |
| height: 100%; | |
| width: 65%; | |
| background: white; | |
| border-radius: 4px; | |
| transition: width 0.5s ease; | |
| } | |
| .quick-actions { | |
| display: grid; | |
| grid-template-columns: repeat(4, 1fr); | |
| gap: 1rem; | |
| } | |
| .quick-action { | |
| background: white; | |
| border-radius: 15px; | |
| padding: 1rem 0.5rem; | |
| text-align: center; | |
| box-shadow: var(--shadow); | |
| cursor: pointer; | |
| transition: transform 0.2s, box-shadow 0.2s; | |
| } | |
| .quick-action:hover { | |
| transform: translateY(-3px); | |
| box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15); | |
| } | |
| .quick-action i { | |
| font-size: 1.5rem; | |
| color: var(--cvs-red); | |
| margin-bottom: 0.5rem; | |
| } | |
| .quick-action span { | |
| display: block; | |
| font-size: 0.75rem; | |
| color: var(--text-dark); | |
| } | |
| .status-message { | |
| text-align: center; | |
| padding: 1rem; | |
| border-radius: 10px; | |
| margin-top: 1rem; | |
| display: none; | |
| } | |
| .status-message.show { | |
| display: block; | |
| animation: fadeIn 0.3s ease; | |
| } | |
| .status-message.success { | |
| background: rgba(40, 167, 69, 0.1); | |
| color: var(--success-green); | |
| } | |
| .status-message.error { | |
| background: rgba(220, 53, 69, 0.1); | |
| color: #dc3545; | |
| } | |
| .status-message.info { | |
| background: rgba(204, 0, 0, 0.1); | |
| color: var(--cvs-red); | |
| } | |
| @keyframes fadeIn { | |
| from { | |
| opacity: 0; | |
| transform: translateY(-10px); | |
| } | |
| to { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| } | |
| footer { | |
| width: 100%; | |
| background: white; | |
| padding: 1rem; | |
| text-align: center; | |
| box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); | |
| } | |
| .footer-nav { | |
| display: flex; | |
| justify-content: space-around; | |
| max-width: 500px; | |
| margin: 0 auto; | |
| } | |
| .footer-nav-item { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| gap: 0.3rem; | |
| color: var(--text-light); | |
| cursor: pointer; | |
| transition: color 0.2s; | |
| } | |
| .footer-nav-item.active, | |
| .footer-nav-item:hover { | |
| color: var(--cvs-red); | |
| } | |
| .footer-nav-item i { | |
| font-size: 1.3rem; | |
| } | |
| .footer-nav-item span { | |
| font-size: 0.7rem; | |
| } | |
| @media (max-width: 400px) { | |
| .amount { | |
| font-size: 2.5rem; | |
| } | |
| .tap-area { | |
| width: 150px; | |
| height: 150px; | |
| } | |
| .tap-icon { | |
| font-size: 2.5rem; | |
| } | |
| .quick-actions { | |
| grid-template-columns: repeat(2, 1fr); | |
| } | |
| } | |
| /* Modal Styles */ | |
| .modal { | |
| display: none; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background: rgba(0, 0, 0, 0.5); | |
| z-index: 1000; | |
| align-items: center; | |
| justify-content: center; | |
| padding: 1rem; | |
| } | |
| .modal.show { | |
| display: flex; | |
| animation: fadeIn 0.3s ease; | |
| } | |
| .modal-content { | |
| background: white; | |
| border-radius: 20px; | |
| padding: 2rem; | |
| max-width: 400px; | |
| width: 100%; | |
| text-align: center; | |
| } | |
| .modal-icon { | |
| font-size: 4rem; | |
| color: var(--success-green); | |
| margin-bottom: 1rem; | |
| } | |
| .modal-title { | |
| font-size: 1.5rem; | |
| color: var(--text-dark); | |
| margin-bottom: 0.5rem; | |
| } | |
| .modal-text { | |
| color: var(--text-light); | |
| margin-bottom: 1.5rem; | |
| } | |
| .modal-btn { | |
| background: var(--cvs-red); | |
| color: white; | |
| border: none; | |
| padding: 1rem 2rem; | |
| border-radius: 10px; | |
| font-size: 1rem; | |
| cursor: pointer; | |
| transition: background 0.2s; | |
| } | |
| .modal-btn:hover { | |
| background: var(--cvs-dark-red); | |
| } | |
| .receipt-details { | |
| text-align: left; | |
| background: #f8f8f8; | |
| border-radius: 10px; | |
| padding: 1rem; | |
| margin: 1rem 0; | |
| } | |
| .receipt-row { | |
| display: flex; | |
| justify-content: space-between; | |
| padding: 0.5rem 0; | |
| font-size: 0.9rem; | |
| } | |
| .receipt-row.total { | |
| border-top: 1px dashed #ddd; | |
| margin-top: 0.5rem; | |
| padding-top: 0.75rem; | |
| font-weight: bold; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <div class="logo"> | |
| <div> | |
| <div class="logo-text">CVS</div> | |
| <div class="logo-tagline">pharmacy</div> | |
| </div> | |
| </div> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" class="built-with" target="_blank"> | |
| Built with anycoder | |
| </a> | |
| </header> | |
| <main> | |
| <div class="payment-card"> | |
| <div class="amount-display"> | |
| <div class="amount-label">Total Amount</div> | |
| <div class="amount" id="totalAmount">$24.99</div> | |
| </div> | |
| <div class="tap-area" id="tapArea"> | |
| <i class="fas fa-wifi tap-icon" id="tapIcon"></i> | |
| <span class="tap-text" id="tapText">Tap to Pay</span> | |
| </div> | |
| <div class="payment-methods"> | |
| <div class="payment-method"><i class="fab fa-apple-pay"></i></div> | |
| <div class="payment-method"><i class="fab fa-google-pay"></i></div> | |
| <div class="payment-method"><i class="fab fa-cc-visa"></i></div> | |
| <div class="payment-method"><i class="fab fa-cc-mastercard"></i></div> | |
| </div> | |
| <div class="status-message" id="statusMessage"></div> | |
| </div> | |
| <div class="transaction-details"> | |
| <div class="detail-row"> | |
| <span class="detail-label">Store</span> | |
| <span class="detail-value">CVS #4521</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Date</span> | |
| <span class="detail-value" id="currentDate"></span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Items</span> | |
| <span class="detail-value">3 items</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Subtotal</span> | |
| <span class="detail-value">$22.99</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Tax</span> | |
| <span class="detail-value">$2.00</span> | |
| </div> | |
| </div> | |
| <div class="rewards-card"> | |
| <div class="rewards-header"> | |
| <span class="rewards-title">ExtraCare Rewards</span> | |
| <span class="rewards-badge">Gold Member</span> | |
| </div> | |
| <div class="rewards-points">2,450 pts</div> | |
| <div class="rewards-subtitle">550 pts until your next $5 reward</div> | |
| <div class="progress-bar"> | |
| <div class="progress-fill"></div> | |
| </div> | |
| </div> | |
| <div class="quick-actions"> | |
| <div class="quick-action"> | |
| <i class="fas fa-receipt"></i> | |
| <span>Receipts</span> | |
| </div> | |
| <div class="quick-action"> | |
| <i class="fas fa-pills"></i> | |
| <span>Pharmacy</span> | |
| </div> | |
| <div class="quick-action"> | |
| <i class="fas fa-percent"></i> | |
| <span>Coupons</span> | |
| </div> | |
| <div class="quick-action"> | |
| <i class="fas fa-store"></i> | |
| <span>Stores</span> | |
| </div> | |
| </div> | |
| </main> | |
| <footer> | |
| <nav class="footer-nav"> | |
| <div class="footer-nav-item"> | |
| <i class="fas fa-home"></i> | |
| <span>Home</span> | |
| </div> | |
| <div class="footer-nav-item"> | |
| <i class="fas fa-search"></i> | |
| <span>Shop</span> | |
| </div> | |
| <div class="footer-nav-item active"> | |
| <i class="fas fa-credit-card"></i> | |
| <span>Pay</span> | |
| </div> | |
| <div class="footer-nav-item"> | |
| <i class="fas fa-heart"></i> | |
| <span>Health</span> | |
| </div> | |
| <div class="footer-nav-item"> | |
| <i class="fas fa-user"></i> | |
| <span>Account</span> | |
| </div> | |
| </nav> | |
| </footer> | |
| <!-- Success Modal --> | |
| <div class="modal" id="successModal"> | |
| <div class="modal-content"> | |
| <i class="fas fa-check-circle modal-icon"></i> | |
| <h2 class="modal-title">Payment Successful!</h2> | |
| <p class="modal-text">Your payment has been processed successfully.</p> | |
| <div class="receipt-details"> | |
| <div class="receipt-row"> | |
| <span>Transaction ID</span> | |
| <span id="transactionId"></span> | |
| </div> | |
| <div class="receipt-row"> | |
| <span>Payment Method</span> | |
| <span>Apple Pay ****4242</span> | |
| </div> | |
| <div class="receipt-row"> | |
| <span>Points Earned</span> | |
| <span>+25 pts</span> | |
| </div> | |
| <div class="receipt-row total"> | |
| <span>Total Paid</span> | |
| <span>$24.99</span> | |
| </div> | |
| </div> | |
| <button class="modal-btn" id="closeModal">Done</button> | |
| </div> | |
| </div> | |
| <script> | |
| // Set current date | |
| const currentDate = new Date(); | |
| const options = { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric' }; | |
| document.getElementById('currentDate').textContent = currentDate.toLocaleDateString('en-US', options); | |
| // Tap to Pay functionality | |
| const tapArea = document.getElementById('tapArea'); | |
| const tapIcon = document.getElementById('tapIcon'); | |
| const tapText = document.getElementById('tapText'); | |
| const statusMessage = document.getElementById('statusMessage'); | |
| const successModal = document.getElementById('successModal'); | |
| const closeModal = document.getElementById('closeModal'); | |
| const transactionId = document.getElementById('transactionId'); | |
| let isProcessing = false; | |
| tapArea.addEventListener('click', function(e) { | |
| if (isProcessing) return; | |
| // Create ripple effect | |
| const ripple = document.createElement('div'); | |
| ripple.classList.add('ripple'); | |
| const rect = tapArea.getBoundingClientRect(); | |
| ripple.style.left = (e.clientX - rect.left - 150) + 'px'; | |
| ripple.style.top = (e.clientY - rect.top - 150) + 'px'; | |
| tapArea.appendChild(ripple); | |
| setTimeout(() => ripple.remove(), 1000); | |
| // Start processing | |
| isProcessing = true; | |
| tapArea.classList.add('processing'); | |
| tapIcon.className = 'fas fa-spinner fa-spin tap-icon'; | |
| tapText.textContent = 'Processing...'; | |
| // Show processing message | |
| showStatus('Connecting to payment terminal...', 'info'); | |
| // Simulate payment processing | |
| setTimeout(() => { | |
| showStatus('Verifying payment...', 'info'); | |
| }, 1000); | |
| setTimeout(() => { | |
| showStatus('Authorizing transaction...', 'info'); | |
| }, 2000); | |
| setTimeout(() => { | |
| // Payment success | |
| tapArea.classList.remove('processing'); | |
| tapArea.classList.add('success'); | |
| tapIcon.className = 'fas fa-check tap-icon'; | |
| tapText.textContent = 'Approved!'; | |
| // Generate transaction ID | |
| transactionId.textContent = 'TXN' + Math.random().toString(36).substr(2, 9).toUpperCase(); | |
| // Show success modal | |
| setTimeout(() => { | |
| successModal.classList.add('show'); | |
| }, 500); | |
| // Update rewards | |
| updateRewards(); | |
| hideStatus(); | |
| }, 3000); | |
| }); | |
| closeModal.addEventListener('click', function() { | |
| successModal.classList.remove('show'); | |
| // Reset tap area | |
| setTimeout(() => { | |
| tapArea.classList.remove('success'); | |
| tapIcon.className = 'fas fa-wifi tap-icon'; | |
| tapText.textContent = 'Tap to Pay'; | |
| isProcessing = false; | |
| }, 300); | |
| }); | |
| function showStatus(message, type) { | |
| statusMessage.textContent = message; | |
| statusMessage.className = 'status-message show ' + type; | |
| } | |
| function hideStatus() { | |
| statusMessage.classList.remove('show'); | |
| } | |
| function updateRewards() { | |
| const pointsElement = document.querySelector('.rewards-points'); | |
| const progressFill = document.querySelector('.progress-fill'); | |
| const subtitle = document.querySelector('.rewards-subtitle'); | |
| // Animate points increase | |
| let currentPoints = 2450; | |
| const targetPoints = 2475; | |
| const interval = setInterval(() => { | |
| currentPoints++; | |
| pointsElement.textContent = currentPoints.toLocaleString() + ' pts'; | |
| if (currentPoints >= targetPoints) { | |
| clearInterval(interval); | |
| } | |
| }, 50); | |
| // Update progress bar | |
| progressFill.style.width = '73%'; | |
| subtitle.textContent = '525 pts until your next $5 reward'; | |
| } | |
| // Quick action click effects | |
| document.querySelectorAll('.quick-action').forEach(action => { | |
| action.addEventListener('click', function() { | |
| this.style.transform = 'scale(0.95)'; | |
| setTimeout(() => { | |
| this.style.transform = ''; | |
| }, 150); | |
| }); | |
| }); | |
| // Footer navigation | |
| document.querySelectorAll('.footer-nav-item').forEach(item => { | |
| item.addEventListener('click', function() { | |
| document.querySelectorAll('.footer-nav-item').forEach(i => i.classList.remove('active')); | |
| this.classList.add('active'); | |
| }); | |
| }); | |
| // Close modal on outside click | |
| successModal.addEventListener('click', function(e) { | |
| if (e.target === successModal) { | |
| closeModal.click(); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |