style.css 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. *,
  2. *::before,
  3. *::after {
  4. box-sizing: border-box;
  5. margin: 0;
  6. padding: 0;
  7. }
  8. body {
  9. background: #1E88E5;
  10. display: flex;
  11. flex-direction: column;
  12. align-items: center;
  13. justify-content: center;
  14. height: 100vh;
  15. color:#fff;
  16. font-size: 16px;
  17. font-family: sans-serif;
  18. }
  19. .game {
  20. border:3px solid #fff;
  21. width: 100%;
  22. max-width: 700px;
  23. padding:50px;
  24. border-radius: 3px;
  25. }
  26. .game h1 {
  27. font-size: 30px;
  28. text-align: center;
  29. }
  30. .counter-block {
  31. width: 200px;
  32. border:2px solid #000;
  33. margin:20px auto;
  34. padding: 10px;
  35. display: flex;
  36. justify-content: space-around;
  37. font-size: 44px;
  38. }
  39. .counter-block span {
  40. margin:0 25px;
  41. }
  42. .count {
  43. position: relative;
  44. width: 50px;
  45. text-align: center;
  46. }
  47. .count::before {
  48. content:"";
  49. display: block;
  50. padding:3px 8px;
  51. background: #1E88E5;
  52. color: #fff;
  53. font-size: 14px;
  54. position: absolute;
  55. top:50px;
  56. }
  57. .count-user::before {
  58. content:"Игрок";
  59. left:-5px;
  60. }
  61. .count-comp::before {
  62. content:"Комп";
  63. right:-5px;
  64. }
  65. .figure-container {
  66. display: flex;
  67. justify-content: space-between;
  68. align-items: center;
  69. padding:30px 20px;
  70. }
  71. .user-field,
  72. .comp-field {
  73. width: 50%;
  74. display: flex;
  75. }
  76. .field {
  77. width: 70px;
  78. height: 70px;
  79. border-radius: 50%;
  80. border:4px solid #fff;
  81. cursor: pointer;
  82. margin:5px;
  83. transition:.2s;
  84. overflow: hidden;
  85. box-shadow: 3px 3px 5px #000;
  86. outline: none;
  87. }
  88. .result {
  89. text-align: center;
  90. }
  91. .field.active {
  92. background-color: green;
  93. }
  94. .field.error {
  95. background-color: red;
  96. }
  97. .comp-field {
  98. justify-content: flex-end;
  99. }
  100. .rock {
  101. background: url(../img/rock.png) center no-repeat;
  102. }
  103. .scissors {
  104. background: url(../img/scissors.png) center no-repeat;
  105. }
  106. .paper {
  107. background: url(../img/paper.png) center no-repeat;
  108. }
  109. .comp-field.blink .rock {
  110. animation: blink 0.3s linear infinite;
  111. }
  112. .comp-field.blink .scissors {
  113. animation: blink 0.3s 0.1s linear infinite;
  114. }
  115. .comp-field.blink .paper {
  116. animation: blink 0.3s 0.2s linear infinite;
  117. }
  118. .comp-field.blink {
  119. animation-play-state: paused;
  120. }
  121. @keyframes blink {
  122. 100% {background-color: green;}
  123. }
  124. .buttons {
  125. padding:20px 15px;
  126. text-align: center;
  127. }
  128. .buttons button {
  129. margin:0 8px;
  130. cursor:pointer;
  131. border:none;
  132. border-radius:3px;
  133. color:#fff;
  134. text-transform: uppercase;
  135. padding:10px 12px;
  136. font-weight: bold;
  137. font-size: 16px;
  138. box-shadow: 3px 3px 2px rgba(0,0,0,0.7);
  139. transition:.2s;
  140. }
  141. .buttons button:hover,
  142. .buttons button:active {
  143. box-shadow: 1px 1px 1px rgba(0,0,0,0.7);
  144. }
  145. .play {
  146. background: green;
  147. }
  148. @media(max-width:700px) {
  149. .game {
  150. padding: 10px;
  151. }
  152. .figure-container {
  153. flex-direction: column;
  154. }
  155. .user-field,
  156. .comp-field {
  157. width: 100%;
  158. flex-wrap: wrap;
  159. justify-content: center;
  160. align-items: center;
  161. }
  162. .user-field {
  163. margin-bottom: 20px;
  164. }
  165. .user-field::before {
  166. content:"Игрок:";
  167. display: block;
  168. width: 100%;
  169. font-size: 20px;
  170. text-align: center;
  171. }
  172. .comp-field::before {
  173. content:"Компьютер:";
  174. display: block;
  175. width: 100%;
  176. font-size: 20px;
  177. text-align: center;
  178. }
  179. .game h1 {
  180. font-size: 20px;
  181. }
  182. }