Spaces:
Running
Running
File size: 48,058 Bytes
c879edd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 |
<!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> |