Spaces:
Running
Running
Add 2 files
Browse filesFiles changed (2)
- README.md+7-5
- index.html+958-19
123452345678910111012---title: Edinsondevemoji: 📈colorFrom: indigocolorTo: indigotitle: edinsondevemoji: 🐳colorFrom: bluecolorTo: yellowsdk: staticpinned: falsetags: - deepsite---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-referenceCheck out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference12345678910111213141516171819123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958<!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><!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Avatar Marketplace</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"> <script> tailwind.config = { theme: { extend: { colors: { primary: '#0f172a', secondary: '#f8fafc', accent: '#38bdf8', dark: '#1e293b', darker: '#0f172a', }, animation: { 'fade-in': 'fadeIn 0.3s ease-out', 'float': 'float 3s ease-in-out infinite', 'pulse-slow': 'pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite', 'shake': 'shake 0.5s cubic-bezier(.36,.07,.19,.97) both' }, keyframes: { fadeIn: { '0%': { opacity: '0', transform: 'translateY(20px)' }, '100%': { opacity: '1', transform: 'translateY(0)' } }, float: { '0%, 100%': { transform: 'translateY(0)' }, '50%': { transform: 'translateY(-10px)' } }, shake: { '10%, 90%': { transform: 'translate3d(-1px, 0, 0)' }, '20%, 80%': { transform: 'translate3d(2px, 0, 0)' }, '30%, 50%, 70%': { transform: 'translate3d(-4px, 0, 0)' }, '40%, 60%': { transform: 'translate3d(4px, 0, 0)' } } } } } } </script> <style> @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap'); body { font-family: 'Poppins', sans-serif; -webkit-tap-highlight-color: transparent; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); } .avatar-card { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); transform: translateY(0); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); perspective: 1000px; } .avatar-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04); } .avatar-image { transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); transform-style: preserve-3d; } .avatar-card:hover .avatar-image { transform: scale(1.05) rotateY(5deg); } .locked-avatar { position: relative; overflow: hidden; } .locked-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.85); display: flex; flex-direction: column; justify-content: center; align-items: center; backdrop-filter: blur(2px); } .progress-bar { height: 6px; border-radius: 3px; background-color: #334155; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); } .progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #38bdf8, #0ea5e9); transition: width 0.5s ease; box-shadow: 0 0 10px rgba(56, 189, 248, 0.5); } .modal { animation: fade-in 0.3s ease-out; } .tab-active { position: relative; background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2); } .tab-active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #38bdf8, #0ea5e9); border-radius: 3px; } .glow { filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.7)); } .nav-item { transition: all 0.2s ease; } .nav-item:hover { transform: translateY(-3px); } .level-badge { position: relative; overflow: hidden; } .level-badge::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient( to bottom right, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 60% ); transform: rotate(30deg); animation: shine 3s infinite; } @keyframes shine { 0% { transform: rotate(30deg) translate(-30%, -30%); } 100% { transform: rotate(30deg) translate(30%, 30%); } } .premium-badge { background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%); color: white; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); } .rarity-common { background: linear-gradient(135deg, #64748b 0%, #475569 100%); } .rarity-uncommon { background: linear-gradient(135deg, #10b981 0%, #059669 100%); } .rarity-rare { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); } .rarity-epic { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); } .rarity-legendary { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); } .rarity-mythic { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); } .shine-effect { position: relative; overflow: hidden; } .shine-effect::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient( to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100% ); animation: shine 5s infinite; } @keyframes shine { 0% { left: -100%; } 20% { left: 100%; } 100% { left: 100%; } } .nav-glow { box-shadow: 0 0 15px rgba(56, 189, 248, 0.4); } </style></head><body class="text-secondary min-h-screen"> <div class="container mx-auto px-4 py-4"> <!-- App Header --> <header class="sticky top-0 z-10 bg-primary/90 backdrop-blur-sm py-3 mb-4 border-b border-slate-700"> <div class="flex justify-between items-center"> <div class="flex items-center space-x-2"> <div class="relative"> <div class="animate-pulse-slow"> <i class="fas fa-coins text-yellow-400 text-xl glow"></i> </div> <span id="coin-balance" class="text-lg font-bold ml-1">1,250</span> </div> </div> <div class="text-center"> <h1 class="text-xl font-bold bg-gradient-to-r from-blue-400 to-cyan-300 bg-clip-text text-transparent">Avatar Market</h1> </div> <div class="flex items-center space-x-2"> <div class="relative"> <i class="fas fa-level-up-alt text-blue-400 text-xl"></i> <span id="player-level" class="text-lg font-bold ml-1">12</span> </div> </div> </div> <!-- Level progress --> <div class="mt-3"> <div class="flex justify-between text-xs mb-1"> <span>Level Progress</span> <span id="level-progress-text">1,200/2,000 XP</span> </div> <div class="progress-bar"> <div id="level-progress-fill" class="progress-fill" style="width: 60%"></div> </div> </div> </header> <!-- Level Tabs --> <div class="flex overflow-x-auto pb-2 mb-4 hide-scrollbar"> <div class="flex space-x-2"> <button data-level="all" class="level-tab px-4 py-2 rounded-full bg-dark text-sm font-medium whitespace-nowrap tab-active"> All </button> <button data-level="1" class="level-tab px-4 py-2 rounded-full bg-dark text-sm font-medium whitespace-nowrap"> Lvl 1+ </button> <button data-level="5" class="level-tab px-4 py-2 rounded-full bg-dark text-sm font-medium whitespace-nowrap"> Lvl 5+ </button> <button data-level="10" class="level-tab px-4 py-2 rounded-full bg-dark text-sm font-medium whitespace-nowrap"> Lvl 10+ </button> <button data-level="15" class="level-tab px-4 py-2 rounded-full bg-dark text-sm font-medium whitespace-nowrap"> Lvl 15+ </button> <button data-level="20" class="level-tab px-4 py-2 rounded-full bg-dark text-sm font-medium whitespace-nowrap"> Lvl 20+ </button> <button data-level="premium" class="level-tab px-4 py-2 rounded-full bg-gradient-to-r from-yellow-500 to-pink-500 text-sm font-medium whitespace-nowrap"> <i class="fas fa-crown mr-1"></i> Premium </button> </div> </div> <!-- Avatar grid - 2 columns on mobile --> <div class="grid grid-cols-2 gap-3 mb-20" id="avatar-grid"> <!-- Avatar 1 --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="1" data-rarity="uncommon"> <div class="relative"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Bandit&backgroundColor=38bdf8" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="absolute top-2 right-2 rarity-uncommon text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 1 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Shadow Bandit</h3> <p class="text-gray-400 text-xs mb-2 truncate">Stealthy rogue</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">250</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-blue-600 rounded-md hover:bg-blue-500 transition text-xs"> Buy </button> </div> </div> </div> </div> <!-- Avatar 2 --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="5" data-rarity="rare"> <div class="relative"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Knight&backgroundColor=0ea5e9" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="absolute top-2 right-2 rarity-rare text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 5 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Royal Knight</h3> <p class="text-gray-400 text-xs mb-2 truncate">Noble warrior</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">500</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-blue-600 rounded-md hover:bg-blue-500 transition text-xs"> Buy </button> </div> </div> </div> </div> <!-- Avatar 3 (Locked) --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="15" data-rarity="epic"> <div class="relative"> <div class="locked-avatar"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Mage&backgroundColor=7c3aed" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="locked-overlay"> <div class="text-center animate-float"> <i class="fas fa-lock text-white text-2xl mb-1"></i> <p class="text-white text-xs font-bold">Level 15 Required</p> </div> </div> </div> <div class="absolute top-2 right-2 rarity-epic text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 15 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Arcane Mage</h3> <p class="text-gray-400 text-xs mb-2 truncate">Master of magic</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">750</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-gray-600 rounded-md cursor-not-allowed text-xs" disabled> Locked </button> </div> </div> </div> </div> <!-- Avatar 4 --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="1" data-rarity="common"> <div class="relative"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Ranger&backgroundColor=10b981" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="absolute top-2 right-2 rarity-common text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 1 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Forest Ranger</h3> <p class="text-gray-400 text-xs mb-2 truncate">Nature guardian</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">150</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-blue-600 rounded-md hover:bg-blue-500 transition text-xs"> Buy </button> </div> </div> </div> </div> <!-- Avatar 5 --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="8" data-rarity="rare"> <div class="relative"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Alchemist&backgroundColor=f59e0b" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="absolute top-2 right-2 rarity-rare text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 8 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Potion Master</h3> <p class="text-gray-400 text-xs mb-2 truncate">Magical elixirs</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">400</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-blue-600 rounded-md hover:bg-blue-500 transition text-xs"> Buy </button> </div> </div> </div> </div> <!-- Avatar 6 (Premium) --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="premium" data-rarity="mythic"> <div class="relative"> <div class="locked-avatar"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Dragon&backgroundColor=ec4899" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="locked-overlay"> <div class="text-center animate-float"> <i class="fas fa-crown text-yellow-400 text-2xl mb-1"></i> <p class="text-white text-xs font-bold">Premium Only</p> </div> </div> </div> <div class="absolute top-2 right-2 rarity-mythic text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> <i class="fas fa-crown mr-1"></i> Lvl 20 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Dragon Lord</h3> <p class="text-gray-400 text-xs mb-2 truncate">Fire ruler</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-gem text-pink-400 text-xs"></i> <span class="font-bold text-sm">1,200</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-gray-600 rounded-md cursor-not-allowed text-xs" disabled> Premium </button> </div> </div> </div> </div> <!-- Avatar 7 --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="10" data-rarity="epic"> <div class="relative"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Samurai&backgroundColor=8b5cf6" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="absolute top-2 right-2 rarity-epic text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 10 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Shadow Samurai</h3> <p class="text-gray-400 text-xs mb-2 truncate">Silent blade</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">600</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-blue-600 rounded-md hover:bg-blue-500 transition text-xs"> Buy </button> </div> </div> </div> </div> <!-- Avatar 8 --> <div class="avatar-card bg-dark rounded-xl overflow-hidden shadow-lg border border-slate-700" data-level="20" data-rarity="legendary"> <div class="relative"> <div class="locked-avatar"> <img src="https://api.dicebear.com/7.x/adventurer/svg?seed=Phoenix&backgroundColor=f59e0b" alt="Avatar" class="avatar-image w-full h-40 object-cover"> <div class="locked-overlay"> <div class="text-center animate-float"> <i class="fas fa-lock text-white text-2xl mb-1"></i> <p class="text-white text-xs font-bold">Level 20 Required</p> </div> </div> </div> <div class="absolute top-2 right-2 rarity-legendary text-white px-2 py-1 rounded-md text-xs font-bold level-badge"> Lvl 20 </div> </div> <div class="p-3"> <h3 class="font-bold text-sm mb-1 truncate">Phoenix Warrior</h3> <p class="text-gray-400 text-xs mb-2 truncate">Reborn from ashes</p> <div class="flex justify-between items-center"> <div class="flex items-center space-x-1"> <i class="fas fa-coins text-yellow-400 text-xs"></i> <span class="font-bold text-sm">1,000</span> </div> <div class="flex space-x-1"> <button class="preview-btn p-1.5 bg-slate-700 rounded-md hover:bg-slate-600 transition"> <i class="fas fa-eye text-xs"></i> </button> <button class="buy-btn px-2 py-1 bg-gray-600 rounded-md cursor-not-allowed text-xs" disabled> Locked </button> </div> </div> </div> </div> </div> <!-- Bottom Navigation --> <nav class="fixed bottom-0 left-0 right-0 bg-darker/95 backdrop-blur-sm border-t border-slate-700 flex justify-around py-3 nav-glow"> <a href="#" class="nav-item flex flex-col items-center text-accent"> <i class="fas fa-home text-lg"></i> <span class="text-xs mt-1">Home</span> </a> <a href="#" class="nav-item flex flex-col items-center text-accent"> <div class="relative"> <i class="fas fa-store text-lg"></i> <div class="absolute -top-1 -right-1 w-2 h-2 bg-blue-400 rounded-full animate-pulse"></div> </div> <span class="text-xs mt-1">Market</span> </a> <a href="#" class="nav-item flex flex-col items-center text-gray-400"> <i class="fas fa-user text-lg"></i> <span class="text-xs mt-1">Profile</span> </a> <a href="#" class="nav-item flex flex-col items-center text-gray-400"> <i class="fas fa-cog text-lg"></i> <span class="text-xs mt-1">Settings</span> </a> </nav> <!-- Preview Modal --> <div id="preview-modal" class="fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-50 hidden modal"> <div class="bg-dark rounded-xl p-5 w-full mx-4 max-w-sm relative border border-slate-600"> <button id="close-preview" class="absolute top-4 right-4 text-gray-400 hover:text-white transition"> <i class="fas fa-times text-xl"></i> </button> <div class="text-center mb-5"> <img id="preview-avatar-img" src="" alt="Preview Avatar" class="w-40 h-40 mx-auto rounded-full object-cover border-4 border-accent shadow-lg glow"> </div> <h2 id="preview-avatar-name" class="text-xl font-bold text-center mb-1">Avatar Name</h2> <div class="flex justify-center mb-2"> <div id="preview-avatar-level" class="px-3 py-1 bg-accent rounded-full text-xs font-bold"> Level 5 </div> </div> <p id="preview-avatar-desc" class="text-gray-400 text-center text-sm mb-4 px-4">Avatar description</p> <div class="bg-darker rounded-lg p-3 mb-4"> <div class="flex justify-between items-center"> <div class="flex items-center space-x-2"> <i class="fas fa-coins text-yellow-400"></i> <div> <p class="text-xs text-gray-400">Price</p> <p id="preview-avatar-price" class="font-bold">250</p> </div> </div> <div class="flex items-center space-x-2"> <i class="fas fa-medal text-blue-400"></i> <div> <p class="text-xs text-gray-400">Rarity</p> <p id="preview-avatar-rarity" class="font-bold text-blue-400">Rare</p> </div> </div> </div> </div> <button id="confirm-buy" class="w-full py-3 bg-gradient-to-r from-blue-500 to-cyan-500 rounded-xl hover:opacity-90 transition font-bold flex items-center justify-center space-x-2 shine-effect"> <i class="fas fa-shopping-cart"></i> <span>Buy Now</span> </button> <div class="text-xs text-gray-400 mt-3 text-center"> <p>This avatar will be equipped immediately after purchase</p> </div> </div> </div> <!-- Purchase Confirmation Modal --> <div id="confirmation-modal" class="fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-50 hidden modal"> <div class="bg-dark rounded-xl p-6 w-full mx-4 max-w-sm text-center border border-slate-600"> <div class="bg-green-500/20 rounded-full w-20 h-20 flex items-center justify-center mx-auto mb-4"> <i class="fas fa-check-circle text-green-400 text-4xl"></i> </div> <h2 class="text-xl font-bold mb-2">Purchase Complete!</h2> <p class="text-gray-400 text-sm mb-5">You've successfully purchased <span id="purchased-avatar-name" class="font-bold text-accent">Shadow Bandit</span>.</p> <div class="flex space-x-3"> <button id="equip-now" class="flex-1 py-2.5 bg-gradient-to-r from-blue-500 to-cyan-500 rounded-xl hover:opacity-90 transition font-bold text-sm"> Equip Now </button> <button id="close-confirmation" class="flex-1 py-2.5 bg-darker rounded-xl hover:bg-slate-700 transition font-bold text-sm border border-slate-600"> Close </button> </div> </div> </div> <!-- Not enough coins modal --> <div id="coins-modal" class="fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-50 hidden modal"> <div class="bg-dark rounded-xl p-6 w-full mx-4 max-w-sm text-center border border-slate-600"> <div class="bg-yellow-500/20 rounded-full w-20 h-20 flex items-center justify-center mx-auto mb-4"> <i class="fas fa-exclamation-triangle text-yellow-400 text-4xl"></i> </div> <h2 class="text-xl font-bold mb-2">Not Enough Coins!</h2> <p class="text-gray-400 text-sm mb-5">You need <span id="coins-needed" class="font-bold text-yellow-400">250</span> more coins to purchase this avatar.</p> <div class="flex space-x-3"> <button id="earn-coins" class="flex-1 py-2.5 bg-gradient-to-r from-yellow-500 to-orange-500 rounded-xl hover:opacity-90 transition font-bold text-sm"> Earn Coins </button> <button id="close-coins" class="flex-1 py-2.5 bg-darker rounded-xl hover:bg-slate-700 transition font-bold text-sm border border-slate-600"> Cancel </button> </div> </div> </div> </div>
<script> // Game state const gameState = { coins: 1250, level: 12, xp: 1200, xpNeeded: 2000, ownedAvatars: ['Shadow Bandit', 'Forest Ranger'] }; // DOM elements const coinBalanceEl = document.getElementById('coin-balance'); const playerLevelEl = document.getElementById('player-level'); const levelProgressTextEl = document.getElementById('level-progress-text'); const levelProgressFillEl = document.getElementById('level-progress-fill'); const avatarGrid = document.getElementById('avatar-grid'); const previewModal = document.getElementById('preview-modal'); const closePreviewBtn = document.getElementById('close-preview'); const previewAvatarImg = document.getElementById('preview-avatar-img'); const previewAvatarName = document.getElementById('preview-avatar-name'); const previewAvatarDesc = document.getElementById('preview-avatar-desc'); const previewAvatarLevel = document.getElementById('preview-avatar-level'); const previewAvatarPrice = document.getElementById('preview-avatar-price'); const previewAvatarRarity = document.getElementById('preview-avatar-rarity'); const confirmBuyBtn = document.getElementById('confirm-buy'); const confirmationModal = document.getElementById('confirmation-modal'); const purchasedAvatarNameEl = document.getElementById('purchased-avatar-name'); const equipNowBtn = document.getElementById('equip-now'); const closeConfirmationBtn = document.getElementById('close-confirmation'); const coinsModal = document.getElementById('coins-modal'); const coinsNeededEl = document.getElementById('coins-needed'); const earnCoinsBtn = document.getElementById('earn-coins'); const closeCoinsBtn = document.getElementById('close-coins'); // Rarity colors and names const rarityData = { common: { name: 'Common', color: 'text-gray-400' }, uncommon: { name: 'Uncommon', color: 'text-green-400' }, rare: { name: 'Rare', color: 'text-blue-400' }, epic: { name: 'Epic', color: 'text-purple-400' }, legendary: { name: 'Legendary', color: 'text-yellow-400' }, mythic: { name: 'Mythic', color: 'text-pink-400' } }; // Level tab functionality document.querySelectorAll('.level-tab').forEach(btn => { btn.addEventListener('click', function() { document.querySelectorAll('.level-tab').forEach(b => { b.classList.remove('tab-active', 'text-accent'); b.classList.add('text-gray-300'); }); this.classList.add('tab-active', 'text-accent'); this.classList.remove('text-gray-300'); const level = this.getAttribute('data-level'); filterAvatarsByLevel(level); }); }); // Filter avatars by level function filterAvatarsByLevel(level) { const avatars = avatarGrid.querySelectorAll('.avatar-card'); avatars.forEach(avatar => { const avatarLevel = avatar.getAttribute('data-level'); const isPremium = avatar.getAttribute('data-level') === 'premium'; if (level === 'all') { avatar.classList.remove('hidden'); } else if (level === 'premium') { if (isPremium) { avatar.classList.remove('hidden'); } else { avatar.classList.add('hidden'); } } else { if (isPremium) { avatar.classList.add('hidden'); } else if (parseInt(avatarLevel) <= parseInt(level)) { avatar.classList.remove('hidden'); } else { avatar.classList.add('hidden'); } } }); } // Update UI with game state function updateUI() { coinBalanceEl.textContent = gameState.coins.toLocaleString(); playerLevelEl.textContent = gameState.level; levelProgressTextEl.textContent = `${gameState.xp.toLocaleString()}/${gameState.xpNeeded.toLocaleString()} XP`; levelProgressFillEl.style.width = `${(gameState.xp / gameState.xpNeeded) * 100}%`; // Update buy buttons based on ownership document.querySelectorAll('.avatar-card').forEach(card => { const avatarName = card.querySelector('h3').textContent; const buyBtn = card.querySelector('.buy-btn'); const levelReq = parseInt(card.getAttribute('data-level')); const isPremium = card.getAttribute('data-level') === 'premium'; if (gameState.ownedAvatars.includes(avatarName)) { buyBtn.textContent = 'Owned'; buyBtn.className = 'px-2 py-1 bg-green-600 rounded-md cursor-default text-xs'; buyBtn.disabled = true; } else if (isPremium) { buyBtn.textContent = 'Premium'; buyBtn.className = 'px-2 py-1 bg-gradient-to-r from-yellow-500 to-pink-500 rounded-md cursor-not-allowed text-xs'; buyBtn.disabled = true; } else if (levelReq > gameState.level) { buyBtn.textContent = 'Locked'; buyBtn.className = 'px-2 py-1 bg-gray-600 rounded-md cursor-not-allowed text-xs'; buyBtn.disabled = true; } else { buyBtn.textContent = 'Buy'; buyBtn.className = 'px-2 py-1 bg-blue-600 rounded-md hover:bg-blue-500 transition text-xs'; buyBtn.disabled = false; } }); } // Initialize preview buttons document.querySelectorAll('.preview-btn').forEach(btn => { btn.addEventListener('click', function() { const card = this.closest('.avatar-card'); const imgSrc = card.querySelector('img').src; const name = card.querySelector('h3').textContent; const desc = card.querySelector('p').textContent; const level = card.querySelector('.level-badge').textContent.trim(); const price = card.querySelector('.flex.items-center.space-x-1 span').textContent; const rarity = card.getAttribute('data-rarity'); const rarityInfo = rarityData[rarity]; previewAvatarImg.src = imgSrc; previewAvatarName.textContent = name; previewAvatarDesc.textContent = desc; previewAvatarLevel.textContent = level; previewAvatarPrice.textContent = price; previewAvatarRarity.textContent = rarityInfo.name; previewAvatarRarity.className = `font-bold ${rarityInfo.color}`; // Update confirm buy button based on ownership/level if (gameState.ownedAvatars.includes(name)) { confirmBuyBtn.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Already Owned'; confirmBuyBtn.className = 'w-full py-3 bg-green-600 rounded-xl cursor-default font-bold flex items-center justify-center'; confirmBuyBtn.disabled = true; } else { const levelReq = parseInt(level.replace('Lvl ', '').replace(/\D/g, '') || '0'); const priceNum = parseInt(price.replace(/,/g, '')); const isPremium = card.getAttribute('data-level') === 'premium'; if (isPremium) { confirmBuyBtn.innerHTML = '<i class="fas fa-crown mr-2"></i> Premium Required'; confirmBuyBtn.className = 'w-full py-3 bg-gradient-to-r from-yellow-500 to-pink-500 rounded-xl cursor-not-allowed font-bold flex items-center justify-center'; confirmBuyBtn.disabled = true; } else if (levelReq > gameState.level) { confirmBuyBtn.innerHTML = '<i class="fas fa-lock mr-2"></i> Level Required'; confirmBuyBtn.className = 'w-full py-3 bg-gray-600 rounded-xl cursor-not-allowed font-bold flex items-center justify-center'; confirmBuyBtn.disabled = true; } else if (priceNum > gameState.coins) { confirmBuyBtn.innerHTML = '<i class="fas fa-exclamation-triangle mr-2"></i> Not Enough Coins'; confirmBuyBtn.className = 'w-full py-3 bg-red-600 rounded-xl cursor-not-allowed font-bold flex items-center justify-center'; confirmBuyBtn.disabled = true; } else { confirmBuyBtn.innerHTML = '<i class="fas fa-shopping-cart mr-2"></i> Buy Now'; confirmBuyBtn.className = 'w-full py-3 bg-gradient-to-r from-blue-500 to-cyan-500 rounded-xl hover:opacity-90 transition font-bold flex items-center justify-center shine-effect'; confirmBuyBtn.disabled = false; } } previewModal.classList.remove('hidden'); document.body.style.overflow = 'hidden'; }); }); // Close preview modal closePreviewBtn.addEventListener('click', function() { previewModal.classList.add('hidden'); document.body.style.overflow = 'auto'; }); // Confirm purchase confirmBuyBtn.addEventListener('click', function() { const avatarName = previewAvatarName.textContent; const price = parseInt(previewAvatarPrice.textContent.replace(/,/g, '')); if (!gameState.ownedAvatars.includes(avatarName) && gameState.coins >= price) { // Deduct coins gameState.coins -= price; // Add to owned avatars gameState.ownedAvatars.push(avatarName); // Add XP gameState.xp += Math.floor(price * 0.5); // Check for level up if (gameState.xp >= gameState.xpNeeded) { gameState.level++; gameState.xp = gameState.xp - gameState.xpNeeded; gameState.xpNeeded = Math.floor(gameState.xpNeeded * 1.2); // Show level up animation const levelEl = document.getElementById('player-level'); levelEl.classList.add('animate-shake'); setTimeout(() => { levelEl.classList.remove('animate-shake'); }, 500); } // Update UI updateUI(); // Show confirmation purchasedAvatarNameEl.textContent = avatarName; previewModal.classList.add('hidden'); confirmationModal.classList.remove('hidden'); document.body.style.overflow = 'hidden'; } else if (gameState.coins < price) { coinsNeededEl.textContent = (price - gameState.coins).toLocaleString(); previewModal.classList.add('hidden'); coinsModal.classList.remove('hidden'); document.body.style.overflow = 'hidden'; } }); // Equip now button equipNowBtn.addEventListener('click', function() { // Animation for equip this.innerHTML = '<i class="fas fa-check mr-2"></i> Equipped!'; this.classList.remove('bg-gradient-to-r', 'from-blue-500', 'to-cyan-500', 'hover:opacity-90'); this.classList.add('bg-green-500', 'hover:bg-green-400'); setTimeout(() => { confirmationModal.classList.add('hidden'); document.body.style.overflow = 'auto'; // Reset button this.innerHTML = 'Equip Now'; this.classList.remove('bg-green-500', 'hover:bg-green-400'); this.classList.add('bg-gradient-to-r', 'from-blue-500', 'to-cyan-500', 'hover:opacity-90'); }, 1000); }); // Close confirmation modal closeConfirmationBtn.addEventListener('click', function() { confirmationModal.classList.add('hidden'); document.body.style.overflow = 'auto'; }); // Earn coins button earnCoinsBtn.addEventListener('click', function() { // Add some coins gameState.coins += 500; updateUI(); // Animation this.innerHTML = '<i class="fas fa-coins mr-2"></i> +500 Coins!'; this.classList.remove('bg-gradient-to-r', 'from-yellow-500', 'to-orange-500', 'hover:opacity-90'); this.classList.add('bg-green-500', 'hover:bg-green-400'); setTimeout(() => { coinsModal.classList.add('hidden'); document.body.style.overflow = 'auto'; // Reset button this.innerHTML = 'Earn Coins'; this.classList.remove('bg-green-500', 'hover:bg-green-400'); this.classList.add('bg-gradient-to-r', 'from-yellow-500', 'to-orange-500', 'hover:opacity-90'); // Show preview again previewModal.classList.remove('hidden'); document.body.style.overflow = 'hidden'; }, 1500); }); // Close coins modal closeCoinsBtn.addEventListener('click', function() { coinsModal.classList.add('hidden'); document.body.style.overflow = 'auto'; }); // Initialize updateUI(); // Add touch effect to cards document.querySelectorAll('.avatar-card').forEach(card => { card.addEventListener('touchstart', function() { this.classList.add('active:scale-95'); }); card.addEventListener('touchend', function() { this.classList.remove('active:scale-95'); }); }); </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=eddyencode/edinsondev" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>README.md+7-5
index.html+958-19