年会抽奖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部分的绕组的绕组匝数为…...
使用docker在3台服务器上搭建基于redis 6.x的一主两从三台均是哨兵模式
一、环境及版本说明 如果服务器已经安装了docker,则忽略此步骤,如果没有安装,则可以按照一下方式安装: 1. 在线安装(有互联网环境): 请看我这篇文章 传送阵>> 点我查看 2. 离线安装(内网环境):请看我这篇文章 传送阵>> 点我查看 说明:假设每台服务器已…...
【根据当天日期输出明天的日期(需对闰年做判定)。】2022-5-15
缘由根据当天日期输出明天的日期(需对闰年做判定)。日期类型结构体如下: struct data{ int year; int month; int day;};-编程语言-CSDN问答 struct mdata{ int year; int month; int day; }mdata; int 天数(int year, int month) {switch (month){case 1: case 3:…...
Qt/C++开发监控GB28181系统/取流协议/同时支持udp/tcp被动/tcp主动
一、前言说明 在2011版本的gb28181协议中,拉取视频流只要求udp方式,从2016开始要求新增支持tcp被动和tcp主动两种方式,udp理论上会丢包的,所以实际使用过程可能会出现画面花屏的情况,而tcp肯定不丢包,起码…...
Admin.Net中的消息通信SignalR解释
定义集线器接口 IOnlineUserHub public interface IOnlineUserHub {/// 在线用户列表Task OnlineUserList(OnlineUserList context);/// 强制下线Task ForceOffline(object context);/// 发布站内消息Task PublicNotice(SysNotice context);/// 接收消息Task ReceiveMessage(…...
spring:实例工厂方法获取bean
spring处理使用静态工厂方法获取bean实例,也可以通过实例工厂方法获取bean实例。 实例工厂方法步骤如下: 定义实例工厂类(Java代码),定义实例工厂(xml),定义调用实例工厂ÿ…...
从零开始打造 OpenSTLinux 6.6 Yocto 系统(基于STM32CubeMX)(九)
设备树移植 和uboot设备树修改的内容同步到kernel将设备树stm32mp157d-stm32mp157daa1-mx.dts复制到内核源码目录下 源码修改及编译 修改arch/arm/boot/dts/st/Makefile,新增设备树编译 stm32mp157f-ev1-m4-examples.dtb \stm32mp157d-stm32mp157daa1-mx.dtb修改…...
JDK 17 新特性
#JDK 17 新特性 /**************** 文本块 *****************/ python/scala中早就支持,不稀奇 String json “”" { “name”: “Java”, “version”: 17 } “”"; /**************** Switch 语句 -> 表达式 *****************/ 挺好的ÿ…...
tree 树组件大数据卡顿问题优化
问题背景 项目中有用到树组件用来做文件目录,但是由于这个树组件的节点越来越多,导致页面在滚动这个树组件的时候浏览器就很容易卡死。这种问题基本上都是因为dom节点太多,导致的浏览器卡顿,这里很明显就需要用到虚拟列表的技术&…...
如何在最短时间内提升打ctf(web)的水平?
刚刚刷完2遍 bugku 的 web 题,前来答题。 每个人对刷题理解是不同,有的人是看了writeup就等于刷了,有的人是收藏了writeup就等于刷了,有的人是跟着writeup做了一遍就等于刷了,还有的人是独立思考做了一遍就等于刷了。…...
VM虚拟机网络配置(ubuntu24桥接模式):配置静态IP
编辑-虚拟网络编辑器-更改设置 选择桥接模式,然后找到相应的网卡(可以查看自己本机的网络连接) windows连接的网络点击查看属性 编辑虚拟机设置更改网络配置,选择刚才配置的桥接模式 静态ip设置: 我用的ubuntu24桌…...
