style.css 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. body {
  2. background: #031921;
  3. color: #fff;
  4. font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
  5. Helvetica, Arial, "Lucida Grande", sans-serif;
  6. font-weight: 300;
  7. margin: 0;
  8. padding: 0;
  9. touch-action: none;
  10. -webkit-touch-callout: none;
  11. user-select: none;
  12. -webkit-user-select: none;
  13. overflow: hidden;
  14. }
  15. #game {
  16. display: flex;
  17. flex-direction: column;
  18. position: absolute;
  19. width: 100%;
  20. height: 100%;
  21. touch-action: none;
  22. }
  23. #game canvas {
  24. object-fit: contain;
  25. image-rendering: -moz-crisp-edges;
  26. image-rendering: -webkit-crisp-edges;
  27. image-rendering: pixelated;
  28. image-rendering: crisp-edges;
  29. height: 100%;
  30. }
  31. #controller {
  32. display: none;
  33. position: fixed;
  34. bottom: 0px;
  35. height: 210px;
  36. width: 100%;
  37. touch-action: none;
  38. opacity: 0.8;
  39. }
  40. #controller_dpad {
  41. position: absolute;
  42. bottom: 20px;
  43. left: 0px;
  44. width: 184px;
  45. height: 184px;
  46. }
  47. #controller_dpad:before {
  48. content: "";
  49. display: block;
  50. width: 48px;
  51. height: 48px;
  52. background: #5c5c5c;
  53. background: radial-gradient(
  54. ellipse at center,
  55. #5c5c5c 0%,
  56. #555 59%,
  57. #5c5c5c 60%
  58. );
  59. position: absolute;
  60. left: 68px;
  61. top: 68px;
  62. }
  63. #controller_left {
  64. position: absolute;
  65. left: 20px;
  66. top: 68px;
  67. width: 48px;
  68. height: 48px;
  69. background: #666;
  70. background: radial-gradient(ellipse at center, #666 0%, #5c5c5c 80%);
  71. border-top-left-radius: 4px;
  72. border-bottom-left-radius: 4px;
  73. }
  74. #controller_right {
  75. position: absolute;
  76. left: 116px;
  77. top: 68px;
  78. width: 48px;
  79. height: 48px;
  80. background: #666;
  81. background: radial-gradient(ellipse at center, #666 0%, #5c5c5c 80%);
  82. border-top-right-radius: 4px;
  83. border-bottom-right-radius: 4px;
  84. }
  85. #controller_up {
  86. position: absolute;
  87. left: 68px;
  88. top: 20px;
  89. width: 48px;
  90. height: 48px;
  91. background: #666;
  92. background: radial-gradient(ellipse at center, #666 0%, #5c5c5c 80%);
  93. border-top-left-radius: 4px;
  94. border-top-right-radius: 4px;
  95. }
  96. #controller_down {
  97. position: absolute;
  98. left: 68px;
  99. top: 116px;
  100. width: 48px;
  101. height: 48px;
  102. background: #666;
  103. background: radial-gradient(ellipse at center, #666 0%, #5c5c5c 80%);
  104. border-bottom-left-radius: 4px;
  105. border-bottom-right-radius: 4px;
  106. }
  107. #controller_a {
  108. position: absolute;
  109. bottom: 110px;
  110. right: 20px;
  111. }
  112. #controller_b {
  113. position: absolute;
  114. bottom: 80px;
  115. right: 100px;
  116. }
  117. .roundBtn {
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. font-weight: bold;
  122. font-size: 32px;
  123. color: #440f1f;
  124. line-height: 64px;
  125. width: 64px;
  126. height: 64px;
  127. border-radius: 64px;
  128. background: #870a4c;
  129. background: radial-gradient(ellipse at center, #ab1465 0%, #8b1e57 100%);
  130. box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.2);
  131. }
  132. .capsuleBtn {
  133. font-weight: bold;
  134. font-size: 10px;
  135. color: #111;
  136. display: flex;
  137. justify-content: center;
  138. align-items: center;
  139. line-height: 40px;
  140. text-transform: uppercase;
  141. width: 64px;
  142. height: 32px;
  143. border-radius: 40px;
  144. background: #222;
  145. background: radial-gradient(ellipse at center, #666 0%, #555 100%);
  146. box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.2);
  147. }
  148. #controller_start {
  149. position: absolute;
  150. bottom: 20px;
  151. right: 15px;
  152. }
  153. #controller_select {
  154. position: absolute;
  155. bottom: 20px;
  156. right: 100px;
  157. }
  158. .btnPressed {
  159. opacity: 0.5;
  160. }
  161. .spinner {
  162. height: 50px;
  163. width: 50px;
  164. margin: 0px auto;
  165. -webkit-animation: rotation 0.8s linear infinite;
  166. -moz-animation: rotation 0.8s linear infinite;
  167. -o-animation: rotation 0.8s linear infinite;
  168. animation: rotation 0.8s linear infinite;
  169. border-left: 10px solid #306850;
  170. border-right: 10px solid #306850;
  171. border-bottom: 10px solid #306850;
  172. border-top: 10px solid #88c070;
  173. border-radius: 100%;
  174. background-color: #031921;
  175. }
  176. @-webkit-keyframes rotation {
  177. from {
  178. -webkit-transform: rotate(0deg);
  179. }
  180. to {
  181. -webkit-transform: rotate(360deg);
  182. }
  183. }
  184. @-moz-keyframes rotation {
  185. from {
  186. -moz-transform: rotate(0deg);
  187. }
  188. to {
  189. -moz-transform: rotate(360deg);
  190. }
  191. }
  192. @-o-keyframes rotation {
  193. from {
  194. -o-transform: rotate(0deg);
  195. }
  196. to {
  197. -o-transform: rotate(360deg);
  198. }
  199. }
  200. @keyframes rotation {
  201. from {
  202. transform: rotate(0deg);
  203. }
  204. to {
  205. transform: rotate(360deg);
  206. }
  207. }
  208. @media only screen and (max-width: 640px) {
  209. #game canvas {
  210. margin-top: 0px;
  211. width: 100%;
  212. max-width: 512px;
  213. border: 0px;
  214. border-radius: 0px;
  215. }
  216. }
  217. @media only screen and (max-device-width: 812px) and (orientation: portrait) {
  218. body {
  219. margin: 0;
  220. }
  221. #game {
  222. width: 100%;
  223. position: fixed;
  224. touch-action: none;
  225. }
  226. #game canvas {
  227. margin: 0;
  228. display: block;
  229. width: 100% !important;
  230. height: auto !important;
  231. }
  232. }
  233. @media only screen and (max-device-width: 320px) and (orientation: portrait) {
  234. #controller_dpad {
  235. left: -5px;
  236. bottom: -5px;
  237. }
  238. #controller_a {
  239. right: 5px;
  240. bottom: 95px;
  241. }
  242. #controller_b {
  243. right: 80px;
  244. }
  245. #controller_start {
  246. right: 5px;
  247. }
  248. #controller_select {
  249. right: 80px;
  250. }
  251. }
  252. @media only screen and (max-width: 500px) and (max-height: 400px) {
  253. #controller {
  254. display: none;
  255. }
  256. }
  257. /* Small devices in landscape */
  258. @media only screen and (max-device-width: 300px) and (orientation: landscape) {
  259. html,
  260. body {
  261. height: 100%;
  262. }
  263. body {
  264. display: flex;
  265. justify-content: center;
  266. align-items: center;
  267. }
  268. #game:after {
  269. content: "PLEASE ROTATE ↻";
  270. font-size: 24px;
  271. font-weight: bold;
  272. color: #fff;
  273. }
  274. #game canvas {
  275. display: none;
  276. max-width: 480px;
  277. }
  278. #controller {
  279. display: none;
  280. }
  281. }
  282. /* Devices large enough for landscape */
  283. @media only screen and (min-width: 300px) and (orientation: landscape) {
  284. #controller {
  285. bottom: 50%;
  286. transform: translateY(50%);
  287. opacity: 0.5;
  288. }
  289. }
  290. #debug {
  291. display:flex;
  292. flex-direction:column;
  293. align-items:center;
  294. padding:10px;
  295. position:fixed;
  296. top:0px;
  297. left:0px;
  298. right:0px;
  299. bottom:0px;
  300. background:rgba(0,0,0,0.5);
  301. }
  302. #debug div {
  303. background: white;
  304. color: black;
  305. border: 1px solid #ddd;
  306. border-radius: 4px;
  307. transform: position;
  308. font-size: 11px;
  309. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  310. display: flex;
  311. align-items: center;
  312. }
  313. #debug span {
  314. padding: 5px 8px;
  315. }
  316. #debug button {
  317. background: transparent;
  318. border: none;
  319. border-left: 1px solid #ddd;
  320. display: flex;
  321. align-items: center;
  322. height: 100%;
  323. }
  324. #debug button:hover {
  325. background: #eee;
  326. }
  327. #debug button:active {
  328. background: #ddd;
  329. }