-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
402 lines (373 loc) · 11.8 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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- Add these meta tags for search engines and social platforms -->
<meta
name="description"
content="Explore the RUM-Color Palette for creative design and development projects. Copy hex colors easily and access clipboard history."
/>
<meta
name="keywords"
content="RUM-Color Palette, hex colors, design, development, color palette, clipboard history"
/>
<meta name="author" content="Your Name or Organization" />
<title>RUM-Color</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
<style>
body {
font-family: "Arial", sans-serif;
background-color: #061726;
color: white;
margin: 0;
padding: 0;
max-width: 800px;
margin: 0 auto;
}
.container {
margin-top: 30px;
}
.color-box {
display: inline-block;
width: 100px;
height: 100px;
margin: 2px;
border-radius: 50%; /* Make it a circle */
cursor: pointer;
position: relative;
overflow: hidden; /* To contain the absolutely positioned hex value */
border: 2px solid white;
}
.color-box .hex-value {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 14px;
color: white;
}
.color-box:hover:after {
content: attr(data-color);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 14px;
background: rgba(0, 0, 0, 0.7);
padding: 5px;
border-radius: 3px;
display: none;
}
.color-box.copied {
animation: flash 1s ease-out;
}
#copySuccess {
display: none;
color: green;
margin-top: 5px;
}
#clipboardHistory {
margin-top: 30px;
display: none;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 200px;
background: #0b3148;
overflow-x: hidden;
padding-top: 20px;
color: white;
z-index: 1;
}
.clipboard-item {
display: inline-block;
margin-right: 10px;
}
.clipboard-item span {
display: block;
margin-top: 5px;
font-size: 12px;
color: #555;
}
.menu-icon {
position: fixed;
left: 10px;
top: 10px;
cursor: pointer;
z-index: 2;
}
@keyframes flash {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.rumbleuser {
padding: 6px;
border: 2px solid #1f9ad0;
background-color: #0b3148;
color: #1f9ad0;
border-radius: 10px;
}
.rumbleuser:hover {
color: white;
cursor: pointer;
}
.instructions {
text-align: left;
background-color: #000312;
padding: 6px;
border-radius: 10px;
border: 1px solid #0b3148;
margin-bottom: 5px;
}
h2 {
text-align: center;
padding: 6px;
border: 2px solid #1f9ad0;
background-color: #0b3148;
color: #1f9ad0;
border-radius: 10px;
font-size: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container text-center">
<div class="row">
<div class="col-12">
<img
src="RUM-Colors Logo.png"
alt="Logo"
class="img-fluid"
style="max-width: 0 auto; height: 50px; margin-bottom: 30px"
/>
</div>
</div>
<!-- Social media icons -->
<!-- Social media icons and hamburger menu -->
<div class="row">
<div class="col-12 d-flex justify-content-end">
<!-- Hamburger menu -->
<span class="menu-icon" onclick="toggleHistoryPanel()">
☰ Clipboard History
</span>
<!-- Social media icons -->
<div class="ml-2">
<a
href="https://discord.gg/737N2f6sGx"
target="_blank"
style="color: white"
><i class="fab fa-discord fa-2x"></i
></a>
<a
href="https://paypal.me/2players1Gamer"
target="_blank"
style="color: white"
><i class="fab fa-paypal fa-2x"></i
></a>
<a
href="https://github.com/tinyplayerss/RUM-Color"
target="_blank"
style="color: white"
><i class="fab fa-github fa-2x"></i
></a>
<!-- Add more icons as needed -->
</div>
</div>
</div>
<span class="menu-icon" onclick="toggleHistoryPanel()">
☰ Clipboard History
</span>
<!-- Instructions Section -->
<div class="instructions">
<h2>How to Use RUM-Color</h2>
<ol>
<li>
<p>
Welcome to RUM-Color Click on any color Circle to copy its hex
value to your clipboard. The hex value will be displayed for you.
</p>
</li>
<li>
<p>
Explore the Rumble Color Palette and the Rumble Studio Color
Palette below. Colors are conveniently organized for your design
and development projects.
</p>
</li>
<li>
<p>
Check the "Clipboard History" section to see a log of copied
colors.
</p>
</li>
<li>
<p>Enjoy using RUM-Color Palette for your creative endeavors!</p>
</li>
</ol>
</div>
<!-- End Instructions Section -->
<div class="row">
<div class="col-12">
<h2>Rumble Color Palette</h2>
</div>
</div>
<div class="row">
<div class="col-12">
<div id="color1" class="color-box" style="background-color: #000312">
<span class="hex-value"></span>
</div>
<div id="color2" class="color-box" style="background-color: #061726">
<span class="hex-value"></span>
</div>
<div id="color3" class="color-box" style="background-color: #85c742">
<span class="hex-value"></span>
</div>
<div id="color4" class="color-box" style="background-color: #d72e59">
<span class="hex-value"></span>
</div>
<div id="color5" class="color-box" style="background-color: #ffffff">
<span class="hex-value"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<h2>Rumble Studio Color Palette</h2>
</div>
</div>
<div class="row">
<div class="col-12">
<div id="color6" class="color-box" style="background-color: #000312">
<span class="hex-value"></span>
</div>
<div id="color7" class="color-box" style="background-color: #061726">
<span class="hex-value"></span>
</div>
<div id="color8" class="color-box" style="background-color: #0b3148">
<span class="hex-value"></span>
</div>
<div id="color9" class="color-box" style="background-color: #74cc1d">
<span class="hex-value"></span>
</div>
<div id="color10" class="color-box" style="background-color: #1f9ad0">
<span class="hex-value"></span>
</div>
<div id="color11" class="color-box" style="background-color: #d72e59">
<span class="hex-value"></span>
</div>
<div id="color12" class="color-box" style="background-color: #ffffff">
<span class="hex-value"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<p id="copySuccess">Color value copied to clipboard!</p>
</div>
</div>
<div class="row">
<div class="col-12" id="clipboardHistory">
<h3>Clipboard History</h3>
</div>
</div>
</div>
<script
src="https://kit.fontawesome.com/739e3ae0dc.js"
crossorigin="anonymous"
></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script>
function toggleHistoryPanel() {
var historyPanel = document.getElementById("clipboardHistory");
historyPanel.style.display =
historyPanel.style.display === "none" ? "block" : "none";
}
document.addEventListener("DOMContentLoaded", function () {
var colorBoxes = document.querySelectorAll(".color-box");
colorBoxes.forEach(function (colorBox, index) {
var hexValue = rgbToHex(getComputedStyle(colorBox).backgroundColor);
colorBox.dataset.color = hexValue; // Set hex value in data attribute
colorBox.querySelector(".hex-value").innerText = hexValue;
invertTextColor(colorBox); // Apply initial text color
});
colorBoxes.forEach(function (colorBox) {
colorBox.addEventListener("click", function () {
var hexValue = this.dataset.color;
copyToClipboard(hexValue);
updateClipboardHistory(hexValue);
this.classList.add("copied");
$("#copySuccess").fadeIn().delay(1000).fadeOut();
setTimeout(function () {
colorBox.classList.remove("copied");
}, 1000);
});
});
function rgbToHex(rgb) {
var rgbArray = rgb.match(/\d+/g);
return (
"#" +
Number(rgbArray[0]).toString(16).padStart(2, "0") +
Number(rgbArray[1]).toString(16).padStart(2, "0") +
Number(rgbArray[2]).toString(16).padStart(2, "0")
);
}
function copyToClipboard(text) {
var textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
document.execCommand("Copy");
document.body.removeChild(textArea);
}
function updateClipboardHistory(value) {
var historyElement = document.getElementById("clipboardHistory");
var clipboardItem = document.createElement("div");
clipboardItem.classList.add("clipboard-item");
clipboardItem.innerHTML =
'<div class="color-box" style="background-color:' +
value +
';" data-color="' +
value +
'">' +
'<span class="hex-value">' +
value +
"</span>" +
"</div>";
historyElement.appendChild(clipboardItem);
}
function invertTextColor(colorBox) {
var hexValue = colorBox.dataset.color;
var rgbArray = hexToRgb(hexValue);
var brightness =
(rgbArray[0] * 299 + rgbArray[1] * 587 + rgbArray[2] * 114) / 1000;
var textColor = brightness > 128 ? "black" : "white";
colorBox.querySelector(".hex-value").style.color = textColor;
}
function hexToRgb(hex) {
var bigint = parseInt(hex.substring(1), 16);
var r = (bigint >> 16) & 255;
var g = (bigint >> 8) & 255;
var b = bigint & 255;
return [r, g, b];
}
});
</script>
</body>
</html>