index.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>五子</title>
  6. <script type="text/javascript" src="/js/jquery.min.js"></script>
  7. <link rel="stylesheet" href="/css/bootstrap.min.css">
  8. <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  9. <link rel="stylesheet" href="/css/style.css">
  10. <link rel="preconnect" href="https://fonts.googleapis.com">
  11. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  12. <link href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700
  13. &family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet">
  14. <style>
  15. * {
  16. padding: 0;
  17. margin: 0;
  18. }
  19. html,
  20. body,
  21. #five {
  22. background: #ccc;
  23. height: 100%;
  24. }
  25. .controls {
  26. /* position: absolute; */
  27. top: 20px;
  28. margin: 5px;
  29. }
  30. #game {
  31. width: 580px;
  32. height: 580px;
  33. /* box-shadow: 2px 2px 5px #333333; */
  34. /* text-align: center; */
  35. padding: 10px;
  36. background: rgba(0, 0, 0, 0.2);
  37. }
  38. table {
  39. width: 560px;
  40. border-collapse: collapse;
  41. border-spacing: 0;
  42. }
  43. td {
  44. width: 35px;
  45. height: 35px;
  46. text-align: center;
  47. }
  48. span {
  49. transition-duration: 100ms;
  50. display: inline-block;
  51. border-radius: 50%;
  52. width: 28px;
  53. height: 28px;
  54. vertical-align: middle;
  55. cursor: pointer;
  56. }
  57. .led {
  58. transition-duration: 100ms;
  59. display: inline-block;
  60. border: 5px double grey;
  61. border-radius: 50%;
  62. width: 18px;
  63. height: 18px;
  64. z-index: 10;
  65. vertical-align: middle;
  66. }
  67. .word {
  68. background: radial-gradient(transparent, rgb(15 15 15 / 25%));
  69. transition-duration: 100ms;
  70. display: inline-block;
  71. padding: 3px 6px;
  72. border: 5px double grey;
  73. z-index: 10;
  74. vertical-align: middle;
  75. }
  76. .red {
  77. filter: drop-shadow(0 0 2px red);
  78. outline: 5px dashed rgba(234, 71, 71, 0.5);
  79. }
  80. span::after {
  81. content: "";
  82. height: 0;
  83. display: inline-block;
  84. vertical-align: middle;
  85. }
  86. .black {
  87. box-shadow: 1px 1px 2px rgba(115, 115, 115, 0.7);
  88. background: #000;
  89. cursor: default;
  90. }
  91. .white {
  92. box-shadow: 1px 1px 2px rgba(115, 115, 115, 0.7);
  93. background: #fff;
  94. cursor: default;
  95. }
  96. .highlight.black {
  97. filter: drop-shadow(0 0 5px black);
  98. }
  99. .highlight.white {
  100. filter: drop-shadow(0 0 5px white);
  101. }
  102. .red:active {
  103. background: radial-gradient(transparent, rgb(15 15 15 / 25%));
  104. }
  105. .word:focus:not(:focus-visible):not(.red),
  106. .word:active:not(:focus-visible):not(.red),
  107. .word:hover:not(.red) {
  108. background: radial-gradient(transparent, rgb(15 15 15 / 25%));
  109. outline: 0;
  110. }
  111. .red:focus {
  112. outline: 5px dashed rgba(234, 71, 71, 0.5);
  113. }
  114. .tables {
  115. top: 0;
  116. left: 0;
  117. z-index: 3;
  118. }
  119. #xq-tips {
  120. position: absolute;
  121. top: 20%;
  122. left: 0;
  123. width: 100%;
  124. height: 150px;
  125. background: rgba(0, 0, 0, 0);
  126. display: none;
  127. z-index: 4;
  128. backdrop-filter: blur(5px);
  129. }
  130. .xq-txt {
  131. position: relative;
  132. height: 150px;
  133. background: rgba(35, 35, 35, 0.5);
  134. top: 0;
  135. bottom: 0;
  136. right: 0;
  137. left: 0;
  138. margin: auto;
  139. color: #fff;
  140. font-size: 40px;
  141. text-align: center;
  142. line-height: 150px;
  143. }
  144. #agin {
  145. display: none;
  146. }
  147. #regret {
  148. display: none;
  149. }
  150. .pointer {
  151. display: none;
  152. transition-duration: 100ms;
  153. pointer-events: none;
  154. position: absolute;
  155. opacity: 50%;
  156. left: 0;
  157. top: 0;
  158. z-index: 10;
  159. }
  160. .btn {
  161. text-shadow: rgb(133, 133, 130) 1px 2px 3px;
  162. }
  163. .noshadow {
  164. text-shadow: none;
  165. }
  166. input {
  167. outline-style: none;
  168. text-shadow: rgb(85, 85, 85) 3px 2px 4px;
  169. border: 1px solid #ccc;
  170. border-radius: 2px;
  171. background: rgb(215 215 215 / 50%);
  172. }
  173. input:hover {
  174. outline-style: none;
  175. text-shadow: rgb(85, 85, 85) 3px 2px 4px;
  176. border: 1px solid #ccc;
  177. border-radius: 2px;
  178. background: rgb(215 215 215 / 40%);
  179. }
  180. </style>
  181. </head>
  182. <body>
  183. <div id="five">
  184. <div class="controls">
  185. <a class="btn btn-info" href="/"><i class="glyphicon glyphicon-home" aria-hidden="true"></i>&nbsp;返回</a>
  186. <button class="btn btn-primary" id="begin"><i class=" glyphicon glyphicon-ban-circle" aria-hidden="true"></i>&nbsp;开始游戏</button>
  187. <div class="btn-group">
  188. <button class="btn btn-primary" id="agin"><i class=" glyphicon glyphicon-repeat" aria-hidden="true"></i>&nbsp;重新游戏</button>
  189. <button class="btn btn-warning" id="regret"><i class=" glyphicon glyphicon-backward" aria-hidden="true"></i>&nbsp;悔棋</button>
  190. <button class="btn btn-info" id="check"><i class=" glyphicon glyphicon-exclamation-sign" aria-hidden="true"></i>&nbsp;下哪了</button>
  191. </div>
  192. <a class="btn btn-default noshadow" onclick="$('.help').toggle()" href="#help"><i class="glyphicon glyphicon-question-sign"></i></a>
  193. <div class="led mylight"></div>
  194. <div class="led light"></div>
  195. <button class="btn btn-danger word message1">快</button>
  196. <button class="btn btn-danger word message2">再想想?</button>
  197. <button class="btn btn-danger word message3">拜拜</button>
  198. <button class="btn btn-danger word message4"><input id="messageText"></button>
  199. </div>
  200. <div id="game" class="center-block">
  201. <span class="black pointer"></span>
  202. </div>
  203. <p>Websocket:<i class="glyphicon glyphicon-remove ws" aria-hidden="true"></i></p>
  204. <div style="display:inline-block">在线人数:<il class="label label-default" id="messageServer"></il>
  205. </div>
  206. <div class="help" style="display:none">
  207. <h4 id="help">说明</h4>
  208. <p>普通五子棋,需双人对战,同一设备只能使用一种颜色。(找不到同伴可以自己用两个设备玩)</p>
  209. <p>右侧按钮可用于发送信号,但请勿频繁点击。</p>
  210. <p>两个指示灯分别表示自身颜色和当前颜色,两者相同时说明该你了。</p>
  211. </div>
  212. </div>
  213. </div>
  214. <script src="/js/chess.js"></script>
  215. </body>