-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathindex.html
More file actions
307 lines (278 loc) · 21.5 KB
/
Copy pathindex.html
File metadata and controls
307 lines (278 loc) · 21.5 KB
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Kalivra</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/components.css">
<link rel="stylesheet" href="css/modules.css">
<style>
.chart-container { position: relative; flex: 1; min-height: 0; width: 100%; background-color: #202225; box-sizing: border-box; overflow: hidden; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal-content { background-color: #2f3136; padding: 20px; border: 1px solid #444; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); max-height: 95vh; overflow-y: auto; position: relative; }
.matrix-container { display: grid; gap: 2px; background-color: #111; border: 1px solid #444; overflow: auto; max-height: 600px; }
.matrix-cell { display: flex; justify-content: center; align-items: center; font-size: 0.8em; color: #fff; cursor: pointer; transition: opacity 0.2s; position: relative; }
.matrix-cell:hover { opacity: 0.8; z-index: 10; border: 1px solid #fff; }
.matrix-header { background-color: #202225; font-weight: bold; color: #ccc; display: flex; justify-content: center; align-items: center; padding: 5px; text-align: center; position: sticky; z-index: 5; }
.matrix-row-header { left: 0; }
.matrix-col-header { top: 0; }
.desc-input { width: 100%; height: 80px; background-color: #1e1e1e; border: 1px solid #3e3e42; color: #ccc; padding: 8px; font-family: monospace; resize: vertical; }
.stat-label-text { cursor: help; text-decoration: underline dotted #666; }
.input-error { border: 2px solid #e74c3c !important; background-color: #3a1d1d !important; color: #ffcccc !important; }
.snapshot-list { max-height: 300px; overflow-y: auto; border: 1px solid #3e3e42; background: #1e1e1e; margin-bottom: 10px; }
.snapshot-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid #2d2d30; cursor: pointer; }
.snapshot-item:hover { background-color: #2a2d3e; }
.snapshot-info { display: flex; flex-direction: column; }
.snapshot-name { font-weight: bold; color: #eee; }
.snapshot-date { font-size: 0.8em; color: #888; }
.snapshot-actions button { background: none; border: none; cursor: pointer; color: #888; margin-left: 5px; }
.snapshot-actions button:hover { color: #fff; }
.bulk-table { width: 100%; border-collapse: collapse; background: #1e1e1e; color: #ccc; font-size: 0.9em; min-width: 800px; }
.bulk-table th, .bulk-table td { border: 1px solid #333; padding: 6px 8px; text-align: center; }
.bulk-table th { background: #252526; position: sticky; top: 0; z-index: 10; font-weight: bold; color: #eee; text-align: center; }
.bulk-table tr:hover { background-color: #2a2d3e; }
.bulk-table tr.selected { background-color: #373b50; }
.bulk-table input[type="checkbox"] { cursor: pointer; }
#feedback-modal .modal-content { width: 350px; }
#feedback-content { width: 100%; height: 120px; margin: 15px 0; background: #1e1e1e; color: white; border: 1px solid #444; padding: 10px; border-radius: 4px; resize: none; box-sizing: border-box; }
#feedback-type { width: 100%; padding: 8px; background: #1e1e1e; color: white; border: 1px solid #444; border-radius: 4px; }
</style>
</head>
<body>
<div class="top-toolbar">
<div class="toolbar-group">
<span id="appTitle" style="font-weight:900; font-size:1.1em; color:#eee; letter-spacing:1px; cursor:default; margin-right: 10px;">Kalivra</span>
</div>
<div class="toolbar-group">
<button id="saveBtn" class="tool-btn success" title="Save Project (Ctrl+S)"><span>💾</span> Save</button>
<button id="loadBtn" class="tool-btn secondary" title="Load Project"><span>📂</span> Load</button>
<button id="configBtn" class="tool-btn secondary" title="Project Config"><span>⚙️</span> Config</button>
</div>
<div class="toolbar-divider"></div>
<div class="toolbar-group" style="display: flex; align-items: center; width: 140px; gap: 0;">
<span style="flex: 6.5; font-size: 0.85em; color: #b9bbbe; font-weight: bold; white-space: nowrap; text-align: right; padding-right: 8px;">Max Level:</span>
<input type="number" id="maxLevel" value="20" class="toolbar-input" style="flex: 3.5; width: 0; min-width: 0; text-align: center; padding: 0 4px; margin: 0;" title="Change to Auto-Simulate">
</div>
<div class="toolbar-divider"></div>
<div class="toolbar-group">
<button id="bulkEditBtn" class="tool-btn bulk"><span>📊</span> Bulk Edit</button>
<button id="snapshotBtn" class="tool-btn" style="color: #d7ba7d;"><span>📷</span> Snapshots</button>
</div>
<div class="toolbar-divider"></div>
<div class="toolbar-group">
<button id="exportBtn" class="tool-btn warning">
<img src="assets/icon_export.png" class="icon-img"> Export ▼
</button>
<button id="unityBtn" class="tool-btn unreal" title="Export for Unity">
<img src="assets/icon_unity.png" alt="Unity">
</button>
<button id="unrealBtn" class="tool-btn unreal" title="Export for Unreal">
<img src="assets/icon_unreal.png" alt="Unreal">
</button>
</div>
<div class="toolbar-divider"></div>
<div class="toolbar-group">
<button id="feedbackBtn" class="tool-btn" style="color: #5fabff;"><span>💬</span></button>
</div>
<div class="window-controls">
<button id="minBtn" class="win-btn">─</button>
<button id="maxBtn" class="win-btn">◻</button>
<button id="closeBtn" class="win-btn close-btn">✕</button>
</div>
</div>
<div class="app-container">
<div class="sidebar" id="leftSidebar">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
<h2>Entities</h2>
<button id="addBtn" style="width: auto; padding: 4px 10px; font-size: 0.8em; background-color:#2da44e; border:none; border-radius:3px; color:white; cursor:pointer; font-weight:bold;">+ Add</button>
</div>
<div id="entityContainer"></div>
</div>
<div class="resizer" id="resizerLeft"></div>
<div class="main-content" id="mainContent">
<div class="chart-header">
<h3>Simulation Result</h3>
<select id="graphMetric">
<option value="cp" selected>Combat Power</option>
<option value="dmg">Avg Damage</option>
</select>
</div>
<div class="chart-container" id="chartPanel"><canvas id="balanceChart"></canvas></div>
<div class="resizer-vertical" id="resizerVertical"></div>
<div class="analysis-panel" id="analysisPanel">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;">
<h3 style="margin:0; border:none;">Balance Analysis</h3>
<div style="display:flex; gap:5px;">
<button id="openLeagueBtn" class="btn" style="width:auto; padding:4px 12px; font-size:0.8em; background-color:#5fabff;">League</button>
<button id="openBattleBtn" class="btn" style="width:auto; padding:4px 12px; font-size:0.8em; background-color:#d29922;">Battle Sim</button>
</div>
</div>
<div id="analysisLog" class="log-container">
<div class="log-item placeholder">Analysis will appear here...</div>
</div>
</div>
</div>
<div class="resizer" id="resizerRight"></div>
<div class="sidebar right-sidebar" id="rightSidebar">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
<h2>Item / Buffs</h2>
<div style="display:flex; gap:5px;">
<button id="addItemBtn" style="padding: 4px 10px; background-color:#d29922; border:none; border-radius:4px; color:white; cursor:pointer;">+ New</button>
<button id="btnItemSet" style="padding: 4px 10px; background-color:#444; border:none; border-radius:4px; color:#ccc; cursor:pointer; font-size:0.8em;">Sets</button>
</div>
</div>
<div id="itemContainer"></div>
<div style="margin-top: auto; padding-top: 15px; border-top: 1px solid #3e3e42; color: #888; font-size: 0.8em;">
* Items apply to checked entities.
</div>
</div>
</div>
<div id="configModal" class="modal">
<div class="modal-content" style="width: 800px; max-width: 95vw;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;"><h3>Game Rules & Info</h3><span class="close-modal">×</span></div>
<div class="config-section" style="background:#252526; padding:10px; border-radius:4px; margin-bottom:15px;">
<label style="color:#5fabff;">Project Meta Info</label>
<div style="display:flex; gap:10px; margin-bottom:5px;">
<input type="text" id="metaProjectName" placeholder="Project Name" style="flex:2;">
<input type="text" id="metaAuthor" placeholder="Author" style="flex:1;">
</div>
<input type="text" id="metaDesc" placeholder="Description / Version Note" style="width:100%;">
</div>
<div class="config-section"><label>Main Damage Formula</label><input type="text" id="dmgFormula" class="formula-input"></div>
<div class="config-section"><label>Hit Chance Formula (%)</label><input type="text" id="hitFormula" class="formula-input"></div>
<div class="config-section"><label>Combat Power (CP) Formula</label><input type="text" id="cpFormula" class="formula-input"></div>
<div class="config-section"><label>Define Stats</label><input type="text" id="statDefinitions" placeholder="e.g. hp, atk, def"></div>
<div class="config-section"><label>Stat Descriptions</label><textarea id="statDescInput" class="desc-input"></textarea></div>
<button class="btn" id="applyConfigBtn">Apply Rules & Info</button>
</div>
</div>
<div id="snapshotModal" class="modal">
<div class="modal-content">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;"><h3>Balance Snapshots</h3><span class="close-snapshot">×</span></div>
<div style="display:flex; gap:10px; margin-bottom:15px;"><input type="text" id="newSnapshotName" placeholder="Snapshot Name" style="flex:1;"><button id="createSnapshotBtn" class="btn" style="width:auto; background-color:#2da44e;">+ Create</button></div>
<div class="snapshot-list" id="snapshotListContainer"></div>
</div>
</div>
<div id="solverModal" class="modal">
<div class="modal-content" style="width: 400px;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
<h3>🎯 Goal Seeker</h3>
<span class="close-modal close-solver" style="cursor:pointer; font-size:1.5em;">×</span>
</div>
<div style="margin-bottom:15px; background:#252526; padding:10px; border-radius:4px;">
<div style="color:#ccc; margin-bottom:5px; font-size:0.9em;">Targeting: <b id="solverTargetName" style="color:#5fabff;">-</b></div>
<div style="color:#ccc; font-size:0.9em;">Adjusting: <b id="solverStatName" style="color:#e74c3c;">-</b> (Growth)</div>
</div>
<div class="config-section">
<label>At Level</label>
<input type="number" id="solverLevel" value="20">
</div>
<div class="config-section">
<label>Target Metric</label>
<select id="solverMetric" class="dark-select" style="width:100%;">
<option value="cp">Combat Power (CP)</option>
<option value="dps">DPS (Avg Damage)</option>
</select>
</div>
<div class="config-section">
<label>Target Value</label>
<input type="number" id="solverValue" placeholder="e.g. 1000">
</div>
<button id="runSolverBtn" class="btn" style="background-color:#5fabff; margin-top:10px;">Calculate & Apply</button>
</div>
</div>
<div id="battleModal" class="modal">
<div class="modal-content battle-content" style="width: 1400px; max-width: 95vw;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;"><h3>Battle Simulator</h3><span class="close-battle" style="font-size:2em; cursor:pointer;">×</span></div>
<div class="battle-controls">
<div class="battle-control-group" style="flex:1;"><label style="color:#007acc;">Attacker</label><select id="battleEntA" class="dark-select"></select></div>
<div style="align-self:end; padding-bottom:10px; font-weight:bold; color:#888;">VS</div>
<div class="battle-control-group" style="flex:1;"><label style="color:#ff5555;">Opponent</label><select id="battleEntB" class="dark-select"><option value="all">ALL (League)</option></select></div>
<div class="battle-control-group" style="width:80px;"><label>Level</label><input type="number" id="battleLevel" value="20"></div>
<div class="battle-control-group" style="width:80px;"><label>Count</label><input type="number" id="battleCount" value="100"></div>
<button id="btnDetail" class="btn" style="width:auto; height:36px; background-color:#5fabff; margin-right:5px;">M.C</button>
<button id="runBattleBtn" class="btn" style="width:auto; height:36px; background-color:#e74c3c;">FIGHT</button>
</div>
<div class="battle-results-wrapper" style="display: flex; gap: 15px; height: 600px;">
<div class="battle-chart-area"><h4 style="margin:0 0 10px 0; color:#ccc; text-align:center;">Win Rate & Avg Turns</h4><div style="flex:1; position:relative; min-height: 200px;"><canvas id="battleResultChart"></canvas></div></div>
<div class="battle-log-area" style="flex: 1; display: flex; flex-direction: column; min-width: 0;"><h4 style="margin:0 0 5px 0; color:#ccc;">Battle Log</h4><div id="battleLog" class="log-container" style="flex: 1; overflow-y: auto;"></div></div>
<div class="battle-stat-area" style="flex: 0.8; display: flex; flex-direction: column; min-width: 0; background-color: #2f3136; padding: 10px; border-radius: 8px;"><h4 style="margin:0 0 5px 0; color:#ccc;">Stats (Lv.<span id="statDisplayLevel">?</span>)</h4><div id="battleStatList" style="flex: 1; overflow-y: auto; padding-right: 5px;"></div></div>
</div>
</div>
</div>
<div id="detailModal" class="modal">
<div class="modal-content" style="width: 1300px; max-width: 95vw;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;"><h3 id="detailTitle">Detailed Analysis</h3><span class="close-detail" style="font-size:2em; cursor:pointer;">×</span></div>
<div style="display:flex; gap:20px; height:400px;">
<div style="flex:1; background:#202225; padding:10px; border-radius:8px;"><h4 style="text-align:center; color:#ccc; margin:5px 0;">Turn Distribution (소요 턴)</h4><div style="position:relative; height:350px;"><canvas id="detailTurnChart"></canvas></div></div>
<div style="flex:1; background:#202225; padding:10px; border-radius:8px;"><h4 style="text-align:center; color:#ccc; margin:5px 0;">Winning HP Distribution (승리 시 잔여 체력)</h4><div style="position:relative; height:350px;"><canvas id="detailHpChart"></canvas></div></div>
</div>
<div id="detailStats" style="margin-top:15px; padding:10px; background:#2f3136; border-radius:4px; color:#ddd; font-family:monospace;">Waiting for data...</div>
</div>
</div>
<div id="leagueModal" class="modal">
<div class="modal-content" style="width: 1200px; max-width: 95vw; height: 90vh; display: flex; flex-direction: column;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
<div style="display:flex; gap:15px; align-items:center;"><h3>League Matchup Matrix</h3><div style="display:flex; align-items:center; gap:5px; font-size:0.9em;"><label>Level:</label><input type="number" id="leagueLevel" value="20" style="width:50px; padding:3px; background:#111; border:1px solid #444; color:#fff;"><button id="runLeagueBtn" class="btn" style="width:auto; padding:3px 10px; font-size:0.9em; background-color:#2da44e;">Run League</button></div></div>
<span class="close-league" style="font-size:2em; cursor:pointer;">×</span>
</div>
<div id="leagueContainer" style="flex:1; position:relative; background:#000; overflow:hidden; display:flex; justify-content:center; align-items:center;"><div style="color:#666;">Press 'Run League' to generate matrix.</div></div>
</div>
</div>
<div id="itemSetModal" class="modal">
<div class="modal-content" style="width: 400px;">
<span class="close-modal close-itemset">×</span><h2>Item Sets</h2>
<div style="display:flex; gap:10px; margin-bottom:15px; border-bottom:1px solid #3e3e42; padding-bottom:15px;"><input type="text" id="newItemSetName" placeholder="Set Name" style="flex: 4; padding: 8px; background-color: #111; border: 1px solid #444; color: white; border-radius: 4px;"><button id="saveItemSetBtn" class="btn" style="flex: 1; min-width: 100px;">Save</button></div>
<div id="itemSetList" style="max-height: 300px; overflow-y: auto;"></div>
</div>
</div>
<div id="bulkModal" class="modal">
<div class="modal-content" style="width: 90vw; height: 85vh; display: flex; flex-direction: column;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
<h3>Bulk Data Editor</h3>
<span class="close-bulk" style="font-size:2em; cursor:pointer;">×</span>
</div>
<div class="bulk-controls" style="margin-bottom:10px; display:flex; gap:10px; align-items:center; background:#252526; padding:10px; border-radius:4px;">
<span style="font-size:0.9em; color:#888;">Selected: <b id="selectedCount" style="color:#fff;">0</b></span>
<div style="width:1px; height:20px; background:#444;"></div>
<select id="bulkStatSelect" class="dark-select" style="width:120px;"></select>
<select id="bulkOpSelect" class="dark-select" style="width:80px;">
<option value="set">Set to</option>
<option value="add">Add (+)</option>
<option value="mult">Mult (*)</option>
</select>
<input type="number" id="bulkValueInput" placeholder="Value" style="width:80px; padding:5px; background:#111; border:1px solid #444; color:#fff;">
<button id="applyBulkBtn" class="btn" style="width:auto; padding:5px 15px; background:#2da44e;">Apply to Selected</button>
</div>
<div id="gridContainer" style="flex:1; overflow:auto; background:#1e1e1e; border:1px solid #3e3e42;">
</div>
</div>
</div>
<div id="feedback-modal" class="modal">
<div class="modal-content">
<h3 style="margin-top:0; border-bottom:1px solid #444; padding-bottom:10px;">Feedback</h3>
<div style="margin: 15px 0;">
<label style="display:block; margin-bottom:5px; font-size:0.9em; color:#888;">Type</label>
<select id="feedback-type">
<option value="bug">Bug Report</option>
<option value="feature">Feature Suggestion</option>
<option value="etc">Others</option>
</select>
</div>
<div style="margin-bottom: 15px;">
<label style="display:block; margin-bottom:5px; font-size:0.9em; color:#888;">Message</label>
<textarea id="feedback-content" placeholder="Enter your feedback here..."></textarea>
</div>
<div style="display:flex; justify-content:flex-end; gap:10px;">
<button id="close-feedback-modal" class="btn" style="background:#444;">Close</button>
<button id="send-feedback" class="btn" style="background:#2da44e; font-weight:bold;">Send</button>
</div>
</div>
</div>
<script src="renderer.js"></script>
</body>
</html>