赌徒

.<!--blogscript--><!DOCTYPE html><html><head><meta charset="utf-8"/><meta name="viewport"content="width=device-width"/><title>蔷薇赌徒</title><style>html,body{padding:0;margin:0}.fullBox{height:100%;width:100%;position:absolute;top:0;left:0;background:rgb(224,224,224)}.contentItemBgicon{background:#3c3c3c;height:40px;width:100%;line-height:40px;padding:0 64px 0 24px;box-shadow:0 0 1px rgba(0,0,0,0.12),0 1px 1px rgba(0,0,0,0.24);color:#fff;box-sizing:border-box}.contentItemBgiconText{font-size:16px!important;opacity:.7;font-weight:bold;margin-left:24px;height:100%;line-height:40px;display:inline;vertical-align:top}.bgBox{overflow:auto;padding:12px}.neicon{line-height:24px;box-shadow:0 0 1px rgba(0,0,0,0.12),0 1px 1px rgba(0,0,0,0.24);padding:24px;float:left;display:flex;background-color:white;font-weight:bold}.neicon>span{opacity:.56}.neitext{width:100%;height:100px;padding:24px;padding-bottom:250px;box-sizing:border-box;font-weight:bold;font-size:16px!important;line-height:26px;box-shadow:0 0 1px rgba(0,0,0,0.12),0 1px 1px rgba(0,0,0,0.24);border:none}.Btns{width:100%;position:absolute;bottom:0}.Btns>button{display:block;width:50%;float:left;height:40px;font-weight:bold;transition:opacity 0.2s;border:none;box-shadow:0 0 1px rgba(0,0,0,0.12),0 1px 1px rgba(0,0,0,0.24)}.Btns>button:hover{opacity:.5}.mainBtn:active{opacity:.3}.mes{background-color:white;position:absolute;bottom:76px;margin:0 auto;left:50%;transform:translate(-50%,0);padding:24px 24px;box-shadow:rgba(0,0,0,0.12)0px 0px 1px,rgba(0,0,0,0.24)0px 1px 1px;overflow:hidden;font-weight:bold;font-size:17px;color:rgba(0,0,0,0.54);display:none}</style></head><body><div class="fullBox"><div class="contentItemBgicon"><span class="contentItemBgiconText">运气</span></div><div class="bgBox"><div style="float:left;clear:both;width:100%;padding:0 12px;margin:12px 0;box-sizing:border-box;"><div class="neicon"><span>您有50%的概率会赢</span></div><div class="neicon"><span>余额:<span id="yue"></span>元</span></div><div class="neicon"><span>余额:<span id="zeng"style="text-align:center;display:inline-block;min-width:54px;">--</span>元</span></div></div><div style="float:left;padding:12px;box-sizing:border-box;width:100%;"><input class="neitext"spellcheck="false"autocomplete="off"id="zhu"placeholder="请输入押注的金额 . . ."min="10"maxlength="9"type="number"/></div></div><div class="Btns"><button id="ces"style="background: white;color:#3C3C3C">概率测试</button><button id="ya"style="background: #3c3c3c;color: white;">下注</button></div></div><div id="mes"class="mes"></div><script>var money=5000;var yue=document.getElementById("yue");var zhu=document.getElementById("zhu");var mes=document.getElementById("mes");var zeng=document.getElementById("zeng");yue.innerHTML=money;zhu.addEventListener("keypress",function(event){if(event.keyCode==13)ya.click()})document.getElementById("ya").addEventListener("click",function(){value=zhu.value;if(value<10){t="压注金额必需大于等于10!"}else{if(money<value){t="您的余额不足!"}else{t='';money-=value;zeng.innerHTML='<span style="color:red;">-'+value+'</span>';if(ran02()){money+=2*value;zeng.innerHTML='<span style="color:green;">+'+value+'</span>'}}}yue.innerHTML=money;if(t){mes.innerHTML=t;mes.style.display='block';setTimeout(function(){mes.style.display='none'},2000)}zhu.value='';zhu.focus()})function ran01(){var now=new Date();return now.getMilliseconds()%2}function ran02(){if(Math.round(Math.random())){return 1}else{return 0}}document.getElementById("ces").addEventListener("click",function(){var sheng=0;for(var i=0;i<20000;i++){sheng+=ran02()}document.getElementById("ces").innerHTML='概率测试2w次:'+sheng+'胜'})function autodu(){var jine=10;var bian=0;setInterval(function(){bian-=document.getElementById("yue").innerHTML},500)}</script></body></html><!--/blogscript-->

猜你喜欢

转载自www.cnblogs.com/midic/p/12387937.html