-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcooking_generator.html
More file actions
276 lines (248 loc) · 11 KB
/
cooking_generator.html
File metadata and controls
276 lines (248 loc) · 11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ItemsAdder Cooking Generator</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
:root {
--primary-color: #2c3e50;
--secondary-color: #34495e;
--accent-color: #3498db;
}
body {
background-color: #f5f6fa;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.navbar {
background-color: var(--primary-color);
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.card {
border: none;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.card-header {
background-color: var(--secondary-color);
color: white;
border-radius: 10px 10px 0 0 !important;
}
.btn-primary {
background-color: var(--accent-color);
border: none;
}
.btn-primary:hover {
background-color: #2980b9;
}
.preview-area {
background-color: #2c3e50;
color: #ecf0f1;
font-family: 'Consolas', monospace;
padding: 15px;
border-radius: 5px;
max-height: 800px;
min-height: 600px;
overflow-y: auto;
}
.machine-option {
margin-right: 15px;
}
.time-info {
font-size: 0.875rem;
color: #6c757d;
margin-top: 5px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark mb-4">
<div class="container">
<a class="navbar-brand" href="index.html">
<i class="fas fa-cube me-2"></i>
ItemsAdder Generators
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="itemsadder_generator.html">
<i class="fas fa-cube me-1"></i>Item Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="cooking_generator.html">
<i class="fas fa-fire me-1"></i>Cooking Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="crafting_generator.html">
<i class="fas fa-hammer me-1"></i>Crafting Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="loot_generator.html">
<i class="fas fa-gift me-1"></i>Loot Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="hud_generator.html">
<i class="fas fa-desktop me-1"></i>HUD Generator
</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Cooking Recipe Configuration</h5>
</div>
<div class="card-body">
<form id="recipeForm">
<div class="mb-3">
<label class="form-label">Namespace</label>
<input type="text" class="form-control" id="namespace" required>
</div>
<div class="mb-3">
<label class="form-label">Recipe ID</label>
<input type="text" class="form-control" id="recipeId" required>
</div>
<div class="mb-3">
<label class="form-label">Permission</label>
<input type="text" class="form-control" id="permission">
</div>
<div class="mb-3">
<label class="form-label">Input Item</label>
<input type="text" class="form-control" id="ingredientItem" placeholder="namespace:item_id" required>
</div>
<div class="mb-3">
<label class="form-label">Allowed Machines</label>
<div class="form-check machine-option">
<input class="form-check-input" type="checkbox" id="furnace" checked>
<label class="form-check-label">Furnace</label>
</div>
<div class="form-check machine-option">
<input class="form-check-input" type="checkbox" id="blastFurnace">
<label class="form-check-label">Blast Furnace</label>
</div>
<div class="form-check machine-option">
<input class="form-check-input" type="checkbox" id="smoker">
<label class="form-check-label">Smoker</label>
</div>
</div>
<div class="mb-3">
<label class="form-label">Experience</label>
<input type="number" class="form-control" id="exp" value="1" min="0" step="0.1">
</div>
<div class="mb-3">
<label class="form-label">Cook Time (ticks)</label>
<input type="number" class="form-control" id="cookTime" value="200" min="1">
<div class="time-info">20 ticks = 1 second</div>
</div>
<div class="mb-3">
<label class="form-label">Result</label>
<div class="row">
<div class="col-md-8">
<input type="text" class="form-control" id="resultItem" placeholder="namespace:item_id" required>
</div>
<div class="col-md-4">
<input type="number" class="form-control" id="resultAmount" value="1" min="1">
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Generate Recipe</button>
</form>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Preview</h5>
</div>
<div class="card-body">
<div class="preview-area" id="preview">
<pre>Recipe will appear here...</pre>
</div>
<button class="btn btn-primary mt-3" onclick="copyToClipboard()">
<i class="fas fa-copy me-2"></i>Copy to Clipboard
</button>
</div>
</div>
</div>
</div>
</div>
<script>
// Generate recipe
document.getElementById('recipeForm').addEventListener('submit', function(e) {
e.preventDefault();
generateRecipe();
});
// Add real-time update listeners
const formInputs = document.querySelectorAll('#recipeForm input, #recipeForm select');
formInputs.forEach(input => {
input.addEventListener('input', generateRecipe);
input.addEventListener('change', generateRecipe);
});
function generateRecipe() {
const namespace = document.getElementById('namespace').value;
const recipeId = document.getElementById('recipeId').value;
const permission = document.getElementById('permission').value;
const ingredientItem = document.getElementById('ingredientItem').value;
const exp = document.getElementById('exp').value;
const cookTime = document.getElementById('cookTime').value;
const resultItem = document.getElementById('resultItem').value;
const resultAmount = document.getElementById('resultAmount').value;
// Get selected machines
const machines = [];
if (document.getElementById('furnace').checked) machines.push('FURNACE');
if (document.getElementById('blastFurnace').checked) machines.push('BLAST_FURNACE');
if (document.getElementById('smoker').checked) machines.push('SMOKER');
let config = `info:
namespace: ${namespace}
recipes:
cooking:
${recipeId}:`;
if (permission) {
config += `\n permission: ${permission}`;
}
config += `\n ingredient:
item: ${ingredientItem}
machines:`;
machines.forEach(machine => {
config += `\n - ${machine}`;
});
config += `\n exp: ${exp}
cook_time: ${cookTime}
result:
item: ${resultItem}
amount: ${resultAmount}`;
document.getElementById('preview').innerHTML = `<pre>${config}</pre>`;
}
function copyToClipboard() {
const preview = document.getElementById('preview').textContent;
navigator.clipboard.writeText(preview).then(() => {
alert('Recipe copied to clipboard!');
});
}
// Initialize the form
document.addEventListener('DOMContentLoaded', function() {
// Prevent form submission on Enter key
document.getElementById('cookingForm').addEventListener('keydown', function(e) {
if (e.key === 'Enter') {
e.preventDefault();
}
});
});
</script>
</body>
</html>