Advertisement
andrzuk

Tetris (template)

Mar 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.57 KB | None | 0 0
  1. /*
  2.  *  Tetris v1.0
  3.  *  Copyright (C) 2017 Andrzej Żukowski
  4.  *  http://angular-cms.pl
  5.  */
  6.  
  7. <style>
  8.     div#game-information { margin: 5px; text-align: center; }
  9.     div#game-information > span { width: 100px; height: 20px; color: #555; display: inline-block; text-align: left; }
  10.     div#game-information > span#position { width: 120px; }
  11.     div#game-information > span#record { color: #090; font-size: 1.1em; font-weight: bold; }
  12.     div#game-information > span#date { color: #090; font-size: 0.85em; display: none; }
  13.     div#game-container { margin: 20px; text-align: center; }
  14.     canvas#game-canvas { background: url(public/img/gallery/75) no-repeat center; }
  15.     span#panel-left, span#panel-right { display: inline-block; padding: 0 10px; position: fixed; vertical-align: top; top: 150px; }
  16.     span#panel-left { left: 10px; }
  17.     span#panel-right { right: 10px; }
  18.     button.game-button { width: 70px; }
  19.     button#start { width: 100px; }
  20.     div#game-control { margin: 0; padding: 0; text-align: center; }
  21.     div#game-message { font-size: 1.0em; font-weight: bold; color: #090; }
  22.     div#game-button { padding: 10px; display: block; }
  23.     canvas#game-canvas { width: 400px; height: 500px; border: 1px solid #aaa; padding: 1px; }
  24.     div#game-legend { display: block; position: fixed; width: 200px; bottom: 100px; right: 50px; font-size: 0.75em; }
  25.     @media (max-width: 968px) {
  26.         div#game-legend { display: none; }
  27.     }
  28.     div#editor-button, div#close-button { position: fixed; top: 80px; right: 20px; }
  29.     div#game-map { display: none; }
  30.     div#game-map > h4 { text-align: center; }
  31.     button.map-element { width: 30px; height: 30px; margin: 1px; padding: 1px; }
  32.     table#maps-edit { max-width: 500px; }
  33.     div#alert-info, div#alert-danger { display: none; text-align: center; margin: 10px 20% 0 20%; }
  34.     div#maps-title { margin: 0 0 30px 0; text-align: center; font-size: 1.2em; font-weight: bold; color: #369; border-bottom: 1px solid #369; }
  35.     div#maps-container { text-align: center; margin: 10px 50px; }
  36.     div.item-container { display: inline-block; margin: 4px; width: 150px; height: 220px; border: 1px solid #ccc; background: #fff; }
  37.     div.lp, div.map, div.color, div.actions { margin: 10px; text-align: center; }
  38.     div.lp { margin: 0; font-size: 0.75em; }
  39. </style>
  40.  
  41. <div id="game-play">
  42.     <div id="editor-button"><button id="map-editor" class="btn btn-info">Map editor</button></div>
  43.  
  44.     <div id="game-container">
  45.         <span id="panel-left">
  46.             <hr>
  47.             <button id="rotate-left" class="btn btn-warning game-button"><i class="fa fa-undo" aria-hidden="true"></i></button>
  48.             <hr>
  49.             <button id="move-left" class="btn btn-success game-button"><i class="fa fa-arrow-left" aria-hidden="true"></i></button>
  50.             <hr>
  51.             <button id="drop-left" class="btn btn-danger game-button drop-down"><i class="fa fa-level-down" aria-hidden="true"></i></button>
  52.         </span>
  53.         <canvas id="game-canvas">Canvas is not supported in your browser.</canvas>
  54.         <span id="panel-right">
  55.             <hr>
  56.             <button id="rotate-right" class="btn btn-warning game-button"><i class="fa fa-repeat" aria-hidden="true"></i></button>
  57.             <hr>
  58.             <button id="move-right" class="btn btn-success game-button"><i class="fa fa-arrow-right" aria-hidden="true"></i></button>
  59.             <hr>
  60.             <button id="drop-right" class="btn btn-danger game-button drop-down"><i class="fa fa-level-down" aria-hidden="true"></i></button>
  61.         </span>
  62.     </div>
  63.  
  64.     <div id="game-information">
  65.         <span id="position"></span>
  66.         <span id="blocks"></span>
  67.         <span id="level"></span>
  68.         <span id="scores"></span>
  69.         <span id="time"></span>
  70.         <span id="record"></span>
  71.         <span id="date"></span>
  72.     </div>
  73.  
  74.     <div id="game-control">
  75.         <div id="game-message">Aby rozpocząć grę, naciśnij przycisk...</div>
  76.         <div id="game-button"><button id="start" class="btn btn-success game-button">Start</button></div>
  77.     </div>
  78.  
  79.     <div id="game-legend">
  80.         <b><u>Keyboard control:</u></b><br><br>
  81.         Rotation: <b>PageUp</b>, <b>PageDown</b><br>Move: <b>Left</b>, <b>Right</b>, <b>Down</b><br>Drop: <b>Space Bar</b>
  82.     </div>
  83. </div>
  84.  
  85. <div id="game-map">
  86.     <div id="close-button"><button id="save-maps" class="btn btn-success">Save &amp; exit</button>&nbsp;<button id="close-editor" class="btn btn-danger">Close</button></div>          
  87.     <div id="maps-title">Tetris Maps Editor</div>
  88.     <div id="maps-table"></div>
  89.     <div class="alert alert-info" id="alert-info"></div>
  90.     <div class="alert alert-danger" id="alert-danger"></div>
  91. </div>
  92.  
  93. <script src="tetris.js"></script>
  94.  
  95. <script>
  96. /*
  97.     shapes.push({ map: [[1, 1, 0], [0, 1, 0], [0, 1, 1]], color: '#009900' });
  98.     shapes.push({ map: [[0, 1, 1], [0, 1, 0], [1, 1, 0]], color: '#0080c0' });
  99.     mapEditor.loadMaps();
  100. */
  101. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement