年会抽奖Html
在这里插入图片描述

<!-- <video id="backgroundMusic" src="file:///D:/background.mp3" loop autoplay></video> -->
<divstyle="width: 290px; height: 580px; margin-left: 20px; margin-top: 20px; background: url('D:/nianhui/zu.png') no-repeat center center; background-size: cover; "><span style="color: #FDF368; top: 60px; font-weight: bold; position: relative; "> <buttonstyle="color: #FDF368; background-color:rgb(219, 0, 1) ; border:0px ;font-size: 30px;"onclick="jixiang()">抽取 吉祥如意(15份)</button></span><br /><div style="top: 90px; position: relative;font-size: 20px;"><span id="jixing1" style="color: #FDF368; font-size: 20px;"></span><span id="jixing2" style="color: #FDF368;"></span><span id="jixing3" style="color: #FDF368;"></span><span id="jixing4" style="color: #FDF368;"></span><span id="jixing5" style="color: #FDF368;"></span><span id="jixing6" style="color: #FDF368;"></span><span id="jixing7" style="color: #FDF368;"></span><span id="jixing8" style="color: #FDF368;"></span><span id="jixing9" style="color: #FDF368;"></span><span id="jixing10" style="color: #FDF368;"></span><span id="jixing11" style="color: #FDF368;"></span><span id="jixing12" style="color: #FDF368;"></span><span id="jixing13" style="color: #FDF368;"></span><span id="jixing14" style="color: #FDF368;"></span><span id="jixing15" style="color: #FDF368;"></span><div style="position: relative; color: #FDF368; font-weight: bold; top: 30px;"> <buttonstyle="color: #FDF368; background-color:rgb(219, 0, 1) ; border:0px ;font-size: 30px;"onclick="fuixng()">抽取 福星高照(4份)</button> </div><div style="top: 50px; position: relative;"><span id="fu1" style="color: #FDF368;"></span><span id="fu2" style="color: #FDF368;"></span><span id="fu3" style="color: #FDF368;"></span><span id="fu4" style="color: #FDF368;"></span></div><div style="position: relative; color: #FDF368; font-weight: bold; top: 70px;"> <buttonstyle="color: #FDF368; background-color:rgb(219, 0, 1) ; border:0px ;font-size: 30px;"onclick="hongyun()">抽取 鸿运当头(1份)</button> </div><div style="position: relative; top: 90px; color: #FDF368;"><span id="hong" style="color: #FDF368;"></span></div><div style="position: relative; color: #FDF368; font-weight: bold; top: 120px;"> <buttonstyle="color: #FDF368; background-color:rgb(219, 0, 1) ; border:0px ;font-size: 30px;"onclick="desk()">抽取 桌奖</button> </div></div>
</div><div class="container" id="containers" style="margin-top: -25%; align-items: center;"><div class="result" id="result" "><div class=" image-wrapper1" id="mage-wrapper1"style="background: url('D:/nianhui/num.png'); width: 365px; height: 295px; background-size: cover;"onclick="chongzhi(1)"><span id="div1"style="font-weight: bold; color: #FDF368; font-size: 98px; animation: pulse 1.5s infinite; top: 88px; position: relative; ">🎉</span></div><div class="image-wrapper2" id="mage-wrapper2"style="background: url('D:/nianhui/num.png'); width: 365px; height: 295px; margin-left: 10px; background-size: cover;"onclick="chongzhi(2)"><span id="div2"style="font-weight: bold; color: #FDF368; font-size: 98px; top: 88px; animation: pulse 1.5s infinite; position: relative;">🎉</span></div><div class="image-wrapper3" id="mage-wrapper3"style="background: url('D:/nianhui/num.png'); width: 365px; height: 295px; margin-left: 10px;background-size: cover;"onclick="chongzhi(3)"><span id="div3"style="font-weight: bold; color: #FDF368; font-size: 98px; top: 88px; position: relative; animation: pulse 1.5s infinite;">🎉</span></div><div class="image-wrapper4" id="mage-wrapper4"style="background:url('D:/nianhui/num.png'); width: 365px; height: 295px; margin-left: 10px;background-size: cover;"onclick="chongzhi(4)"><span id="div4"style="font-weight: bold; color: #FDF368; font-size: 98px; top: 88px; position: relative; animation: pulse 1.5s infinite;">🎉</span></div><div class="image-wrapper5" id="mage-wrapper5"style="background: url('D:/nianhui/num.png'); width: 365px; height: 295px; margin-left: 10px;background-size: cover;"onclick="chongzhi(5)"><span id="div5"style="font-weight: bold; color: #FDF368; font-size: 98px; top: 88px; position: relative; animation: pulse 1.5s infinite;">🎉</span></div>
</div><span id="xianshi"style="color: #FDF368; font-size: 50px; margin-top: 100px; position: relative; left: -100px;">准备抽奖...</span>
<div style="top:96%; left: 80px; position: absolute;"><button id="startButton" class="custom-button" onclick="btnStart()"> <spanstyle="font-size: 10px; ">开始</span></button><!-- <button id="stopButton" class="custom-button" style="margin-left: 60px;" onclick="btnStop()" disabled>重置</button> -->
</div>
<div style="top:96%; left: 150px; position: absolute;"><button id="stopButton" class="custom-button" style="margin-left: 60px;" onclick="btnStop()" disabled><spanstyle="font-size: 10px;">暂停</span></button>
</div>
<div id="poke" onclick="checkPoke()"style="border-radius: 4% 4% 4% 4%;display: none;background-image:url('D:/nianhui/num.png');width: 400px;height: 600px;position: relative;left: 300px;background-repeat: no-repeat;background-size: 100% 100%;"></div>
<div id="deskSpanDiv"style="display: none;background: url('D:/nianhui/num.png'); width: 400px; height: 600px; position: relative;top: -600px;left: 800px;background-size: cover;background-size: 100% 100%;background-repeat: no-repeat;"><span id="deskSpan"style="font-size: 180px;font-weight: bold;position: relative;left: 10px;top:180px;color: #FDF368;">🎉</span>
</div><video name="media" style="width: 20px; height: 20px; position: absolute; left: 1900px;" controls autoplay loop><source src="file:///D:/nianhui/background.mp3" type="audio/mpeg">
</video>
</div><script>const allNumbers = Array.from({ length: 200 }, (_, i) => i + 5901); // 数字 5901-6100const drawnNumbers = new Set();const jixingNumber = getRandomNumbers(15);const fuNumber = getRandomNumbers(4);const hongNumber = getRandomNumbers(1);const oneArray = [];const twoArray = [];const hongArray = [];let chou = "ji";let currentStep = 0;let interval;let isRunning = false;//桌奖抽取var deskJPPoke = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];var deskNum = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];var deskNum1 = [11, 12];var deskNum2 = [13];var checkPokeIndex = -1;var pickPokeList = [];var isClick = true;function chongzhi(val) {if (chou == 'hong') {return}const modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '50%';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '18px';modal.style.width = '400px';modal.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.3)';// 弹框内容modal.innerHTML = `<p>是否确认该数字重抽?</p><button id="confirmBtn" style="margin: 10px; padding: 8px 16px; font-size: 16px; border: none; border-radius: 5px; background: #28a745; color: white; cursor: pointer;">确认</button><button id="cancelBtn" style="margin: 10px; padding: 8px 16px; font-size: 16px; border: none; border-radius: 5px; background: #dc3545; color: white; cursor: pointer;">取消</button>
`;// 添加到页面document.body.appendChild(modal);// 添加事件监听器document.getElementById('confirmBtn').addEventListener('click', () => {const randomNumber = getRandomNumbers(1); // 生成随机数// alert(`新的随机数为: ${randomNumber}`);if (chou == 'ji') {let it = 'jixing' + oneArray.length;let its = "div" + valintervals = setInterval(() => anim(val), 50);setTimeout(() => {// 更新指定元素的文本内容clearInterval(intervals);document.getElementById(it).innerText = randomNumber; // 第一位数字document.getElementById(its).innerHTML = randomNumber;}, 2000); // 3秒后执行//写一个定时器 3s的} else if (chou == 'fu') {let it = 'fu' + twoArray.length;let its = "div" + valintervals = setInterval(() => anim(val), 50);setTimeout(() => {// 更新指定元素的文本内容clearInterval(intervals);document.getElementById(it).innerText = randomNumber; // 第一位数字document.getElementById(its).innerHTML = randomNumber;}, 2000); // 3秒后执行//写一个定时器 3s的}document.body.removeChild(modal); // 移除弹框});document.getElementById('cancelBtn').addEventListener('click', () => {// alert('操作已取消');document.body.removeChild(modal); // 移除弹框});}function anim(val) {const randomNumber1 = Math.floor(Math.random() * 201) + 5900;let consts = 'div' + valdocument.getElementById(consts).innerText = randomNumber1;}document.addEventListener('keydown', function (event) {console.log(event.key)if (event.key === 'Enter') {if (isClick) {btnStart();} else {btnStop();}isClick = !isClick;}if (event.key === 'b' || event.key === 'B') {checkPoke();}})function jixiang() {chou = "ji"// 在这里写一个很好看的弹框 alert('开始抽取吉祥如意')var modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '50%';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '80px';modal.style.width = '700px';modal.style.height = '120px';modal.innerHTML = '开始抽取吉祥如意';// 在页面中添加弹框document.body.appendChild(modal);document.getElementById("div1").innerText = "🎉"; // 第一位数字document.getElementById("div2").innerText = "🎉"; // 第一位数字document.getElementById("div3").innerText = "🎉"; // 第一位数字document.getElementById("div4").innerText = "🎉"; // 第一位数字document.getElementById("div5").innerText = "🎉"; // 第一位数字document.getElementById("xianshi").innerText = '吉祥如意抽奖中...';const resultDivs = document.getElementById('mage-wrapper5'); // 获取要隐藏的块if (resultDivs) {resultDivs.style.display = 'block'; // 设置 display 为 none,隐藏块}const resultDivsDesk1 = document.getElementById('poke'); // 获取要隐藏的块if (resultDivsDesk1) {resultDivsDesk1.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivsDesk2 = document.getElementById('deskSpanDiv'); // 获取要隐藏的块if (resultDivsDesk2) {resultDivsDesk2.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivs2 = document.getElementById('mage-wrapper4'); // 获取要隐藏的块if (resultDivs2) {resultDivs2.style.display = 'block'; // 设置 display 为 none,隐藏块}const resultDivs3 = document.getElementById('mage-wrapper3'); // 获取要隐藏的块if (resultDivs3) {resultDivs3.style.display = 'block'; // 设置 display 为 none,隐藏块}const resultDivs4 = document.getElementById('mage-wrapper2'); // 获取要隐藏的块if (resultDivs4) {resultDivs4.style.display = 'block'; // 设置 display 为 none,隐藏块}const resultDivss = document.getElementById('mage-wrapper1'); // 获取要隐藏的块if (resultDivss) {resultDivss.style.display = 'block'; // 设置 display 为 none,隐藏块}const contaions = document.getElementById('containers'); // 获取要隐藏的块if (contaions) {contaions.style.maxWidth = '1600px'; // 设置 display 为 none,隐藏块}// 自动隐藏弹框,2秒后消失setTimeout(function () {document.body.removeChild(modal);}, 2000);}function fuixng() {chou = "fu"var modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '50%';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '80px';modal.style.width = '700px';modal.style.height = '120px';modal.innerHTML = '开始抽取福星高照';// 在页面中添加弹框document.body.appendChild(modal);document.getElementById("div1").innerText = "🎉"; // 第一位数字document.getElementById("div2").innerText = "🎉"; // 第一位数字document.getElementById("div3").innerText = "🎉"; // 第一位数字document.getElementById("div4").innerText = "🎉"; // 第一位数字document.getElementById("div5").innerText = "🎉"; // 第一位数字const resultDiv = document.getElementById('mage-wrapper5'); // 获取要隐藏的块if (resultDiv) {resultDiv.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivsDesk1 = document.getElementById('poke'); // 获取要隐藏的块if (resultDivsDesk1) {resultDivsDesk1.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivsDesk2 = document.getElementById('deskSpanDiv'); // 获取要隐藏的块if (resultDivsDesk2) {resultDivsDesk2.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDive = document.getElementById('mage-wrapper1'); // 获取要隐藏的块if (resultDive) {resultDive.style.display = 'block'; // 设置 display 为 none,隐藏块}const contaions = document.getElementById('containers'); // 获取要隐藏的块if (contaions) {contaions.style.maxWidth = '1230px'; // 设置 display 为 none,隐藏块}document.getElementById("xianshi").innerText = '福星高照抽奖中...';// 自动隐藏弹框,2秒后消失setTimeout(function () {document.body.removeChild(modal);}, 2000);}function hongyun() {chou = "hong"var modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '50%';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '80px';modal.style.width = '700px';modal.style.height = '120px';modal.innerHTML = '开始抽鸿运当头';document.getElementById("div1").innerText = "🎉"; // 第一位数字document.getElementById("div2").innerText = "🎉"; // 第一位数字document.getElementById("div3").innerText = "🎉"; // 第一位数字document.getElementById("div4").innerText = "🎉"; // 第一位数字document.getElementById("div5").innerText = "🎉"; // 第一位数字document.getElementById("xianshi").innerText = '鸿运当头抽奖中...';const resultDivs = document.getElementById('mage-wrapper5'); // 获取要隐藏的块if (resultDivs) {resultDivs.style.display = 'block'; // 设置 display 为 none,隐藏块}const resultDive = document.getElementById('mage-wrapper1'); // 获取要隐藏的块if (resultDive) {resultDive.style.display = 'none'; // 设置 display 为 none,隐藏块}const contaions = document.getElementById('containers'); // 获取要隐藏的块if (contaions) {contaions.style.maxWidth = '1230px'; // 设置 display 为 none,隐藏块}const resultDivsDesk1 = document.getElementById('poke'); // 获取要隐藏的块if (resultDivsDesk1) {resultDivsDesk1.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivsDesk2 = document.getElementById('deskSpanDiv'); // 获取要隐藏的块if (resultDivsDesk2) {resultDivsDesk2.style.display = 'none'; // 设置 display 为 none,隐藏块}// 在页面中添加弹框document.body.appendChild(modal);// 自动隐藏弹框,2秒后消失setTimeout(function () {document.body.removeChild(modal);}, 2000);}function desk() {chou = 'desk';var modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '40%';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '80px';modal.style.width = '700px';modal.style.height = '120px';modal.innerHTML = '开始抽取桌奖';document.getElementById("xianshi").innerText = '桌奖抽奖中...';const resultDivss = document.getElementById('mage-wrapper1'); // 获取要隐藏的块if (resultDivss) {resultDivss.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivss1 = document.getElementById('mage-wrapper2'); // 获取要隐藏的块if (resultDivss1) {resultDivss1.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivss2 = document.getElementById('mage-wrapper3'); // 获取要隐藏的块if (resultDivss2) {resultDivss2.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivss3 = document.getElementById('mage-wrapper4'); // 获取要隐藏的块if (resultDivss3) {resultDivss3.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivss4 = document.getElementById('mage-wrapper5'); // 获取要隐藏的块if (resultDivss4) {resultDivss4.style.display = 'none'; // 设置 display 为 none,隐藏块}const resultDivsDesk1 = document.getElementById('poke'); // 获取要隐藏的块if (resultDivsDesk1) {resultDivsDesk1.style.display = 'block'; // 设置 display 为 none,隐藏块}const resultDivsDesk2 = document.getElementById('deskSpanDiv'); // 获取要隐藏的块if (resultDivsDesk2) {resultDivsDesk2.style.display = 'block'; // 设置 display 为 none,隐藏块}}function getRandomNumbers(count) {const availableNumbers = allNumbers.filter(num => !drawnNumbers.has(num));const selectedNumbers = [];for (let i = 0; i < count; i++) {if (availableNumbers.length === 0) break;const randomIndex = Math.floor(Math.random() * availableNumbers.length);const number = availableNumbers.splice(randomIndex, 1)[0];selectedNumbers.push(number);drawnNumbers.add(number);}return selectedNumbers;}function btnStart() {if (chou == "ji" && oneArray.length == 5) {document.getElementById("div1").innerText = "🎉"; // 第一位数字document.getElementById("div2").innerText = "🎉"; // 第一位数字document.getElementById("div3").innerText = "🎉"; // 第一位数字document.getElementById("div4").innerText = "🎉"; // 第一位数字document.getElementById("div5").innerText = "🎉"; // 第一位数字}if (chou == 'ji' && oneArray.length == 10) {document.getElementById("div1").innerText = "🎉"; // 第一位数字document.getElementById("div2").innerText = "🎉"; // 第一位数字document.getElementById("div3").innerText = "🎉"; // 第一位数字document.getElementById("div4").innerText = "🎉"; // 第一位数字document.getElementById("div5").innerText = "🎉"; // 第一位数字}if (chou == 'ji' && oneArray.length >= 15) {var modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '50%';modal.style.width = '500px';modal.style.height = '140px';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '80px';modal.innerHTML = '该奖项已抽完';// 在页面中添加弹框document.body.appendChild(modal);// 自动隐藏弹框,2秒后消失setTimeout(function () {document.body.removeChild(modal);}, 2000);return}if (chou == 'fu' && twoArray.length >= 4) {var modal = document.createElement('div');modal.style.position = 'fixed';modal.style.top = '50%';modal.style.left = '50%';modal.style.transform = 'translate(-50%, -50%)';modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';modal.style.color = '#fff';modal.style.padding = '20px';modal.style.width = '500px';modal.style.height = '140px';modal.style.borderRadius = '10px';modal.style.textAlign = 'center';modal.style.fontSize = '80px';modal.innerHTML = '该奖项已抽完';// 在页面中添加弹框document.body.appendChild(modal);// 自动隐藏弹框,2秒后消失setTimeout(function () {document.body.removeChild(modal);}, 2000);return}if (isRunning) return;isRunning = true;console.log("123");document.getElementById("startButton").disabled = true;document.getElementById("stopButton").disabled = false;interval = setInterval(animateNumbers, 50);}function btnStop() {clearInterval(interval);document.getElementById("stopButton").disabled = true;if (chou == 'ji') {console.log("JI");// 第一位数字if (oneArray.length >= 5 && oneArray.length < 10) {let consts = 'div' + (oneArray.length + 1 - 5)document.getElementById(consts).innerText = jixingNumber[oneArray.length];oneArray.push(document.getElementById(consts).innerText)} else if (oneArray.length >= 10 && oneArray.length < 15) {let consts = 'div' + (oneArray.length + 1 - 10)document.getElementById(consts).innerText = jixingNumber[oneArray.length];oneArray.push(document.getElementById(consts).innerText)}else {let consts = 'div' + (oneArray.length + 1)document.getElementById(consts).innerText = jixingNumber[oneArray.length];oneArray.push(document.getElementById(consts).innerText)}} else if (chou == 'fu') {// document.getElementById("div1").innerText = fuNumber[0]; // 第一位数字// document.getElementById("div2").innerText = fuNumber[1]; // 第二位数字let consts = 'div' + (twoArray.length + 1)document.getElementById(consts).innerText = fuNumber[twoArray.length]; // 第一位数字\twoArray.push(document.getElementById(consts).innerText)} else if (chou == 'hong') {let hoong1 = 'div' + (5 - hongArray.length)if (hongArray.length == 0) {document.getElementById(hoong1).innerText = hongNumber[0] % 10;; // 第一位数字hongArray.push('1')// hongArray.push(document.getElementById(hoong1).innerText)} else if (hongArray.length == 1) {document.getElementById(hoong1).innerText = Math.floor((hongNumber[0] / 10) % 10); // 位数字hongArray.push('2')} else if (hongArray.length == 2) {document.getElementById(hoong1).innerText = Math.floor((hongNumber[0] / 100) % 10); // 第一位数字hongArray.push('3')} else if (hongArray.length == 3) {document.getElementById(hoong1).innerText = Math.floor((hongNumber[0] / 1000) % 10); // 第一位数字hongArray.push(document.getElementById(hoong1).innerText)let arr = 'hong'document.getElementById(arr).innerText = hongNumber[0];hongArray.push('4')}} else if (chou == 'desk') {isChoice++;
console.log(isChoice);
if (isChoice == 13) {
var modal = document.createElement(‘div’);
modal.style.position = ‘fixed’;
modal.style.top = ‘50%’;
modal.style.left = ‘50%’;
modal.style.transform = ‘translate(-50%, -50%)’;
modal.style.backgroundColor = ‘rgba(0, 0, 0, 0.8)’;
modal.style.color = ‘#fff’;
modal.style.padding = ‘20px’;
modal.style.borderRadius = ‘10px’;
modal.style.textAlign = ‘center’;
modal.style.fontSize = ‘80px’;
modal.style.width = ‘700px’;
modal.style.height = ‘120px’;
modal.innerHTML = ‘桌奖抽取已完成!!!谢谢支持!!’;
// 在页面中添加弹框document.body.appendChild(modal);// 自动隐藏弹框,2秒后消失setTimeout(function () {document.body.removeChild(modal);}, 2000);} else {// console.log(JSON.stringify(checkPokeIndex), 9999)// console.log(JSON.stringify(pickPokeList),8888)if (pickPokeList.includes(checkPokeIndex)) {console.log("存在");} else {// pickPokeList.push(checkPokeIndex);}//移除当前卡组pickPokeList.push(checkPokeIndex);if (checkPokeIndex <= 10) {const randomNum = deskNum[Math.floor(Math.random() * deskNum.length)];let dom = 'deskSpan';document.getElementById(dom).innerText = randomNum;deskNum = deskNum.filter(item => item != randomNum);// deskNum = deskNum} else if (checkPokeIndex > 10 && checkPokeIndex < 13) {const randomNum = deskNum1[Math.floor(Math.random() * deskNum1.length)];let dom = 'deskSpan';document.getElementById(dom).innerText = randomNum;deskNum1 = deskNum1.filter(item => item != randomNum);// deskNum1 = deskNum1} else {const randomNum = deskNum2[Math.floor(Math.random() * deskNum2.length)];let dom = 'deskSpan';document.getElementById(dom).innerText = randomNum;deskNum2 = deskNum2.filter(item => item != randomNum);// deskNum2 = deskNum2;}deskJPPoke = deskJPPoke.filter(item => !pickPokeList.includes(item));}}revealResult();}
let isChoice=0;
let checkData=[];function checkPoke() {const randomNum = deskJPPoke[Math.floor(Math.random() * deskJPPoke.length)];let dom = 'poke';checkPokeIndex = randomNum;document.getElementById(dom).style.backgroundImage = 'url(D:/nianhui/poke/' + checkPokeIndex + '.jpg)';}function animateNumbers() {// 生成范围在 5900 到 6100 的随机数字const randomNumber1 = Math.floor(Math.random() * 201) + 5900; // 生成 5900 到 6100const randomNumber = Math.random() < 0.5 ? 5 : 6;const randomNumber6 = Math.floor(Math.random() * 9) + 1; // 1 到 9if (chou == "ji") {if (oneArray.length >= 5 && oneArray.length < 10) {let consts = 'div' + (oneArray.length + 1 - 5)document.getElementById(consts).innerText = randomNumber1;// return} else if (oneArray.length >= 10 && oneArray.length < 15) {let consts = 'div' + (oneArray.length + 1 - 10)document.getElementById(consts).innerText = randomNumber1;// return}else {let consts = 'div' + (oneArray.length + 1)document.getElementById(consts).innerText = randomNumber1; // 第一位数字}} else if (chou == "fu") {let constss = 'div' + (twoArray.length + 1)document.getElementById(constss).innerText = randomNumber1; // 第一位数字} else if (chou == "hong") {let hoong1 = 'div' + (5 - hongArray.length)if (hongArray.length == 3) {document.getElementById(hoong1).innerText = randomNumber; // 第一位数字} else {document.getElementById(hoong1).innerText = randomNumber6; // 第一位数字}} else if (chou == "desk") {const randomNum = Math.floor(Math.random() * 9) + 7;let dom = 'deskSpan';document.getElementById(dom).innerText = randomNum;}}function revealResult() {if (chou == "ji") {// if (oneArray.length > 5) {// // alert(1)// return// }// alert(2)let arr = 'jixing' + (oneArray.length)document.getElementById(arr).innerText = jixingNumber[oneArray.length - 1];isRunning = false;document.getElementById("startButton").disabled = false;} else if (chou == "fu") {let arr = 'fu' + (twoArray.length)document.getElementById(arr).innerText = fuNumber[twoArray.length - 1];isRunning = false;document.getElementById("startButton").disabled = false;} else if (chou == "hong" && hongArray.length == 4) {isRunning = false;document.getElementById("startButton").disabled = false;} else {isRunning = false;document.getElementById("startButton").disabled = false;}}
</script>
相关文章:
年会抽奖Html
在这里插入图片描述 <!-- <video id"backgroundMusic" src"file:///D:/background.mp3" loop autoplay></video> --> <divstyle"width: 290px; height: 580px; margin-left: 20px; margin-top: 20px; background: url(D:/nianhu…...
ubuntu16 重启之后lvm信息丢失故障恢复
一、背景 1、问题背景 业务有一台物理开发服务器,文件系统有损坏;由于重启时没有检查,导致重启卡住。后面通过断电重新启动之后,无法进入系统;进入救援模式,注释数据盘挂载。重启之后进入系统,…...
【华为OD-E卷 - 热点网站统计 100分(python、java、c++、js、c)】
【华为OD-E卷 - 热点网站统计 100分(python、java、c、js、c)】 题目 企业路由器的统计页面,有一个功能需要动态统计公司访问最多的网页URL top N。请设计一个算法,可以高效动态统计Top N的页面 输入描述 每一行都是一个URL或…...
Ubuntu下安装Android Sdk
下载android sdk命令行工具 https://developer.android.com/studio?hlzh-cn#command-tools mkdir android-sdk cd android-sdk unzip commandlinetools-linux-11076708_latest.zip 添加环境变量到~/.bashrc export ANDROID_HOME$HOME/android-sdk export PATH$PATH:$ANDRO…...
【JVM】总结篇-类的加载篇之 类的加载器 和ClassLoader分析
文章目录 类的加载器ClassLoader自定义类加载器双亲委派机制概念源码分析优势劣势如何打破Tomcat 沙箱安全机制JDK9 双亲委派机制变化 类的加载器 获得当前类的ClassLoader clazz.getClassLoader() 获得当前线程上下文的ClassLoader Thread.currentThread().getContextClassLoa…...
怎样修改el-table主题样式
起因:el-table有主题样式,部分需要单独设置 环境:ideanodejs插件谷歌浏览器 第一步:找到scss文件: 谷歌浏览器打开表格页面,ctrlshifti打开开发者工具,点击后鼠标移动到表格单元格上单击一下…...
MySQL(二)MySQL DDL数据库定义语言
1. MySQL DDL数据库定义语言 1.1. MySQL定义语言 进入MySQL mysql -u root -p(回车后输入密码,即可进入mysq1)1.1.1. 数据库操作 (1)查看数据库 mysql>show databases;注:MySQL语句分隔符为“;” mysql库很重要它里面有…...
Spring Boot 项目启动报 NoClassDefFoundError 异常的原因分析与解决方案 - jackson 版本不一致
目录 报错: 问题分析: 解决方案: 方案 1:对 Jackson 版本进行统一 方案 2:升级 Springfox 版本 方案 3:替换 Springfox 为 springdoc-openapi(推荐) 方案 4:排除冲突的 Jack…...
原型与原型链
什么是原型(对象) 在JavaScript中,每个对象都具有一个原型对象prototype,目的是:利用原型对象实现在同一原型链中的原型方法共享 在理解原型对象前,需要先了解什么是构造函数 构造函数 用来初始化对象的…...
【Linux】信号处理
一、Linux系统信号 1、常见的系统信号 常见的Linux系统信号 信号值描述1SIGHUP挂起(hang up)进程2SIGINT中断进(interrupt)程3SIGQUIT停止(stop)进程9SIGKILL无条件终止(terminate)…...
5个不同类型的mysql数据库安装
各种社区版本下载官方地址:MySQL :: MySQL Community Downloads 一、在线YUM仓库(Linux) 选择 MySQL Yum Repository 选择对应版本下载仓库安装包(No thanks, just start my download.) 下载方法1:下载到本…...
python学习笔记—12—布尔类型、if语句
1. 布尔类型 (1) 定义 (2) 比较运算符 (3) 代码演示 1. 手动定义 bool_1 True bool_2 False print(f"bool_1的内容是:{bool_1}, 类型是:{type(bool_1)}") print(f"bool_2的内容是:{bool_2}, 类型是:{type(bool…...
分数阶傅里叶变换代码 MATLAB实现
function Faf myfrft(f, a) %分数阶傅里叶变换函数 %输入参数: %f:原始信号 %a:阶数 %输出结果: %原始信号的a阶傅里叶变换N length(f);%总采样点数 shft rem((0:N-1)fix(N/2),N)1;%此项等同于fftshift(1:N),起到翻…...
《数据结构》期末考试测试题【中】
《数据结构》期末考试测试题【中】 21.循环队列队空的判断条件为?22. 单链表的存储密度比1?23.单链表的那些操作的效率受链表长度的影响?24.顺序表中某元素的地址为?25.m叉树第K层的结点数为?26. 在双向循环链表某节点…...
openwrt 清缓存命令行
一、查看缓存 : free -m 二、清缓存:echo 3 > /proc/sys/vm/drop_caches 三、详解。 释放物理页缓存 echo 1 > /proc/sys/vm/drop_caches 释放可回收的slab对象,包含inode and dentry echo 2 > /proc/sys/vm/drop_caches 同时…...
RP2K:一个面向细粒度图像的大规模零售商品数据集
这是一种用于细粒度图像分类的新的大规模零售产品数据集。与以往专注于相对较少产品的数据集不同,我们收集了2000多种不同零售产品的35万张图像,这些图像直接在真实的零售商店的货架上拍摄。我们的数据集旨在推进零售对象识别的研究,该研究具…...
.NET Core FluentAPI
目录 约定配置 主要规则 两种配置方式 Data Annotation Fluent API Fluent API配置 Fluent API众多方法 选择 约定配置 主要规则 表名采用DbContext中的对应的DbSet的属性名。数据表列的名字采用实体类属性的名字,列的数据类型采用和实体类属性类型最兼容…...
【C++数据结构——查找】顺序查找(头歌实践教学平台习题)【合集】
目录😋 任务描述 相关知识 一、根据输入数据建立顺序表 二、顺序表的输出 三、顺序查找算法 测试说明 通关代码 测试结果 任务描述 本关任务:实现顺序查找的算法 相关知识 为了完成本关任务,你需要掌握: 根据输入数据建立…...
HTTP Scheme 通常指的是在 URL 中用于指定使用 HTTP 协议的方案(scheme)
HTTP Scheme 通常指的是在 URL 中用于指定使用 HTTP 协议的方案(scheme)。URL(统一资源定位符)中的 scheme 部分指明了访问资源所使用的协议。对于 HTTP,有两个主要的 scheme: - **http**:表示…...
基于Matlab的变压器仿真模型建模方法(13):单相升压自耦变压器的等效电路和仿真模型
1.单相升压自耦变压器的基本方程和等效电路 单相升压自耦变压器的接线原理图如图1所示。在建立自耦变压器的基本方程时,仍然把它看成是从双绕组变压器演变而来。在图1中,设节点a到节点b部分的绕组的匝数为,对应于双绕组变压器的原边绕组;节点c到节点a部分的绕组的绕组匝数为…...
利用最小二乘法找圆心和半径
#include <iostream> #include <vector> #include <cmath> #include <Eigen/Dense> // 需安装Eigen库用于矩阵运算 // 定义点结构 struct Point { double x, y; Point(double x_, double y_) : x(x_), y(y_) {} }; // 最小二乘法求圆心和半径 …...
51c自动驾驶~合集58
我自己的原文哦~ https://blog.51cto.com/whaosoft/13967107 #CCA-Attention 全局池化局部保留,CCA-Attention为LLM长文本建模带来突破性进展 琶洲实验室、华南理工大学联合推出关键上下文感知注意力机制(CCA-Attention),…...
《从零掌握MIPI CSI-2: 协议精解与FPGA摄像头开发实战》-- CSI-2 协议详细解析 (一)
CSI-2 协议详细解析 (一) 1. CSI-2层定义(CSI-2 Layer Definitions) 分层结构 :CSI-2协议分为6层: 物理层(PHY Layer) : 定义电气特性、时钟机制和传输介质(导线&#…...
YSYX学习记录(八)
C语言,练习0: 先创建一个文件夹,我用的是物理机: 安装build-essential 练习1: 我注释掉了 #include <stdio.h> 出现下面错误 在你的文本编辑器中打开ex1文件,随机修改或删除一部分,之后…...
vue3 字体颜色设置的多种方式
在Vue 3中设置字体颜色可以通过多种方式实现,这取决于你是想在组件内部直接设置,还是在CSS/SCSS/LESS等样式文件中定义。以下是几种常见的方法: 1. 内联样式 你可以直接在模板中使用style绑定来设置字体颜色。 <template><div :s…...
css的定位(position)详解:相对定位 绝对定位 固定定位
在 CSS 中,元素的定位通过 position 属性控制,共有 5 种定位模式:static(静态定位)、relative(相对定位)、absolute(绝对定位)、fixed(固定定位)和…...
土地利用/土地覆盖遥感解译与基于CLUE模型未来变化情景预测;从基础到高级,涵盖ArcGIS数据处理、ENVI遥感解译与CLUE模型情景模拟等
🔍 土地利用/土地覆盖数据是生态、环境和气象等诸多领域模型的关键输入参数。通过遥感影像解译技术,可以精准获取历史或当前任何一个区域的土地利用/土地覆盖情况。这些数据不仅能够用于评估区域生态环境的变化趋势,还能有效评价重大生态工程…...
html css js网页制作成品——HTML+CSS榴莲商城网页设计(4页)附源码
目录 一、👨🎓网站题目 二、✍️网站描述 三、📚网站介绍 四、🌐网站效果 五、🪓 代码实现 🧱HTML 六、🥇 如何让学习不再盲目 七、🎁更多干货 一、👨…...
iview框架主题色的应用
1.下载 less要使用3.0.0以下的版本 npm install less2.7.3 npm install less-loader4.0.52./src/config/theme.js文件 module.exports {yellow: {theme-color: #FDCE04},blue: {theme-color: #547CE7} }在sass中使用theme配置的颜色主题,无需引入,直接可…...
【MATLAB代码】基于最大相关熵准则(MCC)的三维鲁棒卡尔曼滤波算法(MCC-KF),附源代码|订阅专栏后可直接查看
文章所述的代码实现了基于最大相关熵准则(MCC)的三维鲁棒卡尔曼滤波算法(MCC-KF),针对传感器观测数据中存在的脉冲型异常噪声问题,通过非线性加权机制提升滤波器的抗干扰能力。代码通过对比传统KF与MCC-KF在含异常值场景下的表现,验证了后者在状态估计鲁棒性方面的显著优…...
