/** * 目标详情页跳转逻辑 * Centralized logic for target detail page selection */ function getTargetDetail() { // 1. Date Check (Holidays) - Top Priority const now = new Date(); const month = now.getMonth() + 1; // 1-12 const date = now.getDate(); // Christmas: Dec 18 - Dec 31 if (month === 12 && date >= 18) { return 'detail-christmas.html'; } // New Year: Jan 1 - Jan 7 if (month === 1 && date <= 7) { // 增加一点随机性:50% 概率看普通元旦,50% 看烟花版 return Math.random() < 0.5 ? 'detail-newyear.html' : 'detail-newyear-fireworks.html'; } // 2. Random Logic for Regular Days // 50% Chance for default detail.html if (Math.random() < 0.5) { return 'detail.html'; } // 3. 50% Chance for other random weather/seasonal cards const others = [ 'detail-cloud.html', 'detail-rain.html', 'detail-snow.html', 'detail-sun.html', 'detail-windy.html' ]; // Random selection from the pool const randomIndex = Math.floor(Math.random() * others.length); return others[randomIndex]; }