-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
120 lines (109 loc) · 4.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Minecraft Bedrock Finder</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet"> <!-- Przykład użycia Google Fonts -->
<style>
body {
font-family: 'Roboto', sans-serif; /* Zastosowanie własnego fontu */
margin: 20px;
background-color: #f4f4f4;
}
h1 {
color: #333;
}
label, button {
margin-top: 10px;
display: block;
font-size: 16px;
}
input[type="text"] {
padding: 8px;
font-size: 16px;
}
button {
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.result {
margin-top: 20px;
padding: 10px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.result p {
margin: 0;
}
.result a {
color: #007bff;
text-decoration: none;
}
.result a:hover {
text-decoration: underline;
}
.footer {
margin-top: 30px;
font-size: 14px;
color: #777;
}
</style>
</head>
<body>
<h1>Minecraft Bedrock Finder</h1>
<label for="username">Wpisz nazwę z Minecraft Bedrock, aby znaleźć XUID:</label>
<input type="text" id="username" name="username">
<button onclick="searchInfo()">Szukaj</button>
<div class="result" id="result"></div>
<div class="footer">
<p>By Kna</p>
</div>
<script>
async function searchInfo() {
const username = document.getElementById('username').value.trim();
if (!username) {
document.getElementById('result').innerHTML = '<p style="color: red;">Proszę wpisać nazwę użytkownika!</p>';
return;
}
try {
// Fetch XUID
const xuidResponse = await fetch(`https://api.geysermc.org/v2/xbox/xuid/${username}`);
if (!xuidResponse.ok) throw new Error('Failed to fetch XUID data');
const xuidData = await xuidResponse.json();
const xuid = xuidData.xuid;
if (!xuid) {
document.getElementById('result').innerHTML = '<p style="color: red;">Nie znaleziono XUID dla podanej nazwy użytkownika.</p>';
return;
}
// Fetch Skin Texture ID
const skinResponse = await fetch(`https://api.geysermc.org/v2/skin/${xuid}`);
if (!skinResponse.ok) throw new Error('Failed to fetch skin data');
const skinData = await skinResponse.json();
const textureId = skinData.texture_id;
if (!textureId) {
document.getElementById('result').innerHTML = '<p style="color: red;">Nie znaleziono tekstury dla podanego XUID.</p>';
return;
}
const skinUrl = `https://textures.minecraft.net/texture/${textureId}`;
const xuidUrl = `https://api.geysermc.org/v2/xbox/xuid/${username}`;
document.getElementById('result').innerHTML = `
<p>XUID: ${xuid}</p>
<p>Texture ID: ${textureId}</p>
<p><a href="${skinUrl}" target="_blank">Otwórz URL Tekstury</a></p>
<p><a href="${xuidUrl}" target="_blank">Otwórz URL XUID</a></p>
`;
} catch (error) {
document.getElementById('result').innerHTML = `<p style="color: red;">Wystąpił błąd: ${error.message}</p>`;
}
}
</script>
</body>
</html>