-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.html
200 lines (181 loc) · 6.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<head>
<title>shapez.io shape generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="index.css" media="all" />
<script async src="index.js"></script>
<link
rel="shortcut icon"
type="image/x-icon"
href="https://shapez.io/favicon.ico"
/>
<!-- just include all variants for ease of use -->
<link
href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
/>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-FCFW3W6WL0"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-FCFW3W6WL0", { anonymizeIp: true });
</script>
</head>
<body>
<a href="https://steam.shapez.io" target="_blank">
<img id="logo" src="logo.png" />
</a>
<h1>Shape viewer</h1>
<!--
<a
class="nftHint"
href="https://opensea.io/collection/shapez"
target="_blank"
>
<span>
Want to support me? You can now acquire shapez.io shapes as NFTs (Non
Fungible Tokens)!
<strong>Click here to view the available shapes.</strong>
</span>
<img src="opensea-logo-flat-colored-white.png" />
</a> -->
<div class="grid">
<div class="col">
<input
value="CuCuCuCu"
id="code"
placeholder="shape code"
onkeypress="debounce(generate)"
onkeydown="debounce(generate)"
onkeyup="debounce(generate)"
onchange="debounce(generate)"
/>
<div id="error">Error</div>
<br />
<div id="resultWrapper">
<canvas id="result" width="512" height="512"></canvas>
</div>
<button onclick="exportShape()">Export</button>
<button onclick="shareShape()">Share</button>
</div>
<div class="col infoBox">
<h2>About</h2>
<p>
With this tool you can generate any shape supported in shapez.io! This
can be useful to analyze shapes or draft new ones.
</p>
<h3>Instructions</h3>
<p>
Shapes can be generated with a <strong>short key</strong>. Each shape
consists of up to 4 layers, and each layers consists of 4 quadrants.
Shape codes start from the upper right quadrant and move clockwise.
</p>
<br />
<p>
Each quadrant is described via a pair of letters - An
<strong>uppercase letter describing the shape</strong>, followed by a
<strong>lowercase letter describing its color</strong>. If the
quadrant is empty, <code>--</code> is used
</p>
<br />
<p>
Layers are separated via <code>:</code>, starting with the lowest
layer.
</p>
<div class="grid shapeCodes">
<div class="col">
<h3>Shape codes</h3>
<ul>
<li><code>C</code> Circle</li>
<li><code>R</code> Rectangle</li>
<li><code>W</code> Windmill / Fan</li>
<li><code>S</code> Star</li>
</ul>
</div>
<div class="col">
<h3>color codes</h3>
<ul>
<li>
<code>r</code>
<span class="colorPreview" style="background: #ff666a"></span>
Red
</li>
<li>
<code>g</code>
<span class="colorPreview" style="background: #78ff66"></span>
Green
</li>
<li>
<code>b</code>
<span class="colorPreview" style="background: #66a7ff"></span>
Blue
</li>
<li>
<code>y</code>
<span class="colorPreview" style="background: #fcf52a"></span>
Yellow
</li>
<li>
<code>p</code>
<span class="colorPreview" style="background: #dd66ff"></span>
Purple
</li>
<li>
<code>c</code>
<span class="colorPreview" style="background: #00fcff"></span>
Cyan
</li>
<li>
<code>u</code>
<span class="colorPreview" style="background: #aaaaaa"></span>
Uncolored
</li>
<li>
<code>w</code>
<span class="colorPreview" style="background: #ffffff"></span>
White
</li>
</ul>
</div>
</div>
<h3>Examples</h3>
<script>
const examples = [
["CwCwCwCw", "White circle"],
["----RuRu", "Half rectangle"],
["CgScScCg", "Circles and stars mixed"],
["RpRpRpRp:CwCwCwCw", "Layering example"],
["RuCw--Cw:----Ru--", "Logo Shape"],
];
for (let i = 0; i < examples.length; ++i) {
const [key, desc] = examples[i];
document.write(`
<div class="example">
<code>${key}</code><label>${desc}</label>
<button onclick='viewShape(\"${key}\")'>View</button>
</div>
`);
}
</script>
<div class="example">
<code></code><label>Random Shape</label>
<button onclick="randomShape()">Randomize</button>
</div>
</div>
</div>
<div class="footer">
<a target="_blank" href="https://get.shapez.io/viewer">Steam Page</a> |
<a target="_blank" href="https://discord.com/invite/HN7EVzV">Discord</a> |
<a target="_blank" href="https://github.com/tobspr/shapez.io">Github</a> |
<a target="_blank" href="https://tobspr.io" rel="author">tobspr Games</a>
</div>
</body>
</html>