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
| const modules = { feizi: { title: "请陛下翻牌,今晚宠幸哪位妃子?", subtitle: "点击'随机开始'按钮,系统将为您挑选今晚侍寝的妃子", names: ['慧妃', '婉妃', '静妃', '丽妃', '柔妃', '容妃', '德妃', '贤妃', '淑妃'], descs: ['温婉贤淑,深得圣心', '聪慧灵巧,才貌双全', '娴静优雅,气质如兰', '美艳动人,倾国倾城', '柔情似水,善解人意', '雍容华贵,仪态万方', '德才兼备,母仪天下', '贤良淑德,处事得体', '端庄大方,气质非凡'], tags: ['康熙专宠', '乾隆最爱', '雍正钦点', '嘉庆恩宠', '道光厚爱', '咸丰宠幸', '同治优选', '光绪之选', '宣统特宠'], imgList: [ 'https://pica.zhimg.com/v2-58bfd43bdf2b71d39507a8bb8c1cfe28_r.jpg', 'https://pic1.zhimg.com/v2-ff48440794ca29d58d35e6f28ad63766_r.jpg', 'https://pic1.zhimg.com/v2-fba456bb85fd62c6b00e1f1ba2fe5467_r.jpg', 'https://picx.zhimg.com/v2-81ab73e99dfa21e8fcd20a2b912805de_r.jpg', 'https://picx.zhimg.com/v2-a39d6dd4910ff0fcc5b5f7f7f173448c_r.jpg', 'https://picx.zhimg.com/v2-4af49b991eba0a0ff807630bb5bb6275_r.jpg', 'https://picx.zhimg.com/v2-12f3ccc91a9ae4b8bee6bfcac96c0051_r.jpg', 'https://pica.zhimg.com/v2-85d8d11c5cd86d8c30fb7267f255fe3e_r.jpg', 'https://picx.zhimg.com/v2-f42c1d8024de4ffbca21871779cac20b_r.jpg' ], colors: [ 'linear-gradient(135deg,#a8edea,#fed6e3)', 'linear-gradient(135deg,#fbc2eb,#a6c1ee)', 'linear-gradient(135deg,#fceabb,#f8b500)', 'linear-gradient(135deg,#d4fc79,#96e6a1)', 'linear-gradient(135deg,#fff1eb,#ace0f9)', 'linear-gradient(135deg,#f9f586,#ffecd2)', 'linear-gradient(135deg,#f6d365,#fda085)', 'linear-gradient(135deg,#fbc2eb,#f7ff00)', 'linear-gradient(135deg,#c2ffd8,#465efb)' ] }, prize: { title: "幸运大抽奖", subtitle: "点击'随机开始'按钮,赢取丰厚奖品", names: ['一等奖', '二等奖', '三等奖', '幸运奖', '参与奖', '特别奖', '惊喜奖', '纪念奖', '鼓励奖'], descs: ['豪华大礼包一份', '高端数码产品', '精美家电一台', '品牌美妆套装', '实用生活用品', '特别定制礼品', '惊喜盲盒一个', '精致纪念品', '暖心鼓励奖'], tags: ['恭喜中奖', '幸运降临', '手气最佳', '好运连连', '感谢参与', '意外惊喜', '惊喜不断', '值得纪念', '继续加油'], imgList: [ 'https://images.unsplash.com/photo-1607083206968-13611e3d76db?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1468436139062-f60a71c5c892?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1523275335684-37898b6baf30?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1504274066651-8d31a536b11a?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1491553895911-0055eca6402d?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1546868871-7041f2a55e12?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1534452203293-494d7ddbf7e0?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1526170375885-4d8ecf77b99f?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80' ], colors: [ 'linear-gradient(135deg,#FF512F,#F09819)', 'linear-gradient(135deg,#02AAB0,#00CDAC)', 'linear-gradient(135deg,#FF5E62,#FF9966)', 'linear-gradient(135deg,#7F00FF,#E100FF)', 'linear-gradient(135deg,#3a7bd5,#00d2ff)', 'linear-gradient(135deg,#ff7e5f,#feb47b)', 'linear-gradient(135deg,#DA4453,#89216B)', 'linear-gradient(135deg,#2193b0,#6dd5ed)', 'linear-gradient(135deg,#654ea3,#eaafc8)' ] }, redpacket: { title: "红包大派送", subtitle: "点击'随机开始'按钮,抽取现金红包", descs: ['10元红包', '20元红包', '50元红包', '100元红包', '5元红包', '8元红包', '15元红包', '30元红包', '88元红包'], names: ['小额惊喜', '中等红包', '丰厚奖励', '超级大包', '小试牛刀', '吉祥如意', '惊喜连连', '幸运降临', '大吉大利'], tags: ['10元红包', '20元红包', '50元红包', '100元红包', '5元红包', '8元红包', '15元红包', '30元红包', '88元红包'], imgList: [ 'https://images.unsplash.com/photo-1607082350899-7e105aa886ae?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082350899-7e105aa886ae?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80', 'https://images.unsplash.com/photo-1607082350899-7e105aa886ae?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80' ], colors: [ 'linear-gradient(135deg,#f85032,#e73827)', 'linear-gradient(135deg,#FF416C,#FF4B2B)', 'linear-gradient(135deg,#FF512F,#DD2476)', 'linear-gradient(135deg,#f857a6,#ff5858)', 'linear-gradient(135deg,#ee0979,#ff6a00)', 'linear-gradient(135deg,#f953c6,#b91d73)', 'linear-gradient(135deg,#f857a6,#ff5858)', 'linear-gradient(135deg,#ee0979,#ff6a00)', 'linear-gradient(135deg,#f953c6,#b91d73)' ] } };
let currentModule = modules.feizi; const grid = document.getElementById('grid'); const cards = []; let animating = false; let selectedIndex = null;
function createCards() { if (!currentModule || !currentModule.colors) { console.error('当前模块数据不完整'); return; }
grid.innerHTML = ''; cards.length = 0;
for (let i = 0; i < 9; i++) { const scene = document.createElement('div'); scene.className = 'scene';
const card = document.createElement('div'); card.className = 'card'; card.dataset.index = i;
const front = document.createElement('div'); front.className = 'card-face front'; front.style.background = currentModule.colors[i];
const frontContent = document.createElement('div'); frontContent.className = 'front-content'; frontContent.textContent = currentModule.names[i]; front.appendChild(frontContent);
const back = document.createElement('div'); back.className = 'card-face back';
const img = document.createElement('img'); img.src = currentModule.imgList[i]; img.alt = currentModule.names[i];
const tag = document.createElement('span'); tag.className = 'card-tag'; tag.textContent = currentModule.tags[i];
back.appendChild(img); back.appendChild(tag);
card.appendChild(front); card.appendChild(back); scene.appendChild(card); grid.appendChild(scene); cards.push(card);
card.addEventListener('click', () => { if (animating) return; card.classList.add('flipped'); showModal(i); }); }
document.querySelector('.title-container h3').textContent = currentModule.title; document.querySelector('.title-container p').textContent = currentModule.subtitle;
updateButtonState(); }
function updateButtonState(isBgChanging = false) { const randomBtn = document.getElementById('randomStartBtn'); if (isBgChanging || !currentModule) { randomBtn.style.display = 'none'; } else { randomBtn.style.display = 'block'; } }
function setSelected(idx) { cards.forEach((c, i) => { c.classList.remove('selected'); }); const card = cards[idx]; card.classList.add('selected'); }
function showModal(index) { selectedIndex = index; const overlay = document.getElementById('overlay'); const modal = document.getElementById('modal');
document.getElementById('modalTitle').textContent = currentModule.names[index]; document.getElementById('modalDesc').textContent = currentModule.descs[index]; document.getElementById('modalImg').src = currentModule.imgList[index];
overlay.style.display = 'block'; modal.style.display = 'block'; }
function closeModal() { const overlay = document.getElementById('overlay'); const modal = document.getElementById('modal');
modal.style.display = 'none'; overlay.style.display = 'none';
if (selectedIndex !== null) { cards[selectedIndex].classList.add('flipped'); } }
let slotSound = null;
function initSounds() { slotSound = new Audio('https://mpimg.cn/view.php/98b51729a02fefe5ad171c2007d0bf18.mp3'); slotSound.loop = true; }
document.getElementById('randomStartBtn').addEventListener('click', async () => { if (animating) return; if (slotSound) { slotSound.currentTime = 0; slotSound.play().catch(e => console.log("自动播放被阻止:", e)); }
animating = true;
cards.forEach(c => { c.classList.remove('flipped', 'selected'); });
let lastIdx = 0; let used = new Set(); const jumpTimes = 12 + Math.floor(Math.random() * 8);
for (let i = 0; i < jumpTimes; i++) { let available = cards.map((_, idx) => idx).filter(idx => !used.has(idx)); if (available.length === 0) { used.clear(); available = cards.map((_, idx) => idx); }
const idx = available[Math.floor(Math.random() * available.length)]; setSelected(idx); used.add(idx); lastIdx = idx;
await new Promise(r => setTimeout(r, 80 + i * 8)); }
cards[lastIdx].classList.remove('selected'); setTimeout(() => { if (slotSound) slotSound.pause(); showModal(lastIdx); animating = false; }, 300);
});
document.querySelectorAll('#sidebar button[data-module]').forEach(btn => { btn.addEventListener('click', () => { document.querySelectorAll('#sidebar button').forEach(b => b.classList.remove('active')); btn.classList.add('active');
const moduleName = btn.dataset.module; if (modules[moduleName]) { currentModule = modules[moduleName]; createCards(); selectedIndex = null; } }); });
const bgPanel = document.getElementById('bgPanel'); const changeBgBtn = document.getElementById('changeBgBtn'); const closePanelBtn = document.getElementById('closePanelBtn'); const bgOptions = document.querySelectorAll('.bg-option'); const colorPicker1 = document.getElementById('colorPicker1'); const colorPicker2 = document.getElementById('colorPicker2'); const applyCustomBg = document.getElementById('applyCustomBg');
changeBgBtn.addEventListener('click', () => { updateButtonState(true);
bgPanel.style.display = 'block'; });
closePanelBtn.addEventListener('click', () => { bgPanel.style.display = 'none'; updateButtonState(false); });
bgOptions.forEach(option => { option.addEventListener('click', () => { bgOptions.forEach(opt => opt.classList.remove('active')); option.classList.add('active'); document.body.style.background = option.dataset.bg; }); });
document.addEventListener('DOMContentLoaded', () => { initSounds(); createCards(); updateButtonState(); });
applyCustomBg.addEventListener('click', () => { const color1 = colorPicker1.value; const color2 = colorPicker2.value; document.body.style.background = `linear-gradient(135deg, ${color1}, ${color2})`; });
document.getElementById('closeModalBtn').addEventListener('click', closeModal);
createCards();
|