Download src/components/GameCenterView.tsx from xx911121/sdex: direct link, hf CLI and curl.
- Browser
- Download file 33 kB
-
https://huggingface.co/spaces/xx911121/sdex/resolve/main/src/components/GameCenterView.tsx
- Command line
-
hf download hf://spaces/xx911121/sdex/src/components/GameCenterView.tsx
-
curl -L -o GameCenterView.tsx https://huggingface.co/spaces/xx911121/sdex/resolve/main/src/components/GameCenterView.tsx
33 kB
| import React, { useRef, useState } from "react"; | |
| import { ScreenId, AppState } from "../types"; | |
| import { Search, PlayCircle, Star, Landmark } from "lucide-react"; | |
| interface GameCenterViewProps { | |
| state: AppState; | |
| onNavigate: (screen: ScreenId) => void; | |
| } | |
| interface GameItem { | |
| id: string; | |
| title: string; | |
| provider: string; | |
| tag: "Hot" | "New" | "Jackpot" | "Trend"; | |
| image: string; | |
| categories: string[]; | |
| } | |
| const ALL_GAMES: GameItem[] = [ | |
| // PG Soft | |
| { | |
| id: "god-wealth", | |
| title: "财神到 (God of Wealth)", | |
| provider: "PG Soft", | |
| tag: "Hot", | |
| image: "https://lh3.googleusercontent.com/aida-public/AB6AXuCvCZ9nLkoHEJdij0ZYoQP7lB_J_xWMlTcTteA3SX8HGD7anTwlbvxteqV1CMtwm2Ux1uYCLDQhFmwOtNlhp_FUzQnwgP_RkqC_87SMxDuqWzVWGQ6JH2n0OmZo8M9mmV-sXcC3SVBUXw7ufHGXszztiqtLSpyOzO8fR-nVXRnW_t0k5oTKvMWb7EdBG4rqE3llMt6MAJEIBwqDDeebjAdKEbOi1Jfj34J_3-l9CbMNkGWGHPbO4kTaiN86vVhvhFxYO-aHjfxW9YK_", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "cyberpunk", | |
| title: "赛博朋克:急速狂飙", | |
| provider: "PG Soft", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1542751371-adc38448a05e?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "mahjong-ways", | |
| title: "麻将胡了 2 (Mahjong Ways)", | |
| provider: "PG Soft", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "wild-bandito", | |
| title: "寻宝黄金城 (Wild Bandito)", | |
| provider: "PG Soft", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1614064641938-3bbee52942c7?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "double-fortune", | |
| title: "双喜临门 (Double Fortune)", | |
| provider: "PG Soft", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1596838132731-3301c3fd4317?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // Pragmatic Play (PP) | |
| { | |
| id: "classic-fruits", | |
| title: "经典玛丽水果机 (Fruit Slots)", | |
| provider: "Pragmatic Play", | |
| tag: "Trend", | |
| image: "https://lh3.googleusercontent.com/aida-public/AB6AXuCUOPzY0f0cN85nT2OZlnuBdQrdP8sIGwLlLO_8susMpMWkXB-aibDGbWaDnZaWBlbahzkdnUyY0l0G8guuVjey0SuNDkV4ltkrHm2IadXAqtq_NzPPuJl9S7ueFDdA2l4Bz-WE9msi2Ccby2LeiV0xoAN-8Jz3xp7O49zvjuWQ1fYi87CbSvsCOEtkz1k72Gc_dXsJG95_d3QSWHPqnfKcGdxJsAJOwQ13A7i5Es-M1srCbhRY2qBM3PFrsdtmEg5-HISozrKTHgpr", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "gates-olympus", | |
| title: "奥林匹斯之门 (Gates of Olympus)", | |
| provider: "Pragmatic Play", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1606167668584-78701c57f13d?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "sweet-bonanza", | |
| title: "甜心炸弹 (Sweet Bonanza)", | |
| provider: "Pragmatic Play", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1581798459219-318e76aecc7b?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "sugar-rush", | |
| title: "极速糖果 (Sugar Rush)", | |
| provider: "Pragmatic Play", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1534080564583-6be75777b70a?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // CQ9 | |
| { | |
| id: "dragon-story", | |
| title: "巨龙传说:黄金帝国", | |
| provider: "CQ9", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1508739773434-c26b3d09e071?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "jump-high", | |
| title: "极速跳高高 (Jump High)", | |
| provider: "CQ9", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1553481187-be93c21490a9?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "good-fortune", | |
| title: "鸿运当头 (Good Fortune)", | |
| provider: "CQ9", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1534447677768-be436bb09401?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "disco-gold", | |
| title: "黄金迪斯科 (Disco Gold)", | |
| provider: "CQ9", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1516450360452-9312f5e86fc7?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // JDB | |
| { | |
| id: "caishen-jdb", | |
| title: "金鸡报喜 (JBD Birds)", | |
| provider: "JDB", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1518133910546-b6c2fb7d79e3?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "open-sesame", | |
| title: "芝麻开门 (Open Sesame)", | |
| provider: "JDB", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1518133910546-b6c2fb7d79e3?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "dragon-king", | |
| title: "龙王传说 (Dragon King)", | |
| provider: "JDB", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1607604276583-eef5d076aa5f?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "face-change", | |
| title: "川剧变脸 (Face Change)", | |
| provider: "JDB", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1509248961158-e54f6934749c?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // FC | |
| { | |
| id: "fa-fa-fa", | |
| title: "发发发发 (Fa Fa Fa)", | |
| provider: "FC", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1596838132731-3301c3fd4317?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "golden-panther", | |
| title: "黄金黑豹 (Golden Panther)", | |
| provider: "FC", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "bao-boon-chin", | |
| title: "百倍暴龙 (Bao Boon Chin)", | |
| provider: "FC", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1563089145-599997674d42?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "dragon-gate", | |
| title: "黄金鲤鱼跃龙门 (Dragon Gate)", | |
| provider: "FC", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1508739773434-c26b3d09e071?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // JILI Gaming | |
| { | |
| id: "faraoh-treasure", | |
| title: "法老王的宝藏 (Faraoh's Gold)", | |
| provider: "JILI Gaming", | |
| tag: "Jackpot", | |
| image: "https://lh3.googleusercontent.com/aida-public/AB6AXuALk4ZWUmQ0U7ymNLwjMAfWY4huZ-X-_zq1l_CYklO-2OZv3s4u3TkBbTRpeuUKWV0t-Y19q_nfEEQOrwCkyPUQgtEF9xSwmqqVMuyCgzP1k9tLB8Mhg2SpWgl5BoecA0SMq5pn-1w3hccl5A24dpr7L8TmZbT8eRkSBj2_S9NPG1H33_oYksl862fPJsNgO1dW28r8JEYeomBrvV7iSVYFHsyf_zMJdeinitT7CRjcNZbokiLJoChgZ4Lptce3yv9diLJc6qYAeV6X", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "boxing-king", | |
| title: "拳王争霸 (Boxing King)", | |
| provider: "JILI Gaming", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1517649763962-0c623066013b?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "roma-gold", | |
| title: "罗马帝国 (Roma Gold)", | |
| provider: "JILI Gaming", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1552820728-8b83bb6b773f?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "super-rich", | |
| title: "聚宝盆 (Super Rich)", | |
| provider: "JILI Gaming", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1579621970563-ebec7560ff3e?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // NoLimit City | |
| { | |
| id: "mental-slots", | |
| title: "精神病医院 (Mental)", | |
| provider: "NoLimit City", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1509248961158-e54f6934749c?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "tombstone-rip", | |
| title: "墓碑特区 (Tombstone R.I.P)", | |
| provider: "NoLimit City", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1509248961158-e54f6934749c?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "san-quentin", | |
| title: "圣贤监狱 (San Quentin xWays)", | |
| provider: "NoLimit City", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1589829545856-d10d557cf95f?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // Hacksaw Gaming | |
| { | |
| id: "chaos-crew", | |
| title: "混沌骷髅 (Chaos Crew 2)", | |
| provider: "Hacksaw Gaming", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1563089145-599997674d42?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "wanted-dead", | |
| title: "死亡之手 (Wanted Dead or a Wild)", | |
| provider: "Hacksaw Gaming", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1518895949257-7621c3c786d7?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| { | |
| id: "rotten-gear", | |
| title: "齿轮僵尸 (Rotten)", | |
| provider: "Hacksaw Gaming", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1563089145-599997674d42?auto=format&fit=crop&w=300&q=80", | |
| categories: ["电子"] | |
| }, | |
| // Live casino (视讯) | |
| { | |
| id: "liveroulette", | |
| title: "视讯:异国急速百家乐 (Live Baccarat)", | |
| provider: "Evolution Gaming", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1596838132731-3301c3fd4317?auto=format&fit=crop&w=300&q=80", | |
| categories: ["视讯"] | |
| }, | |
| { | |
| id: "dragon-tiger", | |
| title: "真人:龙虎争霸 (Dragon-Tiger Live)", | |
| provider: "Evolution Gaming", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1518133910546-b6c2fb7d79e3?auto=format&fit=crop&w=300&q=80", | |
| categories: ["视讯"] | |
| }, | |
| { | |
| id: "live-sicbo", | |
| title: "真人:极速骰宝 (Live SicBo)", | |
| provider: "Evolution Gaming", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1518133910546-b6c2fb7d79e3?auto=format&fit=crop&w=300&q=80", | |
| categories: ["视讯"] | |
| }, | |
| // Fishing (捕鱼) | |
| { | |
| id: "fishing-master", | |
| title: "经典欢乐捕鱼达人 (Fishing Master)", | |
| provider: "JILI Gaming", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=300&q=80", | |
| categories: ["捕鱼"] | |
| }, | |
| { | |
| id: "ocean-king", | |
| title: "真人:深海捕鱼王 (Ocean King)", | |
| provider: "JILI Gaming", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=300&q=80", | |
| categories: ["捕鱼"] | |
| }, | |
| { | |
| id: "shark-hunter", | |
| title: "3D:猎鲨风暴 (Shark Hunter)", | |
| provider: "JILI Gaming", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1544551763-46a013bb70d5?auto=format&fit=crop&w=300&q=80", | |
| categories: ["捕鱼"] | |
| }, | |
| // Lottery (彩票) | |
| { | |
| id: "hk-lotto-six", | |
| title: "香港六合彩 (Hong Kong Mark Six)", | |
| provider: "HY Lottery", | |
| tag: "Jackpot", | |
| image: "https://images.unsplash.com/photo-1606167668584-78701c57f13d?auto=format&fit=crop&w=300&q=80", | |
| categories: ["彩票"] | |
| }, | |
| { | |
| id: "canada-lotto", | |
| title: "加拿大 PC28 极速开奖", | |
| provider: "HY Lottery", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1605810230434-7631ac76ec81?auto=format&fit=crop&w=300&q=80", | |
| categories: ["彩票"] | |
| }, | |
| { | |
| id: "bj-k3", | |
| title: "北京快三 (Beijing K3)", | |
| provider: "HY Lottery", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1605810230434-7631ac76ec81?auto=format&fit=crop&w=300&q=80", | |
| categories: ["彩票"] | |
| }, | |
| // Sports (体育) | |
| { | |
| id: "pl-football", | |
| title: "英超/西甲极速亚洲盘", | |
| provider: "SABAH Sports", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1508098682722-e99c43a406b2?auto=format&fit=crop&w=300&q=80", | |
| categories: ["体育"] | |
| }, | |
| { | |
| id: "nba-esports", | |
| title: "美职篮篮球滚盘 (NBA Basketball Live)", | |
| provider: "IM Sports", | |
| tag: "New", | |
| image: "https://images.unsplash.com/photo-1546519638-68e109498ffc?auto=format&fit=crop&w=300&q=80", | |
| categories: ["体育"] | |
| }, | |
| { | |
| id: "wbc-boxing", | |
| title: "世界拳击锦标赛 (WBC Boxing)", | |
| provider: "IM Sports", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1517649763962-0c623066013b?auto=format&fit=crop&w=300&q=80", | |
| categories: ["体育"] | |
| }, | |
| // Poker (棋牌) | |
| { | |
| id: "poker-king", | |
| title: "金牌急速斗地主 (Poker King)", | |
| provider: "King Maker", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=300&q=80", | |
| categories: ["棋牌"] | |
| }, | |
| { | |
| id: "rich-landlord", | |
| title: "极速斗地主 (Rich Landlord)", | |
| provider: "King Maker", | |
| tag: "Hot", | |
| image: "https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=300&q=80", | |
| categories: ["棋牌"] | |
| }, | |
| { | |
| id: "texas-holdem", | |
| title: "德州扑克大师赛 (Texas Hold'em)", | |
| provider: "King Maker", | |
| tag: "Trend", | |
| image: "https://images.unsplash.com/photo-1596838132731-3301c3fd4317?auto=format&fit=crop&w=300&q=80", | |
| categories: ["棋牌"] | |
| } | |
| ]; | |
| const matchesProvider = (gameProvider: string, filter: string) => { | |
| if (filter === "全部") return true; | |
| if (filter === "PG") return gameProvider === "PG Soft"; | |
| if (filter === "PP") return gameProvider === "Pragmatic Play"; | |
| if (filter === "CQ9") return gameProvider === "CQ9"; | |
| if (filter === "JDB") return gameProvider === "JDB"; | |
| if (filter === "FC") return gameProvider === "FC"; | |
| if (filter === "JILI") return gameProvider === "JILI Gaming"; | |
| if (filter === "nolimit") return gameProvider === "NoLimit City"; | |
| if (filter === "hacksaw") return gameProvider === "Hacksaw Gaming"; | |
| return false; | |
| }; | |
| const PROVIDERS_LIST = [ | |
| "PG Soft", | |
| "Pragmatic Play", | |
| "CQ9", | |
| "JDB", | |
| "FC", | |
| "JILI Gaming", | |
| "NoLimit City", | |
| "Hacksaw Gaming", | |
| "Evolution Gaming", | |
| "HY Lottery", | |
| "SABAH Sports", | |
| "IM Sports", | |
| "King Maker" | |
| ]; | |
| export const GameCenterView: React.FC<GameCenterViewProps> = ({ state, onNavigate }) => { | |
| const [searchQuery, setSearchQuery] = useState(""); | |
| const [activeTab, setActiveTab] = useState("热门推荐"); | |
| const [selectedProvider, setSelectedProvider] = useState("全部"); | |
| const [showAdminSettings, setShowAdminSettings] = useState(false); | |
| const tabScrollRef = useRef<HTMLElement | null>(null); | |
| const tabDragRef = useRef({ | |
| active: false, | |
| dragged: false, | |
| startX: 0, | |
| scrollLeft: 0 | |
| }); | |
| // Recommended list loaded from default config, can be toggled by settings | |
| const [recommendedGameIds, setRecommendedGameIds] = useState<string[]>([ | |
| "god-wealth", "faraoh-treasure", "cyberpunk", "dragon-story" | |
| ]); | |
| const tabs = ["热门推荐", "电子", "视讯", "捕鱼", "彩票", "体育", "棋牌"]; | |
| const filteredGames = ALL_GAMES.filter((g) => { | |
| // Check search query | |
| const matchesQuery = searchQuery | |
| ? g.title.toLowerCase().includes(searchQuery.toLowerCase()) || | |
| g.provider.toLowerCase().includes(searchQuery.toLowerCase()) | |
| : true; | |
| if (!matchesQuery) return false; | |
| // Check custom recommendation logic | |
| if (activeTab === "热门推荐") { | |
| return recommendedGameIds.includes(g.id); | |
| } | |
| const matchesCategory = g.categories.includes(activeTab); | |
| if (!matchesCategory) return false; | |
| // Additional provider filter for slots | |
| if (activeTab === "电子") { | |
| return matchesProvider(g.provider, selectedProvider); | |
| } | |
| return true; | |
| }); | |
| const getTagStyle = (tag: string) => { | |
| switch(tag) { | |
| case "Hot": return "bg-red-500/20 text-red-400 border border-red-500/30"; | |
| case "New": return "bg-blue-500/20 text-blue-400 border border-blue-500/30"; | |
| case "Jackpot": return "bg-amber-500/20 text-amber-400 border border-amber-500/30 font-bold"; | |
| default: return "bg-teal-500/20 text-teal-400 border border-teal-500/30"; | |
| } | |
| }; | |
| const handleTabPointerDown = (event: React.PointerEvent<HTMLElement>) => { | |
| const el = tabScrollRef.current; | |
| if (!el) return; | |
| tabDragRef.current = { | |
| active: true, | |
| dragged: false, | |
| startX: event.clientX, | |
| scrollLeft: el.scrollLeft | |
| }; | |
| el.setPointerCapture(event.pointerId); | |
| }; | |
| const handleTabPointerMove = (event: React.PointerEvent<HTMLElement>) => { | |
| const el = tabScrollRef.current; | |
| const drag = tabDragRef.current; | |
| if (!el || !drag.active) return; | |
| const deltaX = event.clientX - drag.startX; | |
| if (Math.abs(deltaX) > 4) { | |
| drag.dragged = true; | |
| } | |
| el.scrollLeft = drag.scrollLeft - deltaX; | |
| }; | |
| const handleTabPointerEnd = (event: React.PointerEvent<HTMLElement>) => { | |
| const el = tabScrollRef.current; | |
| if (el?.hasPointerCapture(event.pointerId)) { | |
| el.releasePointerCapture(event.pointerId); | |
| } | |
| tabDragRef.current.active = false; | |
| }; | |
| const handleTabClick = (tab: string) => { | |
| if (tabDragRef.current.dragged) { | |
| tabDragRef.current.dragged = false; | |
| return; | |
| } | |
| setActiveTab(tab); | |
| setSearchQuery(""); | |
| if (tab === "电子") { | |
| setSelectedProvider("PG"); | |
| } else if (tab === "热门推荐") { | |
| setSelectedProvider("全部"); | |
| } else { | |
| setSelectedProvider("厂商 A"); | |
| } | |
| }; | |
| return ( | |
| <div className="bg-[#000B14] text-[#d1e4ff] min-h-screen pb-24 font-sans select-none overflow-x-hidden"> | |
| {/* Header */} | |
| <header className="bg-[#0b2135] fixed top-0 w-full z-45 shadow-sm border-b border-[#414755] flex justify-between items-center px-4 h-14"> | |
| <h1 | |
| className="text-base font-bold text-white tracking-wider cursor-pointer select-none shrink truncate pr-2" | |
| onClick={() => onNavigate(ScreenId.HOME)} | |
| > | |
| sdyl.ph/游戏中心 | |
| </h1> | |
| <div className="flex items-center gap-2"> | |
| {/* Admin Configuration toggle button */} | |
| <button | |
| onClick={() => setShowAdminSettings(prev => !prev)} | |
| className="text-[10px] bg-amber-400/20 hover:bg-amber-400/30 text-amber-300 font-bold px-2.5 py-1 rounded-full border border-amber-400/40 transition-all cursor-pointer active:scale-95" | |
| > | |
| 后台配置 | |
| </button> | |
| </div> | |
| </header> | |
| {/* Admin Settings Panel */} | |
| {showAdminSettings && ( | |
| <section className="mx-4 mt-20 p-4 bg-[#0b2135] border border-amber-400/30 rounded-2xl shadow-2xl animate-fade-in relative z-30"> | |
| <div className="flex items-center justify-between mb-3 border-b border-white/10 pb-2"> | |
| <h3 className="text-xs font-bold text-amber-400 flex items-center gap-1.5"> | |
| <span>⚙️ 模拟后台:热门推荐配置 (按厂商分组)</span> | |
| </h3> | |
| <button | |
| onClick={() => setShowAdminSettings(false)} | |
| className="text-[10px] text-slate-400 hover:text-white" | |
| > | |
| 关闭 | |
| </button> | |
| </div> | |
| <p className="text-[10px] text-slate-300 mb-4 leading-relaxed"> | |
| 在模拟后台中勾选指定厂商的某款游戏为“热门推荐”,前台“热门推荐”页将实时同步呈现。 | |
| </p> | |
| <div className="space-y-4 max-h-[220px] overflow-y-auto pr-1 scrollbar-thin"> | |
| {PROVIDERS_LIST.map((provider) => { | |
| const providerGames = ALL_GAMES.filter(g => g.provider === provider); | |
| if (providerGames.length === 0) return null; | |
| return ( | |
| <div key={provider} className="bg-[#000B14]/40 p-2.5 rounded-xl border border-white/5"> | |
| <h4 className="text-[10px] font-black text-amber-400 mb-2 border-b border-white/5 pb-1"> | |
| {provider} | |
| </h4> | |
| <div className="grid grid-cols-2 gap-2"> | |
| {providerGames.map((game) => { | |
| const isHot = recommendedGameIds.includes(game.id); | |
| return ( | |
| <label | |
| key={game.id} | |
| className={`flex items-center gap-2 p-1.5 rounded-lg border text-[10px] cursor-pointer transition-all select-none ${ | |
| isHot | |
| ? "bg-amber-400/10 border-amber-400/25 text-white font-bold" | |
| : "bg-[#0b2135]/40 border-transparent text-slate-400 hover:text-white" | |
| }`} | |
| > | |
| <input | |
| type="checkbox" | |
| checked={isHot} | |
| onChange={(e) => { | |
| if (e.target.checked) { | |
| setRecommendedGameIds(prev => [...prev, game.id]); | |
| } else { | |
| setRecommendedGameIds(prev => prev.filter(id => id !== game.id)); | |
| } | |
| }} | |
| className="w-3.5 h-3.5 rounded text-amber-500 focus:ring-0 cursor-pointer" | |
| /> | |
| <span className="truncate flex-1">{game.title}</span> | |
| </label> | |
| ); | |
| })} | |
| </div> | |
| </div> | |
| ); | |
| })} | |
| </div> | |
| </section> | |
| )} | |
| {/* Search Bar */} | |
| <section className={`px-4 ${showAdminSettings ? "mt-4" : "mt-20"}`}> | |
| <div className="relative"> | |
| <input | |
| type="text" | |
| value={searchQuery} | |
| onChange={(e) => setSearchQuery(e.target.value)} | |
| placeholder="搜索您喜爱的游戏或供应商..." | |
| className="w-full bg-[#0b2135] border border-white/5 rounded-full py-2.5 pl-11 pr-4 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-[#528dff]" | |
| /> | |
| <Search className="w-4 h-4 text-slate-500 absolute left-4 top-3.5" /> | |
| </div> | |
| </section> | |
| {/* Horizontal Category Tab Selector */} | |
| <section | |
| ref={tabScrollRef} | |
| onPointerDown={handleTabPointerDown} | |
| onPointerMove={handleTabPointerMove} | |
| onPointerUp={handleTabPointerEnd} | |
| onPointerCancel={handleTabPointerEnd} | |
| className="category-tab-scroll mt-4 px-4 scrollbar-none" | |
| > | |
| <div className="flex gap-2 min-w-max pb-2"> | |
| {tabs.map((tab) => ( | |
| <button | |
| key={tab} | |
| onClick={() => handleTabClick(tab)} | |
| className={`px-4 py-2 rounded-full text-xs font-bold transition-all border ${ | |
| activeTab === tab | |
| ? "bg-gradient-to-r from-amber-400 to-[#FFD700] text-slate-950 border-transparent shadow-[0_2px_8px_rgba(255,215,0,0.3)] scale-105" | |
| : "bg-[#0b2135] text-[#c1c6d7] border-white/5 hover:bg-[#22364c]/55 hover:text-white" | |
| }`} | |
| > | |
| {tab} | |
| </button> | |
| ))} | |
| </div> | |
| </section> | |
| {/* Games List Display Grid */} | |
| <section className="mt-4 px-4"> | |
| {filteredGames.length === 0 ? ( | |
| <div className="py-20 text-center text-xs text-[#c1c6d7] opacity-60"> | |
| 暂无符合当前“{activeTab}”分类的游戏记录,请尝试其他分类。 | |
| </div> | |
| ) : ( | |
| activeTab === "热门推荐" ? ( | |
| /* Popular Recommendations Grid (No sidebar, full width) */ | |
| <div className="grid grid-cols-2 gap-3.5"> | |
| {filteredGames.map((game) => ( | |
| <div | |
| key={game.id} | |
| onClick={() => { | |
| if (game.id === "god-wealth" || game.provider === "PG Soft") { | |
| onNavigate(ScreenId.GAME_DETAILS); | |
| } else { | |
| onNavigate(ScreenId.GAME_RECOMMENDATIONS); | |
| } | |
| }} | |
| className="bg-[#0b2135] border border-white/5 rounded-2xl overflow-hidden shadow-lg group active:scale-[0.98] transition-all cursor-pointer flex flex-col justify-between" | |
| > | |
| <div className="aspect-[4/3] w-full relative overflow-hidden bg-slate-950"> | |
| <img | |
| alt={game.title} | |
| src={game.image} | |
| className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 opacity-80" | |
| /> | |
| <div className="absolute inset-0 bg-black/20 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity"> | |
| <PlayCircle className="text-white w-10 h-10 drop-shadow-md" /> | |
| </div> | |
| <span className={`absolute top-2 left-2 text-[8px] font-bold px-2 py-0.5 rounded-full uppercase tracking-wider backdrop-blur-md ${getTagStyle(game.tag)}`}> | |
| {game.tag} | |
| </span> | |
| </div> | |
| <div className="p-3"> | |
| <h4 className="text-xs font-bold text-white tracking-wide truncate">{game.title}</h4> | |
| <div className="flex items-center justify-between mt-1"> | |
| <span className="text-[10px] text-[#c1c6d7] opacity-80 font-mono italic">{game.provider}</span> | |
| <span className="text-[9px] text-amber-500 flex items-center gap-0.5 font-bold"> | |
| <Star className="w-2.5 h-2.5 fill-current" /> 9.8 | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| ) : ( | |
| /* Sidebar-enabled categories (电子, 视讯, 捕鱼, 彩票, 体育, 棋牌) */ | |
| <div className="flex gap-3 items-start"> | |
| {/* Left Sidebar */} | |
| <div className="w-[72px] shrink-0 flex flex-col gap-1.5 bg-[#0b2135]/40 border border-white/5 p-1.5 rounded-xl max-h-[420px] overflow-y-auto scrollbar-none"> | |
| <span className="text-[8px] font-bold text-slate-500 uppercase tracking-wider text-center block mb-1">厂商筛选</span> | |
| {activeTab === "电子" ? ( | |
| /* Slots real vendors */ | |
| ["PG", "PP", "CQ9", "JDB", "FC", "JILI", "nolimit", "hacksaw"].map((prov) => ( | |
| <button | |
| key={prov} | |
| onClick={() => setSelectedProvider(prov)} | |
| className={`py-1.5 rounded-lg text-[10px] font-black transition-all text-center block ${ | |
| selectedProvider === prov | |
| ? "bg-amber-400 text-slate-950 shadow-sm font-bold scale-105" | |
| : "bg-[#0b2135]/80 text-[#c1c6d7] hover:text-white border border-white/5" | |
| }`} | |
| > | |
| {prov} | |
| </button> | |
| )) | |
| ) : ( | |
| /* Other categories: Placeholder vendors */ | |
| ["厂商 A", "厂商 B", "厂商 C"].map((placeholder) => ( | |
| <button | |
| key={placeholder} | |
| onClick={() => setSelectedProvider(placeholder)} | |
| className={`py-1.5 rounded-lg text-[10px] font-black transition-all text-center block ${ | |
| selectedProvider === placeholder | |
| ? "bg-amber-400 text-slate-950 shadow-sm font-bold scale-105" | |
| : "bg-[#0b2135]/85 text-slate-500 hover:text-slate-400 border border-dashed border-white/10" | |
| }`} | |
| > | |
| {placeholder} | |
| </button> | |
| )) | |
| )} | |
| </div> | |
| {/* Right Game Grid (2-column, shrunk icons) */} | |
| <div className="flex-1 animate-fade-in"> | |
| <div className="grid grid-cols-2 gap-2.5"> | |
| {filteredGames.map((game) => ( | |
| <div | |
| key={game.id} | |
| onClick={() => { | |
| if (game.id === "god-wealth" || game.provider === "PG Soft") { | |
| onNavigate(ScreenId.GAME_DETAILS); | |
| } else { | |
| onNavigate(ScreenId.GAME_RECOMMENDATIONS); | |
| } | |
| }} | |
| className="bg-[#0b2135] border border-white/5 rounded-xl overflow-hidden shadow-md group active:scale-[0.98] transition-all cursor-pointer flex flex-col justify-between" | |
| > | |
| <div className="aspect-[4/3] w-full relative overflow-hidden bg-slate-950"> | |
| <img | |
| alt={game.title} | |
| src={game.image} | |
| className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 opacity-80" | |
| /> | |
| <div className="absolute inset-0 bg-black/20 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity"> | |
| <PlayCircle className="text-white w-7 h-7 drop-shadow-md" /> | |
| </div> | |
| <span className={`absolute top-1.5 left-1.5 text-[7px] font-bold px-1.5 py-0.5 rounded-full uppercase tracking-wider backdrop-blur-md ${getTagStyle(game.tag)}`}> | |
| {game.tag} | |
| </span> | |
| </div> | |
| <div className="p-2"> | |
| <h4 className="text-[10px] font-bold text-white tracking-wide truncate">{game.title}</h4> | |
| <div className="flex items-center justify-between mt-0.5"> | |
| <span className="text-[8px] text-[#c1c6d7] opacity-80 font-mono italic truncate max-w-[45px]">{game.provider}</span> | |
| <span className="text-[8px] text-amber-500 flex items-center gap-0.5 font-bold shrink-0"> | |
| <Star className="w-2 h-2 fill-current" /> 9.8 | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| </div> | |
| ) | |
| )} | |
| </section> | |
| {/* Floating Recharge Access FAB */} | |
| <div className="fixed bottom-5 left-1/2 -translate-x-1/2 z-[60]"> | |
| <div className="relative"> | |
| <div className="absolute -inset-1 bg-[#afc6ff]/35 blur-xl rounded-full animate-pulse"></div> | |
| <button | |
| onClick={() => onNavigate(ScreenId.DEPOSIT)} | |
| className="w-14 h-14 bg-gradient-to-b from-[#528dff] to-[#afc6ff] text-[#002d6c] rounded-full shadow-[0_4px_16px_rgba(82,141,255,0.4)] border-4 border-[#0b2135] flex flex-col items-center justify-center active:scale-90 transition-transform relative hover:brightness-105 cursor-pointer" | |
| > | |
| <Landmark className="w-5 h-5 mx-auto" /> | |
| <span className="text-[10px] font-bold mt-0.5">充值</span> | |
| </button> | |
| </div> | |
| </div> | |
| {/* Bottom Nav Bar */} | |
| <nav className="bg-[#22364c] border-t border-[#414755] fixed bottom-0 left-0 w-full z-50 rounded-t-xl shadow-xl flex justify-around items-center h-16 px-1"> | |
| <a | |
| onClick={() => onNavigate(ScreenId.HOME)} | |
| className="flex flex-col items-center justify-[#c1c6d7] hover:text-[#afc6ff] transition-colors cursor-pointer flex-1" | |
| > | |
| <span className="text-sm font-semibold">首页</span> | |
| <span className="text-[9px] mt-0.5">Home</span> | |
| </a> | |
| <a | |
| onClick={() => onNavigate(ScreenId.GAME_CENTER)} | |
| className="flex flex-col items-center justify-center text-[#afc6ff] font-bold drop-shadow-[0_0_8px_rgba(175,198,255,0.5)] scale-105 cursor-pointer flex-1" | |
| > | |
| <span className="text-xl">游戏</span> | |
| <span className="text-[10px] tracking-wide mt-1">Games</span> | |
| </a> | |
| <div className="w-16"></div> {/* Spacer for FAB */} | |
| <a | |
| onClick={() => onNavigate(ScreenId.PROMOTIONS)} | |
| className="flex flex-col items-center justify-[#c1c6d7] hover:text-[#afc6ff] transition-colors cursor-pointer flex-1" | |
| > | |
| <span className="text-sm font-semibold">活动</span> | |
| <span className="text-[9px] mt-0.5">Promos</span> | |
| </a> | |
| <a | |
| onClick={() => onNavigate(ScreenId.PROFILE)} | |
| className="flex flex-col items-center justify-[#c1c6d7] hover:text-[#afc6ff] transition-colors cursor-pointer flex-1" | |
| > | |
| <span className="text-sm font-semibold">我的</span> | |
| <span className="text-[9px] mt-0.5">Profile</span> | |
| </a> | |
| </nav> | |
| </div> | |
| ); | |
| }; | |