Spaces:
Running
Running
Add 3 files
Browse filesFiles changed (3)
- README.md+7-5
- index.html+483-19
- prompts.txtAdded+1
12345678910---title: Cards Saveemoji: 🐨colorFrom: indigocolorTo: redsdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112---title: cards-saveemoji: 🐳colorFrom: bluecolorTo: pinksdk: staticpinned: falsetags:- deepsite---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483<!DOCTYPE html><html lang="ar" dir="rtl"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>تطبيق حفظ البطاقات البنكية</title><script src="https://cdn.tailwindcss.com"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>.card-preview {background: linear-gradient(135deg, #3a7bd5, #00d2ff);transform-style: preserve-3d;transition: all 0.5s ease;}.card-preview:hover {transform: rotateY(10deg);}.card-chip {background: linear-gradient(135deg, #ddb35f, #f9e7b0);}.card-logo {filter: brightness(0) invert(1);}.card-form {backdrop-filter: blur(10px);}.flip-card {perspective: 1000px;}.flip-card-inner {transition: transform 0.6s;transform-style: preserve-3d;}.flip-card.flipped .flip-card-inner {transform: rotateY(180deg);}.flip-card-front, .flip-card-back {backface-visibility: hidden;}.flip-card-back {transform: rotateY(180deg);}.card-number-input {letter-spacing: 2px;font-family: 'Courier New', monospace;}.card-cvv {direction: ltr;}</style></head><body class="bg-gray-100 min-h-screen font-sans"><div class="container mx-auto px-4 py-8"><!-- Header --><header class="flex justify-between items-center mb-8"><h1 class="text-3xl font-bold text-blue-800"><i class="fas fa-credit-card mr-2"></i> محفظة البطاقات</h1><button id="addCardBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center"><i class="fas fa-plus mr-2"></i> إضافة بطاقة</button></header><!-- Card Display Section --><section class="mb-12"><h2 class="text-xl font-semibold text-gray-700 mb-4">بطاقاتك</h2><div id="cardsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"><!-- Cards will be added here dynamically --><div class="text-center py-10 text-gray-500" id="noCardsMessage"><i class="fas fa-credit-card text-4xl mb-2"></i><p>لا توجد بطاقات مسجلة</p></div></div></section><!-- Add Card Modal --><div id="addCardModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 hidden"><div class="bg-white rounded-xl shadow-xl w-full max-w-md"><div class="p-6"><div class="flex justify-between items-center mb-4"><h3 class="text-xl font-bold text-gray-800">إضافة بطاقة جديدة</h3><button id="closeModalBtn" class="text-gray-500 hover:text-gray-700"><i class="fas fa-times"></i></button></div><!-- Card Preview --><div class="flip-card mb-6" id="cardPreview"><div class="flip-card-inner"><!-- Front of Card --><div class="flip-card-front card-preview rounded-xl p-6 text-white shadow-lg"><div class="flex justify-between items-start mb-8"><div class="card-chip w-12 h-8 rounded-md flex items-center justify-center"><i class="fas fa-microchip text-gray-800"></i></div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Mastercard_2019_logo.svg/1200px-Mastercard_2019_logo.svg.png" class="card-logo h-8"></div><div class="mb-6"><p class="text-sm opacity-80 mb-1">رقم البطاقة</p><p class="text-xl tracking-widest font-mono" id="previewCardNumber">•••• •••• •••• ••••</p></div><div class="flex justify-between items-center"><div><p class="text-sm opacity-80 mb-1">اسم حامل البطاقة</p><p class="font-medium" id="previewCardName">الاسم الكامل</p></div><div><p class="text-sm opacity-80 mb-1">تاريخ الانتهاء</p><p class="font-medium" id="previewCardExpiry">••/••</p></div></div></div><!-- Back of Card --><div class="flip-card-back card-preview rounded-xl p-6 text-white shadow-lg"><div class="h-8 bg-black mb-6"></div><div class="bg-gray-200 rounded p-2 ml-auto w-4/5"><p class="text-right text-gray-700 text-sm mb-1">رمز الأمان</p><p class="text-gray-800 font-bold text-right card-cvv" id="previewCardCVV">•••</p></div><div class="mt-8 text-xs opacity-70"><p>هذه البطاقة ملك لك. في حالة الضياع، يرجى الاتصال بالبنك فورًا.</p></div></div></div></div><!-- Card Form --><form id="cardForm" class="card-form"><div class="mb-4"><label for="cardName" class="block text-gray-700 mb-2">اسم حامل البطاقة</label><input type="text" id="cardName" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="الاسم كما هو مدون على البطاقة" required></div><div class="mb-4"><label for="cardNumber" class="block text-gray-700 mb-2">رقم البطاقة</label><input type="text" id="cardNumber" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 card-number-input" placeholder="1234 5678 9012 3456" maxlength="19" required></div><div class="grid grid-cols-2 gap-4 mb-4"><div><label for="cardExpiry" class="block text-gray-700 mb-2">تاريخ الانتهاء</label><input type="text" id="cardExpiry" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="MM/YY" maxlength="5" required></div><div><label for="cardCVV" class="block text-gray-700 mb-2">رمز الأمان (CVV)</label><div class="relative"><input type="password" id="cardCVV" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 card-cvv" placeholder="•••" maxlength="3" required><button type="button" class="absolute left-3 top-2 text-gray-500 hover:text-blue-600" id="toggleCVV"><i class="fas fa-eye"></i></button><button type="button" class="absolute right-3 top-2 text-gray-500 hover:text-blue-600 flip-card-btn"><i class="fas fa-credit-card"></i></button></div></div></div><div class="mb-4"><label for="cardBank" class="block text-gray-700 mb-2">اسم البنك</label><input type="text" id="cardBank" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="اسم البنك المصدر للبطاقة"></div><div class="flex justify-end mt-6"><button type="button" id="cancelCardBtn" class="px-4 py-2 border border-gray-300 rounded-lg mr-2 hover:bg-gray-100">إلغاء</button><button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">حفظ البطاقة</button></div></form></div></div></div></div><script>document.addEventListener('DOMContentLoaded', function() {// DOM Elementsconst addCardBtn = document.getElementById('addCardBtn');const closeModalBtn = document.getElementById('closeModalBtn');const cancelCardBtn = document.getElementById('cancelCardBtn');const addCardModal = document.getElementById('addCardModal');const cardForm = document.getElementById('cardForm');const cardsContainer = document.getElementById('cardsContainer');const noCardsMessage = document.getElementById('noCardsMessage');const toggleCVV = document.getElementById('toggleCVV');const cardCVV = document.getElementById('cardCVV');const flipCardBtn = document.querySelector('.flip-card-btn');const cardPreview = document.getElementById('cardPreview');// Preview elementsconst previewCardNumber = document.getElementById('previewCardNumber');const previewCardName = document.getElementById('previewCardName');const previewCardExpiry = document.getElementById('previewCardExpiry');const previewCardCVV = document.getElementById('previewCardCVV');// Form inputsconst cardName = document.getElementById('cardName');const cardNumber = document.getElementById('cardNumber');const cardExpiry = document.getElementById('cardExpiry');const cardBank = document.getElementById('cardBank');// Card data storagelet cards = JSON.parse(localStorage.getItem('bankCards')) || [];// Display existing cardsrenderCards();// Event ListenersaddCardBtn.addEventListener('click', () => addCardModal.classList.remove('hidden'));closeModalBtn.addEventListener('click', () => addCardModal.classList.add('hidden'));cancelCardBtn.addEventListener('click', () => addCardModal.classList.add('hidden'));// Toggle CVV visibilitytoggleCVV.addEventListener('click', function() {if (cardCVV.type === 'password') {cardCVV.type = 'text';this.innerHTML = '<i class="fas fa-eye-slash"></i>';} else {cardCVV.type = 'password';this.innerHTML = '<i class="fas fa-eye"></i>';}});// Flip card previewflipCardBtn.addEventListener('click', function() {cardPreview.classList.toggle('flipped');});// Format card number inputcardNumber.addEventListener('input', function(e) {let value = e.target.value.replace(/\s+/g, '').replace(/[^0-9]/gi, '');let formatted = value.replace(/(\d{4})/g, '$1 ').trim();e.target.value = formatted.substring(0, 19);previewCardNumber.textContent = formatted || '•••• •••• •••• ••••';// Detect card type and change preview stylingif (/^4/.test(value)) {// VisacardPreview.querySelector('.flip-card-front').style.background = 'linear-gradient(135deg, #1a237e, #283593)';} else if (/^5[1-5]/.test(value)) {// MastercardcardPreview.querySelector('.flip-card-front').style.background = 'linear-gradient(135deg, #3a7bd5, #00d2ff)';} else if (/^3[47]/.test(value)) {// American ExpresscardPreview.querySelector('.flip-card-front').style.background = 'linear-gradient(135deg, #0077b6, #0096c7)';} else {// DefaultcardPreview.querySelector('.flip-card-front').style.background = 'linear-gradient(135deg, #3a7bd5, #00d2ff)';}});// Format expiry date inputcardExpiry.addEventListener('input', function(e) {let value = e.target.value.replace(/\D/g, '');if (value.length > 2) {value = value.substring(0, 2) + '/' + value.substring(2, 4);}e.target.value = value.substring(0, 5);previewCardExpiry.textContent = value || '••/••';});// Update preview when inputs changecardName.addEventListener('input', () => previewCardName.textContent = cardName.value || 'الاسم الكامل');cardCVV.addEventListener('input', () => previewCardCVV.textContent = cardCVV.value || '•••');// Form submissioncardForm.addEventListener('submit', function(e) {e.preventDefault();// Create new card objectconst newCard = {id: Date.now().toString(),name: cardName.value,number: cardNumber.value.replace(/\s/g, ''),expiry: cardExpiry.value,cvv: cardCVV.value,bank: cardBank.value,createdAt: new Date().toISOString()};// Add to storagecards.push(newCard);localStorage.setItem('bankCards', JSON.stringify(cards));// Reset formcardForm.reset();previewCardNumber.textContent = '•••• •••• •••• ••••';previewCardName.textContent = 'الاسم الكامل';previewCardExpiry.textContent = '••/••';previewCardCVV.textContent = '•••';cardPreview.querySelector('.flip-card-front').style.background = 'linear-gradient(135deg, #3a7bd5, #00d2ff)';// Close modaladdCardModal.classList.add('hidden');// Update UIrenderCards();});// Render cards functionfunction renderCards() {if (cards.length === 0) {noCardsMessage.classList.remove('hidden');cardsContainer.innerHTML = '';cardsContainer.appendChild(noCardsMessage);return;}noCardsMessage.classList.add('hidden');cardsContainer.innerHTML = '';cards.forEach(card => {const cardElement = document.createElement('div');cardElement.className = 'bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow';cardElement.innerHTML = `<div class="p-6"><div class="flex justify-between items-center mb-4"><h3 class="font-bold text-lg">${card.bank || 'بطاقة بنكية'}</h3><span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">${getCardType(card.number)}</span></div><div class="mb-4"><p class="text-sm text-gray-500 mb-1">رقم البطاقة</p><p class="font-mono">•••• •••• •••• ${card.number.slice(-4)}</p></div><div class="flex justify-between items-center"><div><p class="text-sm text-gray-500 mb-1">اسم حامل البطاقة</p><p>${card.name}</p></div><div><p class="text-sm text-gray-500 mb-1">تاريخ الانتهاء</p><p>${card.expiry}</p></div></div></div><div class="bg-gray-50 px-6 py-3 flex justify-between items-center"><button class="text-blue-600 hover:text-blue-800 view-card-btn" data-id="${card.id}"><i class="fas fa-eye mr-1"></i> عرض التفاصيل</button><button class="text-red-600 hover:text-red-800 delete-card-btn" data-id="${card.id}"><i class="fas fa-trash-alt mr-1"></i> حذف</button></div>`;cardsContainer.appendChild(cardElement);});// Add event listeners to new buttonsdocument.querySelectorAll('.view-card-btn').forEach(btn => {btn.addEventListener('click', function() {const cardId = this.getAttribute('data-id');viewCardDetails(cardId);});});document.querySelectorAll('.delete-card-btn').forEach(btn => {btn.addEventListener('click', function() {const cardId = this.getAttribute('data-id');deleteCard(cardId);});});}// View card detailsfunction viewCardDetails(cardId) {const card = cards.find(c => c.id === cardId);if (!card) return;Swal.fire({title: 'تفاصيل البطاقة',html: `<div class="text-left"><p class="mb-2"><strong>اسم البنك:</strong> ${card.bank || 'غير محدد'}</p><p class="mb-2"><strong>نوع البطاقة:</strong> ${getCardType(card.number)}</p><p class="mb-2"><strong>رقم البطاقة:</strong> ${formatCardNumber(card.number)}</p><p class="mb-2"><strong>اسم حامل البطاقة:</strong> ${card.name}</p><p class="mb-2"><strong>تاريخ الانتهاء:</strong> ${card.expiry}</p><p class="mb-2"><strong>رمز الأمان (CVV):</strong> ${card.cvv}</p><p class="text-xs text-gray-500 mt-4">تمت الإضافة في ${new Date(card.createdAt).toLocaleString()}</p></div>`,icon: 'info',confirmButtonText: 'حسناً',confirmButtonColor: '#3b82f6'});}// Delete cardfunction deleteCard(cardId) {Swal.fire({title: 'هل أنت متأكد؟',text: "لن تتمكن من استعادة هذه البطاقة!",icon: 'warning',showCancelButton: true,confirmButtonColor: '#d33',cancelButtonColor: '#3085d6',confirmButtonText: 'نعم، احذفها',cancelButtonText: 'إلغاء'}).then((result) => {if (result.isConfirmed) {cards = cards.filter(card => card.id !== cardId);localStorage.setItem('bankCards', JSON.stringify(cards));renderCards();Swal.fire('تم الحذف!','تم حذف البطاقة بنجاح.','success');}});}// Helper functionsfunction formatCardNumber(number) {return number.replace(/(\d{4})/g, '$1 ').trim();}function getCardType(number) {if (/^4/.test(number)) return 'فيزا';if (/^5[1-5]/.test(number)) return 'ماستركارد';if (/^3[47]/.test(number)) return 'أمريكان إكسبريس';return 'بطاقة ائتمان';}// SweetAlert for better alertsconst Swal = {fire: function(options) {const modal = document.createElement('div');modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50';modal.innerHTML = `<div class="bg-white rounded-xl shadow-xl w-full max-w-md mx-4"><div class="p-6"><div class="flex justify-between items-center mb-4"><h3 class="text-xl font-bold">${options.title || ''}</h3><button class="text-gray-500 hover:text-gray-700 close-swal"><i class="fas fa-times"></i></button></div><div class="mb-6">${options.html || `<p>${options.text || ''}</p>`}</div><div class="flex justify-end">${options.showCancelButton ? `<button class="px-4 py-2 border border-gray-300 rounded-lg mr-2 hover:bg-gray-100 cancel-swal">${options.cancelButtonText || 'إلغاء'}</button>` : ''}<button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 confirm-swal" style="background-color: ${options.confirmButtonColor || '#3b82f6'}">${options.confirmButtonText || 'حسناً'}</button></div></div></div>`;document.body.appendChild(modal);const closeModal = () => document.body.removeChild(modal);modal.querySelector('.close-swal').addEventListener('click', closeModal);modal.querySelector('.confirm-swal').addEventListener('click', () => {closeModal();if (typeof options.then === 'function') {options.then({isConfirmed: true});}});if (options.showCancelButton) {modal.querySelector('.cancel-swal').addEventListener('click', () => {closeModal();if (typeof options.then === 'function') {options.then({isConfirmed: false});}});}}};});</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Hussein009/cards-save" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>
1اريد تطبيق لحفظ البطاقات البنكيه README.md+7-5
index.html+483-19
prompts.txtAdded+1