mirror of
https://github.com/SwingTheVine/Wplace-BlueMarble.git
synced 2026-04-21 15:21:58 +00:00
Made all invalid palette colors appear under "Other" color
This commit is contained in:
parent
ed15a15577
commit
5707943734
6 changed files with 30 additions and 21 deletions
4
dist/BlueMarble.user.js
vendored
4
dist/BlueMarble.user.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -49,7 +49,7 @@
|
||||||
<a href="https://discord.gg/tpeBPy46hf" target="_blank" rel="noopener noreferrer"><img alt="Contact Me" src="https://img.shields.io/badge/Contact_Me-gray?style=flat&logo=Discord&logoColor=white&logoSize=auto&labelColor=cornflowerblue"></a>
|
<a href="https://discord.gg/tpeBPy46hf" target="_blank" rel="noopener noreferrer"><img alt="Contact Me" src="https://img.shields.io/badge/Contact_Me-gray?style=flat&logo=Discord&logoColor=white&logoSize=auto&labelColor=cornflowerblue"></a>
|
||||||
<a href="https://bluemarble.camilledaguin.fr/" target="_blank" rel="noopener noreferrer"><img alt="Blue Marble Website" src="https://img.shields.io/badge/Blue_Marble_Website-Camille_Daguin-blue?style=flat&logo=globe&logoColor=white"></a>
|
<a href="https://bluemarble.camilledaguin.fr/" target="_blank" rel="noopener noreferrer"><img alt="Blue Marble Website" src="https://img.shields.io/badge/Blue_Marble_Website-Camille_Daguin-blue?style=flat&logo=globe&logoColor=white"></a>
|
||||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="WakaTime" src="https://img.shields.io/badge/Coding_Time-111hrs_12mins-blue?style=flat&logo=wakatime&logoColor=black&logoSize=auto&labelColor=white"></a>
|
<a href="" target="_blank" rel="noopener noreferrer"><img alt="WakaTime" src="https://img.shields.io/badge/Coding_Time-111hrs_12mins-blue?style=flat&logo=wakatime&logoColor=black&logoSize=auto&labelColor=white"></a>
|
||||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Total Patches" src="https://img.shields.io/badge/Total_Patches-508-black?style=flat"></a>
|
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Total Patches" src="https://img.shields.io/badge/Total_Patches-509-black?style=flat"></a>
|
||||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Total Lines of Code" src="https://tokei.rs/b1/github/SwingTheVine/Wplace-BlueMarble?category=code"></a>
|
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Total Lines of Code" src="https://tokei.rs/b1/github/SwingTheVine/Wplace-BlueMarble?category=code"></a>
|
||||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Total Comments" src="https://tokei.rs/b1/github/SwingTheVine/Wplace-BlueMarble?category=comments"></a>
|
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Total Comments" src="https://tokei.rs/b1/github/SwingTheVine/Wplace-BlueMarble?category=comments"></a>
|
||||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Compression" src="https://img.shields.io/badge/Compression-69.52%25-blue"></a>
|
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Compression" src="https://img.shields.io/badge/Compression-69.52%25-blue"></a>
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "wplace-bluemarble",
|
"name": "wplace-bluemarble",
|
||||||
"version": "0.84.13",
|
"version": "0.84.14",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "wplace-bluemarble",
|
"name": "wplace-bluemarble",
|
||||||
"version": "0.84.13",
|
"version": "0.84.14",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"esbuild": "^0.25.0",
|
"esbuild": "^0.25.0",
|
||||||
"jsdoc": "^4.0.4",
|
"jsdoc": "^4.0.4",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "wplace-bluemarble",
|
"name": "wplace-bluemarble",
|
||||||
"version": "0.84.13",
|
"version": "0.84.14",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"homepage": "https://bluemarble.camilledaguin.fr/",
|
"homepage": "https://bluemarble.camilledaguin.fr/",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Blue Marble
|
// @name Blue Marble
|
||||||
// @namespace https://github.com/SwingTheVine/
|
// @namespace https://github.com/SwingTheVine/
|
||||||
// @version 0.84.13
|
// @version 0.84.14
|
||||||
// @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA.
|
// @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA.
|
||||||
// @author SwingTheVine
|
// @author SwingTheVine
|
||||||
// @license MPL-2.0
|
// @license MPL-2.0
|
||||||
|
|
|
||||||
37
src/main.js
37
src/main.js
|
|
@ -652,31 +652,40 @@ function buildOverlayMain() {
|
||||||
.sort((a,b) => b[1].count - a[1].count); // sort by frequency desc
|
.sort((a,b) => b[1].count - a[1].count); // sort by frequency desc
|
||||||
|
|
||||||
for (const [rgb, meta] of entries) {
|
for (const [rgb, meta] of entries) {
|
||||||
const [r,g,b] = rgb.split(',').map(Number);
|
let row = document.createElement('div');
|
||||||
|
|
||||||
const row = document.createElement('div');
|
|
||||||
row.style.display = 'flex';
|
row.style.display = 'flex';
|
||||||
row.style.alignItems = 'center';
|
row.style.alignItems = 'center';
|
||||||
row.style.gap = '8px';
|
row.style.gap = '8px';
|
||||||
row.style.margin = '4px 0';
|
row.style.margin = '4px 0';
|
||||||
|
|
||||||
const swatch = document.createElement('div');
|
let swatch = document.createElement('div');
|
||||||
swatch.style.width = '14px';
|
swatch.style.width = '14px';
|
||||||
swatch.style.height = '14px';
|
swatch.style.height = '14px';
|
||||||
swatch.style.border = '1px solid rgba(255,255,255,0.5)';
|
swatch.style.border = '1px solid rgba(255,255,255,0.5)';
|
||||||
swatch.style.background = `rgb(${r},${g},${b})`;
|
|
||||||
|
|
||||||
const label = document.createElement('span');
|
let label = document.createElement('span');
|
||||||
label.style.fontSize = '12px';
|
label.style.fontSize = '12px';
|
||||||
let labelText = `${meta.count.toLocaleString()}`;
|
let labelText = `${meta.count.toLocaleString()}`;
|
||||||
try {
|
|
||||||
const tMeta = templateManager.templatesArray?.[0]?.rgbToMeta?.get(rgb);
|
// Special handling for "other" and "transparent"
|
||||||
if (tMeta && typeof tMeta.id === 'number') {
|
if (rgb === 'other') {
|
||||||
const displayName = tMeta?.name || `rgb(${r},${g},${b})`;
|
swatch.style.background = '#888'; // Neutral color for "Other"
|
||||||
const starLeft = tMeta.premium ? '★ ' : '';
|
labelText = `Other • ${labelText}`;
|
||||||
labelText = `#${tMeta.id} ${starLeft}${displayName} • ${labelText}`;
|
} else if (rgb === '#deface') {
|
||||||
}
|
swatch.style.background = '#deface';
|
||||||
} catch (_) {}
|
labelText = `Transparent • ${labelText}`;
|
||||||
|
} else {
|
||||||
|
const [r, g, b] = rgb.split(',').map(Number);
|
||||||
|
swatch.style.background = `rgb(${r},${g},${b})`;
|
||||||
|
try {
|
||||||
|
const tMeta = templateManager.templatesArray?.[0]?.rgbToMeta?.get(rgb);
|
||||||
|
if (tMeta && typeof tMeta.id === 'number') {
|
||||||
|
const displayName = tMeta?.name || `rgb(${r},${g},${b})`;
|
||||||
|
const starLeft = tMeta.premium ? '★ ' : '';
|
||||||
|
labelText = `#${tMeta.id} ${starLeft}${displayName} • ${labelText}`;
|
||||||
|
}
|
||||||
|
} catch (ignored) {}
|
||||||
|
}
|
||||||
label.textContent = labelText;
|
label.textContent = labelText;
|
||||||
|
|
||||||
const toggle = document.createElement('input');
|
const toggle = document.createElement('input');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue