Spaces:
Running
Running
Update index.html
Browse files- index.html +267 -21
index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Redstone Sandbox</title>
|
7 |
<style>
|
8 |
body {
|
9 |
margin: 0;
|
@@ -17,6 +17,7 @@
|
|
17 |
position: relative;
|
18 |
width: 100vw;
|
19 |
height: 100vh;
|
|
|
20 |
}
|
21 |
|
22 |
#grid {
|
@@ -30,6 +31,20 @@
|
|
30 |
box-shadow: 0 0 50px rgba(0,0,0,0.5);
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
.cell {
|
34 |
width: 40px;
|
35 |
height: 40px;
|
@@ -42,6 +57,16 @@
|
|
42 |
justify-content: center;
|
43 |
font-size: 10px;
|
44 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
.toolbar {
|
@@ -56,6 +81,8 @@
|
|
56 |
gap: 12px;
|
57 |
box-shadow: 0 5px 25px rgba(0,0,0,0.3);
|
58 |
z-index: 100;
|
|
|
|
|
59 |
}
|
60 |
|
61 |
.tool {
|
@@ -69,13 +96,14 @@
|
|
69 |
justify-content: center;
|
70 |
font-size: 22px;
|
71 |
background: rgba(255,255,255,0.05);
|
72 |
-
transition: 0.3s;
|
73 |
position: relative;
|
74 |
}
|
75 |
|
76 |
.tool:hover {
|
77 |
transform: translateY(-2px);
|
78 |
background: rgba(255,255,255,0.1);
|
|
|
79 |
}
|
80 |
|
81 |
.tool.active {
|
@@ -84,6 +112,26 @@
|
|
84 |
transform: scale(1.1);
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
.button {
|
88 |
background: #f55;
|
89 |
border: none;
|
@@ -107,6 +155,15 @@
|
|
107 |
background: #f55;
|
108 |
}
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
.wire {
|
111 |
background: #300;
|
112 |
transition: background-color 0.3s;
|
@@ -214,24 +271,48 @@
|
|
214 |
from { box-shadow: 0 0 20px #ff0; }
|
215 |
to { box-shadow: 0 0 40px #ff0; }
|
216 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
</style>
|
218 |
</head>
|
219 |
-
|
220 |
<body>
|
221 |
<div id="gameContainer">
|
222 |
<div class="toolbar">
|
223 |
-
<div class="tool active" data-tool="wire" data-name="Wire"
|
224 |
-
|
225 |
-
|
226 |
-
<div class="tool" data-tool="
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
<button class="button reset">Reset</button>
|
230 |
<button class="button pause">Pause</button>
|
|
|
|
|
|
|
|
|
|
|
231 |
</div>
|
232 |
-
<div id="grid" style="width: 802px; height: 802px;"><div class="cell" style="left: 0px; top: 0px;" data-x="0" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 0px;" data-x="1" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 0px;" data-x="2" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 0px;" data-x="3" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 0px;" data-x="4" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 0px;" data-x="5" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 0px;" data-x="6" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 0px;" data-x="7" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 0px;" data-x="8" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 0px;" data-x="9" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 0px;" data-x="10" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 0px;" data-x="11" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 0px;" data-x="12" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 0px;" data-x="13" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 0px;" data-x="14" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 0px;" data-x="15" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 0px;" data-x="16" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 0px;" data-x="17" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 0px;" data-x="18" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 0px;" data-x="19" data-y="0"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 40px;" data-x="0" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 40px;" data-x="1" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 40px;" data-x="2" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 40px;" data-x="3" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 40px;" data-x="4" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 40px;" data-x="5" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 40px;" data-x="6" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 40px;" data-x="7" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 40px;" data-x="8" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 40px;" data-x="9" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 40px;" data-x="10" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 40px;" data-x="11" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 40px;" data-x="12" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 40px;" data-x="13" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 40px;" data-x="14" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 40px;" data-x="15" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 40px;" data-x="16" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 40px;" data-x="17" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 40px;" data-x="18" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 40px;" data-x="19" data-y="1"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 80px;" data-x="0" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 80px;" data-x="1" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 80px;" data-x="2" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 80px;" data-x="3" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 80px;" data-x="4" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 80px;" data-x="5" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 80px;" data-x="6" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 80px;" data-x="7" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 80px;" data-x="8" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 80px;" data-x="9" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 80px;" data-x="10" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 80px;" data-x="11" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 80px;" data-x="12" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 80px;" data-x="13" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 80px;" data-x="14" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 80px;" data-x="15" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 80px;" data-x="16" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 80px;" data-x="17" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 80px;" data-x="18" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 80px;" data-x="19" data-y="2"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 120px;" data-x="0" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 120px;" data-x="1" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 120px;" data-x="2" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 120px;" data-x="3" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 120px;" data-x="4" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 120px;" data-x="5" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 120px;" data-x="6" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 120px;" data-x="7" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 120px;" data-x="8" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 120px;" data-x="9" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 120px;" data-x="10" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 120px;" data-x="11" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 120px;" data-x="12" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 120px;" data-x="13" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 120px;" data-x="14" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 120px;" data-x="15" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 120px;" data-x="16" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 120px;" data-x="17" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 120px;" data-x="18" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 120px;" data-x="19" data-y="3"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 160px;" data-x="0" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 160px;" data-x="1" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 160px;" data-x="2" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 160px;" data-x="3" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 160px;" data-x="4" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 160px;" data-x="5" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 160px;" data-x="6" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 160px;" data-x="7" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 160px;" data-x="8" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 160px;" data-x="9" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 160px;" data-x="10" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 160px;" data-x="11" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 160px;" data-x="12" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 160px;" data-x="13" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 160px;" data-x="14" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 160px;" data-x="15" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 160px;" data-x="16" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 160px;" data-x="17" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 160px;" data-x="18" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 160px;" data-x="19" data-y="4"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 200px;" data-x="0" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 200px;" data-x="1" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 200px;" data-x="2" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 200px;" data-x="3" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 200px;" data-x="4" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 200px;" data-x="5" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 200px;" data-x="6" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 200px;" data-x="7" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 200px;" data-x="8" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 200px;" data-x="9" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 200px;" data-x="10" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 200px;" data-x="11" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 200px;" data-x="12" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 200px;" data-x="13" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 200px;" data-x="14" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 200px;" data-x="15" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 200px;" data-x="16" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 200px;" data-x="17" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 200px;" data-x="18" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 200px;" data-x="19" data-y="5"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 240px;" data-x="0" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 240px;" data-x="1" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 240px;" data-x="2" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 240px;" data-x="3" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 240px;" data-x="4" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 240px;" data-x="5" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 240px;" data-x="6" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 240px;" data-x="7" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 240px;" data-x="8" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 240px;" data-x="9" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 240px;" data-x="10" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 240px;" data-x="11" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 240px;" data-x="12" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 240px;" data-x="13" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 240px;" data-x="14" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 240px;" data-x="15" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 240px;" data-x="16" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 240px;" data-x="17" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 240px;" data-x="18" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 240px;" data-x="19" data-y="6"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 280px;" data-x="0" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 280px;" data-x="1" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 280px;" data-x="2" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 280px;" data-x="3" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 280px;" data-x="4" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 280px;" data-x="5" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 280px;" data-x="6" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 280px;" data-x="7" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 280px;" data-x="8" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 280px;" data-x="9" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 280px;" data-x="10" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 280px;" data-x="11" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 280px;" data-x="12" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 280px;" data-x="13" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 280px;" data-x="14" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 280px;" data-x="15" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 280px;" data-x="16" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 280px;" data-x="17" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 280px;" data-x="18" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 280px;" data-x="19" data-y="7"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 320px;" data-x="0" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 320px;" data-x="1" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 320px;" data-x="2" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 320px;" data-x="3" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 320px;" data-x="4" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 320px;" data-x="5" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 320px;" data-x="6" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 320px;" data-x="7" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 320px;" data-x="8" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 320px;" data-x="9" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 320px;" data-x="10" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 320px;" data-x="11" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 320px;" data-x="12" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 320px;" data-x="13" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 320px;" data-x="14" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 320px;" data-x="15" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 320px;" data-x="16" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 320px;" data-x="17" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 320px;" data-x="18" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 320px;" data-x="19" data-y="8"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 360px;" data-x="0" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 360px;" data-x="1" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 360px;" data-x="2" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 360px;" data-x="3" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 360px;" data-x="4" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 360px;" data-x="5" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 360px;" data-x="6" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 360px;" data-x="7" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 360px;" data-x="8" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 360px;" data-x="9" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 360px;" data-x="10" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 360px;" data-x="11" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 360px;" data-x="12" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 360px;" data-x="13" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 360px;" data-x="14" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 360px;" data-x="15" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 360px;" data-x="16" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 360px;" data-x="17" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 360px;" data-x="18" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 360px;" data-x="19" data-y="9"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 400px;" data-x="0" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 400px;" data-x="1" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 400px;" data-x="2" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 400px;" data-x="3" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 400px;" data-x="4" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 400px;" data-x="5" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 400px;" data-x="6" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 400px;" data-x="7" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 400px;" data-x="8" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 400px;" data-x="9" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 400px;" data-x="10" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 400px;" data-x="11" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 400px;" data-x="12" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 400px;" data-x="13" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 400px;" data-x="14" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 400px;" data-x="15" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 400px;" data-x="16" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 400px;" data-x="17" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 400px;" data-x="18" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 400px;" data-x="19" data-y="10"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 440px;" data-x="0" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 440px;" data-x="1" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 440px;" data-x="2" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 440px;" data-x="3" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 440px;" data-x="4" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 440px;" data-x="5" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 440px;" data-x="6" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 440px;" data-x="7" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 440px;" data-x="8" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 440px;" data-x="9" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 440px;" data-x="10" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 440px;" data-x="11" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 440px;" data-x="12" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 440px;" data-x="13" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 440px;" data-x="14" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 440px;" data-x="15" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 440px;" data-x="16" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 440px;" data-x="17" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 440px;" data-x="18" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 440px;" data-x="19" data-y="11"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 480px;" data-x="0" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 480px;" data-x="1" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 480px;" data-x="2" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 480px;" data-x="3" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 480px;" data-x="4" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 480px;" data-x="5" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 480px;" data-x="6" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 480px;" data-x="7" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 480px;" data-x="8" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 480px;" data-x="9" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 480px;" data-x="10" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 480px;" data-x="11" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 480px;" data-x="12" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 480px;" data-x="13" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 480px;" data-x="14" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 480px;" data-x="15" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 480px;" data-x="16" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 480px;" data-x="17" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 480px;" data-x="18" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 480px;" data-x="19" data-y="12"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 520px;" data-x="0" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 520px;" data-x="1" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 520px;" data-x="2" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 520px;" data-x="3" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 520px;" data-x="4" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 520px;" data-x="5" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 520px;" data-x="6" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 520px;" data-x="7" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 520px;" data-x="8" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 520px;" data-x="9" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 520px;" data-x="10" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 520px;" data-x="11" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 520px;" data-x="12" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 520px;" data-x="13" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 520px;" data-x="14" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 520px;" data-x="15" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 520px;" data-x="16" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 520px;" data-x="17" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 520px;" data-x="18" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 520px;" data-x="19" data-y="13"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 560px;" data-x="0" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 560px;" data-x="1" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 560px;" data-x="2" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 560px;" data-x="3" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 560px;" data-x="4" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 560px;" data-x="5" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 560px;" data-x="6" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 560px;" data-x="7" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 560px;" data-x="8" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 560px;" data-x="9" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 560px;" data-x="10" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 560px;" data-x="11" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 560px;" data-x="12" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 560px;" data-x="13" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 560px;" data-x="14" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 560px;" data-x="15" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 560px;" data-x="16" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 560px;" data-x="17" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 560px;" data-x="18" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 560px;" data-x="19" data-y="14"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 600px;" data-x="0" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 600px;" data-x="1" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 600px;" data-x="2" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 600px;" data-x="3" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 600px;" data-x="4" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 600px;" data-x="5" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 600px;" data-x="6" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 600px;" data-x="7" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 600px;" data-x="8" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 600px;" data-x="9" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 600px;" data-x="10" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 600px;" data-x="11" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 600px;" data-x="12" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 600px;" data-x="13" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 600px;" data-x="14" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 600px;" data-x="15" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 600px;" data-x="16" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 600px;" data-x="17" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 600px;" data-x="18" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 600px;" data-x="19" data-y="15"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 640px;" data-x="0" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 640px;" data-x="1" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 640px;" data-x="2" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 640px;" data-x="3" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 640px;" data-x="4" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 640px;" data-x="5" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 640px;" data-x="6" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 640px;" data-x="7" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 640px;" data-x="8" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 640px;" data-x="9" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 640px;" data-x="10" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 640px;" data-x="11" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 640px;" data-x="12" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 640px;" data-x="13" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 640px;" data-x="14" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 640px;" data-x="15" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 640px;" data-x="16" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 640px;" data-x="17" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 640px;" data-x="18" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 640px;" data-x="19" data-y="16"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 680px;" data-x="0" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 680px;" data-x="1" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 680px;" data-x="2" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 680px;" data-x="3" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 680px;" data-x="4" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 680px;" data-x="5" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 680px;" data-x="6" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 680px;" data-x="7" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 680px;" data-x="8" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 680px;" data-x="9" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 680px;" data-x="10" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 680px;" data-x="11" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 680px;" data-x="12" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 680px;" data-x="13" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 680px;" data-x="14" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 680px;" data-x="15" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 680px;" data-x="16" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 680px;" data-x="17" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 680px;" data-x="18" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 680px;" data-x="19" data-y="17"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 720px;" data-x="0" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 720px;" data-x="1" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 720px;" data-x="2" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 720px;" data-x="3" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 720px;" data-x="4" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 720px;" data-x="5" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 720px;" data-x="6" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 720px;" data-x="7" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 720px;" data-x="8" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 720px;" data-x="9" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 720px;" data-x="10" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 720px;" data-x="11" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 720px;" data-x="12" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 720px;" data-x="13" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 720px;" data-x="14" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 720px;" data-x="15" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 720px;" data-x="16" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 720px;" data-x="17" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 720px;" data-x="18" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 720px;" data-x="19" data-y="18"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 0px; top: 760px;" data-x="0" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 40px; top: 760px;" data-x="1" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 80px; top: 760px;" data-x="2" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 120px; top: 760px;" data-x="3" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 160px; top: 760px;" data-x="4" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 200px; top: 760px;" data-x="5" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 240px; top: 760px;" data-x="6" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 280px; top: 760px;" data-x="7" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 320px; top: 760px;" data-x="8" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 360px; top: 760px;" data-x="9" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 400px; top: 760px;" data-x="10" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 440px; top: 760px;" data-x="11" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 480px; top: 760px;" data-x="12" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 520px; top: 760px;" data-x="13" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 560px; top: 760px;" data-x="14" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 600px; top: 760px;" data-x="15" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 640px; top: 760px;" data-x="16" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 680px; top: 760px;" data-x="17" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 720px; top: 760px;" data-x="18" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div><div class="cell" style="left: 760px; top: 760px;" data-x="19" data-y="19"><div class="power-level"></div><div class="timer-value"></div></div></div>
|
233 |
</div>
|
234 |
-
|
235 |
<script>
|
236 |
class RedstoneSandbox {
|
237 |
constructor() {
|
@@ -242,6 +323,8 @@
|
|
242 |
this.timers = new Set();
|
243 |
this.isPaused = false;
|
244 |
this.gameLoopInterval = null;
|
|
|
|
|
245 |
this.init();
|
246 |
}
|
247 |
|
@@ -250,6 +333,9 @@
|
|
250 |
this.setupTools();
|
251 |
this.setupButtons();
|
252 |
this.bindEvents();
|
|
|
|
|
|
|
253 |
this.startGameLoop();
|
254 |
}
|
255 |
|
@@ -291,6 +377,148 @@
|
|
291 |
}
|
292 |
}
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
setupTools() {
|
295 |
const tools = document.querySelectorAll('.tool');
|
296 |
tools.forEach(tool => {
|
@@ -304,15 +532,7 @@
|
|
304 |
|
305 |
setupButtons() {
|
306 |
document.querySelector('.reset').addEventListener('click', () => {
|
307 |
-
|
308 |
-
cell.element.className = 'cell';
|
309 |
-
cell.type = null;
|
310 |
-
cell.powered = false;
|
311 |
-
cell.powerLevel = 0;
|
312 |
-
cell.powerDisplay.textContent = '';
|
313 |
-
cell.timerDisplay.textContent = '';
|
314 |
-
});
|
315 |
-
this.timers.clear();
|
316 |
});
|
317 |
|
318 |
const pauseBtn = document.querySelector('.pause');
|
@@ -323,6 +543,18 @@
|
|
323 |
});
|
324 |
}
|
325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
bindEvents() {
|
327 |
const grid = document.getElementById('grid');
|
328 |
|
@@ -332,6 +564,7 @@
|
|
332 |
const x = parseInt(e.target.dataset.x);
|
333 |
const y = parseInt(e.target.dataset.y);
|
334 |
this.deleteComponent(x, y);
|
|
|
335 |
}
|
336 |
});
|
337 |
|
@@ -348,6 +581,19 @@
|
|
348 |
} else {
|
349 |
this.placeComponent(x, y);
|
350 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
}
|
352 |
});
|
353 |
}
|
@@ -369,6 +615,7 @@
|
|
369 |
toggleTorch(cell) {
|
370 |
cell.powered = !cell.powered;
|
371 |
cell.powerLevel = cell.powered ? 15 : 0;
|
|
|
372 |
this.updatePower();
|
373 |
}
|
374 |
|
@@ -485,6 +732,5 @@
|
|
485 |
|
486 |
new RedstoneSandbox();
|
487 |
</script>
|
488 |
-
|
489 |
</body>
|
490 |
</html>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Redstone Sandbox 2.0</title>
|
7 |
<style>
|
8 |
body {
|
9 |
margin: 0;
|
|
|
17 |
position: relative;
|
18 |
width: 100vw;
|
19 |
height: 100vh;
|
20 |
+
background: radial-gradient(circle at center, #2a2a2a 0%, #1a1a1a 100%);
|
21 |
}
|
22 |
|
23 |
#grid {
|
|
|
31 |
box-shadow: 0 0 50px rgba(0,0,0,0.5);
|
32 |
}
|
33 |
|
34 |
+
.grid-overlay {
|
35 |
+
position: absolute;
|
36 |
+
top: 0;
|
37 |
+
left: 0;
|
38 |
+
width: 100%;
|
39 |
+
height: 100%;
|
40 |
+
background:
|
41 |
+
linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
|
42 |
+
linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
|
43 |
+
background-size: 40px 40px;
|
44 |
+
pointer-events: none;
|
45 |
+
border-radius: 8px;
|
46 |
+
}
|
47 |
+
|
48 |
.cell {
|
49 |
width: 40px;
|
50 |
height: 40px;
|
|
|
57 |
justify-content: center;
|
58 |
font-size: 10px;
|
59 |
cursor: pointer;
|
60 |
+
box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
|
61 |
+
}
|
62 |
+
|
63 |
+
.cell:hover {
|
64 |
+
box-shadow: inset 0 0 15px rgba(255,255,255,0.1);
|
65 |
+
}
|
66 |
+
|
67 |
+
.cell[data-power] {
|
68 |
+
transform: scale(1.05);
|
69 |
+
z-index: 1;
|
70 |
}
|
71 |
|
72 |
.toolbar {
|
|
|
81 |
gap: 12px;
|
82 |
box-shadow: 0 5px 25px rgba(0,0,0,0.3);
|
83 |
z-index: 100;
|
84 |
+
backdrop-filter: blur(10px);
|
85 |
+
border: 1px solid rgba(255,255,255,0.1);
|
86 |
}
|
87 |
|
88 |
.tool {
|
|
|
96 |
justify-content: center;
|
97 |
font-size: 22px;
|
98 |
background: rgba(255,255,255,0.05);
|
99 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
100 |
position: relative;
|
101 |
}
|
102 |
|
103 |
.tool:hover {
|
104 |
transform: translateY(-2px);
|
105 |
background: rgba(255,255,255,0.1);
|
106 |
+
box-shadow: 0 0 20px rgba(255,85,85,0.3);
|
107 |
}
|
108 |
|
109 |
.tool.active {
|
|
|
112 |
transform: scale(1.1);
|
113 |
}
|
114 |
|
115 |
+
.tool-tooltip {
|
116 |
+
position: absolute;
|
117 |
+
bottom: -30px;
|
118 |
+
left: 50%;
|
119 |
+
transform: translateX(-50%);
|
120 |
+
background: rgba(0,0,0,0.8);
|
121 |
+
padding: 5px 10px;
|
122 |
+
border-radius: 4px;
|
123 |
+
font-size: 12px;
|
124 |
+
opacity: 0;
|
125 |
+
transition: 0.3s;
|
126 |
+
pointer-events: none;
|
127 |
+
white-space: nowrap;
|
128 |
+
}
|
129 |
+
|
130 |
+
.tool:hover .tool-tooltip {
|
131 |
+
opacity: 1;
|
132 |
+
bottom: -25px;
|
133 |
+
}
|
134 |
+
|
135 |
.button {
|
136 |
background: #f55;
|
137 |
border: none;
|
|
|
155 |
background: #f55;
|
156 |
}
|
157 |
|
158 |
+
.save-btn, .load-btn {
|
159 |
+
background: #444;
|
160 |
+
margin: 0 5px;
|
161 |
+
}
|
162 |
+
|
163 |
+
.save-btn:hover, .load-btn:hover {
|
164 |
+
background: #555;
|
165 |
+
}
|
166 |
+
|
167 |
.wire {
|
168 |
background: #300;
|
169 |
transition: background-color 0.3s;
|
|
|
271 |
from { box-shadow: 0 0 20px #ff0; }
|
272 |
to { box-shadow: 0 0 40px #ff0; }
|
273 |
}
|
274 |
+
|
275 |
+
@keyframes power-pulse {
|
276 |
+
0% { box-shadow: 0 0 10px currentColor; }
|
277 |
+
50% { box-shadow: 0 0 20px currentColor; }
|
278 |
+
100% { box-shadow: 0 0 10px currentColor; }
|
279 |
+
}
|
280 |
+
|
281 |
+
.powered {
|
282 |
+
animation: power-pulse 2s infinite;
|
283 |
+
}
|
284 |
</style>
|
285 |
</head>
|
|
|
286 |
<body>
|
287 |
<div id="gameContainer">
|
288 |
<div class="toolbar">
|
289 |
+
<div class="tool active" data-tool="wire" data-name="Wire">⚡
|
290 |
+
<div class="tool-tooltip">Wire</div>
|
291 |
+
</div>
|
292 |
+
<div class="tool" data-tool="torch" data-name="Torch">🔥
|
293 |
+
<div class="tool-tooltip">Torch</div>
|
294 |
+
</div>
|
295 |
+
<div class="tool" data-tool="block" data-name="Block">⬛
|
296 |
+
<div class="tool-tooltip">Block</div>
|
297 |
+
</div>
|
298 |
+
<div class="tool" data-tool="spreader" data-name="Spreader">➕
|
299 |
+
<div class="tool-tooltip">Spreader</div>
|
300 |
+
</div>
|
301 |
+
<div class="tool" data-tool="lamp" data-name="Lamp">💡
|
302 |
+
<div class="tool-tooltip">Lamp</div>
|
303 |
+
</div>
|
304 |
+
<div class="tool" data-tool="timer" data-name="Timer">⏲️
|
305 |
+
<div class="tool-tooltip">Timer</div>
|
306 |
+
</div>
|
307 |
<button class="button reset">Reset</button>
|
308 |
<button class="button pause">Pause</button>
|
309 |
+
<button class="button save-btn">Save</button>
|
310 |
+
<button class="button load-btn">Load</button>
|
311 |
+
</div>
|
312 |
+
<div id="grid">
|
313 |
+
<div class="grid-overlay"></div>
|
314 |
</div>
|
|
|
315 |
</div>
|
|
|
316 |
<script>
|
317 |
class RedstoneSandbox {
|
318 |
constructor() {
|
|
|
323 |
this.timers = new Set();
|
324 |
this.isPaused = false;
|
325 |
this.gameLoopInterval = null;
|
326 |
+
this.undoStack = [];
|
327 |
+
this.redoStack = [];
|
328 |
this.init();
|
329 |
}
|
330 |
|
|
|
333 |
this.setupTools();
|
334 |
this.setupButtons();
|
335 |
this.bindEvents();
|
336 |
+
this.addTooltips();
|
337 |
+
this.setupSaveLoad();
|
338 |
+
this.setupKeyboardShortcuts();
|
339 |
this.startGameLoop();
|
340 |
}
|
341 |
|
|
|
377 |
}
|
378 |
}
|
379 |
|
380 |
+
addTooltips() {
|
381 |
+
document.querySelectorAll('.tool').forEach(tool => {
|
382 |
+
const tooltip = document.createElement('div');
|
383 |
+
tooltip.className = 'tool-tooltip';
|
384 |
+
tooltip.textContent = tool.dataset.name;
|
385 |
+
tool.appendChild(tooltip);
|
386 |
+
});
|
387 |
+
}
|
388 |
+
|
389 |
+
setupSaveLoad() {
|
390 |
+
document.querySelector('.save-btn').addEventListener('click', () => {
|
391 |
+
const saveData = {};
|
392 |
+
Object.entries(this.grid).forEach(([coord, cell]) => {
|
393 |
+
if(cell.type) {
|
394 |
+
saveData[coord] = {
|
395 |
+
type: cell.type,
|
396 |
+
powered: cell.powered,
|
397 |
+
powerLevel: cell.powerLevel,
|
398 |
+
timerInterval: cell.timerInterval
|
399 |
+
};
|
400 |
+
}
|
401 |
+
});
|
402 |
+
localStorage.setItem('redstoneSave', JSON.stringify(saveData));
|
403 |
+
this.showNotification('Design saved successfully!');
|
404 |
+
});
|
405 |
+
|
406 |
+
document.querySelector('.load-btn').addEventListener('click', () => {
|
407 |
+
const saveData = JSON.parse(localStorage.getItem('redstoneSave') || '{}');
|
408 |
+
this.reset();
|
409 |
+
Object.entries(saveData).forEach(([coord, data]) => {
|
410 |
+
const [x,y] = coord.split(',');
|
411 |
+
const cell = this.grid[coord];
|
412 |
+
cell.type = data.type;
|
413 |
+
cell.powered = data.powered;
|
414 |
+
cell.powerLevel = data.powerLevel;
|
415 |
+
cell.timerInterval = data.timerInterval;
|
416 |
+
cell.element.className = `cell ${data.type}`;
|
417 |
+
if(data.powered) cell.element.classList.add('powered');
|
418 |
+
if(data.type === 'timer') {
|
419 |
+
this.timers.add(coord);
|
420 |
+
cell.timerDisplay.textContent = `${data.timerInterval}s`;
|
421 |
+
}
|
422 |
+
});
|
423 |
+
this.updatePower();
|
424 |
+
this.showNotification('Design loaded successfully!');
|
425 |
+
});
|
426 |
+
}
|
427 |
+
|
428 |
+
showNotification(message) {
|
429 |
+
const notification = document.createElement('div');
|
430 |
+
notification.style.cssText = `
|
431 |
+
position: fixed;
|
432 |
+
bottom: 20px;
|
433 |
+
left: 50%;
|
434 |
+
transform: translateX(-50%);
|
435 |
+
background: rgba(0,0,0,0.8);
|
436 |
+
color: white;
|
437 |
+
padding: 10px 20px;
|
438 |
+
border-radius: 5px;
|
439 |
+
z-index: 1000;
|
440 |
+
animation: fadeInOut 2s forwards;
|
441 |
+
`;
|
442 |
+
notification.textContent = message;
|
443 |
+
document.body.appendChild(notification);
|
444 |
+
setTimeout(() => notification.remove(), 2000);
|
445 |
+
}
|
446 |
+
|
447 |
+
setupKeyboardShortcuts() {
|
448 |
+
document.addEventListener('keydown', (e) => {
|
449 |
+
if(e.ctrlKey && e.key === 'z') {
|
450 |
+
this.undo();
|
451 |
+
} else if(e.ctrlKey && e.key === 'y') {
|
452 |
+
this.redo();
|
453 |
+
} else if(e.key === ' ') {
|
454 |
+
this.isPaused = !this.isPaused;
|
455 |
+
document.querySelector('.pause').classList.toggle('active');
|
456 |
+
}
|
457 |
+
});
|
458 |
+
}
|
459 |
+
|
460 |
+
saveState() {
|
461 |
+
const state = {};
|
462 |
+
Object.entries(this.grid).forEach(([coord, cell]) => {
|
463 |
+
if(cell.type) {
|
464 |
+
state[coord] = {
|
465 |
+
type: cell.type,
|
466 |
+
powered: cell.powered,
|
467 |
+
powerLevel: cell.powerLevel,
|
468 |
+
timerInterval: cell.timerInterval
|
469 |
+
};
|
470 |
+
}
|
471 |
+
});
|
472 |
+
this.undoStack.push(state);
|
473 |
+
this.redoStack = [];
|
474 |
+
if(this.undoStack.length > 50) this.undoStack.shift();
|
475 |
+
}
|
476 |
+
|
477 |
+
undo() {
|
478 |
+
if(this.undoStack.length === 0) return;
|
479 |
+
const currentState = {};
|
480 |
+
Object.entries(this.grid).forEach(([coord, cell]) => {
|
481 |
+
if(cell.type) {
|
482 |
+
currentState[coord] = {
|
483 |
+
type: cell.type,
|
484 |
+
powered: cell.powered,
|
485 |
+
powerLevel: cell.powerLevel,
|
486 |
+
timerInterval: cell.timerInterval
|
487 |
+
};
|
488 |
+
}
|
489 |
+
});
|
490 |
+
this.redoStack.push(currentState);
|
491 |
+
|
492 |
+
const previousState = this.undoStack.pop();
|
493 |
+
this.reset();
|
494 |
+
this.loadState(previousState);
|
495 |
+
}
|
496 |
+
|
497 |
+
redo() {
|
498 |
+
if(this.redoStack.length === 0) return;
|
499 |
+
const state = this.redoStack.pop();
|
500 |
+
this.reset();
|
501 |
+
this.loadState(state);
|
502 |
+
this.undoStack.push(state);
|
503 |
+
}
|
504 |
+
|
505 |
+
loadState(state) {
|
506 |
+
Object.entries(state).forEach(([coord, data]) => {
|
507 |
+
const cell = this.grid[coord];
|
508 |
+
cell.type = data.type;
|
509 |
+
cell.powered = data.powered;
|
510 |
+
cell.powerLevel = data.powerLevel;
|
511 |
+
cell.timerInterval = data.timerInterval;
|
512 |
+
cell.element.className = `cell ${data.type}`;
|
513 |
+
if(data.powered) cell.element.classList.add('powered');
|
514 |
+
if(data.type === 'timer') {
|
515 |
+
this.timers.add(coord);
|
516 |
+
cell.timerDisplay.textContent = `${data.timerInterval}s`;
|
517 |
+
}
|
518 |
+
});
|
519 |
+
this.updatePower();
|
520 |
+
}
|
521 |
+
|
522 |
setupTools() {
|
523 |
const tools = document.querySelectorAll('.tool');
|
524 |
tools.forEach(tool => {
|
|
|
532 |
|
533 |
setupButtons() {
|
534 |
document.querySelector('.reset').addEventListener('click', () => {
|
535 |
+
this.reset();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
536 |
});
|
537 |
|
538 |
const pauseBtn = document.querySelector('.pause');
|
|
|
543 |
});
|
544 |
}
|
545 |
|
546 |
+
reset() {
|
547 |
+
Object.values(this.grid).forEach(cell => {
|
548 |
+
cell.element.className = 'cell';
|
549 |
+
cell.type = null;
|
550 |
+
cell.powered = false;
|
551 |
+
cell.powerLevel = 0;
|
552 |
+
cell.powerDisplay.textContent = '';
|
553 |
+
cell.timerDisplay.textContent = '';
|
554 |
+
});
|
555 |
+
this.timers.clear();
|
556 |
+
}
|
557 |
+
|
558 |
bindEvents() {
|
559 |
const grid = document.getElementById('grid');
|
560 |
|
|
|
564 |
const x = parseInt(e.target.dataset.x);
|
565 |
const y = parseInt(e.target.dataset.y);
|
566 |
this.deleteComponent(x, y);
|
567 |
+
this.saveState();
|
568 |
}
|
569 |
});
|
570 |
|
|
|
581 |
} else {
|
582 |
this.placeComponent(x, y);
|
583 |
}
|
584 |
+
this.saveState();
|
585 |
+
}
|
586 |
+
});
|
587 |
+
|
588 |
+
let isDragging = false;
|
589 |
+
grid.addEventListener('mousedown', () => isDragging = false);
|
590 |
+
grid.addEventListener('mousemove', () => isDragging = true);
|
591 |
+
grid.addEventListener('mouseup', e => {
|
592 |
+
if(!isDragging && e.target.classList.contains('cell')) {
|
593 |
+
const x = parseInt(e.target.dataset.x);
|
594 |
+
const y = parseInt(e.target.dataset.y);
|
595 |
+
this.placeComponent(x, y);
|
596 |
+
this.saveState();
|
597 |
}
|
598 |
});
|
599 |
}
|
|
|
615 |
toggleTorch(cell) {
|
616 |
cell.powered = !cell.powered;
|
617 |
cell.powerLevel = cell.powered ? 15 : 0;
|
618 |
+
cell.element.classList.toggle('powered');
|
619 |
this.updatePower();
|
620 |
}
|
621 |
|
|
|
732 |
|
733 |
new RedstoneSandbox();
|
734 |
</script>
|
|
|
735 |
</body>
|
736 |
</html>
|