-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmiencraft-crafting-recipe.html
162 lines (156 loc) · 7.7 KB
/
miencraft-crafting-recipe.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
<!DOCTYPE HTML>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="image/icontestHtml.png">
<title>hrmc.ngs.computer</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@700&display=swap" rel="stylesheet">
</head>
<body>
<header>
<!-- <div class="link">
<a id="twitterLink" href="https://x.com/0526ngs" target="_blank">
<img src="image/iconTwitterhrmcngsHtml.png" alt="Twitter Link Image" width="100">
</a>
<a id="twitterLink" href="https://Instagram.com/0526ngs" target="_blank">
<img src="image/iconInstagramhrmcngsHtml.png" alt="Instagram Link Image" width="100">
</a>
<a id="twitterLink" href="https://github.com/hrmcngs" target="_blank">
<img src="image/iconGithubhrmcngsHtml.png" alt="Github Link Image" width="100">
</a>
<a id="twitterLink" href="https://x.com/RenkonUmauma65" target="_blank">
<img src="image/iconTwitterrenkonHtml.png" alt="Twitter Link Image" width="100">
</a>
<a id="twitterLink" href="https://github.com/Renkon65" target="_blank">
<img src="image/iconGithubrenkonHtml.png" alt="github Link Image" width="100">
</a>
</div> -->
<nav>
<div class="global-nav">
<ul>
<li><a class="button" href="index.html">home</a></li>
<li><a class="button" href="rotation.html">回転</a></li>
<li><a class="button" href="pythagorean-theorem.html">三平方の定理</a></li>
<li><a class="button" href="canvas-arc.html">円弧</a></li>
<li><a class="button" href="3dgraphics.html">3D図形</a></li>
</ul>
</div>
</nav>
</header>
<div class="craft_main">
<h2>マイクラ | クラフト レシピ生成</h2>
<!-- <input type="range" min="-2" max="2" step="0.01" id="start-angle">
<input type="range" min="-2" max="2" step="0.01" id="end-angle">
-->
<table>
<tbody>
<tr>
<th><label for="id-block-or-item-0">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-0"/></td>
<th><label for="id-block-or-item-3">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-3"></td>
<th><label for="id-block-or-item-6">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-6"></td>
</tr>
<tr>
<th><label for="id-block-or-item-1">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-1"/></td>
<th><label for="id-block-or-item-4">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-4"></td>
<th><label for="id-block-or-item-7">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-7"></td>
</tr>
<tr>
<th><label for="id-block-or-item-2">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-2"/></td>
<th><label for="id-block-or-item-5">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-5"></td>
<th><label for="id-block-or-item-8">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-8"></td>
</tr>
<tr>
<th><label for="id-block-or-item-9">item id:</label></th>
<td><input placeholder="アイテムのidを入力" id="id-block-or-item-9"/></td>
</tr>
</tbody>
</table>
<input type="number" id="item-count" placeholder="数値を入力" min="1" max="64">
<button id="submitButton">了承</button>
<button id="copyButton">コピー</button>
<p id="log">Existing text</p>
<canvas id="myCanvas" width="578" height="250"></canvas>
<script>
// const mql = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');
// const isDark = mql.matches;
document.getElementById('submitButton').addEventListener('click', function() {
// JSONオブジェクトのテンプレート
var jsonTemplate = {
"type": "minecraft:crafting_shaped",
"pattern": generateRandomPattern(),
"key": {},
"result": {
"item": "id-block-or-item-9",
"count": 1
}
};
// テキストフィールドの数
var fieldCount = 10; // 0から9まで
// 各テキストフィールドの値を取得してJSONオブジェクトに追加
for (var i = 0; i < fieldCount; i++) {
var inputText = document.getElementById('id-block-or-item-' + i).value;
jsonTemplate.key[i.toString()] = {
"item": inputText
};
}
// countの値を取得してJSONオブジェクトに追加
var itemCount = document.getElementById('item-count').value;
jsonTemplate.result.count = parseInt(itemCount);
// JSONオブジェクトを整形して表示
document.getElementById('log').textContent = JSON.stringify(jsonTemplate, null, 2);
});
// ランダムなパターンを生成する関数
function generateRandomPattern() {
var digits = "0123456788";
var pattern = [];
// パターンをランダムに並べ替える
for (var i = 0; i < 3; i++) {
var row = "";
for (var j = 0; j < 3; j++) {
var randomIndex = Math.floor(Math.random() * digits.length);
row += digits[randomIndex];
digits = digits.replace(digits[randomIndex],'');
}
pattern.push(row);
}
return pattern;
}
// コピー機能を追加
document.getElementById('copyButton').addEventListener('click', function() {
var resultText = document.getElementById('log').textContent;
var textArea = document.createElement("textarea");
textArea.value = resultText;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
alert('Copied to clipboard');
});
// mql.addEventListener('change', update);
</script>
</div>
<div class="omake">
<h2>おまけ</h2>
<ul>
<li><a class="button" href="miencraft-blasting-smoking-campfire-cooking-recipe.html">blasting-smoking-campfire-cooking</a></li>
<li><a class="button" href="miencraft-crafting-recipe.html">minecraft-crafting-recipe</a></li>
<li><a class="button" href="miencraft-smelting-recipe.html">minecraft-smelting-recipe</a></li>
</ul>
</div>
<footer><small>2024年9月4日現在最新版</small></footer>
</body>
</html>