1 Code này mà có 1 thằng xin tui quá trời đố mn là ai.
TWIG
{%if api.r.get('game')=='baucua'%}{% if api.user_id%} <script src="/files/1043097/cookies.js"></script> <meta charset="UTF-8"> <style> .focus{ position: relative; animation: myAnimation 0.7s ease-out infinite; -webkit-transition: all 0.3s; } @keyframes myAnimation { 0% {top: 0px;} 25% {top: -2px;} 50% {top: -3px;} 75% {top: -2px;} 100% {top: 0px;} } @-moz-keyframes myAnimation { 0% {top: 0px;} 50% {top: -3px;} 100% {top: 0px;} } @-webkit-keyframes myAnimation { 0% {top: 0px;} 50% {top: -3px;} 100% {top: 0px;} } @-o-keyframes myAnimation { 0% {top: 0px;} 50% {top: -3px;} 100% {top: 0px;} } #huu img,#bau img,#ga img,#ca img,#cua img,#tom img{ position: absolute; margin-top: 25px; margin-left: 25px; } #MAD_photo_robot{ width: 83px; height: 72px; position: absolute; top: 20px; left: 4px; box-shadow: 0px 0px 23px 0px #7E877A inset; border-radius: 12px;} div,img{display:block} </style> <script> $(function(){ var size,game=0; function coinRun(){ coin=parseInt(getCookie('tien')); $('#MAD_coin').html(coin); } coinRun(); var photo='user.png'; //System game if(coin==0 || !coin){ setCookie('tien',1500,3600); coinRun(); } screenWidth=window.screen.width; screenHeight=window.screen.height; $('#MAD_screen').html(screenWidth+' x '+screenHeight); if(screenWidth<1366 && screenHeight<768){ size='Phone'; if(screenWidth>240 && screenHeight>240){ var returnValue = confirm("Nhấn ok để chuyển sang chế độ vừa màn hình để tránh bị khuất hoặc xoay màn hình thủ công nếu không được"); if(returnValue == true) { $('html').attr('style','display:block;-webkit-transform: rotate(450deg);-moz-transform: rotate(450deg);-ms-transform: rotate(450deg);transform: rotate(450deg);width: 100%;height: 100%;') } } }else{ size='PC'; } //Start Game function $('body').attr('style','display:block;padding:0px;margin:0px;') if(size=='Phone'){ $('#MAD_html').attr('style','display:block;padding:0px; margin:0px; background:#940800;cursor: default; zoom:0.7;position:fixed;left:-100px;right:-100px;top:-100px;bottom:-100px;'); }else{ $('#MAD_html').attr('style','display:block;padding:0px; margin:0px; background:#940800;cursor: default;position:fixed;left:-100px;right:-100px;top:-100px;bottom:-100px;'); } $('#MAD_body').attr('style','display:block;background-image:url("/files/1043097/bgs.png"); -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;position:fixed;left:-100px;right:-100px;top:-100px;bottom:-100px;'); $('#MAD_main').attr('style','display:block;max-width:620px;height:100%;margin:auto;'); $('#MAD_exit').attr('style','display:block;background-image:url("/files/1043097/exits.png");width: 105px;height:40px;border-radius: 5px;box-shadow: 0px 0px 7px 1px #000, 0px 0px 5px 0px #000 inset; cursor: pointer;z-index: 1;position: absolute;top: 10px;'); $('#MAD_table').attr('style','display:block;background-image: url("/files/1043097/tables.png"); width: 620px;height: 276px; position: absolute; left: 50%; top: 50%; margin-top: -138px; margin-left: -310px;box-shadow: 0px 0px 10px 1px #000,0px 0px 10px 1px #000 inset;border-radius: 10px;'); $('#MAD_robot').attr('style','display:block;background-image: url("/files/1043097/robots.png"); width: 92px;height: 111px; position: absolute;top: -40px;left: 100%;margin-left: -55px;border-radius: 12px;box-shadow: 0px 0px 5px 0px #000, 0px 0px 10px 0px #000 inset;'); $('#MAD_user').attr('style','display:block;background-image: url("/files/1043097/robots.png"); width: 92px;height: 111px; position: absolute;top: 70%;left: 2%;margin-left: -55px;border-radius: 12px;box-shadow: 0px 0px 5px 0px #000, 0px 0px 10px 0px #000 inset;'); $('#MAD_screen').attr('style','display:block;background: rgba(255, 255, 255, 0.5);right:0px;top:0px;position: absolute;color: #000;padding: 2px 5px;font-family: monospace;'); $('#MAD_name_robot,#MAD_name_user').attr('style','display:block;margin-top: 95%;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;'); $('#MAD_name_nhacai').attr('style','display:block;color: red;font-weight: bold;font-family: cursive;position: absolute;text-align: center;left: 15px;text-shadow: 0px 0px 2px #FF1515;'); $('#MAD_card_user').attr('style','display:block;margin-top: -90px;margin-left: 100px;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;width:140px'); $('#MAD_card_robot').attr('style','display:block;margin-top: -90px;margin-left: -150px;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;width:140px;'); $('#MAD_card_robot').attr('style','display:block;margin-top: -90px;margin-left: -150px;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;width:140px;'); $('#MAD_chat_user').attr('style','display:block;margin-top: -165px;margin-left: 50px;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;width:140px;text-align:right;'); $('#MAD_chat_robot').attr('style','display:block;margin-top: -50px;margin-left: 100px;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;width:140px;text-align:left;'); $('#MAD_start_game').attr('style','display:block;position: absolute;left: 50%;top: 50%;width: 210px;margin-left: -105px;margin-top: -70px;'); $('#MAD_lose_game,#MAD_win_game,#MAD_hoa_game').attr('style','display:block;position: absolute; left: 50%; top: 50%; width: 220px; margin-left: -110px; margin-top: -20px; text-align: center;font-size: 30px;font-weight: bold;color: #FF5722;background: #fff;border-radius: 30px;display:none;'); $('#MAD_play').attr('style','display:block;background: -webkit-linear-gradient(#EDD23C, #CDB000);padding: 8px 20px 6px 20px;font-family: sans-serif;font-weight: bold;color: #533B05;border: 1px solid #55490C;display: inline-block;border-radius: 3px;box-shadow: 0px 1px 0px 0px #FFEE95 inset, 0px 1px 1px 0px #5B4F00;text-shadow: 0px 1px 0px #F5ECC3;cursor: pointer;outline: 0px;text-transform: uppercase;margin: 3px 0px;position: relative;top: -10px;'); $('#MAD_coin_select').attr('style','display:block;width: 120px;background: -webkit-linear-gradient(#EDD23C, #CDB000);padding: 9px 20px 6px 20px;font-family: sans-serif;font-weight: bold;color: #533B05;border: 1px solid #55490C;display: inline-block;border-radius: 3px;box-shadow: 0px 1px 0px 0px #FFEE95 inset, 0px 1px 1px 0px #5B4F00;text-shadow: 0px 1px 0px #F5ECC3;cursor: pointer;outline: 0px;text-transform: uppercase;margin: 3px 2px;'); $('#MAD_coin').attr('style','display:block;background: url("/files/1043097/money.png") left center no-repeat;position: absolute;font-size: 16px;font-family: monospace;padding: 1px 1px 1px 15px;border-radius: 4px;top:0px;color: #FFED00;font-weight: bold;text-shadow: 0px 0px 1px #956204;'); $('#huu').attr('style','display:block;background: url("/files/1043097/huu.png");width:60px;height:60px;display: inline-block;background-size: 100% 100%;border-radius: 4px;box-shadow: 0px 1px 5px 1px #000, 0px 0px 6px 0px #000 inset;margin: 5px;cursor:pointer;'); $('#bau').attr('style','display:block;background: url("/files/1043097/bau.png");width:60px;height:60px;display: inline-block;background-size: 100% 100%;border-radius: 4px;box-shadow: 0px 1px 5px 1px #000, 0px 0px 6px 0px #000 inset;margin: 5px;cursor:pointer;'); $('#ga').attr('style','display:block;background: url("/files/1043097/ga.png");width:60px;height:60px;display: inline-block;background-size: 100% 100%;border-radius: 4px;box-shadow: 0px 1px 5px 1px #000, 0px 0px 6px 0px #000 inset;margin: 5px;cursor:pointer;'); $('#ca').attr('style','display:block;background: url("/files/1043097/ca.png");width:60px;height:60px;display: inline-block;background-size: 100% 100%;border-radius: 4px;box-shadow: 0px 1px 5px 1px #000, 0px 0px 6px 0px #000 inset;margin: 5px;cursor:pointer;'); $('#cua').attr('style','display:block;background: url("/files/1043097/cua.png");width:60px;height:60px;display: inline-block;background-size: 100% 100%;border-radius: 4px;box-shadow: 0px 1px 5px 1px #000, 0px 0px 6px 0px #000 inset;margin: 5px;cursor:pointer;'); $('#tom').attr('style','display:block;background: url("/files/1043097/tom.png");width:60px;height:60px;display: inline-block;background-size: 100% 100%;border-radius: 4px;box-shadow: 0px 1px 5px 1px #000, 0px 0px 6px 0px #000 inset;margin: 5px;cursor:pointer;'); $('#MAD_select_c').attr('style','display:block;position: absolute;top: 90%;margin-left: 60px;cursor: pointer;'); //Program $('#MAD_name_robot').html('ChiOn'); $('#MAD_name_user').html('[nick]'); $('#MAD_photo_user').attr('style','display:block;background: url("/files/1043097/'+photo+'");width: 83px;height: 72px;position: absolute;top: 20px;left: 4px;background-size: 100%;box-shadow: 0px 0px 23px 0px #7E877A inset; border-radius: 12px;'); //Play var select,chon={},so={}; chon[0]=''; chon[1]=''; chon[2]=''; so[0]=''; so[1]=''; so[2]=''; var text=['huu','bau','ga','ca','cua','tom']; var cuoc=['5000','10000','20000','50000']; select='5000'; $('#'+select).addClass('focus'); $('.select').click(function(){ if(select=='' || !select){ $(this).addClass('focus'); select=$(this).attr('id'); }else{ $(this).addClass('focus'); $('#'+select).removeClass('focus'); select=$(this).attr('id'); } }); $('#huu,#bau,#ga,#ca,#cua,#tom').click(function(){ if(select){ if(coin>=5000){ if(chon[0]=='' || !chon[0]){ if(coin-select>=0){ so[0]=select; chon[0]=$(this).attr('id'); $(this).html('<img src="/files/1043097/'+select+'.png">'); }else{ alert('Bạn không đủ tiền cược!'); } }else if(chon[1]=='' || !chon[1]){ if(coin-select-so[0]>=0){ chon[1]=$(this).attr('id'); so[1]=select; if(chon[1]!=chon[0]){ $(this).html('<img src="/files/1043097/'+select+'.png">'); }else{ so[1]=''; chon[1]=''; alert('Sao chọn con này hoài vậy?'); } }else{ alert('Bạn không đủ tiền cược!'); } }else if(chon[2]=='' || !chon[2]){ if(coin-select-so[0]-so[1]>=0){ chon[2]=$(this).attr('id'); so[2]=select; if(chon[2]!=chon[0] && chon[2]!=chon[1]){ $(this).html('<img src="/files/1043097/'+select+'.png">'); }else{ so[2]=''; chon[2]=''; alert('Sao chọn con này hoài vậy?'); } }else{ alert('Bạn không đủ tiền cược!'); } }else{ alert('Bạn cứ chọn hoài, lắm chọn thế?'); } }else{ alert('Không đủ tiên rồi') } }else{ alert('Bạn chưa chọn mức cược!'); } }) $('#MAD_play').click(function(){ var coin_cuoc=0; if(chon[0] || chon[1] || chon[2]){ $('#MAD_photo_robot').attr('style','display:block;background: url("/files/1043097/lacbaucua.gif");background-size: 100% 100%;'); var rand=Math.floor((Math.random() * 6)+1); setTimeout(function(){ $('#MAD_photo_robot').attr('style','display:block;background: url("/files/1043097/'+text[rand-1]+'.png");background-size: 100% 100%;'); if(chon[0]==text[rand-1]){ coin_cuoc=coin_cuoc+(parseInt(so[0])*3); }else{ coin_cuoc=coin_cuoc-so[0]; } if(chon[1]){ if(chon[1]==text[rand-1]){ coin_cuoc=coin_cuoc+(parseInt(so[1])*3); }else{ coin_cuoc=coin_cuoc-so[1]; } } if(chon[2]){ if(chon[2]==text[rand-1]){ coin_cuoc=coin_cuoc+(parseInt(so[2])*3); }else{ coin_cuoc=coin_cuoc-so[2]; } } if(coin_cuoc>0){ $('#MAD_chat_user').html('Hôm nay hên thật +'+coin_cuoc+' xu'); }else{ $('#MAD_chat_user').html('Hôm nay thật là buồn '+coin_cuoc+' xu') } setCookie('tien',parseInt(coin)+parseInt(coin_cuoc),3600); setTimeout(function(){ endgame(); },1500); },2000); }else{ alert('Bạn chưa đặt cược mà!'); } }) function endgame(){ $('#MAD_chat_user').html(''); $('#MAD_photo_robot').attr('style','display:block;'); $('#huu,#bau,#ga,#ca,#cua,#tom').html(''); chon[0]=''; chon[1]=''; chon[2]=''; cuoc[0]=''; cuoc[1]=''; cuoc[2]=''; coinRun(); } }) </script> <div id="MAD_html"> <div id="MAD_body"> <div id="MAD_main"> <div id="MAD_exit"> </div> <div id="MAD_table"> <div id="MAD_robot"> <div id="MAD_name_nhacai">Nhà cái</div> <div id="MAD_photo_robot"></div> <div id="MAD_name_robot"></div> <div id="MAD_card_robot"></div> <div id="MAD_chat_robot"></div> </div> <div id="MAD_start_game"><div id="huu"></div><div id="bau"></div><div id="ga"></div><br><div id="ca"></div><div id="cua"></div><div id="tom"></div></div> <div id="MAD_lose_game">Thua Rồi</div> <div id="MAD_hoa_game">Hòa Rồi</div> <div id="MAD_win_game">Thắng Rồi</div> <div id="MAD_user"> <div id="MAD_photo_user"></div> <div id="MAD_name_user"></div> <div id="MAD_card_user"></div> <div id="MAD_chat_user"></div> <div id="MAD_coin"></div> </div> <div id="MAD_select_c"> <img src="/files/1043097/5000.png" class="select" id="5000"> <img src="/files/1043097/10000.png" class="select" id="10000"> <img src="/files/1043097/20000.png" class="select" id="20000"> <img src="/files/1043097/50000.png" class="select" id="50000"> <div id="MAD_play">Chơi ngay</div> </div> </div> </div> <div id="MAD_screen"></div> </div> </div> {%else%} <div class="error">Chưa đăng nhập wap mà ERROR</div> {%endif%}{%endif%}
Like đi mn.