-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
287 lines (271 loc) · 11 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta Tags for Discord Preview -->
<meta property="og:type" content="website" />
<meta property="og:title" content="PUA Generator by @lukyn76" />
<meta
property="og:description"
content="Generate a random Private Use Area (PUA) character, which will automatically be copied to your clipboard. The generated characters will be saved in your history list and stored in your browser's local storage until you clear the history."
/>
<meta property="og:image" content="https://pua.vercel.app/logo.png" />
<meta property="og:image:type" content="image/png" />
<meta name="og:card" content="summary" />
<meta property="og:image:width" content="96" />
<meta property="og:image:height" content="96" />
<meta
property="og:image:secure_url"
content="https://pua.vercel.app/logo.png"
/>
<meta property="og:url" content="https://pua.vercel.app/" />
<meta name="theme-color" content="#6A00FF" />
<meta property="og:type" content="article" />
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="PUA Generator by @lukyn76" />
<meta
name="twitter:description"
content="Generate a random Private Use Area (PUA) character, which will automatically be copied to your clipboard. The generated characters will be saved in your history list and stored in your browser's local storage until you clear the history."
/>
<meta name="twitter:image" content="https://pua.vercel.app/logo.png" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="Generate a random Private Use Area (PUA) character, which will automatically be copied to your clipboard. The generated characters will be saved in your history list and stored in your browser's local storage until you clear the history."
/>
<link rel="icon" href="favicon.png" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="favicon.png" />
<title>PUA Generator by @lukyn76</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css"
/>
<style>
body {
display: flex;
flex-direction: column;
justify-content: start;
align-items: center;
min-height: 100vh;
height: 100%;
margin: 0;
font-family: Arial, sans-serif;
background: #0a0a0a;
color: #eee;
text-align: center;
}
img {
margin-top: 60px;
}
.title {
margin-top: 20px;
font-size: 36px;
margin-bottom: 20px;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.description {
opacity: 0.8;
font-size: 18px;
margin-bottom: 40px;
font-weight: bold;
max-width: 500px;
}
.hex-display {
margin-top: 40px;
font-size: 24px;
margin-bottom: 20px;
font-weight: bold;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
#generateButton {
padding: 15px 30px;
font-size: 20px;
font-weight: bold;
color: #ffffff;
background-color: #6a11cb;
background-color: #6a00ff;
border: 2px solid #000;
border-radius: 8px;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
transition: transform 0.2s, box-shadow 0.2s;
margin-bottom: 20px;
}
#generateButton:hover {
transform: scale(1.05);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}
#generateButton:active {
transform: scale(0.95);
}
.github-btn {
color: #c7c7c7;
padding: 10px 20px;
font-size: 18px;
border-radius: 5px;
text-decoration: none;
display: inline-block;
font-weight: bold;
transition: background-color 0.3s ease;
}
.history-section {
margin-top: 40px;
width: 100%;
max-width: 500px;
padding: 10px;
background-color: #181818;
border-radius: 8px;
text-align: left;
color: #c7c7c7;
margin-bottom: 100px;
}
.history-item {
margin-bottom: 15px;
font-size: 18px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.history-item span {
font-family: monospace;
}
.history-item .time {
font-size: 12px;
}
.clear-history {
display: flex;
justify-content: flex-end;
margin-bottom: 10px;
}
.clear-history button {
background-color: rgba(255, 255, 255, 0.2);
border: none;
border-radius: 4px;
font-size: 14px;
cursor: pointer;
text-decoration: none;
padding: 5px 10px;
}
.clear-history button:hover {
color: #fff;
}
.tag {
position: absolute;
bottom: 50px;
font-weight: 600;
text-decoration: none;
color: #fff;
}
</style>
</head>
<body>
<a href="https://github.com/heyxmirko" class="github-btn"
>by @lukyn76</a
>
<img src="logo.png" height="100%" alt="PUA Generator by @lukyn76" />
<div class="title">Random PUA Character Generator</div>
<div class="description">
Click the button below to generate a random Private Use Area (PUA)
character, which will automatically be copied to your clipboard. The
generated characters will be saved in your history list and stored
in your browser's local storage until you clear the history.
</div>
<div id="hexDisplay" class="hex-display"></div>
<button id="generateButton">Generate & Copy</button>
<div class="history-section">
<div class="clear-history">
<button id="clearHistoryButton">Clear History</button>
</div>
<div class="history-list" id="historyList"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
<script>
const generateButton = document.getElementById("generateButton");
const hexDisplay = document.getElementById("hexDisplay");
const historyList = document.getElementById("historyList");
const clearHistoryButton =
document.getElementById("clearHistoryButton");
function loadHistory() {
const history =
JSON.parse(localStorage.getItem("puaHistory")) || [];
historyList.innerHTML = "";
history.forEach((item) => {
const historyItem = document.createElement("div");
historyItem.classList.add("history-item");
const date = new Date(item.timestamp);
historyItem.innerHTML = `
<span>"${item.char}"</span>
<span>${item.hex}</span>
<div class="time">${date.toLocaleString()}</div>
`;
historyList.appendChild(historyItem);
});
}
function generateAndCopyPUACharacter() {
const startCodePoint = 0xe000; // Start of PUA range
const endCodePoint = 0xf8ff; // End of PUA range
const randomCodePoint =
Math.floor(
Math.random() * (endCodePoint - startCodePoint + 1)
) + startCodePoint;
const char = String.fromCharCode(randomCodePoint);
const hexCode = `U+${randomCodePoint
.toString(16)
.toUpperCase()}`;
hexDisplay.textContent = `Generated Hex: ${hexCode}`;
// Save the history to local storage
const history =
JSON.parse(localStorage.getItem("puaHistory")) || [];
const timestamp = new Date().toISOString();
history.unshift({ char, hex: hexCode, timestamp }); // Add to the start of the list
localStorage.setItem("puaHistory", JSON.stringify(history));
loadHistory();
navigator.clipboard
.writeText(char)
.then(() => {
Toastify({
text: `Character "${char}" copied to clipboard!`,
duration: 3000,
gravity: "top",
position: "right",
backgroundColor:
"linear-gradient(to right, #6a11cb, #2575fc)",
}).showToast();
})
.catch((err) => {
console.error("Failed to copy: ", err);
});
}
generateButton.addEventListener(
"click",
generateAndCopyPUACharacter
);
clearHistoryButton.addEventListener("click", () => {
localStorage.removeItem("puaHistory");
loadHistory();
});
loadHistory();
</script>
<script src="https://tebex-lib.vercel.app/template.js"></script>
<script>
initTebexTemplate(
"PUA Generator",
"https://pua.vercel.app/",
"undefined",
"undefined",
"undefined",
"undefined",
"undefined",
"undefined"
);
</script>
</body>
</html>