Guest User

HTML MC Inventorius

a guest
Aug 13th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.03 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>Test</title>
  5.         <style>
  6.             .table {
  7.                 background-color: #f1f1f1;
  8.                 min-width: 500px;
  9.                 height: 250px;
  10.                 border: 0.5px solid #000;
  11.                 -webkit-border-radius: 4px;
  12.                 -moz-border-radius: 4px;
  13.                 border-radius: 4px;
  14.             }
  15.             tbody td {
  16.                 background-color: #c4c4c4;
  17.             }
  18.            
  19.             .space {
  20.                 margin: 0px 5px;
  21.                 background-color: #f1f1f1;
  22.                 width: 5px;
  23.                 height: 5px;
  24.                 max-height: 5px;
  25.                 max-width: 5px;
  26.             }
  27.            
  28.             .space1 {
  29.                 background-color: #f1f1f1;
  30.                 width: 5px;
  31.             }
  32.            
  33.             td {
  34.                 text-align: center;
  35.                 max-width: 60px;
  36.                 max-height: 53px;
  37.                 width: 60px;
  38.                 height: 53px;
  39.             }
  40.            
  41.             .drop {
  42.                 max-width: 60px;
  43.                 max-height: 53px;
  44.                 width: 60px;
  45.                 height: 53px;
  46.                 padding-top: 3px;
  47.             }
  48.            
  49.             .space2 {
  50.                 width: 5px;
  51.                 height: 5px;
  52.                 max-height: 5px;
  53.                 max-width: 5px;
  54.             }
  55.            
  56.         </style>
  57.         <script>
  58.             function allowDrop(ev) {
  59.                 ev.preventDefault();
  60.             }
  61.  
  62.             function drag(ev) {
  63.                 ev.dataTransfer.setData("Text", ev.target.id);
  64.             }
  65.  
  66.             function drop(ev) {
  67.                 ev.preventDefault();
  68.                 var data = ev.dataTransfer.getData("Text");
  69.                 ev.target.appendChild(document.getElementById(data));
  70.             }
  71.         </script>
  72.     </head>
  73.     <body>
  74.         <table class='table'>
  75.             <thead>
  76.                 <tr>
  77.                     <td colspan=11><center style='color: #c4c4c4'><b>Mano</b> Inventorius</center></td>
  78.                 </tr>
  79.             </thead>
  80.             <tbody>
  81.                 <tr>
  82.                     <td class='space1'> </td>
  83. <?php
  84. for($i=1;$i<10;$i++) {
  85.     echo "<td><div class='drop' ondrop=\"drop(event)\" ondragover=\"allowDrop(event)\"></div></td>";
  86. }
  87. ?>
  88.                     <td class='space'> </td>
  89.                 </tr>
  90.                 <tr>
  91.                     <td class='space1'> </td>
  92. <?php
  93. for($i=10;$i<19;$i++) {
  94.     echo "<td><div class='drop' ondrop=\"drop(event)\" ondragover=\"allowDrop(event)\"></div></td>";
  95. }
  96. ?>
  97.                     <td class='space'> </td>
  98.                 </tr>
  99.                 <tr>
  100.                     <td class='space1'> </td>
  101. <?php
  102. for($i=19;$i<28;$i++) {
  103.     echo "<td><div class='drop' ondrop=\"drop(event)\" ondragover=\"allowDrop(event)\"></div></td>";
  104. }
  105. ?>
  106.                     <td class='space'> </td>
  107.                 </tr>
  108.             </tbody>
  109.             <thead>
  110.                 <tr>
  111.                     <td colspan=11 class='space2'></td>
  112.                 </tr>
  113.             </thead>
  114.             <tbody>
  115.                 <tr>
  116.                     <td class='space1'> </td>
  117. <?php
  118. for($i=28;$i<37;$i++) {
  119.     echo "<td><div class='drop' ondrop=\"drop(event)\" ondragover=\"allowDrop(event)\"></div></td>";
  120. }
  121. ?>
  122.                     <td class='space'> </td>
  123.                 </tr>
  124.             </tbody>
  125.             <thead>
  126.                 <tr>
  127.                     <td colspan=11 class='space2'> </td>
  128.                 </tr>
  129.             </thead>
  130.         </table>
  131. <img id="drag1" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  132. <img id="drag2" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  133. <img id="drag3" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  134. <img id="drag4" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  135. <img id="drag5" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  136. <img id="drag6" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  137. <img id="drag7" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  138. <img id="drag8" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  139. <img id="drag9" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  140. <img id="drag10" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  141. <img id="drag11" src="http://www.laboratory424.com/files/images/build/mcpp/panels/wood-th.png" draggable="true" ondragstart="drag(event)">
  142.     </body>
  143. </html>
Advertisement
Add Comment
Please, Sign In to add comment