Advertisement
kasougi

Untitled

May 27th, 2022
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 4.02 KB | None | 0 0
  1. <style>
  2.   :global(html) {
  3.     background: black;
  4.   }
  5.   main {
  6.     text-align: center;
  7.     padding: 1em;
  8.     max-width: 240px;
  9.     margin: 0 auto;
  10.   }
  11.   button {
  12.     background: #14c07c;
  13.     border: none;
  14.     color: white;
  15.     cursor: pointer;
  16.     border-radius: 20px;
  17.     padding: 20px;
  18.   }
  19.   h1 {
  20.     color: #14c07c;
  21.     text-transform: uppercase;
  22.     font-size: 4em;
  23.     font-weight: 100;
  24.   }
  25.   h2 {
  26.     color: #14c07c;
  27.     font-weight: 100;
  28.   }
  29.   p {
  30.     color: #f4f4f4;
  31.   }
  32.   @media (min-width: 640px) {
  33.     main {
  34.       max-width: none;
  35.     }
  36.   }
  37.  
  38.   .header {
  39.     display: grid;
  40.     grid-template-columns: 30% 70%;
  41.     margin: 0 auto;
  42.     align-items: center;
  43.   }
  44.  
  45.   .title {
  46.     font-size:60px;
  47.     text-align: center;
  48.     margin: 30px 0;
  49.     font-weight: bold;
  50.     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  51.     color: #14c07c;
  52.   }
  53.   .score-box {
  54.     background-color:  #C9BBAE;
  55.     padding: 3px 0px;
  56.     margin: 50px auto 0 auto;
  57.     text-align: center;
  58.     width: 100px;
  59.     height:65px;
  60.     border-radius: 5px;
  61.   }
  62.  
  63.   .score-title{
  64.     font-size:20px;
  65.     color:  #eee4da;
  66.   }
  67.   .score-number {
  68.     font-size:30px;
  69.     color: white;
  70.   }
  71.   .scorer{
  72.     float: left;
  73.     width: 30%;
  74.   }
  75.  
  76.  
  77.   reset-box {
  78.     padding: 3px 0px;
  79.     text-align: center;
  80.     width: 100px;
  81.     height:65px;
  82.     border-radius: 5px;
  83.   }
  84.   .reset-box h1:hover {
  85.     color: #bbada0;
  86.     cursor: pointer;
  87.   }
  88.   .rules-box {
  89.     max-width: 500px;
  90.     margin: 0 auto;
  91.   }
  92.  
  93.  
  94.   .main-main {
  95.     display: inline-block;
  96.     /*display: grid;*/
  97.     /*grid-template-columns: 30% 80%;*/
  98.     width: 100%;
  99.     height: 70%;
  100.   }
  101.  
  102.   main {
  103.     max-width: 40%;
  104.     min-height: 70%;
  105.     max-height: 80%;
  106.     margin-left: 0;
  107.     display: grid;
  108.     grid-template-columns: repeat(4, 1fr);
  109.     grid-template-rows: repeat(4, 1fr);
  110.     gap: 20px;
  111.     background-color: #bbada0;
  112.     padding: 20px;
  113.     box-sizing: border-box;
  114.     border-radius: 5px;
  115.   }
  116.  
  117.  
  118.   .tile {
  119.     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  120.     width: 100%;
  121.     height: 100%;
  122.     background-color: #c9bbae;
  123.     display: grid;
  124.     place-items: center;
  125.     font-size: 3em;
  126.     border-radius: 5px;
  127.     color: #776e65;
  128.     font-weight: bold;
  129.   }
  130.   .two {
  131.     background-color: #eee4da;
  132.   }
  133.   .four {
  134.     background-color: #ede0c8;
  135.   }
  136.   .eight {
  137.     background-color: #f2b179;
  138.   }
  139.   .sixteen {
  140.     background-color: #f59563;
  141.   }
  142.   .thirtytwo {
  143.     background-color: #f67c60;
  144.   }
  145.   .sixtyfour {
  146.     background-color: #f65e3b;
  147.   }
  148.   .onetwoeight {
  149.     background-color: #edcf73;
  150.   }
  151.   .twofivesix {
  152.     background-color: #edcc62;
  153.   }
  154.   .fiveonetwo {
  155.     background-color: #edc850;
  156.   }
  157.   .onezerotwofour {
  158.     background-color: #edc53f;
  159.   }
  160.   .twozerofoureight {
  161.     background-color: #edc22d;
  162.   }
  163.  
  164. </style>
  165.  
  166. <svelte:window on:keydown={keyPress} />
  167.  
  168.  
  169. <div class="header">
  170.   <h1 class="title">2048</h1>
  171.   <div class="reset-box">
  172.     <h1 on:click={reset}>Перезапустить</h1>
  173.   </div>
  174. </div>
  175. <div class="main-main">
  176.   <div class="scorer">
  177.     <div class="score-box">
  178.       <p class="score-title">Счет</p>
  179.       <p class="score-number">{game.score}</p>
  180.     </div>
  181.     <div class="score-box second">
  182.       <p class="score-title">Лучший</p>
  183.       <p class="score-number">{game.best}</p>
  184.     </div>
  185.   </div>
  186.   <main>
  187.     {#each numbers as arr, i}
  188.       {#each arr as num, i}
  189.         <div
  190.                 class="tile {num === 2 ? 'two' : num === 4 ? 'four' : num === 8 ? 'eight' : num === 16 ? 'sixteen' : num === 32 ? 'thirtytwo' : num === 64 ? 'sixtyfour' : num === 128 ? 'onetwoeight' : num === 256 ? 'twofivesix' : num === 512 ? 'fiveonetwo' : num === 1024 ? 'onezerotwofour' : num === 2048 ? 'twozerofoureight' : ''}">
  191.           {num !== 0 ? num : ''}
  192.         </div>
  193.       {/each}
  194.     {/each}
  195.   </main>
  196. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement