Spaces:
Running
Running
**Design Task:** Create a website to track PUBG players using the player ID to display their information, statistics, and live status (in the lobby or in a match), with the ability to receive notifications when they start playing. **Basic Requirements:** 1. **Find a Player:** - Player ID input field - Search button 2. **View Player Information:** - Player Name - Player Avatar - Server they play on (e.g., Asia, Europe, North America, etc.) - Country (if applicable) 3. **Basic Statistics:** - Level - Current Rank - Kills - Matches - Survival Rate 4. **Real-Time Status:** - Status indicator (icon + text) showing: - If offline: "Offline" - If in the lobby (waiting for a match to start): "Waiting for a match" - If in a match: "In match" + elapsed match duration (in minutes) - Status updates every minute (or use a WebSocket for instant migration) 5. **Notification Feature (Notifications):** - User option to enable notifications (if the player is offline or in the lobby and then starts a match, a notification is sent) - Notifications can be within the site or via email (optional) 6. **Technologies:** - Use of the PUBG API (such as the API from pubg.op.gg or the official PUBG Developer API) - User Interface: React.js or Vue.js - For live updates: WebSockets (such as Socket.io) or Polling - Store player favorites (if the user logs in again) **User Interface:** - Modern design with a dark background (suitable for gaming) - Display of the image and statistics in an organized card - A status section with a distinctive color (green = in a match, yellow = in the lobby, gray = offline) - A button to add the player to favorites (if registered) **Additional Requirements:** - Multilingual support (at least Arabic and English) - Mobile compatibility - SSL certificate **Notes:** - If the API does not support live status (such as knowing whether or not a player is in a match) We will need an alternative solution (such as monitoring changes in statistics or using another data source). - You may need a private API key from the PUBG Developer Portal. **Expected Result:** A fully functional website, complete with a user guide and a developer guide for maintenance. **Design Template:** - Colors: Black and gray with contrasting colors for important data (such as green and red) - Template: You can use a design similar to tracker.gg or pubg.op.gg, but with an Arabic twist. - Initial Deployment
Browse filesFiles changed (3)
- README.md+6-4
- index.html+702-19
- prompts.txtAdded+1
12323455678910111012---title: Levaiemoji: 📉title: levaiemoji: 🐳colorFrom: graycolorTo: greencolorTo: graysdk: 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-reference12345678910111213141516171819123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702<!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" dir="ltr"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>PUBG Player Tracker</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> /* Custom CSS for elements that can't be handled by Tailwind */ .status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; } .online { background-color: #4ade80; } .offline { background-color: #9ca3af; } .in-lobby { background-color: #facc15; } .in-match { background-color: #ef4444; animation: pulse 1.5s infinite; } @keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } } /* RTL support for Arabic */ [dir="rtl"] .profile-section { direction: rtl; } .lang-switch { transition: all 0.3s ease; } .lang-switch:hover { transform: scale(1.1); } /* Custom scrollbar */ ::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: #1f2937; } ::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #6b7280; } </style></head><body class="bg-gray-900 text-white min-h-screen"> <div id="app"> <!-- Header Section --> <header class="bg-black py-4 px-6 shadow-lg"> <div class="container mx-auto flex justify-between items-center"> <div class="flex items-center space-x-4"> <img src="https://upload.wikimedia.org/wikipedia/commons/3/3a/PUBG_Logo.svg" alt="PUBG Logo" class="h-10"> <h1 class="text-2xl font-bold text-red-500 hidden md:block">PUBG Player Tracker</h1> </div> <div class="flex items-center space-x-4"> <button id="langToggle" class="lang-switch bg-gray-800 hover:bg-gray-700 text-white px-4 py-2 rounded-lg flex items-center"> <i class="fas fa-language mr-2"></i> <span id="currentLang">English</span> </button> <button id="themeToggle" class="p-2 rounded-full bg-gray-800 hover:bg-gray-700"> <i class="fas fa-moon"></i> </button> </div> </div> </header>
<!-- Main Content --> <main class="container mx-auto px-4 py-8"> <!-- Search Section --> <section class="mb-12"> <div class="max-w-4xl mx-auto bg-gray-800 rounded-xl p-6 shadow-lg"> <h2 class="text-2xl font-bold mb-6 text-center text-blue-400" data-i18n="search_title">Track PUBG Player</h2> <div class="flex flex-col md:flex-row gap-4"> <div class="flex-grow"> <label for="playerId" class="block text-sm font-medium text-gray-300 mb-2" data-i18n="player_id">Player ID / Nickname</label> <div class="relative"> <input type="text" id="playerId" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-3 text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition" placeholder="Enter PUBG player ID or nickname" data-i18n-placeholder="player_id_placeholder" > <div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"> <i class="fas fa-search text-gray-400"></i> </div> </div> </div> <div class="flex items-end"> <button id="searchBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg font-medium transition flex items-center w-full md:w-auto justify-center"> <i class="fas fa-search mr-2"></i> <span data-i18n="search_button">Search</span> </button> </div> </div> <div class="mt-4 text-sm text-gray-400" data-i18n="search_note">Note: Search by exact player nickname or account ID from any region.</div> </div> </section>
<!-- Player Profile Section --> <section id="profileSection" class="hidden max-w-4xl mx-auto mb-12 profile-section"> <div class="bg-gray-800 rounded-xl p-6 shadow-lg"> <div class="flex flex-col md:flex-row gap-6"> <!-- Player Avatar and Basic Info --> <div class="md:w-1/3 flex flex-col items-center"> <div class="relative mb-4"> <img id="playerAvatar" src="https://via.placeholder.com/150" alt="Player Avatar" class="w-32 h-32 rounded-full border-4 border-blue-500 object-cover"> <div id="statusCircle" class="absolute bottom-2 right-2 status-dot"></div> </div> <h2 id="playerName" class="text-2xl font-bold text-center mb-1"></h2> <div class="text-gray-400 mb-4 flex items-center"> <i class="fas fa-globe mr-2"></i> <span id="playerRegion"></span> <span class="mx-2">|</span> <i class="fas fa-flag mr-2"></i> <span id="playerCountry"></span> </div> <div class="flex space-x-2 mb-6"> <button id="notificationBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg text-sm flex items-center"> <i class="fas fa-bell mr-2"></i> <span data-i18n="notify_me">Notify Me</span> </button> <button id="favoriteBtn" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg text-sm flex items-center"> <i class="far fa-star mr-2"></i> <span data-i18n="favorite">Favorite</span> </button> </div> </div>
<!-- Player Statistics --> <div class="md:w-2/3"> <div id="playerStatus" class="mb-6 p-4 rounded-lg flex items-center justify-between"> <div class="flex items-center"> <span id="statusDot" class="status-dot mr-2"></span> <span id="statusText" class="font-medium"></span> </div> <span id="matchDuration" class="bg-gray-700 px-3 py-1 rounded-full text-sm hidden"></span> </div>
<h3 class="text-xl font-semibold mb-4 text-blue-400" data-i18n="statistics">Statistics</h3> <div class="grid grid-cols-2 md:grid-cols-3 gap-4"> <div class="bg-gray-700 p-4 rounded-lg"> <div class="text-gray-400 text-sm mb-1" data-i18n="level">Level</div> <div id="playerLevel" class="text-2xl font-bold">-</div> </div> <div class="bg-gray-700 p-4 rounded-lg"> <div class="text-gray-400 text-sm mb-1" data-i18n="rank">Rank</div> <div id="playerRank" class="text-2xl font-bold">-</div> </div> <div class="bg-gray-700 p-4 rounded-lg"> <div class="text-gray-400 text-sm mb-1" data-i18n="kills">Kills</div> <div id="playerKills" class="text-2xl font-bold">-</div> </div> <div class="bg-gray-700 p-4 rounded-lg"> <div class="text-gray-400 text-sm mb-1" data-i18n="matches">Matches</div> <div id="playerMatches" class="text-2xl font-bold">-</div> </div> <div class="bg-gray-700 p-4 rounded-lg"> <div class="text-gray-400 text-sm mb-1" data-i18n="win_rate">Win Rate</div> <div id="playerWinRate" class="text-2xl font-bold">-</div> </div> <div class="bg-gray-700 p-4 rounded-lg"> <div class="text-gray-400 text-sm mb-1" data-i18n="headshot_rate">Headshot Rate</div> <div id="playerHSRate" class="text-2xl font-bold">-</div> </div> </div> </div> </div> </div> </section>
<!-- Recent Matches Section --> <section id="matchesSection" class="hidden max-w-4xl mx-auto"> <h2 class="text-2xl font-bold mb-6 text-blue-400" data-i18n="recent_matches">Recent Matches</h2> <div class="bg-gray-800 rounded-xl p-6 shadow-lg"> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-700"> <thead> <tr> <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider" data-i18n="match_mode">Mode</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider" data-i18n="match_date">Date</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider" data-i18n="match_result">Result</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider" data-i18n="match_kills">Kills</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider" data-i18n="match_damage">Damage</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider" data-i18n="match_time">Time</th> </tr> </thead> <tbody id="matchesTableBody" class="divide-y divide-gray-700"> <!-- Matches will be inserted here by JavaScript --> </tbody> </table> </div> <div id="noMatchesMessage" class="text-center py-8 text-gray-400 hidden" data-i18n="no_matches">No recent matches found.</div> </div> </section> </main>
<!-- Footer --> <footer class="bg-black py-6 mt-12"> <div class="container mx-auto px-4 text-center text-gray-400"> <p data-i18n="footer_text">PUBG Player Tracker is not affiliated with PUBG Corporation or Krafton. All game data is provided via unofficial APIs.</p> <div class="mt-4 flex justify-center space-x-6"> <a href="#" class="hover:text-white transition"><i class="fab fa-discord"></i></a> <a href="#" class="hover:text-white transition"><i class="fab fa-twitter"></i></a> <a href="#" class="hover:text-white transition"><i class="fab fa-github"></i></a> </div> <p class="mt-4 text-sm" data-i18n="copyright">© 2023 PUBG Player Tracker - All Rights Reserved</p> </div> </footer>
<!-- Notification Modal --> <div id="notificationModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> <div class="bg-gray-800 rounded-xl p-6 max-w-md w-full mx-4 shadow-xl"> <div class="flex justify-between items-center mb-4"> <h3 class="text-xl font-bold" data-i18n="notifications">Notifications</h3> <button id="closeNotificationModal" class="text-gray-400 hover:text-white"> <i class="fas fa-times"></i> </button> </div> <div class="mb-4"> <p class="text-gray-300 mb-4" data-i18n="notification_description">Get notified when this player comes online or starts a match.</p> <div class="space-y-4"> <div class="flex items-center"> <input type="checkbox" id="notifyOnline" class="rounded bg-gray-700 border-gray-600 text-blue-500 focus:ring-blue-500 h-5 w-5"> <label for="notifyOnline" class="ml-3 text-sm text-gray-300" data-i18n="notify_online">When player comes online</label> </div> <div class="flex items-center"> <input type="checkbox" id="notifyMatch" class="rounded bg-gray-700 border-gray-600 text-blue-500 focus:ring-blue-500 h-5 w-5"> <label for="notifyMatch" class="ml-3 text-sm text-gray-300" data-i18n="notify_match">When player starts a match</label> </div> <div class="pt-2"> <label class="block text-sm text-gray-300 mb-1" data-i18n="notification_method">Notification Method</label> <div class="mt-1 space-y-2"> <div class="flex items-center"> <input type="radio" id="browserNotify" name="notificationMethod" value="browser" checked class="h-4 w-4 bg-gray-700 border-gray-600 text-blue-500 focus:ring-blue-500"> <label for="browserNotify" class="ml-3 text-sm text-gray-300" data-i18n="browser_notification">Browser Notification</label> </div> <div class="flex items-center"> <input type="radio" id="emailNotify" name="notificationMethod" value="email" class="h-4 w-4 bg-gray-700 border-gray-600 text-blue-500 focus:ring-blue-500"> <label for="emailNotify" class="ml-3 text-sm text-gray-300" data-i18n="email_notification">Email (coming soon)</label> </div> </div> </div> </div> </div> <div class="flex justify-end space-x-3"> <button id="cancelNotification" class="px-4 py-2 text-gray-300 hover:text-white rounded-lg" data-i18n="cancel">Cancel</button> <button id="saveNotification" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg" data-i18n="save_settings">Save Settings</button> </div> </div> </div> </div>
<script> // Internationalization Support const translations = { en: { search_title: "Track PUBG Player", player_id: "Player ID / Nickname", player_id_placeholder: "Enter PUBG player ID or nickname", search_button: "Search", search_note: "Note: Search by exact player nickname or account ID from any region.", notify_me: "Notify Me", favorite: "Favorite", statistics: "Statistics", level: "Level", rank: "Rank", kills: "Kills", matches: "Matches", win_rate: "Win Rate", headshot_rate: "Headshot Rate", recent_matches: "Recent Matches", match_mode: "Mode", match_date: "Date", match_result: "Result", match_kills: "Kills", match_damage: "Damage", match_time: "Time", no_matches: "No recent matches found.", footer_text: "PUBG Player Tracker is not affiliated with PUBG Corporation or Krafton. All game data is provided via unofficial APIs.", copyright: "© 2023 PUBG Player Tracker - All Rights Reserved", notifications: "Notifications", notification_description: "Get notified when this player comes online or starts a match.", notify_online: "When player comes online", notify_match: "When player starts a match", notification_method: "Notification Method", browser_notification: "Browser Notification", email_notification: "Email (coming soon)", cancel: "Cancel", save_settings: "Save Settings", online: "Online", offline: "Offline", in_lobby: "In Lobby", in_match: "In Match", error_empty: "Please enter a player ID or nickname", error_not_found: "Player not found. Please check the ID/nickname and try again." }, ar: { search_title: "تتبع لاعب PUBG", player_id: "معرف اللاعب / الاسم المستعار", player_id_placeholder: "أدخل معرف لاعب PUBG أو الاسم المستعار", search_button: "بحث", search_note: "ملاحظة: ابحث باستخدام الاسم المستعار الدقيق للاعب أو معرف الحساب من أي منطقة.", notify_me: "إشعار لي", favorite: "المفضلة", statistics: "الإحصائيات", level: "المستوى", rank: "الرتبة", kills: "القتلى", matches: "المباريات", win_rate: "معدل الفوز", headshot_rate: "معدل الرأس", recent_matches: "المباريات الأخيرة", match_mode: "الوضع", match_date: "التاريخ", match_result: "النتيجة", match_kills: "القتلى", match_damage: "الضرر", match_time: "الوقت", no_matches: "لا توجد مباريات حديثة.", footer_text: "PUBG Player Tracker غير مرتبط بـ PUBG Corporation أو Krafton. يتم توفير جميع بيانات اللعبة عبر واجهات برمجة تطبيقات غير رسمية.", copyright: "© 2023 PUBG Player Tracker - جميع الحقوق محفوظة", notifications: "الإشعارات", notification_description: "احصل على إشعار عندما يأتي هذا اللاعب عبر الإنترنت أو يبدأ مباراة.", notify_online: "عندما يأتي اللاعب عبر الإنترنت", notify_match: "عندما يبدأ اللاعب مباراة", notification_method: "طريقة الإشعار", browser_notification: "إشعار المتصفح", email_notification: "بريد إلكتروني (قريبًا)", cancel: "إلغاء", save_settings: "حفظ الإعدادات", online: "عبر الإنترنت", offline: "غير متصل", in_lobby: "في اللوبي", in_match: "في المباراة", error_empty: "الرجاء إدخال معرف اللاعب أو الاسم المستعار", error_not_found: "لم يتم العثور على اللاعب. يرجى التحقق من المعرف/الاسم المستعار والمحاولة مرة أخرى." } };
// Current language (default English) let currentLanguage = 'en'; document.getElementById('currentLang').textContent = 'English';
// Toggle language between English and Arabic document.getElementById('langToggle').addEventListener('click', function() { currentLanguage = currentLanguage === 'en' ? 'ar' : 'en'; const langText = currentLanguage === 'en' ? 'English' : 'العربية'; document.getElementById('currentLang').textContent = langText; // Apply language direction if (currentLanguage === 'ar') { document.documentElement.dir = 'rtl'; document.documentElement.lang = 'ar'; } else { document.documentElement.dir = 'ltr'; document.documentElement.lang = 'en'; } // Apply translations translatePage(); });
// Translate the page function translatePage() { const elements = document.querySelectorAll('[data-i18n]'); elements.forEach(element => { const key = element.getAttribute('data-i18n'); element.textContent = translations[currentLanguage][key]; });
const placeholders = document.querySelectorAll('[data-i18n-placeholder]'); placeholders.forEach(element => { const key = element.getAttribute('data-i18n-placeholder'); element.setAttribute('placeholder', translations[currentLanguage][key]); }); }
// Theme Toggle document.getElementById('themeToggle').addEventListener('click', function() { const isDark = document.documentElement.classList.contains('dark'); if (isDark) { document.documentElement.classList.remove('dark'); document.body.classList.remove('bg-gray-900'); document.getElementById('themeToggle').innerHTML = '<i class="fas fa-moon"></i>'; } else { document.documentElement.classList.add('dark'); document.body.classList.add('bg-gray-900'); document.getElementById('themeToggle').innerHTML = '<i class="fas fa-sun"></i>'; } });
// Mock data for demonstration const mockPlayers = { "shroud": { name: "shroud", avatar: "https://static-cdn.jtvnw.net/jtv_user_pictures/7ed72b04-8979-491e-8d65-5c6957783b62-profile_image-300x300.png", region: "North America", country: "Canada", level: 500, rank: "Ace Dominator", kills: 45000, matches: 3200, winRate: "28.5%", hsRate: "45.2%", status: "in-match", matchDuration: 12, recentMatches: [ { mode: "Squad FPP", date: "2023-06-15", result: "Winner", kills: 18, damage: 2700, time: "25:12" }, { mode: "Duo TPP", date: "2023-06-15", result: "2nd", kills: 9, damage: 1400, time: "19:45" }, { mode: "Squad FPP", date: "2023-06-14", result: "Winner", kills: 14, damage: 2100, time: "22:30" }, { mode: "Solo FPP", date: "2023-06-14", result: "Winner", kills: 12, damage: 1900, time: "20:15" } ] }, "chocotaco": { name: "chocotaco", avatar: "https://pbs.twimg.com/profile_images/1019836211833073664/E7v3b9Q4_400x400.jpg", region: "North America", country: "United States", level: 420, rank: "Ace Master", kills: 32000, matches: 2800, winRate: "22.1%", hsRate: "38.7%", status: "in-lobby", recentMatches: [ { mode: "Squad FPP", date: "2023-06-15", result: "5th", kills: 8, damage: 1300, time: "18:22" }, { mode: "Duo FPP", date: "2023-06-15", result: "Winner", kills: 11, damage: 1800, time: "21:05" }, { mode: "Solo FPP", date: "2023-06-14", result: "12th", kills: 5, damage: 900, time: "15:40" } ] }, "wackyjacky101": { name: "WackyJacky101", avatar: "https://yt3.googleusercontent.com/ytc/AL5GRJWvXM8eO_0m6c5T0vJ6k38mFZVgTgJJ1k4X2RY1=s900-c-k-c0x00ffffff-no-rj", region: "Europe", country: "Denmark", level: 380, rank: "Conqueror", kills: 28000, matches: 2500, winRate: "18.9%", hsRate: "42.3%", status: "online", recentMatches: [ { mode: "Squad FPP", date: "2023-06-15", result: "3rd", kills: 7, damage: 1100, time: "19:10" }, { mode: "Solo FPP", date: "2023-06-14", result: "Winner", kills: 10, damage: 1600, time: "20:30" } ] }, "dr_disrespect": { name: "DrDisRespect", avatar: "https://staticg.sportskeeda.com/editor/2020/07/45c95-15943961631837-800.jpg", region: "North America", country: "United States", level: 450, rank: "Ace Dominator", kills: 39000, matches: 3000, winRate: "25.7%", hsRate: "40.1%", status: "offline", recentMatches: [ { mode: "Squad FPP", date: "2023-06-14", result: "Winner", kills: 16, damage: 2400, time: "23:45" }, { mode: "Duo FPP", date: "2023-06-13", result: "Winner", kills: 12, damage: 1900, time: "21:20" } ] } };
// Simulate status changes function simulateStatusChanges() { const statuses = ['online', 'in-lobby', 'in-match', 'offline']; const playerIds = Object.keys(mockPlayers); setInterval(() => { playerIds.forEach(id => { const player = mockPlayers[id]; const rand = Math.random(); if (rand > 0.95) { // 5% chance to change status player.status = statuses[Math.floor(Math.random() * statuses.length)]; if (player.status === 'in-match') { player.matchDuration = 0; // Start counting match duration const matchInterval = setInterval(() => { player.matchDuration++; if (player.status !== 'in-match') { clearInterval(matchInterval); } }, 60000); // Update every minute } // If we're displaying this player, update their status if (document.getElementById('playerName') && document.getElementById('playerName').textContent.toLowerCase() === id.toLowerCase()) { updatePlayerStatus(player); } } }); }, 60000); // Check every minute }
// Start simulating status changes simulateStatusChanges();
// Modal functions document.getElementById('notificationBtn').addEventListener('click', function() { document.getElementById('notificationModal').classList.remove('hidden'); });
document.getElementById('closeNotificationModal').addEventListener('click', function() { document.getElementById('notificationModal').classList.add('hidden'); });
document.getElementById('cancelNotification').addEventListener('click', function() { document.getElementById('notificationModal').classList.add('hidden'); });
document.getElementById('saveNotification').addEventListener('click', function() { const notifyOnline = document.getElementById('notifyOnline').checked; const notifyMatch = document.getElementById('notifyMatch').checked; const notificationMethod = document.querySelector('input[name="notificationMethod"]:checked').value; // In a real app, we would save these settings to the server if (notifyOnline || notifyMatch) { alert(translations[currentLanguage]['notifications'] + ": " + (notifyOnline ? translations[currentLanguage]['notify_online'] : "") + (notifyOnline && notifyMatch ? " & " : "") + (notifyMatch ? translations[currentLanguage]['notify_match'] : "")); } document.getElementById('notificationModal').classList.add('hidden'); });
// Favorite button toggle document.getElementById('favoriteBtn').addEventListener('click', function() { this.classList.toggle('bg-gray-700'); this.classList.toggle('bg-yellow-500'); const icon = this.querySelector('i'); if (icon.classList.contains('far')) { icon.classList.remove('far'); icon.classList.add('fas'); } else { icon.classList.remove('fas'); icon.classList.add('far'); } });
// Update player status display function updatePlayerStatus(player) { const statusElement = document.getElementById('playerStatus'); const statusDot = document.getElementById('statusDot'); const statusText = document.getElementById('statusText'); const matchDuration = document.getElementById('matchDuration'); const statusCircle = document.getElementById('statusCircle'); // Reset classes statusElement.className = 'mb-6 p-4 rounded-lg flex items-center justify-between'; if (player.status === 'online') { statusDot.className = 'status-dot online'; statusText.textContent = translations[currentLanguage]['online']; statusElement.classList.add('bg-green-900', 'bg-opacity-30'); statusCircle.className = 'absolute bottom-2 right-2 status-dot online'; matchDuration.classList.add('hidden'); } else if (player.status === 'in-lobby') { statusDot.className = 'status-dot in-lobby'; statusText.textContent = translations[currentLanguage]['in_lobby']; statusElement.classList.add('bg-yellow-900', 'bg-opacity-30'); statusCircle.className = 'absolute bottom-2 right-2 status-dot in-lobby'; matchDuration.classList.add('hidden'); } else if (player.status === 'in-match') { statusDot.className = 'status-dot in-match'; statusText.textContent = translations[currentLanguage]['in_match']; statusElement.classList.add('bg-red-900', 'bg-opacity-30'); statusCircle.className = 'absolute bottom-2 right-2 status-dot in-match'; matchDuration.textContent = `${player.matchDuration} ${translations[currentLanguage]['match_time']}`; matchDuration.classList.remove('hidden'); } else { // offline statusDot.className = 'status-dot offline'; statusText.textContent = translations[currentLanguage]['offline']; statusElement.classList.add('bg-gray-800'); statusCircle.className = 'absolute bottom-2 right-2 status-dot offline'; matchDuration.classList.add('hidden'); } }
// Load player data function loadPlayerData(playerId) { // In a real app, this would be an API call // Here we just use our mock data const normalizedId = playerId.toLowerCase(); if (mockPlayers[normalizedId]) { const player = mockPlayers[normalizedId]; // Show profile section document.getElementById('profileSection').classList.remove('hidden'); document.getElementById('matchesSection').classList.remove('hidden'); // Set player info document.getElementById('playerName').textContent = player.name; document.getElementById('playerAvatar').src = player.avatar; document.getElementById('playerRegion').textContent = player.region; document.getElementById('playerCountry').textContent = player.country; // Set stats document.getElementById('playerLevel').textContent = player.level; document.getElementById('playerRank').textContent = player.rank; document.getElementById('playerKills').textContent = player.kills; document.getElementById('playerMatches').textContent = player.matches; document.getElementById('playerWinRate').textContent = player.winRate; document.getElementById('playerHSRate').textContent = player.hsRate; // Set status updatePlayerStatus(player); // Load recent matches const matchesBody = document.getElementById('matchesTableBody'); matchesBody.innerHTML = ''; if (player.recentMatches && player.recentMatches.length > 0) { document.getElementById('noMatchesMessage').classList.add('hidden'); player.recentMatches.forEach(match => { const row = document.createElement('tr'); row.className = 'hover:bg-gray-700'; row.innerHTML = ` <td class="px-4 py-3 whitespace-nowrap">${match.mode}</td> <td class="px-4 py-3 whitespace-nowrap">${match.date}</td> <td class="px-4 py-3 whitespace-nowrap font-medium ${match.result === 'Winner' ? 'text-green-400' : 'text-yellow-400'}">${match.result}</td> <td class="px-4 py-3 whitespace-nowrap">${match.kills}</td> <td class="px-4 py-3 whitespace-nowrap">${match.damage}</td> <td class="px-4 py-3 whitespace-nowrap">${match.time}</td> `; matchesBody.appendChild(row); }); } else { document.getElementById('noMatchesMessage').classList.remove('hidden'); } // Scroll to profile document.getElementById('profileSection').scrollIntoView({ behavior: 'smooth' }); } else { // Player not found alert(translations[currentLanguage]['error_not_found']); } }
// Search functionality document.getElementById('searchBtn').addEventListener('click', function() { const playerId = document.getElementById('playerId').value.trim(); if (playerId === '') { alert(translations[currentLanguage]['error_empty']); return; } loadPlayerData(playerId); });
// Allow search on Enter key document.getElementById('playerId').addEventListener('keyup', function(e) { if (e.key === 'Enter') { document.getElementById('searchBtn').click(); } });
// Request notification permission when page loads if ('Notification' in window) { Notification.requestPermission(); } </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=linksysbbvv/levai" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>1**Design Task:** Create a website to track PUBG players using the player ID to display their information, statistics, and live status (in the lobby or in a match), with the ability to receive notifications when they start playing. **Basic Requirements:** 1. **Find a Player:** - Player ID input field - Search button 2. **View Player Information:** - Player Name - Player Avatar - Server they play on (e.g., Asia, Europe, North America, etc.) - Country (if applicable) 3. **Basic Statistics:** - Level - Current Rank - Kills - Matches - Survival Rate 4. **Real-Time Status:** - Status indicator (icon + text) showing: - If offline: "Offline" - If in the lobby (waiting for a match to start): "Waiting for a match" - If in a match: "In match" + elapsed match duration (in minutes) - Status updates every minute (or use a WebSocket for instant migration) 5. **Notification Feature (Notifications):** - User option to enable notifications (if the player is offline or in the lobby and then starts a match, a notification is sent) - Notifications can be within the site or via email (optional) 6. **Technologies:** - Use of the PUBG API (such as the API from pubg.op.gg or the official PUBG Developer API) - User Interface: React.js or Vue.js - For live updates: WebSockets (such as Socket.io) or Polling - Store player favorites (if the user logs in again) **User Interface:** - Modern design with a dark background (suitable for gaming) - Display of the image and statistics in an organized card - A status section with a distinctive color (green = in a match, yellow = in the lobby, gray = offline) - A button to add the player to favorites (if registered) **Additional Requirements:** - Multilingual support (at least Arabic and English) - Mobile compatibility - SSL certificate **Notes:** - If the API does not support live status (such as knowing whether or not a player is in a match) We will need an alternative solution (such as monitoring changes in statistics or using another data source). - You may need a private API key from the PUBG Developer Portal. **Expected Result:** A fully functional website, complete with a user guide and a developer guide for maintenance. **Design Template:** - Colors: Black and gray with contrasting colors for important data (such as green and red) - Template: You can use a design similar to tracker.gg or pubg.op.gg, but with an Arabic twist.README.md+6-4
index.html+702-19
prompts.txtAdded+1