| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="https://cdn.tailwindcss.com"></script>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
- <script>
- tailwind.config = {
- theme: {
- extend: {
- colors: {
- primary: '#3372ac',
- },
- animation: {
- marquee: 'marquee 25s linear infinite',
- },
- keyframes: {
- marquee: {
- '0%': { transform: 'translateX(100%)' },
- '100%': { transform: 'translateX(-100%)' },
- }
- }
- }
- }
- }
- </script>
- <style>
- @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800&display=swap');
- body { font-family: 'Nunito', sans-serif; }
- .no-scrollbar::-webkit-scrollbar { display: none; }
- .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
- .snap-mandatory { scroll-behavior: smooth; }
- .fade-in-up { animation: fadeInUp 0.4s ease-out forwards; opacity: 0; transform: translateY(10px); }
- @keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
-
- .dropdown-enter { opacity: 0; transform: translateY(-10px) scale(0.95); }
- .dropdown-enter-active { opacity: 1; transform: translateY(0) scale(1); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
- </style>
- </head>
- <body class="bg-slate-50 relative pb-24" onclick="closeDropdownOnClickOutside(event)">
- <!-- 1. 顶部 Header -->
- <div class="relative w-full h-[260px]">
- <img src="https://orienteering.beswell.com/card/nanning/cardtop1122-2.jpg"
- class="w-full h-full object-cover shadow-md" alt="Header BG">
- <div class="absolute inset-0 bg-gradient-to-b from-primary/60 via-transparent to-black/30"></div>
- <div class="absolute top-0 w-full pt-10 px-5 flex justify-between items-center z-10 text-white">
- <button class="bg-black/20 backdrop-blur-sm p-2 rounded-full w-9 h-9 flex items-center justify-center active:scale-90 transition">
- <i class="fas fa-chevron-left"></i>
- </button>
- <h1 class="text-lg font-bold tracking-wider shadow-sm">实时赛况</h1>
- <button onclick="openInfoModal()" class="bg-black/20 backdrop-blur-sm px-3 py-1.5 rounded-full text-xs font-semibold flex items-center gap-1 active:scale-90 transition">
- <i class="fas fa-question-circle"></i> 说明
- </button>
- </div>
- <!-- 底部公告跑马灯 -->
- <div class="absolute bottom-[35px] w-full z-10 px-4">
- <div class="bg-black/40 backdrop-blur-md rounded-full py-1.5 px-3 flex items-center gap-2 overflow-hidden border border-white/10 shadow-lg">
- <i class="fas fa-bullhorn text-yellow-300 text-xs shrink-0"></i>
- <div class="flex-1 overflow-hidden relative h-4">
- <div class="absolute whitespace-nowrap text-[10px] text-white animate-marquee leading-4">
- 当前总题目: 1500道 | 总里程: 5024km | 总打点数: 8900个 | 距离比赛结束还有 1天 5小时 | 加油!冲鸭!
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 2. 个人信息卡 -->
- <div class="px-4 -mt-8 relative z-20">
- <div class="bg-white rounded-xl shadow-lg p-4 flex justify-between items-center border border-white/50">
- <div class="flex items-center gap-3">
- <div class="relative">
- <img src="https://i.pravatar.cc/100?img=12" class="w-12 h-12 rounded-full border-2 border-slate-100">
- <div class="absolute -bottom-1 -right-1 bg-primary text-white text-[8px] px-1.5 py-0.5 rounded-full border border-white">Lv.3</div>
- </div>
- <div>
- <!-- 昵称 & 编辑按钮 -->
- <h2 class="font-bold text-gray-800 text-sm flex items-center gap-1">
- <span id="profileName">奔跑的蜗牛</span>
- <button onclick="openEditModal()" class="text-xs text-primary/60 p-1 hover:text-primary transition-colors"><i class="fas fa-pen"></i></button>
- </h2>
- <!-- 战队 -->
- <p class="text-xs text-gray-500 mt-0.5 flex items-center gap-1">
- <i class="fas fa-user-friends text-blue-300 text-[10px]"></i>
- <span id="profileTeam">飞虎队</span>
- </p>
- </div>
- </div>
- <div class="text-center pl-4 border-l border-gray-100">
- <div id="userScore" class="text-2xl font-black text-primary font-mono leading-none">120</div>
- <div class="text-[10px] text-gray-400 mt-1">当前积分</div>
- </div>
- </div>
- </div>
- <!-- 3. 排行榜 Tabs -->
- <div class="mt-6 px-4">
-
- <!-- 主榜单切换:轻量化分段控制器风格 -->
- <div class="bg-slate-100 p-1 rounded-full flex gap-1 mb-4 relative shadow-inner">
- <button onclick="switchMainTab('team')" id="tab-team"
- class="flex-1 py-2 rounded-full text-sm font-bold text-center transition-all duration-300 bg-white text-primary shadow-sm">
- 团队榜
- </button>
- <button onclick="switchMainTab('individual')" id="tab-ind"
- class="flex-1 py-2 rounded-full text-sm font-bold text-center transition-all duration-300 text-gray-500 hover:text-gray-700">
- 个人榜
- </button>
- </div>
-
- <!-- 维度切换 -->
- <div class="flex gap-2 justify-center pt-4 overflow-x-auto no-scrollbar pb-2" id="metric-tabs">
- <button onclick="switchMetric('score')" id="metric-score" class="metric-btn bg-primary text-white px-3 py-1 rounded-full text-xs shadow-md shadow-blue-100 font-bold shrink-0 relative overflow-visible">
- 积分
- <span id="prize-badge" class="absolute -top-2 -right-2 bg-red-500 text-white text-[9px] px-1.5 py-0.5 rounded-full shadow-sm border border-white z-10 leading-none">奖</span>
- </button>
- <button onclick="switchMetric('mileage')" id="metric-mileage" class="metric-btn bg-white text-gray-500 border border-gray-200 px-3 py-1 rounded-full text-xs font-bold shrink-0 active:bg-gray-50 transition-colors">里程</button>
- <button onclick="switchMetric('accuracy')" id="metric-accuracy" class="metric-btn bg-white text-gray-500 border border-gray-200 px-3 py-1 rounded-full text-xs font-bold shrink-0 active:bg-gray-50 transition-colors">答题正确率</button>
- <button onclick="switchMetric('count')" id="metric-count" class="metric-btn bg-white text-gray-500 border border-gray-200 px-3 py-1 rounded-full text-xs font-bold shrink-0 active:bg-gray-50 transition-colors">打点数</button>
- <button onclick="switchMetric('lap')" id="metric-lap" class="metric-btn bg-white text-gray-500 border border-gray-200 px-3 py-1 rounded-full text-xs font-bold shrink-0 active:bg-gray-50 transition-colors">单圈用时</button>
- </div>
- </div>
- <!-- 4. 排行榜列表容器 -->
- <!-- 修改点:space-y-2 (间距变小), 内层渲染 logic 变 p-2 -->
- <div id="leaderboard-container" class="px-4 mt-1 space-y-2 mb-24 min-h-[300px]"></div>
- <!-- 5. 底部悬浮栏 -->
- <div class="fixed bottom-0 w-full bg-white border-t border-gray-100 shadow-[0_-5px_20px_rgba(0,0,0,0.05)] px-4 py-3 flex items-center z-40 safe-area-bottom">
- <button onclick="openDrawer()" class="w-full bg-gradient-to-r from-orange-500 to-red-600 text-white py-3 rounded-full font-bold shadow-lg shadow-orange-100 transform active:scale-[0.98] transition flex items-center justify-center gap-2 text-base">
- <i class="fas fa-flag-checkered animate-pulse"></i> 进入比赛
- </button>
- </div>
- <!-- ================= 模态框区域 ================= -->
- <!-- A. 编辑个人资料模态框 -->
- <div id="editProfileModal" class="fixed inset-0 z-[60] hidden flex items-center justify-center">
- <div class="absolute inset-0 bg-slate-900/60 backdrop-blur-sm" onclick="closeEditModal()"></div>
- <div class="bg-white w-[85%] rounded-2xl p-6 relative z-10 shadow-2xl animate-[fadeInUp_0.3s_ease-out]">
- <h3 class="font-bold text-lg mb-6 text-gray-800 text-center">修改报名信息</h3>
- <div class="space-y-5">
- <div>
- <label class="block text-sm font-bold text-gray-500 mb-2">我的昵称</label>
- <input type="text" id="editNameInput" value="奔跑的蜗牛"
- class="w-full bg-slate-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm font-bold text-gray-800 focus:outline-none focus:ring-1 focus:ring-primary focus:bg-white transition-colors">
- </div>
- <div>
- <label class="block text-sm font-bold text-gray-500 mb-2">所属战队</label>
- <div class="relative group">
- <button type="button" id="dropdownBtn" onclick="toggleDropdown(event)"
- class="w-full bg-slate-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm font-bold text-left flex items-center justify-between focus:outline-none focus:ring-1 focus:ring-primary transition-all">
- <span id="selectedTeamText" class="text-gray-800 flex items-center gap-2">
- <i class="fas fa-user-friends text-primary"></i> 飞虎队
- </span>
- <i class="fas fa-chevron-circle-down text-gray-400 transition-transform duration-300" id="dropdownArrow"></i>
- </button>
- <div id="dropdownMenu" class="hidden absolute top-[110%] left-0 w-full bg-white rounded-xl shadow-2xl border border-gray-100 overflow-hidden z-50 dropdown-enter max-h-48 overflow-y-auto">
- <ul class="text-sm text-gray-700">
- <li onclick="selectOption('飞虎队')" class="px-4 py-3 hover:bg-blue-50 cursor-pointer flex items-center justify-between border-b border-gray-50"><span class="font-bold flex items-center gap-2"><i class="fas fa-user-friends text-blue-200"></i> 飞虎队</span></li>
- <li onclick="selectOption('火箭队')" class="px-4 py-3 hover:bg-blue-50 cursor-pointer flex items-center justify-between border-b border-gray-50"><span class="font-bold flex items-center gap-2"><i class="fas fa-user-friends text-blue-200"></i> 火箭队</span></li>
- <li onclick="selectOption('摸鱼队')" class="px-4 py-3 hover:bg-blue-50 cursor-pointer flex items-center justify-between border-b border-gray-50"><span class="font-bold flex items-center gap-2"><i class="fas fa-user-friends text-blue-200"></i> 摸鱼队</span></li>
- <li onclick="selectOption('汪汪队')" class="px-4 py-3 hover:bg-blue-50 cursor-pointer flex items-center justify-between"><span class="font-bold flex items-center gap-2"><i class="fas fa-user-friends text-blue-200"></i> 汪汪队</span></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <div class="flex gap-3 mt-8">
- <button onclick="closeEditModal()" class="flex-1 py-2.5 rounded-full border border-gray-200 text-gray-500 font-bold text-sm">取消</button>
- <button onclick="saveProfile()" class="flex-1 py-2.5 rounded-full bg-primary text-white font-bold text-sm shadow-lg shadow-blue-200">保存修改</button>
- </div>
- </div>
- </div>
- <!-- B. 说明模态框 -->
- <div id="infoModal" class="fixed inset-0 z-50 hidden transition-opacity duration-300">
- <div class="absolute inset-0 bg-slate-900/70 backdrop-blur-sm" onclick="closeInfoModal()"></div>
- <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[90%] bg-white rounded-3xl p-6 shadow-2xl">
- <button onclick="closeInfoModal()" class="absolute -top-12 right-0 text-white/80 hover:text-white w-10 h-10 border border-white/30 rounded-full flex items-center justify-center">
- <i class="fas fa-times text-lg"></i>
- </button>
- <h3 class="text-center font-bold text-xl mb-4 text-primary border-b border-gray-100 pb-3">
- <i class="fas fa-book-open mr-2"></i>比赛规则说明
- </h3>
- <div id="modalSlider" class="overflow-x-auto flex snap-x snap-mandatory no-scrollbar space-x-4 pb-2" onscroll="updateDots()">
- <div class="snap-center shrink-0 w-full bg-blue-50 rounded-2xl p-5 text-center border border-blue-100">
- <div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-3"><i class="fas fa-map-marker-alt text-xl text-primary"></i></div>
- <h4 class="font-bold text-base text-gray-800 mb-1">1. 定向寻宝</h4>
- <p class="text-gray-600 text-xs leading-relaxed">比赛设置12个隐藏打卡点。</p>
- </div>
- <div class="snap-center shrink-0 w-full bg-blue-50 rounded-2xl p-5 text-center border border-blue-100">
- <div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-3"><i class="fas fa-mobile-alt text-xl text-primary"></i></div>
- <h4 class="font-bold text-base text-gray-800 mb-1">2. 扫码打卡</h4>
- <p class="text-gray-600 text-xs leading-relaxed">到达点位后,使用APP扫描二维码。</p>
- </div>
- <div class="snap-center shrink-0 w-full bg-blue-50 rounded-2xl p-5 text-center border border-blue-100">
- <div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-3"><i class="fas fa-medal text-xl text-primary"></i></div>
- <h4 class="font-bold text-base text-gray-800 mb-1">3. 完赛奖励</h4>
- <p class="text-gray-600 text-xs leading-relaxed">前50名有精美礼品!加油!</p>
- </div>
- </div>
- <div class="flex justify-center gap-2 mt-4" id="dotsContainer">
- <div class="dot w-6 h-1.5 rounded-full bg-primary transition-all duration-300"></div>
- <div class="dot w-1.5 h-1.5 rounded-full bg-gray-300 transition-all duration-300"></div>
- <div class="dot w-1.5 h-1.5 rounded-full bg-gray-300 transition-all duration-300"></div>
- </div>
- </div>
- </div>
- <!-- C. 上滑抽屉 -->
- <div id="drawer-backdrop" class="fixed inset-0 bg-black/50 z-50 hidden transition-opacity" onclick="closeDrawer()"></div>
- <div id="drawer" class="fixed bottom-0 left-0 w-full bg-white rounded-t-3xl p-6 z-50 transform translate-y-full transition-transform duration-300 ease-out safe-area-bottom">
- <div class="w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-6"></div>
- <h3 class="font-bold text-lg mb-5 text-gray-800">前往比赛场地</h3>
- <div class="space-y-6">
- <div>
- <button onclick="triggerJump('兴隆山校区')" class="w-full border-2 border-primary bg-blue-50 text-primary py-4 rounded-xl font-bold text-sm flex items-center justify-between px-6 shadow-sm active:scale-[0.98] transition-transform">
- <div class="flex items-center gap-3">
- <i class="fas fa-map-marked-alt text-2xl"></i>
- <div class="text-left">
- <div class="text-base font-bold">兴隆山校区</div>
- <div class="text-[10px] opacity-70 font-normal">当前比赛区域</div>
- </div>
- </div>
- <i class="fas fa-chevron-right text-lg"></i>
- </button>
- </div>
- <div>
- <label class="text-xs text-gray-400 font-bold uppercase mb-2 block pl-1">选择导航</label>
- <div class="bg-gray-50 rounded-2xl p-2 flex flex-col gap-2 border border-gray-100">
- <button onclick="triggerJump('高德地图')" class="flex items-center gap-4 w-full bg-white p-3 rounded-xl border border-gray-100 shadow-sm active:bg-gray-50 active:scale-[0.99] transition-transform">
- <img src="./gd.png" class="w-8 h-8 object-contain">
- <div class="text-left">
- <div class="font-bold text-gray-800 text-sm">高德地图</div>
- <div class="text-[10px] text-gray-400">推荐路线</div>
- </div>
- <i class="fas fa-location-arrow ml-auto text-primary"></i>
- </button>
- <button onclick="triggerJump('百度地图')" class="flex items-center gap-4 w-full bg-white p-3 rounded-xl border border-gray-100 shadow-sm active:bg-gray-50 active:scale-[0.99] transition-transform">
- <img src="./bd.png" class="w-8 h-8 object-contain">
- <div class="text-left">
- <div class="font-bold text-gray-800 text-sm">百度地图</div>
- <div class="text-[10px] text-gray-400">备选方案</div>
- </div>
- <i class="fas fa-location-arrow ml-auto text-primary"></i>
- </button>
- </div>
- </div>
- </div>
- </div>
- <script src="js/uni-compat.js"></script>
- <script src="js/define.js"></script>
- <script src="js/api.js"></script>
- <script src="js/tools.js"></script>
- <script src="js/cardfunc.js"></script>
- <script src="js/logic-ranklist.js"></script>
- <script>
- // UI Logic that doesn't need state
- const slider = document.getElementById('modalSlider');
- const dots = document.querySelectorAll('.dot');
- function updateDots() {
- const index = Math.round(slider.scrollLeft / slider.offsetWidth);
- dots.forEach((dot, i) => {
- dot.className = (i === index) ? 'dot w-6 h-1.5 rounded-full bg-primary transition-all duration-300' : 'dot w-1.5 h-1.5 rounded-full bg-gray-300 transition-all duration-300';
- });
- }
- </script>
- </body>
- </html>
|