267 lines
5.8 KiB
HTML
267 lines
5.8 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<title>Monsterplex Level Editor</title>
|
|
<link rel="icon" href="assets/favicon.png">
|
|
<style>
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
background: #0b0e14;
|
|
color: #e8eef7;
|
|
font-family: monospace;
|
|
}
|
|
body {
|
|
padding: 20px;
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
}
|
|
h1 {
|
|
font-size: 22px;
|
|
color: #ffffff;
|
|
margin: 0 0 4px;
|
|
}
|
|
p.subtitle {
|
|
color: #9aa7bb;
|
|
margin: 0 0 20px;
|
|
font-size: 13px;
|
|
}
|
|
section {
|
|
background: #131826;
|
|
border: 1px solid #232c40;
|
|
border-radius: 6px;
|
|
padding: 14px 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
h2 {
|
|
font-size: 14px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
color: #9aa7bb;
|
|
margin: 0 0 10px;
|
|
}
|
|
#palette {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
}
|
|
.palette-btn {
|
|
background: #2255aa;
|
|
color: #ffffff;
|
|
border: 1px solid #1a1f29;
|
|
border-radius: 4px;
|
|
padding: 8px 12px;
|
|
font-family: monospace;
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
}
|
|
.palette-btn:hover {
|
|
background: #2f6ac0;
|
|
}
|
|
#track {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
min-height: 40px;
|
|
margin-bottom: 10px;
|
|
}
|
|
.track-item {
|
|
background: #1a2236;
|
|
border: 1px solid #2c374f;
|
|
border-radius: 4px;
|
|
padding: 6px 10px;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
color: #c8d3e0;
|
|
}
|
|
.track-item.selected {
|
|
background: #2255aa;
|
|
border-color: #4a8fe0;
|
|
color: #ffffff;
|
|
}
|
|
.track-item.locked {
|
|
opacity: 0.7;
|
|
}
|
|
#track-controls button, #export-panel button {
|
|
background: #2255aa;
|
|
color: #fff;
|
|
border: 1px solid #1a1f29;
|
|
border-radius: 4px;
|
|
padding: 6px 12px;
|
|
font-family: monospace;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
margin-right: 6px;
|
|
}
|
|
#track-controls button:disabled, #export-panel button:disabled {
|
|
opacity: 0.35;
|
|
cursor: not-allowed;
|
|
}
|
|
#size-panel {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 16px;
|
|
margin-top: 12px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid #232c40;
|
|
}
|
|
.size-field {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
min-width: 220px;
|
|
}
|
|
.size-field label {
|
|
font-size: 12px;
|
|
color: #9aa7bb;
|
|
}
|
|
.size-field-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
.size-field-row input[type="range"] {
|
|
flex: 1;
|
|
}
|
|
.size-field-row input[type="number"] {
|
|
width: 64px;
|
|
background: #0b0e14;
|
|
border: 1px solid #2c374f;
|
|
color: #e8eef7;
|
|
border-radius: 4px;
|
|
padding: 4px 6px;
|
|
font-family: monospace;
|
|
font-size: 12px;
|
|
}
|
|
.size-field-row input:disabled {
|
|
opacity: 0.35;
|
|
cursor: not-allowed;
|
|
}
|
|
.checkbox-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-size: 13px;
|
|
color: #e8eef7;
|
|
cursor: pointer;
|
|
}
|
|
.checkbox-row:has(input:disabled) {
|
|
opacity: 0.35;
|
|
cursor: not-allowed;
|
|
}
|
|
#metadata-form {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
gap: 10px;
|
|
}
|
|
#metadata-form label {
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-size: 12px;
|
|
color: #9aa7bb;
|
|
gap: 4px;
|
|
}
|
|
#metadata-form input, #metadata-form textarea {
|
|
background: #0b0e14;
|
|
border: 1px solid #2c374f;
|
|
color: #e8eef7;
|
|
border-radius: 4px;
|
|
padding: 6px 8px;
|
|
font-family: monospace;
|
|
font-size: 13px;
|
|
}
|
|
#preview-scroll {
|
|
overflow-x: auto;
|
|
border: 1px solid #232c40;
|
|
border-radius: 4px;
|
|
background: #0b0e14;
|
|
}
|
|
#preview-canvas {
|
|
display: block;
|
|
}
|
|
#export-textarea {
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
height: 220px;
|
|
background: #0b0e14;
|
|
color: #c8d3e0;
|
|
border: 1px solid #2c374f;
|
|
border-radius: 4px;
|
|
font-family: monospace;
|
|
font-size: 12px;
|
|
padding: 8px;
|
|
margin-bottom: 10px;
|
|
resize: vertical;
|
|
}
|
|
#empty-state {
|
|
color: #9aa7bb;
|
|
font-size: 13px;
|
|
padding: 20px;
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Monsterplex Level Editor</h1>
|
|
<p class="subtitle">Build a level from snap-together sections, then export it as a level file for src/data/levels/.</p>
|
|
|
|
<section>
|
|
<h2>Level Details</h2>
|
|
<div id="metadata-form"></div>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Sections</h2>
|
|
<div id="palette"></div>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Sequence</h2>
|
|
<div id="track"></div>
|
|
<div id="track-controls">
|
|
<button id="move-left-btn">◀ Move Left</button>
|
|
<button id="move-right-btn">Move Right ▶</button>
|
|
<button id="remove-btn">✕ Remove</button>
|
|
</div>
|
|
<div id="size-panel" hidden>
|
|
<div class="size-field">
|
|
<label for="width-range">Width (horizontal)</label>
|
|
<div class="size-field-row">
|
|
<input type="range" id="width-range" min="250" max="2100" step="10">
|
|
<input type="number" id="width-number" min="250" max="2100" step="10">
|
|
</div>
|
|
</div>
|
|
<div class="size-field">
|
|
<label for="vscale-range">Vertical Scale</label>
|
|
<div class="size-field-row">
|
|
<input type="range" id="vscale-range" min="0.3" max="2.5" step="0.05">
|
|
<input type="number" id="vscale-number" min="0.3" max="2.5" step="0.05">
|
|
</div>
|
|
</div>
|
|
<div class="size-field">
|
|
<label for="smooth-checkbox">Entry</label>
|
|
<label class="checkbox-row">
|
|
<input type="checkbox" id="smooth-checkbox">
|
|
Smooth (round off the seam with the previous section)
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Preview</h2>
|
|
<div id="preview-scroll"><canvas id="preview-canvas"></canvas></div>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Export</h2>
|
|
<textarea id="export-textarea" readonly spellcheck="false"></textarea>
|
|
<button id="download-btn">Download levelNN.js</button>
|
|
</section>
|
|
|
|
<script type="module" src="./src/editor/main.js"></script>
|
|
</body>
|
|
</html>
|