TWIG
<script src="/files/1043097/jquery.js"></script> <script src="/files/1091621/cookies.js"></script> <script> $(function(){ var size,game=0,ref='main.php?id=ch_topic_h&uid=225683'; function coinRun(){ coin=parseInt(getCookie('tien'))*1; $('#MAD_coin').html(coin); } coinRun(); var photo='{{api.u.get(api.user_id).profilephotourl}}'; //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','-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','padding:0px;margin:0px;') if(size=='Phone'){ $('#MAD_html').attr('style','padding:0px; margin:0px; background:#940800;cursor: default; zoom:0.7;position:fixed;top:-100px;left:-100px;right:-100px;bottom:-100px;'); }else{ $('#MAD_html').attr('style','padding:0px; margin:0px; background:#940800;cursor: default;position:fixed;top:-100px;left:-100px;right:-100px;bottom:-100px;'); } $('#MAD_body').attr('style','background-image:url("files/1043097/bgs.png"); -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;position:fixed;top:0px;left:0px;right:0px;bottom:0px;'); $('#MAD_main').attr('style','max-width:620px;height:100%;margin:auto;'); $('#MAD_exit').attr('style','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','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','background-image: url("files/1043097/robots.png"); width: 92px;height: 111px; position: absolute;top: -40px;left: 50%;margin-left: -55px;border-radius: 12px;box-shadow: 0px 0px 5px 0px #000, 0px 0px 10px 0px #000 inset;'); $('#MAD_robota').attr('style','background-image: url("files/1043097/robots.png"); width: 92px;height: 111px; position: absolute;top: 25%;left: 2%;margin-left: -55px;border-radius: 12px;box-shadow: 0px 0px 5px 0px #000, 0px 0px 10px 0px #000 inset;'); $('#MAD_robotb').attr('style','background-image: url("files/1043097/robots.png"); width: 92px;height: 111px; position: absolute;top: 25%;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','background-image: url("files/1043097/robots.png"); width: 92px;height: 111px; position: absolute;top: 70%;left: 50%;margin-left: -55px;border-radius: 12px;box-shadow: 0px 0px 5px 0px #000, 0px 0px 10px 0px #000 inset;'); $('#MAD_screen').attr('style','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,#MAD_name_robota,#MAD_name_robotb').attr('style','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','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','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','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','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_robota').attr('style','margin-top: -60px;margin-left: 100px;color: #FFC107;font-weight: bold;font-family: cursive;text-align: center;text-shadow: 0px 0px 1px #7D7C25;width:140px;'); $('#MAD_card_robotb').attr('style','margin-top: -60px;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','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;text-align:right;'); $('#MAD_chat_robot').attr('style','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_chat_robota').attr('style','margin-top: -100px;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_chat_robotb').attr('style','margin-top: -100px;margin-left: -120px;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','position: absolute;left: 50%;top: 50%;width: 220px;margin-left: -110px; margin-top: -20px;'); $('#MAD_lose_game,#MAD_win_game,#MAD_hoa_game').attr('style','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_start').attr('style','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;'); $('#MAD_coin_select').attr('style','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','background: url("files/1067753/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;'); //Program $('#MAD_name_robot').html('OscarPham'); $('#MAD_name_user').html('[nick]'); $('#MAD_photo_user').attr('style','background: url("'+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 $('#MAD_start').click(function(){ coinVal=parseInt($('#MAD_coin_select').val()); if(coin-coinVal>=0){ $('#MAD_start_game').hide(); var names=['A','2','3','4','5','6','7','8','9','10']; var vars=['C','H','D','S']; var card1a=Math.floor((Math.random() * 9)+1); var card2a=Math.floor((Math.random() * 9)+1); var card3a=Math.floor((Math.random() * 9)+1); var card1b=Math.floor((Math.random() * 9)+1); var card2b=Math.floor((Math.random() * 9)+1); var card3b=Math.floor((Math.random() * 9)+1); var card1c=Math.floor((Math.random() * 9)+1); var card2c=Math.floor((Math.random() * 9)+1); var card3c=Math.floor((Math.random() * 9)+1); var card1d=Math.floor((Math.random() * 9)+1); var card2d=Math.floor((Math.random() * 9)+1); var card3d=Math.floor((Math.random() * 9)+1); var robotdiem=(10+card1b+card2b+card3b); var robotadiem=(10+card1c+card2c+card3c); var robotbdiem=(10+card1d+card2d+card3d); var userdiem=(10+card1a+card2a+card3a); setTimeout(function(){ $('#MAD_card_robot').append('<img src="files/1043097/'+(names[card1b-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robota').append('<img src="files/1043097/'+(names[card1c-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_user').append('<img src="files/1043097/'+(names[card1a-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robotb').append('<img src="files/1043097/'+(names[card1d-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robot').append('<img src="files/1043097/'+(names[card2b-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robota').append('<img src="files/1043097/'+(names[card2c-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_user').append('<img src="files/1043097/'+(names[card2a-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robotb').append('<img src="files/1043097/'+(names[card2d-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robot').append('<img src="files/1043097/'+(names[card3b-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robota').append('<img src="files/1043097/'+(names[card3c-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_user').append('<img src="files/1043097/'+(names[card3a-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); setTimeout(function(){ $('#MAD_card_robotb').append('<img src="files/1043097/'+(names[card3d-1])+vars[Math.floor((Math.random()*4))]+'.jpg" style="box-shadow: 0px 0px 5px 0px #000;border-radius: 6px;">'); //count setTimeout(function(){ $('#MAD_chat_robot').html((robotdiem+'').substr(1,1)+' điểm'); setTimeout(function(){ $('#MAD_chat_robota').html((robotadiem+'').substr(1,1)+' điểm'); setTimeout(function(){ $('#MAD_chat_user').html((userdiem+'').substr(1,1)+' điểm'); setTimeout(function(){ $('#MAD_chat_robotb').html((robotbdiem+'').substr(1,1)+' điểm'); setTimeout(function(){ $('#MAD_chat_robot').html(''); setTimeout(function(){ $('#MAD_chat_robota').html(''); setTimeout(function(){ $('#MAD_chat_user').html(''); setTimeout(function(){ $('#MAD_chat_robotb').html(''); //This Win or Lose setTimeout(function(){ if((userdiem+'').substr(1,1)>(robotdiem+'').substr(1,1)){ $('#MAD_win_game').show(); setTimeout(function(){ $('#MAD_win_game').hide(); $('#MAD_chat_user').html('Yeah! Lại thêm '+coinVal+' xu nữa!'); setTimeout(function(){ $('#MAD_chat_user').html(''); endgame(); $.post(ref,{text:' Đã thắng trong [a=/main.php?f=3444759&game=baicao]Game bài cào[/a]! (+'+coinVal+' xu)'}); setCookie('tien',parseInt(coin)+parseInt(coinVal),3600); },1500); },2000); }else if((userdiem+'').substr(1,1)<(robotdiem+'').substr(1,1)){ $('#MAD_lose_game').show(); setTimeout(function(){ $('#MAD_lose_game').hide(); $('#MAD_chat_user').html('Huhuhu! Mất '+coinVal+' xu rồi!'); setTimeout(function(){ $('#MAD_chat_user').html(''); endgame(); $.post(ref,{text:'Đã thua trong game bài cào[a=/main.php?f=3444759&game=baicao^]Game bài cào[/a] ! (-'+coinVal+' xu)'}); setCookie('tien',parseInt(coin)-parseInt(coinVal),3600); },1500); },2000); }else{ $('#MAD_hoa_game').show(); setTimeout(function(){ $('#MAD_hoa_game').hide(); $('#MAD_chat_user').html('Hòa rồi!'); setTimeout(function(){ $('#MAD_chat_user').html(''); endgame(); },1500); },2000); } if((robotadiem+'').substr(1,1)>(robotdiem+'').substr(1,1)){ setTimeout(function(){ $('#MAD_chat_robota').html('Yeah! Lại thêm 5000 xu nữa!'); setTimeout(function(){ $('#MAD_chat_robota').html(''); },1500); },2000); }else if((robotadiem+'').substr(1,1)<(robotdiem+'').substr(1,1)){ setTimeout(function(){ $('#MAD_chat_robota').html('Huhuhu! Mất 5000 xu rồi!'); setTimeout(function(){ $('#MAD_chat_robota').html(''); endgame(); },1500); },2000); }else{ setTimeout(function(){ $('#MAD_chat_robota').html('Hòa rồi!'); setTimeout(function(){ $('#MAD_chat_robota').html(''); endgame(); },1500); },1000); } if((robotbdiem+'').substr(1,1)>(robotdiem+'').substr(1,1)){ setTimeout(function(){ $('#MAD_chat_robotb').html('Yeah! Lại thêm 10000 xu nữa!'); setTimeout(function(){ $('#MAD_chat_robotb').html(''); },1500); },2000); }else if((robotbdiem+'').substr(1,1)<(robotdiem+'').substr(1,1)){ setTimeout(function(){ $('#MAD_chat_robotb').html('Huhuhu! Mất 5000 xu rồi!'); setTimeout(function(){ $('#MAD_chat_robotb').html(''); endgame(); },1500); },2000); }else{ setTimeout(function(){ $('#MAD_chat_robotb').html('Hòa rồi!'); setTimeout(function(){ $('#MAD_chat_robotb').html(''); endgame(); },1500); },2000); } }) },1000); },1000); },1000); },1000); },1000); },1000); },1000); },1000); },700); },700); },700); },700); },700); },700); },700); },700); },700); },700); },700); },700); }else{ alert('Số dư của bạn không đủ!'+(coin-coinVal)); coinRun(); } }); function endgame(){ $('#MAD_card_user').html(''); $('#MAD_card_robot').html(''); $('#MAD_card_robota').html(''); $('#MAD_card_robotb').html(''); $('#MAD_start_game').show(); coinRun(); } $('#MAD_exit').click(function(){ location='main.php?f=3444759'; }) }) </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_name_robot"></div> <div id="MAD_card_robot"></div> <div id="MAD_chat_robot"></div> </div> <div id="MAD_robota"> <div id="MAD_name_robota">Bim</div> <div id="MAD_card_robota"></div> <div id="MAD_chat_robota">Đánh đi! HEHEHE</div> </div> <div id="MAD_robotb"> <div id="MAD_name_robotb">Root</div> <div id="MAD_card_robotb"></div> <div id="MAD_chat_robotb">Chơi thêm ván nữa! Haiz</div> </div> <div id="MAD_start_game"><select id="MAD_coin_select"><option value="1000">1000</option><option value="2000">2000</option><option value="5000">5000</option><option value="10000">10000</option></select><div id="MAD_start">Start</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> </div> <div id="MAD_screen"></div> </div> </div>
Cái này thêm vào twig nhé
Dòng thứ 5 các bạn thay ref='main.php?id=ch_topic_h&uid=225683'; thành shoutbox wap bạn là có thể báo ra trang sb rồi.
cái này sử dụng với 2 game kia(cùng tiền lun nhé).
![[OFF]](/assets/images/off.gif)