年会抽奖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部分的绕组的绕组匝数为…...
xcode 各版本真机调试包下载
下载地址 https://github.com/filsv/iOSDeviceSupport 使用方法: 添加到下面路径中,然后退出重启xcode /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport...

ideal2022.3.1版本编译项目报java: OutOfMemoryError: insufficient memory
最近换了新电脑,用新电脑拉项目配置后,启动时报错,错误描述 idea 启动Springboot项目在编译阶段报错:java: OutOfMemoryError: insufficient memory 2. 处理方案 修改VM参数,分配更多内存 ❌ 刚刚开始以为时JVM内存设置…...

【评测】用Flux的图片文本修改的PS效果
【评测】Flux的图片文本修改的PS效果 1. 百度图库找一张有英文的图片 2. 打开https://playground.bfl.ai/image/edit上传图片 3. 输入提示词 “change brarfant to goodbeer” 图片的文字被修改了...

Ctrl+R 运行xxx.exe,发现有如下问题.
CtrlR 运行xxx.exe,发现有如下问题. (1)找不到Qt5Core.all,Qt5Cored.dll,Qt5Gui.dll,Qt5Guid.dll,Qt5Widgets.all,Qt5Widgetsd.dll? (2)之后找不到libwinpthread-1.dll 从这个目录拷贝相应的库到运行xx.exe目录下 方法二:将库路径添加到系统PATH环境变量里: 在Path中添加路…...
Linux中shell编程表达式和数组讲解
一、表达式 1.1 测试表达式 样式1: test 条件表达式 样式2: [ 条件表达式 ] 注意:以上两种方法的作用完全一样,后者为常用。但后者需要注意方括号[、]与条件表达式之间至少有一个空格。test跟 [] 的意思一样条件成立,状态返回值是0条件不成…...

VR视频制作有哪些流程?
VR视频制作流程知识 VR视频制作,作为融合了创意与技术的复杂制作过程,涵盖从初步策划到最终呈现的多个环节。在这个过程中,我们可以结合众趣科技的产品,解析每一环节的实现与优化,揭示背后的奥秘。 VR视频制作有哪些…...

【大模型LLM学习】Flash-Attention的学习记录
【大模型LLM学习】Flash-Attention的学习记录 0. 前言1. flash-attention原理简述2. 从softmax到online softmax2.1 safe-softmax2.2 3-pass safe softmax2.3 Online softmax2.4 Flash-attention2.5 Flash-attention tiling 0. 前言 Flash Attention可以节约模型训练和推理时间…...
TeamCity Agent 配置完整教程(配合 Docker Compose 快速部署)
在《使用 Docker Compose 从零部署 TeamCity PostgreSQL(详细新手教程)》中,我们成功部署了 TeamCity Server 和数据库服务。但要真正运行构建任务,还需要至少一个 Build Agent(构建代理)。 本教程将继续…...

第2天:认识LSTM
🍨 本文为🔗365天深度学习训练营 中的学习记录博客🍖 原作者:K同学啊 目标 具体实现 (一)环境 语言环境:Python 3.10 编 译 器: PyCharm 框 架: pytorch (二)具体步骤…...

动态规划 熟悉30题 ---上
本来是要写那个二维动态规划嘛,但是我今天在问题时候,一个大佬就把他初一时候教练让他练dp的30题发出来了(初一,啊虽然知道计算机这一专业,很多人从小就学了,但是我每次看到一些大佬从小学还是会很羡慕吧或…...