Share game bầu cua, chuẩn đẹp trai

41 bài đăng
06.07.2016 / 13:55
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

1 Code này mà có 1 thằng xin tui quá trời đố mn là ai.

TWIG
  1. {%if api.r.get('game')=='baucua'%}{% if api.user_id%}
  2. <script src="/files/1043097/cookies.js"></script>
  3. <meta charset="UTF-8">
  4. <style>
  5. .focus{
  6. position: relative;
  7. animation: myAnimation 0.7s ease-out infinite;
  8. -webkit-transition: all 0.3s;
  9. }
  10. @keyframes myAnimation {
  11. 0% {top: 0px;}
  12. 25% {top: -2px;}
  13. 50% {top: -3px;}
  14. 75% {top: -2px;}
  15. 100% {top: 0px;}
  16. }
  17. @-moz-keyframes myAnimation {
  18. 0% {top: 0px;}
  19. 50% {top: -3px;}
  20. 100% {top: 0px;}
  21. }
  22. @-webkit-keyframes myAnimation {
  23. 0% {top: 0px;}
  24. 50% {top: -3px;}
  25. 100% {top: 0px;}
  26. }
  27. @-o-keyframes myAnimation {
  28. 0% {top: 0px;}
  29. 50% {top: -3px;}
  30. 100% {top: 0px;}
  31. }
  32. #huu img,#bau img,#ga img,#ca img,#cua img,#tom img{
  33. position: absolute;
  34. margin-top: 25px;
  35. margin-left: 25px;
  36. }
  37. #MAD_photo_robot{
  38. width: 83px;
  39. height: 72px;
  40. position: absolute;
  41. top: 20px;
  42. left: 4px;
  43. box-shadow: 0px 0px 23px 0px #7E877A inset;
  44. border-radius: 12px;}
  45. div,img{display:block}
  46. </style>
  47. <script>
  48. $(function(){
  49. var size,game=0;
  50. function coinRun(){
  51. coin=parseInt(getCookie('tien'));
  52. $('#MAD_coin').html(coin);
  53. }
  54. coinRun();
  55. var photo='user.png';
  56. //System game
  57. if(coin==0 || !coin){
  58. setCookie('tien',1500,3600);
  59. coinRun();
  60. }
  61. screenWidth=window.screen.width;
  62. screenHeight=window.screen.height;
  63. $('#MAD_screen').html(screenWidth+' x '+screenHeight);
  64. if(screenWidth<1366 && screenHeight<768){
  65. size='Phone';
  66. if(screenWidth>240 && screenHeight>240){
  67. 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");
  68.  
  69. if(returnValue == true)
  70. {
  71. $('html').attr('style','display:block;-webkit-transform: rotate(450deg);-moz-transform: rotate(450deg);-ms-transform: rotate(450deg);transform: rotate(450deg);width: 100%;height: 100%;')
  72. }
  73. }
  74. }else{
  75. size='PC';
  76. }
  77.  
  78. //Start Game function
  79. $('body').attr('style','display:block;padding:0px;margin:0px;')
  80. if(size=='Phone'){
  81. $('#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;');
  82. }else{
  83. $('#MAD_html').attr('style','display:block;padding:0px; margin:0px; background:#940800;cursor: default;position:fixed;left:-100px;right:-100px;top:-100px;bottom:-100px;');
  84. }
  85. $('#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;');
  86. $('#MAD_main').attr('style','display:block;max-width:620px;height:100%;margin:auto;');
  87. $('#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;');
  88. $('#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;');
  89. $('#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;');
  90. $('#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;');
  91. $('#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;');
  92. $('#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;');
  93. $('#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;');
  94. $('#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');
  95. $('#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;');
  96. $('#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;');
  97. $('#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;');
  98. $('#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;');
  99. $('#MAD_start_game').attr('style','display:block;position: absolute;left: 50%;top: 50%;width: 210px;margin-left: -105px;margin-top: -70px;');
  100. $('#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;');
  101. $('#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;');
  102. $('#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;');
  103. $('#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;');
  104. $('#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;');
  105. $('#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;');
  106. $('#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;');
  107. $('#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;');
  108. $('#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;');
  109. $('#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;');
  110. $('#MAD_select_c').attr('style','display:block;position: absolute;top: 90%;margin-left: 60px;cursor: pointer;');
  111.  
  112.  
  113. //Program
  114. $('#MAD_name_robot').html('ChiOn');
  115. $('#MAD_name_user').html('[nick]');
  116. $('#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;');
  117.  
  118. //Play
  119. var select,chon={},so={};
  120. chon[0]='';
  121. chon[1]='';
  122. chon[2]='';
  123. so[0]='';
  124. so[1]='';
  125. so[2]='';
  126. var text=['huu','bau','ga','ca','cua','tom'];
  127. var cuoc=['5000','10000','20000','50000'];
  128. select='5000';
  129. $('#'+select).addClass('focus');
  130. $('.select').click(function(){
  131. if(select=='' || !select){
  132. $(this).addClass('focus');
  133. select=$(this).attr('id');
  134. }else{
  135. $(this).addClass('focus');
  136. $('#'+select).removeClass('focus');
  137. select=$(this).attr('id');
  138. }
  139. });
  140. $('#huu,#bau,#ga,#ca,#cua,#tom').click(function(){
  141. if(select){
  142. if(coin>=5000){
  143. if(chon[0]=='' || !chon[0]){
  144. if(coin-select>=0){
  145. so[0]=select;
  146. chon[0]=$(this).attr('id');
  147. $(this).html('<img src="/files/1043097/'+select+'.png">');
  148. }else{
  149. alert('Bạn không đủ tiền cược!');
  150. }
  151. }else if(chon[1]=='' || !chon[1]){
  152. if(coin-select-so[0]>=0){
  153. chon[1]=$(this).attr('id');
  154. so[1]=select;
  155. if(chon[1]!=chon[0]){
  156. $(this).html('<img src="/files/1043097/'+select+'.png">');
  157. }else{
  158. so[1]='';
  159. chon[1]='';
  160. alert('Sao chọn con này hoài vậy?');
  161. }
  162. }else{
  163. alert('Bạn không đủ tiền cược!');
  164. }
  165. }else if(chon[2]=='' || !chon[2]){
  166. if(coin-select-so[0]-so[1]>=0){
  167. chon[2]=$(this).attr('id');
  168. so[2]=select;
  169. if(chon[2]!=chon[0] && chon[2]!=chon[1]){
  170. $(this).html('<img src="/files/1043097/'+select+'.png">');
  171. }else{
  172. so[2]='';
  173. chon[2]='';
  174. alert('Sao chọn con này hoài vậy?');
  175. }
  176. }else{
  177. alert('Bạn không đủ tiền cược!');
  178. }
  179. }else{
  180. alert('Bạn cứ chọn hoài, lắm chọn thế?');
  181. }
  182. }else{
  183. alert('Không đủ tiên rồi')
  184. }
  185. }else{
  186. alert('Bạn chưa chọn mức cược!');
  187. }
  188. })
  189. $('#MAD_play').click(function(){
  190. var coin_cuoc=0;
  191. if(chon[0] || chon[1] || chon[2]){
  192. $('#MAD_photo_robot').attr('style','display:block;background: url("/files/1043097/lacbaucua.gif");background-size: 100% 100%;');
  193. var rand=Math.floor((Math.random() * 6)+1);
  194. setTimeout(function(){
  195. $('#MAD_photo_robot').attr('style','display:block;background: url("/files/1043097/'+text[rand-1]+'.png");background-size: 100% 100%;');
  196. if(chon[0]==text[rand-1]){
  197. coin_cuoc=coin_cuoc+(parseInt(so[0])*3);
  198. }else{
  199. coin_cuoc=coin_cuoc-so[0];
  200. }
  201. if(chon[1]){
  202. if(chon[1]==text[rand-1]){
  203. coin_cuoc=coin_cuoc+(parseInt(so[1])*3);
  204. }else{
  205. coin_cuoc=coin_cuoc-so[1];
  206. }
  207. }
  208. if(chon[2]){
  209. if(chon[2]==text[rand-1]){
  210. coin_cuoc=coin_cuoc+(parseInt(so[2])*3);
  211. }else{
  212. coin_cuoc=coin_cuoc-so[2];
  213. }
  214. }
  215. if(coin_cuoc>0){
  216. $('#MAD_chat_user').html('Hôm nay hên thật +'+coin_cuoc+' xu');
  217. }else{
  218. $('#MAD_chat_user').html('Hôm nay thật là buồn '+coin_cuoc+' xu')
  219. }
  220. setCookie('tien',parseInt(coin)+parseInt(coin_cuoc),3600);
  221. setTimeout(function(){
  222. endgame();
  223. },1500);
  224. },2000);
  225. }else{
  226. alert('Bạn chưa đặt cược mà!');
  227. }
  228. })
  229. function endgame(){
  230. $('#MAD_chat_user').html('');
  231. $('#MAD_photo_robot').attr('style','display:block;');
  232. $('#huu,#bau,#ga,#ca,#cua,#tom').html('');
  233. chon[0]='';
  234. chon[1]='';
  235. chon[2]='';
  236. cuoc[0]='';
  237. cuoc[1]='';
  238. cuoc[2]='';
  239. coinRun();
  240. }
  241. })
  242. </script>
  243. <div id="MAD_html">
  244. <div id="MAD_body">
  245. <div id="MAD_main">
  246. <div id="MAD_exit">
  247. </div>
  248. <div id="MAD_table">
  249. <div id="MAD_robot">
  250. <div id="MAD_name_nhacai">Nhà cái</div>
  251. <div id="MAD_photo_robot"></div>
  252. <div id="MAD_name_robot"></div>
  253. <div id="MAD_card_robot"></div>
  254. <div id="MAD_chat_robot"></div>
  255. </div>
  256.  
  257. <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>
  258.  
  259. <div id="MAD_lose_game">Thua Rồi</div>
  260. <div id="MAD_hoa_game">Hòa Rồi</div>
  261. <div id="MAD_win_game">Thắng Rồi</div>
  262.  
  263. <div id="MAD_user">
  264. <div id="MAD_photo_user"></div>
  265. <div id="MAD_name_user"></div>
  266. <div id="MAD_card_user"></div>
  267. <div id="MAD_chat_user"></div>
  268. <div id="MAD_coin"></div>
  269. </div>
  270. <div id="MAD_select_c">
  271. <img src="/files/1043097/5000.png" class="select" id="5000">
  272. <img src="/files/1043097/10000.png" class="select" id="10000">
  273. <img src="/files/1043097/20000.png" class="select" id="20000">
  274. <img src="/files/1043097/50000.png" class="select" id="50000">
  275. <div id="MAD_play">Chơi ngay</div>
  276. </div>
  277. </div>
  278. </div>
  279.  
  280. <div id="MAD_screen"></div>
  281. </div>
  282. </div>
  283. {%else%}
  284. <div class="error">Chưa đăng nhập wap mà ERROR</div>
  285. {%endif%}{%endif%}

Like đi mn.

Đã chỉnh sửa. mad (06.07.2016 / 13:56)
06.07.2016 / 13:58
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

mình thì luôn thích chế game nhưng game bên hayshare của thằng kia thì mn biết là của ai rùi nhể?

06.07.2016 / 13:58
ga_bong
Bài đăng: 519
Member
♔ Lovemoon.wap.mu ♔

vâng! quá chuẩn

bác mad rất đẹp zai và khoai to :v

06.07.2016 / 14:03
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

sao bác biết tôi thế, hic chắc bác rình tôi

06.07.2016 / 14:05
ga_bong
Bài đăng: 519
Member
♔ Lovemoon.wap.mu ♔

:21:

06.07.2016 / 14:08
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

nếu có ng hỏi ko hiện game thì do style wap bạn !

nếu ko phải style thì bạn vào &game=baucua

06.07.2016 / 14:14
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

xóa

div,img{display:block} đi nhé

06.07.2016 / 14:15
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

Lưu ý chưa có thư viện jquery thì thêm vào nhé.

JAVASCRIPT
  1. if(coin==0 || !coin){
  2. setCookie('tien',1500,3600);
  3. coinRun();
  4. }

chỗ 1500 là tiền khởi đầu

06.07.2016 / 14:22
TrieuLuan
Bài đăng: 453
Member
Happy New Year

Game cho wapego hả bác

06.07.2016 / 14:22
Windyluck
Bài đăng: 299
Member

bác tỉnh vl. :haha: