Game for OLC Code Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

style.css 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. html, body {
  2. margin: 0;
  3. padding: 0;
  4. width: 100%;
  5. height: 100%;
  6. display: flex;
  7. justify-content: center;
  8. align-items: center;
  9. background: rgb(51, 51, 51);
  10. overflow: hidden;
  11. white-space: nowrap;
  12. color: white;
  13. font-family: arial;
  14. }
  15. #root, #canvas {
  16. position: absolute;
  17. margin: 0;
  18. padding: 0;
  19. width: 100%;
  20. max-height: 100%;
  21. aspect-ratio: 16/9;
  22. overflow: hidden;
  23. }
  24. #canvas {
  25. background: rgb(31, 31, 31);
  26. }
  27. #root div {
  28. transform: translate(-50%, -50%);
  29. position: absolute;
  30. }
  31. .cloud-particle {
  32. border-radius: 50%;
  33. background: rgb(255, 255, 255);
  34. animation-name: cloud;
  35. animation-iteration-count: infinite;
  36. animation-direction: alternate;
  37. }
  38. .result {
  39. left: 50%;
  40. top: 50%;
  41. font-size: 108px;
  42. }
  43. .result:after {
  44. content: 'Press any key to continue';
  45. position: absolute;
  46. font-size: 48px;
  47. width: fit-content;
  48. top: 85%;
  49. left: 50%;
  50. transform: translate(-50%);
  51. }
  52. #lives {
  53. position: absolute;
  54. top: 15px;
  55. left: 15px;
  56. font-size: 32px;
  57. }
  58. #sound {
  59. position: absolute;
  60. display: block;
  61. top: 15px;
  62. right: 15px;
  63. font-size: 32px;
  64. border: none;
  65. background: transparent;
  66. outline: none;
  67. cursor: pointer;
  68. }
  69. #lives:before {
  70. content: '❤ ';
  71. color: red;
  72. }
  73. @keyframes cloud {
  74. from {
  75. transform: translate(-50%) scale(1.2);
  76. opacity: 0.7;
  77. }
  78. to {
  79. transform: translate(-50%) scale(0.2);
  80. opacity: 0.1;
  81. }
  82. }