mirror of
https://github.com/SwingTheVine/Wplace-BlueMarble.git
synced 2026-01-11 22:40:18 +00:00
Color filtering & telemetry (#191)
* Update to 0.80.0 (#108) * Create CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Added some install instructions * Finished CONTRIBUTING.md * Fixed CONTRIBUTING table * Added SECURITY.md * Added Computer Edge instructions * Added Computer FireFox instructions * Clarified where the userscript can be downloaded from * Update to Wiki Docs * Simplify installation instructions with one-click install links This is because Tampermonkey automagically detect whether raw js files are being opened and redirect user to installation page. We might need a custom build action to update the links though. - Replace manual download and drag process with direct install links - Remove unnecessary screenshots and dashboard steps * Fix stuff * Fixed again. Sorry I was looking at the wrong branch T-T * . * Added color palette to src/utils.js * Updated Shields to match HEAD of main * Added build.yml RegEx for v0.0.0 version updating in README.md * Branch sync * Update CONTRIBUTING.md * Added the quick guide * Added wplace status shield * Moved wiki to its own branch * Added Shields from #61 and #58 * Fixed PR template * Squashed commit of the following: commitaca7df4189Author: SwingTheVine <swingthevine@gmail.com> Date: Sat Aug 9 20:52:22 2025 -0400 Added color palette to src/utils.js commit13ff8fbe33Merge:70eb0a2f2d34d8Author: SwingTheVine <swingthevine@gmail.com> Date: Sat Aug 9 20:49:26 2025 -0400 Merge branch 'main' of https://github.com/SwingTheVine/Wplace-BlueMarble commit70eb0a26faAuthor: SwingTheVine <swingthevine@gmail.com> Date: Fri Aug 8 19:38:49 2025 -0400 Update to Wiki Docs * Fixed bug in JSDoc generation in build.js * v0.79.0; Merge pull request #98 from SwingTheVine/documentation Updated documentation * Added missing dependency for minami * Added brief description about what Blue Marble does * v0.80.0; Added brief description about what Blue Marble does * v0.81.0; Merge branch 'code' into main --------- Co-authored-by: thatfrozenfrog <101154752+thatfrozenfrog@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * counts and colors for 81 * updated color palette and counts for transparent pixels * Implement #44 Ability to auto paste coordinates in their proper field (#45) * added automatic parsing of coordinates if pasted in first coordinate field * added automatic parsing of coordinates if pasted in first coordinate field * added automatic parsing of coordinates if pasted in first coordinate field * v0.82.0; Merge branch 'code' into main * Git is such a pain * v0.81.0; Git is such a pain * Stupid automation AAAAAA * v0.80.0; Stupid automation AAAAAA * v0.81.0; Merge branch 'code' into main --------- Co-authored-by: Filip Struzik <e12020637@student.tuwien.ac.at> Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fixed checkerboard patterns on black pixels (#143) Close #122 * Added telemetry * Debugging CSS * Telemetry and color filter are stable * Forgot to remove this before commiting * Begin update for v0.83.0 (#188) * Create CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Added some install instructions * Finished CONTRIBUTING.md * Fixed CONTRIBUTING table * Added SECURITY.md * Added Computer Edge instructions * Added Computer FireFox instructions * Clarified where the userscript can be downloaded from * Update to Wiki Docs * Simplify installation instructions with one-click install links This is because Tampermonkey automagically detect whether raw js files are being opened and redirect user to installation page. We might need a custom build action to update the links though. - Replace manual download and drag process with direct install links - Remove unnecessary screenshots and dashboard steps * Fix stuff * Fixed again. Sorry I was looking at the wrong branch T-T * . * Added color palette to src/utils.js * Updated Shields to match HEAD of main * Added build.yml RegEx for v0.0.0 version updating in README.md * Branch sync * Update CONTRIBUTING.md * Added the quick guide * Added wplace status shield * Moved wiki to its own branch * Added Shields from #61 and #58 * Fixed PR template * Squashed commit of the following: commitaca7df4189Author: SwingTheVine <swingthevine@gmail.com> Date: Sat Aug 9 20:52:22 2025 -0400 Added color palette to src/utils.js commit13ff8fbe33Merge:70eb0a2f2d34d8Author: SwingTheVine <swingthevine@gmail.com> Date: Sat Aug 9 20:49:26 2025 -0400 Merge branch 'main' of https://github.com/SwingTheVine/Wplace-BlueMarble commit70eb0a26faAuthor: SwingTheVine <swingthevine@gmail.com> Date: Fri Aug 8 19:38:49 2025 -0400 Update to Wiki Docs * Fixed bug in JSDoc generation in build.js * v0.79.0; Merge pull request #98 from SwingTheVine/documentation Updated documentation * Added missing dependency for minami * Added brief description about what Blue Marble does * Added missing dependency for minami * Added brief description about what Blue Marble does * Added missing dependency for minami * Added brief description about what Blue Marble does * v0.80.0; Added brief description about what Blue Marble does * v0.80.0; Added brief description about what Blue Marble does * Added a Shield for Pages * Added markdown support to the wiki * fixed broken links firefox related links were broken * fixed latest pre-releases links * Cleanup of bugs related to one-click install link * feat: Add new official Blue Marble website and update documentation Add newly created official Blue Marble website and update project documentation - Add official website badge to README.md - Include website link in Quick Guide section - Add website creator credits in CREDITS.md - Update CONTRIBUTING.md with website reference - Add new official website URL: https://bluemarble.camilledaguin.fr/ This commit introduces the newly created official Blue Marble website and updates all documentation to reference it. The website provides a dedicated platform for Blue Marble users and information. * Markdown links are used in CREDITS.md * Website Shield Moved Next to Social Shields * Website should not take priority over download information... ...also, removed the word "official" due to the fact that the website being linked on the GitHub indicates that the website is official. Just like how the Discord server being linked on GitHub indicates that the Discord server is "official." * Since the website does not contain security information... ...it should not be in SECURITY.md * Removed redundant @website meta attribute... ...since @website and @homepageURL do the exact same thing * Added @WondaMegapon to the CREDITS.md file * Fix some issues with the README (#124) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Update README.md Fix some issues with the readme * Added version Shield back --------- Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update documentation branch (#164) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 --------- Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update Wplace status badge (#140) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 * Update Wplace status badge --------- Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix spelling mistakes (#151) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 * Fix spelling mistakes --------- Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Remove `@run-at` (#161) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 * Remove `@run-at` --------- Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update `@match` to match only the frontend (#162) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 * Updae `@match` to match only the frontend --------- Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * docs: correction of typographical errors (#178) * Added ignore files to stop popular code formatters from messing with the code style * Change transform easing to 0s * Added a translucent gray checkerboard render for #deface * Added workflow to check what branch PR came from * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 * docs: correction of typographical errors recieved -> received --------- Co-authored-by: SwingTheVine <swingthevine@gmail.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: thatfrozenfrog <101154752+thatfrozenfrog@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Cyberflixt <54700008+Cyberflixt@users.noreply.github.com> Co-authored-by: Iris <camille.daguin1@gmail.com> Co-authored-by: windbus <103200560+windigerbus@users.noreply.github.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: SobakinTech <sobakintech@gmail.com> Co-authored-by: Agatem <agaatem@outlook.com> Co-authored-by: Nemupy <82650472+Nemupy@users.noreply.github.com> * Potential fix for code scanning alert no. 30: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Updated README Shields * Update code branch (#190) * Create CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Added some install instructions * Finished CONTRIBUTING.md * Fixed CONTRIBUTING table * Added SECURITY.md * Added Computer Edge instructions * Added Computer FireFox instructions * Clarified where the userscript can be downloaded from * Update to Wiki Docs * Simplify installation instructions with one-click install links This is because Tampermonkey automagically detect whether raw js files are being opened and redirect user to installation page. We might need a custom build action to update the links though. - Replace manual download and drag process with direct install links - Remove unnecessary screenshots and dashboard steps * Fix stuff * Fixed again. Sorry I was looking at the wrong branch T-T * . * Added color palette to src/utils.js * Updated Shields to match HEAD of main * Added build.yml RegEx for v0.0.0 version updating in README.md * Branch sync * Update CONTRIBUTING.md * Added the quick guide * Added wplace status shield * Moved wiki to its own branch * Added Shields from #61 and #58 * Fixed PR template * Squashed commit of the following: commitaca7df4189Author: SwingTheVine <swingthevine@gmail.com> Date: Sat Aug 9 20:52:22 2025 -0400 Added color palette to src/utils.js commit13ff8fbe33Merge:70eb0a2f2d34d8Author: SwingTheVine <swingthevine@gmail.com> Date: Sat Aug 9 20:49:26 2025 -0400 Merge branch 'main' of https://github.com/SwingTheVine/Wplace-BlueMarble commit70eb0a26faAuthor: SwingTheVine <swingthevine@gmail.com> Date: Fri Aug 8 19:38:49 2025 -0400 Update to Wiki Docs * Fixed bug in JSDoc generation in build.js * v0.79.0; Merge pull request #98 from SwingTheVine/documentation Updated documentation * Added missing dependency for minami * Added brief description about what Blue Marble does * v0.80.0; Added brief description about what Blue Marble does * v0.81.0; Merge branch 'code' into main * Emergency patch... ...please stop informing me that the install link is broken 😭 * v0.82.0; Emergency patch... ...please stop informing me that the install link is broken 😭 --------- Co-authored-by: thatfrozenfrog <101154752+thatfrozenfrog@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix minor comment typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: thatfrozenfrog <101154752+thatfrozenfrog@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: vishnuvardhan33 <93069382+vishnuvardhan33@users.noreply.github.com> Co-authored-by: Filip Str <filipus098@gmail.com> Co-authored-by: Filip Struzik <e12020637@student.tuwien.ac.at> Co-authored-by: East Monster 🍉 <89259667+EastMonster@users.noreply.github.com> Co-authored-by: Cyberflixt <54700008+Cyberflixt@users.noreply.github.com> Co-authored-by: Iris <camille.daguin1@gmail.com> Co-authored-by: windbus <103200560+windigerbus@users.noreply.github.com> Co-authored-by: AloeSapling <aloesapling@gmail.com> Co-authored-by: Endrik Tombak <littleendu@gmail.com> Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com> Co-authored-by: SobakinTech <sobakintech@gmail.com> Co-authored-by: Agatem <agaatem@outlook.com> Co-authored-by: Nemupy <82650472+Nemupy@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
eea86fe511
commit
63dc4b8ea1
19 changed files with 960 additions and 394 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -81,12 +81,12 @@ jobs:
|
|||
|
||||
- name: Update static version numbers
|
||||
run: |
|
||||
current_version="${{ steps.get_latest_tag.outputs.latest_tag_no_v }}"
|
||||
current_version="${{ steps.get_version.outputs.current_version }}"
|
||||
latest_tag="${{ steps.get_latest_tag.outputs.latest_tag_no_v }}"
|
||||
if [ -f "docs/README.md" ]; then
|
||||
echo "README.md exists. Modifying..."
|
||||
sed -i \
|
||||
-e 's|\(Latest_Version-\)[^-\ ]*\(-lightblue\)|\1'"$current_version"'\2|' \
|
||||
-e 's|v[0-9]\+\.[0-9]\+\.[0-9]\+|v'"$current_version"'|g' \
|
||||
docs/README.md
|
||||
else
|
||||
echo "README.md was not found. Skipping..."
|
||||
|
|
|
|||
3
.github/workflows/pr-branch-check.yml
vendored
3
.github/workflows/pr-branch-check.yml
vendored
|
|
@ -1,5 +1,8 @@
|
|||
name: Enforce allowed branches for PRs to main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
|
|
|
|||
2
dist/BlueMarble.user.css
vendored
2
dist/BlueMarble.user.css
vendored
|
|
@ -1 +1 @@
|
|||
#bm-n{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}#bm-4,#bm-n hr,#bm-3,#bm-1{transition:opacity .2s ease,height .2s ease}div#bm-n{font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}#bm-i{margin-bottom:.5em;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="5" height="5"><circle cx="3" cy="3" r="1.5" fill="CornflowerBlue" /></svg>') repeat;cursor:grab;width:100%;height:1em}#bm-i.dragging{cursor:grabbing}#bm-n:has(#bm-i.dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#bm-i.dragging{pointer-events:auto}#bm-7{margin-bottom:.5em}#bm-7[style*="text-align: center"]{display:flex;flex-direction:column;align-items:center;justify-content:center}#bm-n[style*="padding: 5px"]{width:auto!important;max-width:300px;min-width:200px}#bm-n img{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle;transition:opacity .2s ease}#bm-7[style*="text-align: center"] img{display:block;margin:0 auto}#bm-i{transition:margin-bottom .2s ease}#bm-n h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}#bm-3 input[type=checkbox]{vertical-align:middle;margin-right:.5ch}#bm-3 label{margin-right:.5ch}.bm-q{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}#bm-d{vertical-align:middle}#bm-d svg{width:50%;margin:0 auto;fill:#111}div:has(>#bm-button-teleport){display:flex;gap:.5ch}#bm-button-favorite svg,#bm-button-template svg{height:1em;margin:2px auto 0;text-align:center;line-height:1em;vertical-align:bottom}#bm-8 input[type=number]{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}#bm-8 input[type=number]::-webkit-outer-spin-button,#bm-8 input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#bm-0{display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:1ch}div:has(>#bm-2)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#bm-2,input[type=file][id*=template]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}#bm-b{font-size:small;background-color:#0003;padding:0 .5ch;height:3.75em;width:100%}#bm-1{display:flex;justify-content:space-between}#bm-n small{font-size:x-small;color:#d3d3d3}#bm-4,#bm-3,#bm-8,#bm-0,div:has(>#bm-2),#bm-b{margin-top:.5em}#bm-n button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}#bm-n button:hover,#bm-n button:focus-visible{background-color:#1061e5}#bm-n button:active,#bm-n button:disabled{background-color:#2e97ff}#bm-n button:disabled{text-decoration:line-through}
|
||||
#bm-s,#bm-s-telemetry{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}#bm-8,#bm-s hr,#bm-s-telemetry hr,#bm-7,#bm-3{transition:opacity .2s ease,height .2s ease}div#bm-s,div#bm-s-telemetry{font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}#bm-r,#bm-r-telemetry{margin-bottom:.5em;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="5" height="5"><circle cx="3" cy="3" r="1.5" fill="CornflowerBlue" /></svg>') repeat;cursor:grab;width:100%;height:1em}#bm-r.dragging,#bm-r-telemetry.dragging{cursor:grabbing}#bm-s:has(#bm-r.dragging),#bm-s-telemetry:has(#bm-r-telemetry.dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#bm-r.dragging,#bm-r-telemetry.dragging{pointer-events:auto}#bm-c,#bm-c-telemetry{margin-bottom:.5em}#bm-c[style*="text-align: center"],#bm-c-telemetry[style*="text-align: center"]{display:flex;flex-direction:column;align-items:center;justify-content:center}#bm-s[style*="padding: 5px"],#bm-s-telemetry[style*="padding: 5px"]{width:auto!important;max-width:300px;min-width:200px}#bm-s img{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle;transition:opacity .2s ease}#bm-c[style*="text-align: center"] img{display:block;margin:0 auto}#bm-r,#bm-r-telemetry{transition:margin-bottom .2s ease}#bm-s h1,#bm-s-telemetry h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}#bm-7 input[type=checkbox]{vertical-align:middle;margin-right:.5ch}#bm-7 label{margin-right:.5ch}.bm-v{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}#bm-i{vertical-align:middle}#bm-i svg{width:50%;margin:0 auto;fill:#111}div:has(>#bm-button-teleport){display:flex;gap:.5ch}#bm-button-favorite svg,#bm-button-template svg{height:1em;margin:2px auto 0;text-align:center;line-height:1em;vertical-align:bottom}#bm-d input[type=number]{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}#bm-d input[type=number]::-webkit-outer-spin-button,#bm-d input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#bm-2{display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:1ch}div:has(>#bm-5)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#bm-5,input[type=file][id*=template]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}#bm-g{font-size:small;background-color:#0003;padding:0 .5ch;height:3.75em;width:100%}#bm-3{display:flex;justify-content:space-between}#bm-s small{font-size:x-small;color:#d3d3d3}#bm-8,#bm-7,#bm-d,#bm-2,div:has(>#bm-5),#bm-g{margin-top:.5em}#bm-s button,#bm-s-telemetry button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}#bm-s button:hover,#bm-s button:focus-visible,#bm-s-telemetry button:hover,#bm-s-telemetry button:focus-visible{background-color:#1061e5}#bm-s button:active,#bm-s-telemetry button:active #bm-s button:disabled,#bm-s-telemetry button:disabled{background-color:#2e97ff}#bm-s button:disabled,#bm-s-telemetry button:disabled{text-decoration:line-through}
|
||||
|
|
|
|||
61
dist/BlueMarble.user.css.map.json
vendored
61
dist/BlueMarble.user.css.map.json
vendored
|
|
@ -1,30 +1,35 @@
|
|||
{
|
||||
"bm-contain-buttons-template": "bm-0",
|
||||
"bm-contain-buttons-action": "bm-1",
|
||||
"bm-input-file-template": "bm-2",
|
||||
"bm-contain-automation": "bm-3",
|
||||
"bm-contain-userinfo": "bm-4",
|
||||
"bm-display-coords": "bm-5",
|
||||
"bm-user-nextlevel": "bm-6",
|
||||
"bm-contain-header": "bm-7",
|
||||
"bm-contain-coords": "bm-8",
|
||||
"bm-button-disable": "bm-9",
|
||||
"bm-button-convert": "bm-a",
|
||||
"bm-output-status": "bm-b",
|
||||
"bm-user-droplets": "bm-c",
|
||||
"bm-button-coords": "bm-d",
|
||||
"bm-button-create": "bm-e",
|
||||
"bm-button-enable": "bm-f",
|
||||
"bm-button-move": "bm-g",
|
||||
"bm-user-name": "bm-h",
|
||||
"bm-bar-drag": "bm-i",
|
||||
"bm-input-tx": "bm-j",
|
||||
"bm-input-ty": "bm-k",
|
||||
"bm-input-px": "bm-l",
|
||||
"bm-input-py": "bm-m",
|
||||
"bm-overlay": "bm-n",
|
||||
"bm-cStyle": "bm-o",
|
||||
"bm-canvas": "bm-p",
|
||||
"bm-help": "bm-q",
|
||||
"bm-name": "bm-r"
|
||||
"bm-button-colors-disable-all": "bm-0",
|
||||
"bm-button-colors-enable-all": "bm-1",
|
||||
"bm-contain-buttons-template": "bm-2",
|
||||
"bm-contain-buttons-action": "bm-3",
|
||||
"bm-contain-colorfilter": "bm-4",
|
||||
"bm-input-file-template": "bm-5",
|
||||
"bm-rebuild-color-list": "bm-6",
|
||||
"bm-contain-automation": "bm-7",
|
||||
"bm-contain-userinfo": "bm-8",
|
||||
"bm-colorfilter-list": "bm-9",
|
||||
"bm-display-coords": "bm-a",
|
||||
"bm-user-nextlevel": "bm-b",
|
||||
"bm-contain-header": "bm-c",
|
||||
"bm-contain-coords": "bm-d",
|
||||
"bm-button-disable": "bm-e",
|
||||
"bm-button-convert": "bm-f",
|
||||
"bm-output-status": "bm-g",
|
||||
"bm-user-droplets": "bm-h",
|
||||
"bm-button-coords": "bm-i",
|
||||
"bm-button-create": "bm-j",
|
||||
"bm-button-enable": "bm-k",
|
||||
"bm-button-move": "bm-l",
|
||||
"bm-user-name": "bm-m",
|
||||
"bm-input-tx": "bm-n",
|
||||
"bm-input-ty": "bm-o",
|
||||
"bm-input-px": "bm-p",
|
||||
"bm-input-py": "bm-q",
|
||||
"bm-bar-drag": "bm-r",
|
||||
"bm-overlay": "bm-s",
|
||||
"bm-cStyle": "bm-t",
|
||||
"bm-canvas": "bm-u",
|
||||
"bm-help": "bm-v",
|
||||
"bm-name": "bm-w"
|
||||
}
|
||||
8
dist/BlueMarble.user.js
vendored
8
dist/BlueMarble.user.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -50,7 +50,7 @@
|
|||
<h1>Contributing</h1>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/LICENSE.txt" target="_blank" rel="noopener noreferrer"><img alt="Software License: MPL-2.0" src="https://img.shields.io/badge/Software_License-MPL--2.0-slateblue?style=flat"></a>
|
||||
<p>
|
||||
Thank you for wanting to contribute to the userscript "Blue Marble"! It means a lot to me that someone likes my project enough to want to help it grow. If you haven't already done so, consider joining our Discord. You can ask questions about the userscript there and receive feedback.
|
||||
Thank you for wanting to contribute to the userscript "Blue Marble"! It means a lot to me that someone likes my project enough to want to help it grow. If you haven't already done so, consider joining our Discord. You can ask questions about the userscript there and receive feedback. You can also visit the <a href="https://bluemarble.camilledaguin.fr/" target="_blank" rel="noopener noreferrer">official Blue Marble website</a> for more information.
|
||||
<br>
|
||||
<b>Note</b>: If you are using AI, and you want to tell the AI how the codebase files are related to each-other, go to the <code>Class diagram of relationships for Blue Marble</code> diagram in the chart section of this file. Copy the chart, and give it to the AI.
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -18,12 +18,13 @@
|
|||
---------------------------------------------------
|
||||
|
||||
"Blue Marble" is made by SwingTheVine
|
||||
|
||||
The [Blue Marble Website](https://bluemarble.camilledaguin.fr/) is made by Camille Daguin
|
||||
The favicon "Blue Marble" is owned by NASA
|
||||
|
||||
Special Thanks:
|
||||
* nof, [darkness](https://github.com/TouchedByDarkness) for creating similar userscripts!
|
||||
* [Wonda](https://wondapon.net/) for the Blue Marble banner image!
|
||||
* [BullStein](https://github.com/BullStein), [allanf181](https://github.com/allanf181) for being early beta testers!
|
||||
* guidu_ and [Nick-machado](https://github.com/Nick-machado) for the "Minimize" Button code!
|
||||
* Nomad and [Gustav](https://www.youtube.com/@gustav_vv) for the tutorials!
|
||||
* TheBlueCorner for getting me interested in online pixel canvases!
|
||||
* TheBlueCorner for getting me interested in online pixel canvases!
|
||||
|
|
|
|||
135
docs/README.md
135
docs/README.md
|
|
@ -42,21 +42,110 @@
|
|||
</table>
|
||||
|
||||
<h1>Blue Marble</h1>
|
||||
<a href="https://wplacestatus.sobakintech.xyz" target="_blank" rel="noopener noreferrer"><img alt="Wplace Status" src="https://status.wplace.lol/api/badge/15/status"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Latest Version" src="https://img.shields.io/badge/Latest_Version-Version-lightblue?style=flat"></a>
|
||||
<a href="https://status.wplace.lol" target="_blank" rel="noopener noreferrer"><img alt="Wplace Status" src="https://status.wplace.lol/badge/_/status?labelColor=5f5f5f&color=&style=flat&label=Wplace%20Status"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Latest Version" src="https://img.shields.io/badge/Latest_Version-0.82.54-lightblue?style=flat"></a>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/releases" target="_blank" rel="noopener noreferrer"><img alt="Latest Release" src="https://img.shields.io/github/v/release/SwingTheVine/Wplace-BlueMarble?sort=semver&style=flat&label=Latest%20Release&color=blue"></a>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/LICENSE.txt" target="_blank" rel="noopener noreferrer"><img alt="Software License: MPL-2.0" src="https://img.shields.io/badge/Software_License-MPL--2.0-slateblue?style=flat"></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="" 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-494-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 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-74.77%25-blue"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Repo Size" src="https://img.shields.io/github/repo-size/SwingTheVine/Wplace-BlueMarble"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Visitors" src="https://img.shields.io/badge/Visitors-84_851-gainsboro?style=flat"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Visitors" src="https://img.shields.io/badge/Visitors-354_340-gainsboro?style=flat"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Downloads" src="https://img.shields.io/github/downloads/SwingTheVine/Wplace-BlueMarble/total.svg"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Build" src="https://github.com/SwingTheVine/Wplace-BlueMarble/actions/workflows/build.yml/badge.svg"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="Pages" src="https://github.com/SwingTheVine/Wplace-BlueMarble/actions/workflows/pages/pages-build-deployment/badge.svg?branch=wiki"></a>
|
||||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="CodeQL" src="https://github.com/SwingTheVine/Wplace-BlueMarble/actions/workflows/github-code-scanning/codeql/badge.svg"></a>
|
||||
<a href="https://www.bestpractices.dev/projects/11067" target="_blank" rel="noopener noreferrer"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/11067/badge"></a>
|
||||
|
||||
<h2>Quick Guide</h2>
|
||||
<p>
|
||||
Press the arrows to reveal the option you want.
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to download Blue Marble.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="#installation-instructions">Click here</a> to view the installation instructions.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to ask questions about Blue Marble.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://discord.gg/tpeBPy46hf" target="_blank" rel="noopener noreferrer">Click here</a> for the Discord server invite to the Blue Marble support server.
|
||||
<br>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/discussions/categories/q-a">Click here</a> for the GitHub help & question page for Blue Marble.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to report a bug.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/issues/new/choose">Click here</a> to report a bug, then choose the "Bug Report" option.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to suggest a feature.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/issues/new/choose">Click here</a> to suggest a feature, then choose the Feature Request" option.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to contribute.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/CONTRIBUTING.md">Click here</a> to read the contributing guidelines.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to report a vulnerability.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/security">Click here</a> to submit a vulnerability report.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to visit the website.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://bluemarble.camilledaguin.fr/" target="_blank" rel="noopener noreferrer">Click here</a> to visit the official Blue Marble website.
|
||||
</details>
|
||||
</p>
|
||||
|
||||
<h2>Quick Guide</h2>
|
||||
<p>
|
||||
Press the arrows to reveal the option you want.
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to download Blue Marble.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="#installation-instructions">Click here</a> to view the installation instructions.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to ask questions about Blue Marble.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://discord.gg/tpeBPy46hf" target="_blank" rel="noopener noreferrer">Click here</a> for the Discord server invite to the Blue Marble support server.
|
||||
<br>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/discussions/categories/q-a">Click here</a> for the GitHub help & question page for Blue Marble.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to report a bug.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/issues/new/choose">Click here</a> to report a bug, then choose the "Bug Report" option.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to suggest a feature.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/issues/new/choose">Click here</a> to suggest a feature, then choose the Feature Request" option.
|
||||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>I want to contribute.</b> <sup>(Click to Expand)</sup>
|
||||
</summary>
|
||||
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/CONTRIBUTING.md">Click here</a> to read the contributing guidelines.
|
||||
</details>
|
||||
</p>
|
||||
|
||||
<h2>Quick Guide</h2>
|
||||
<p>
|
||||
|
|
@ -105,7 +194,7 @@
|
|||
<li>Allowing you to use the eyedropper on the template image, provided the colors are correct</li>
|
||||
<li>...and more!</li>
|
||||
</ul>
|
||||
If you like this userscript, please ⭐ the repository! If you wish to contribute to Blue Marble, check out the <a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer">CONTRIBUTING.md</a> file in <code>docs/</code>.
|
||||
If you like this userscript, please ⭐ the repository! For more information and updates, visit the <a href="https://bluemarble.camilledaguin.fr/" target="_blank" rel="noopener noreferrer">Blue Marble website</a>. If you wish to contribute to Blue Marble, check out the <a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer">CONTRIBUTING.md</a> file in <code>docs/</code>.
|
||||
|
||||
<img alt="Showcase image of Blue Marble template" src="./assets/Showcase1.png">
|
||||
|
||||
|
|
@ -118,16 +207,16 @@
|
|||
Installation instructions for Blue Marble are below. Click the arrows to expand the instructions you want to see. Blue text is a link.
|
||||
<details>
|
||||
<summary>
|
||||
<b>Install Chrome</b> <sup>(Click to Expand)</sup>
|
||||
<b>Install Chrome</b> <sup>(Click to expand)</sup>
|
||||
</summary>
|
||||
<a href="https://www.youtube.com/watch?v=gg5oiJcftEc" target="_blank" rel="noopener noreferrer"><img alt="Install Tutorial" src="https://img.shields.io/badge/Install_Tutorial-gray?style=flat&logo=YouTube&logoColor=white&logoSize=auto&labelColor=darkred"></a>
|
||||
<ol>
|
||||
<li>Install the <a href="https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo" target="_blank" rel="noopener noreferrer">TamperMonkey</a> plugin for Chrome.
|
||||
<li>Install the <a href="https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo" target="_blank" rel="noopener noreferrer">TamperMonkey</a> extension for Chrome.
|
||||
<br>
|
||||
<img alt="Click the 'Add extention' button" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerChromeInstall1.png"></li>
|
||||
<li>Right-click the extention.
|
||||
<img alt="Click the 'Add extension' button" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerChromeInstall1.png"></li>
|
||||
<li>Right-click the extension.
|
||||
<br>
|
||||
<img alt="Enter the 'Manage Extention' menu" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerChromeInstall2.png"></li>
|
||||
<img alt="Enter the 'Manage Extension' menu" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerChromeInstall2.png"></li>
|
||||
<li>Left-click "Manage Extension."</li>
|
||||
<li>Enable "Developer Mode."
|
||||
<br>
|
||||
|
|
@ -141,20 +230,20 @@
|
|||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>Install Edge</b> <sup>(Click to Expand)</sup>
|
||||
<b>Install on Microsoft Edge</b> <sup>(Click to expand)</sup>
|
||||
</summary>
|
||||
<ol>
|
||||
<li>Install the <a href="https://microsoftedge.microsoft.com/addons/detail/iikmkjmpaadaobahmlepeloendndfphd" target="_blank" rel="noopener noreferrer">TamperMonkey</a> plugin for Microsoft Edge.
|
||||
<br>
|
||||
<img alt="Click the 'Get' button" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerEdgeInstall1.png"></li>
|
||||
<li>Right-click the extention.
|
||||
<li>Right-click the extension.
|
||||
<br>
|
||||
<img alt="Enter the 'Manage Extention' menu" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerEdgeInstall2.png"></li>
|
||||
<img alt="Enter the 'Manage Extension' menu" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerEdgeInstall2.png"></li>
|
||||
<li>Left-click "Manage Extension."</li>
|
||||
<li>Enable "Developer Mode."
|
||||
<br>
|
||||
<img alt="Enable 'Developer Mode'" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerEdgeInstall3.png"></li>
|
||||
<li>Download the <a href="https://github.com/SwingTheVine/Wplace-BlueMarble/releases" target="_blank" rel="noopener noreferrer">BlueMarble.user.js</a> file in the "assets" of the latest release.</li>
|
||||
<li>Download the <a href="https://github.com/SwingTheVine/Wplace-BlueMarble/releases" target="_blank" rel="noopener noreferrer">BlueMarble.user.js</a> file in the "Assets" of the latest release.</li>
|
||||
<li>Open the TamperMonkey Dashboard.
|
||||
<br>
|
||||
<img alt="Enter the TamperMonkey 'Dashboard'" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerEdgeInstall4.png"></li>
|
||||
|
|
@ -172,15 +261,15 @@
|
|||
</details>
|
||||
<details>
|
||||
<summary>
|
||||
<b>Install FireFox</b> <sup>(Click to Expand)</sup>
|
||||
<b>Install on Firefox</b> <sup>(Click to expand)</sup>
|
||||
</summary>
|
||||
<ol>
|
||||
<li>Install the <a href="https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/" target="_blank" rel="noopener noreferrer">TamperMonkey</a> plugin for Firefox.
|
||||
<br>
|
||||
<img alt="Click the 'Add to FireFox' button" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerFireFoxInstall1.png"></li>
|
||||
<img alt="Click the 'Add to Firefox' button" src="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/docs/assets/ComputerFireFoxInstall1.png"></li>
|
||||
<li><strong>One-click install:</strong> Click this link to Install Blue Marble directly: <a href="https://github.com/SwingTheVine/Wplace-BlueMarble/releases/download/pre/BlueMarble.user.js" target="_blank" rel="noopener noreferrer"><strong>Install Blue Marble</strong></a>
|
||||
<br>
|
||||
TamperMonkey will automatically detect the userscript and prompt you to Install it.</li>
|
||||
TamperMonkey will automatically detect the userscript and prompt you to install it.</li>
|
||||
<li>Refresh the <a href="https://wplace.live/" target="_blank" rel="noopener noreferrer">wplace.live</a> webpage.</li>
|
||||
</ol>
|
||||
</details>
|
||||
|
|
@ -201,18 +290,6 @@
|
|||
<h3>Script Settings</h3>
|
||||
<p>
|
||||
There are many settings available for the Blue Marble userscript! Through these settings, you can control how the script behaves.
|
||||
<!--
|
||||
<h4>Stealth Mode</h4>
|
||||
<a href="" target="_blank"><img alt="Default: Enabled" src="https://img.shields.io/badge/Default-Enabled-lightgreen?style=flat"></a>
|
||||
<p>
|
||||
Stealth Mode, when enabled, requires the game to make a request to the server instead of Blue Marble making its own requests. However, this means Blue Marble will wait indefinitely until the request is made. <b>This should be used with Possessed Mode</b> so Blue Marble can "suggest" the game make certain requests instead of waiting for the requests to naturally occur.
|
||||
</p>
|
||||
<h4>Possessed Mode</h4>
|
||||
<a href="" target="_blank"><img alt="Default: Enabled" src="https://img.shields.io/badge/Default-Enabled-lightgreen?style=flat"></a>
|
||||
<p>
|
||||
In Possessed Mode, Blue Marble will prioritize controling the game over directly interacting with the server. For example, assume a situation where Blue Marble is trying to place a pixel. However, the tile is not loaded. Typically, Blue Marble would make a request to the server to fetch the tile. When <b>Possessed Mode</b> is enabled, Blue Marble will teleport the game to the tile, which causes the game to fetch the tile. The difference lies in <i>who</i> sends the request to the server. When <b>Stealth Mode</b> and <b>Possessed Mode</b> are both enabled, it is harder to detect the userscript since most actions are made through the game, not the userscript.
|
||||
</p>
|
||||
-->
|
||||
</p>
|
||||
|
||||
<h3>Template Settings</h3>
|
||||
|
|
@ -259,7 +336,7 @@
|
|||
<p><b>A:</b> Blue Marble does not contain malicious code. The Blue Marble code can be found in the <code>src/</code> folder. If you worry about Blue Marble being malware, you can read the code, then bundle it yourself using the tools in <code>build/</code>.
|
||||
|
||||
<h3>How can Blue Marble place pixels for me?</h3>
|
||||
<p><b>A:</b> Unfortunatly, Blue Marble will not support the automatic placement of pixels without user interaction.
|
||||
<p><b>A:</b> Unfortunately, Blue Marble will not support the automatic placement of pixels without user interaction because it is not allowed by Wplace.
|
||||
|
||||
<h3>How do I hide the overlay?</h3>
|
||||
<p><b>A:</b> Turn the userscript off and refresh the page.</p>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
<a href="" target="_blank" rel="noopener noreferrer"><img alt="CodeQL" src="https://github.com/SwingTheVine/Wplace-BlueMarble/actions/workflows/github-code-scanning/codeql/badge.svg"></a>
|
||||
<p>
|
||||
Since this is a userscript, there will not be many vulnerabilities. The user is in charge of their own security, by choosing which scripts to run. Regardless, if you do find a security vulnerability in Blue Marble, please report it on the GitHub Security Advisory <a href="https://github.com/SwingTheVine/Wplace-BlueMarble/security/advisories/new">"Report a Vulnerability"</a> tab.
|
||||
</p>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@
|
|||
"include": ["src"],
|
||||
"exclude": ["node_modules", "build", "dist"]
|
||||
},
|
||||
"homepage": "https://bluemarble.camilledaguin.fr/",
|
||||
"opts": {
|
||||
"destination": "docs",
|
||||
"template": "node_modules/minami",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"plugins": [],
|
||||
"plugins": ["plugins/markdown"],
|
||||
"templates": {
|
||||
"cleverLinks": false,
|
||||
"monospaceLinks": false
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "wplace-bluemarble",
|
||||
"version": "0.78.0",
|
||||
"version": "0.82.54",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wplace-bluemarble",
|
||||
"version": "0.78.0",
|
||||
"version": "0.82.54",
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.25.0",
|
||||
"jsdoc": "^4.0.4",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
{
|
||||
"name": "wplace-bluemarble",
|
||||
"version": "0.82.0",
|
||||
"version": "0.82.54",
|
||||
"type": "module",
|
||||
"homepage": "https://bluemarble.camilledaguin.fr/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/SwingTheVine/Wplace-BlueMarble.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build/build.js",
|
||||
"patch": "node build/patch.js && npm run build"
|
||||
|
|
|
|||
|
|
@ -1,22 +1,24 @@
|
|||
// ==UserScript==
|
||||
// @name Blue Marble
|
||||
// @namespace https://github.com/SwingTheVine/
|
||||
// @version 0.82.0
|
||||
// @version 0.82.54
|
||||
// @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
|
||||
// @license MPL-2.0
|
||||
// @supportURL https://discord.gg/tpeBPy46hf
|
||||
// @homepageURL https://github.com/SwingTheVine/Wplace-BlueMarble
|
||||
// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/e936688dc67a3f7aefd65afc8b96c23530674605/dist/assets/Favicon.png
|
||||
// @homepageURL https://bluemarble.camilledaguin.fr/
|
||||
// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/f3ee47c55505d29255b29e320891453884f13369/dist/assets/Favicon.png
|
||||
// @updateURL https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/BlueMarble.user.js
|
||||
// @downloadURL https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/BlueMarble.user.js
|
||||
// @run-at document-start
|
||||
// @match *://*.wplace.live/*
|
||||
// @match https://wplace.live/
|
||||
// @match https://wplace.live/?*
|
||||
// @grant GM_getResourceText
|
||||
// @grant GM_addStyle
|
||||
// @grant GM.setValue
|
||||
// @grant GM_getValue
|
||||
// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/e936688dc67a3f7aefd65afc8b96c23530674605/dist/BlueMarble.user.css
|
||||
// @grant GM_xmlhttpRequest
|
||||
// @connect telemetry.thebluecorner.net
|
||||
// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/1b71f0f8403b459cec0e1e298b73823570ed6016/dist/BlueMarble.user.css
|
||||
// ==/UserScript==
|
||||
|
||||
// Wplace --> https://wplace.live
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { uint8ToBase64 } from "./utils";
|
||||
import { uint8ToBase64, colorpalette } from "./utils";
|
||||
|
||||
/** An instance of a template.
|
||||
* Handles all mathematics, manipulation, and analysis regarding a single template.
|
||||
|
|
@ -39,6 +39,35 @@ export default class Template {
|
|||
this.chunked = chunked;
|
||||
this.tileSize = tileSize;
|
||||
this.pixelCount = 0; // Total pixel count in template
|
||||
this.requiredPixelCount = 0; // Total number of non-transparent, non-#deface pixels
|
||||
this.defacePixelCount = 0; // Number of #deface pixels (represents Transparent color in-game)
|
||||
this.colorPalette = {}; // key: "r,g,b" -> { count: number, enabled: boolean }
|
||||
this.tilePrefixes = new Set(); // Set of "xxxx,yyyy" tiles this template touches
|
||||
this.storageKey = null; // Key used inside templatesJSON to persist settings
|
||||
|
||||
// Build allowed color set from site palette (exclude special Transparent entry by name)
|
||||
const allowed = Array.isArray(colorpalette) ? colorpalette : [];
|
||||
this.allowedColorsSet = new Set(
|
||||
allowed
|
||||
.filter(c => (c?.name || '').toLowerCase() !== 'transparent' && Array.isArray(c?.rgb))
|
||||
.map(c => `${c.rgb[0]},${c.rgb[1]},${c.rgb[2]}`)
|
||||
);
|
||||
// Ensure template #deface marker is treated as allowed (maps to Transparent color)
|
||||
const defaceKey = '222,250,206';
|
||||
this.allowedColorsSet.add(defaceKey);
|
||||
// Map rgb-> {id, premium}
|
||||
this.rgbToMeta = new Map(
|
||||
allowed
|
||||
.filter(c => Array.isArray(c?.rgb))
|
||||
.map(c => [ `${c.rgb[0]},${c.rgb[1]},${c.rgb[2]}`, { id: c.id, premium: !!c.premium, name: c.name } ])
|
||||
);
|
||||
// Map #deface to Transparent meta for UI naming and ID continuity
|
||||
try {
|
||||
const transparent = allowed.find(c => (c?.name || '').toLowerCase() === 'transparent');
|
||||
if (transparent && Array.isArray(transparent.rgb)) {
|
||||
this.rgbToMeta.set(defaceKey, { id: transparent.id, premium: !!transparent.premium, name: transparent.name });
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
/** Creates chunks of the template for each tile.
|
||||
|
|
@ -62,6 +91,51 @@ export default class Template {
|
|||
// Store pixel count in instance property for access by template manager and UI components
|
||||
this.pixelCount = totalPixels;
|
||||
|
||||
// ==================== REQUIRED/DEFACE PIXEL COUNTING ====================
|
||||
// Build a 1× scale canvas to inspect original pixels and count required vs deface
|
||||
try {
|
||||
const inspectCanvas = new OffscreenCanvas(imageWidth, imageHeight);
|
||||
const inspectCtx = inspectCanvas.getContext('2d', { willReadFrequently: true });
|
||||
inspectCtx.imageSmoothingEnabled = false;
|
||||
inspectCtx.clearRect(0, 0, imageWidth, imageHeight);
|
||||
inspectCtx.drawImage(bitmap, 0, 0);
|
||||
const inspectData = inspectCtx.getImageData(0, 0, imageWidth, imageHeight).data;
|
||||
|
||||
let required = 0;
|
||||
let deface = 0;
|
||||
const paletteMap = new Map();
|
||||
for (let y = 0; y < imageHeight; y++) {
|
||||
for (let x = 0; x < imageWidth; x++) {
|
||||
const idx = (y * imageWidth + x) * 4;
|
||||
const r = inspectData[idx];
|
||||
const g = inspectData[idx + 1];
|
||||
const b = inspectData[idx + 2];
|
||||
const a = inspectData[idx + 3];
|
||||
if (a === 0) { continue; } // Ignored transparent pixel
|
||||
const key = `${r},${g},${b}`;
|
||||
if (r === 222 && g === 250 && b === 206) { deface++; }
|
||||
if (!this.allowedColorsSet.has(key)) { continue; } // Skip non-palette colors (but #deface added to allowed)
|
||||
required++;
|
||||
paletteMap.set(key, (paletteMap.get(key) || 0) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
this.requiredPixelCount = required;
|
||||
this.defacePixelCount = deface;
|
||||
|
||||
// Persist palette with all colors enabled by default
|
||||
const paletteObj = {};
|
||||
for (const [key, count] of paletteMap.entries()) {
|
||||
paletteObj[key] = { count, enabled: true };
|
||||
}
|
||||
this.colorPalette = paletteObj;
|
||||
} catch (err) {
|
||||
// Fail-safe: if OffscreenCanvas not available or any error, fall back to width×height
|
||||
this.requiredPixelCount = Math.max(0, this.pixelCount);
|
||||
this.defacePixelCount = 0;
|
||||
console.warn('Failed to compute required/deface counts. Falling back to total pixels.', err);
|
||||
}
|
||||
|
||||
const templateTiles = {}; // Holds the template tiles
|
||||
const templateTilesBuffers = {}; // Holds the buffers of the template tiles
|
||||
|
||||
|
|
@ -140,12 +214,22 @@ export default class Template {
|
|||
imageData.data[pixelIndex] = 0;
|
||||
imageData.data[pixelIndex + 1] = 0;
|
||||
imageData.data[pixelIndex + 2] = 0;
|
||||
imageData.data[pixelIndex + 3] = 32; // Translucent black
|
||||
} else { // Transparent negative space
|
||||
imageData.data[pixelIndex + 3] = 0;
|
||||
} else {
|
||||
imageData.data[pixelIndex] = 255;
|
||||
imageData.data[pixelIndex + 1] = 255;
|
||||
imageData.data[pixelIndex + 2] = 255;
|
||||
}
|
||||
imageData.data[pixelIndex + 3] = 32; // Make it translucent
|
||||
} else if (x % shreadSize !== 1 || y % shreadSize !== 1) { // Otherwise only draw the middle pixel
|
||||
imageData.data[pixelIndex + 3] = 0; // Make the pixel transparent on the alpha channel
|
||||
} else {
|
||||
// Center pixel: keep only if in allowed site palette
|
||||
const r = imageData.data[pixelIndex];
|
||||
const g = imageData.data[pixelIndex + 1];
|
||||
const b = imageData.data[pixelIndex + 2];
|
||||
if (!this.allowedColorsSet.has(`${r},${g},${b}`)) {
|
||||
imageData.data[pixelIndex + 3] = 0; // hide non-palette colors
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -164,6 +248,8 @@ export default class Template {
|
|||
.padStart(3, '0')},${(pixelY % 1000).toString().padStart(3, '0')}`;
|
||||
|
||||
templateTiles[templateTileName] = await createImageBitmap(canvas); // Creates the bitmap
|
||||
// Record tile prefix for fast lookup later
|
||||
this.tilePrefixes.add(templateTileName.split(',').slice(0,2).join(','));
|
||||
|
||||
const canvasBlob = await canvas.convertToBlob();
|
||||
const canvasBuffer = await canvasBlob.arrayBuffer();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import TemplateManager from "./templateManager.js";
|
||||
import { escapeHTML, numberToEncoded, serverTPtoDisplayTP } from "./utils.js";
|
||||
import { consoleError, escapeHTML, numberToEncoded, serverTPtoDisplayTP } from "./utils.js";
|
||||
|
||||
export default class ApiManager {
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ export default class ApiManager {
|
|||
this.templateCoordsTilePixel = []; // Contains the last "enabled" template coords
|
||||
}
|
||||
|
||||
/** Determines if the spontaneously recieved response is something we want.
|
||||
/** Determines if the spontaneously received response is something we want.
|
||||
* Otherwise, we can ignore it.
|
||||
* Note: Due to aggressive compression, make your calls like `data['jsonData']['name']` instead of `data.jsonData.name`
|
||||
*
|
||||
|
|
@ -141,4 +141,110 @@ export default class ApiManager {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Sends a heartbeat to the telemetry server
|
||||
async sendHeartbeat(version) {
|
||||
|
||||
console.log('Sending heartbeat to telemetry server...');
|
||||
|
||||
let userSettings = GM_getValue('bmUserSettings', '{}')
|
||||
userSettings = JSON.parse(userSettings);
|
||||
|
||||
if (!userSettings || !userSettings.telemetry || !userSettings.uuid) {
|
||||
console.log('Telemetry is disabled, not sending heartbeat.');
|
||||
return; // If telemetry is disabled, do not send heartbeat
|
||||
}
|
||||
|
||||
const ua = navigator.userAgent;
|
||||
let browser = await this.#getBrowserFromUA(ua);
|
||||
let os = this.#getOS(ua);
|
||||
|
||||
GM_xmlhttpRequest({
|
||||
method: 'POST',
|
||||
url: 'https://telemetry.thebluecorner.net/heartbeat',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: JSON.stringify({
|
||||
uuid: userSettings.uuid,
|
||||
version: version,
|
||||
browser: browser,
|
||||
os: os,
|
||||
}),
|
||||
onload: (response) => {
|
||||
if (response.status !== 200) {
|
||||
consoleError('Failed to send heartbeat:', response.statusText);
|
||||
}
|
||||
},
|
||||
onerror: (error) => {
|
||||
consoleError('Error sending heartbeat:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async #getBrowserFromUA(ua = navigator.userAgent) {
|
||||
ua = ua || "";
|
||||
|
||||
// Opera
|
||||
if (ua.includes("OPR/") || ua.includes("Opera")) return "Opera";
|
||||
|
||||
// Edge (Chromium-based uses "Edg/")
|
||||
if (ua.includes("Edg/")) return "Edge";
|
||||
|
||||
// Vivaldi
|
||||
if (ua.includes("Vivaldi")) return "Vivaldi";
|
||||
|
||||
// Yandex
|
||||
if (ua.includes("YaBrowser")) return "Yandex";
|
||||
|
||||
// Kiwi (not guaranteed, but typically shows "Kiwi")
|
||||
if (ua.includes("Kiwi")) return "Kiwi";
|
||||
|
||||
// Brave (doesn't expose in UA by default; heuristic via Brave/ token in some versions)
|
||||
if (ua.includes("Brave")) return "Brave";
|
||||
|
||||
// Firefox
|
||||
if (ua.includes("Firefox/")) return "Firefox";
|
||||
|
||||
// Chrome (catch-all for Chromium browsers)
|
||||
if (ua.includes("Chrome/")) return "Chrome";
|
||||
|
||||
// Safari (must be after Chrome check)
|
||||
if (ua.includes("Safari/")) return "Safari";
|
||||
|
||||
// Brave special check
|
||||
if (navigator.brave && typeof navigator.brave.isBrave === "function") {
|
||||
if (await navigator.brave.isBrave()) return "Brave";
|
||||
}
|
||||
|
||||
// Fallback
|
||||
return 'Unknown';
|
||||
}
|
||||
|
||||
#getOS(ua = navigator.userAgent) {
|
||||
ua = ua || "";
|
||||
|
||||
if (/Windows NT 11/i.test(ua)) return "Windows 11";
|
||||
if (/Windows NT 10/i.test(ua)) return "Windows 10";
|
||||
if (/Windows NT 6\.3/i.test(ua)) return "Windows 8.1";
|
||||
if (/Windows NT 6\.2/i.test(ua)) return "Windows 8";
|
||||
if (/Windows NT 6\.1/i.test(ua)) return "Windows 7";
|
||||
if (/Windows NT 6\.0/i.test(ua)) return "Windows Vista";
|
||||
if (/Windows NT 5\.1|Windows XP/i.test(ua)) return "Windows XP";
|
||||
|
||||
if (/Mac OS X 10[_\.]15/i.test(ua)) return "macOS Catalina";
|
||||
if (/Mac OS X 10[_\.]14/i.test(ua)) return "macOS Mojave";
|
||||
if (/Mac OS X 10[_\.]13/i.test(ua)) return "macOS High Sierra";
|
||||
if (/Mac OS X 10[_\.]12/i.test(ua)) return "macOS Sierra";
|
||||
if (/Mac OS X 10[_\.]11/i.test(ua)) return "OS X El Capitan";
|
||||
if (/Mac OS X 10[_\.]10/i.test(ua)) return "OS X Yosemite";
|
||||
if (/Mac OS X 10[_\.]/i.test(ua)) return "macOS"; // Generic fallback
|
||||
|
||||
if (/Android/i.test(ua)) return "Android";
|
||||
if (/iPhone|iPad|iPod/i.test(ua)) return "iOS";
|
||||
|
||||
if (/Linux/i.test(ua)) return "Linux";
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
243
src/main.js
243
src/main.js
|
|
@ -6,7 +6,7 @@ import Overlay from './Overlay.js';
|
|||
import Observers from './observers.js';
|
||||
import ApiManager from './apiManager.js';
|
||||
import TemplateManager from './templateManager.js';
|
||||
import { consoleLog, consoleWarn } from './utils.js';
|
||||
import { consoleLog, consoleWarn, selectAllCoordinateInputs } from './utils.js';
|
||||
|
||||
const name = GM_info.script.name.toString(); // Name of userscript
|
||||
const version = GM_info.script.version.toString(); // Version of userscript
|
||||
|
|
@ -185,6 +185,25 @@ const storageTemplates = JSON.parse(GM_getValue('bmTemplates', '{}'));
|
|||
console.log(storageTemplates);
|
||||
templateManager.importJSON(storageTemplates); // Loads the templates
|
||||
|
||||
const userSettings = JSON.parse(GM_getValue('bmUserSettings', '{}')); // Loads the user settings
|
||||
console.log(userSettings);
|
||||
console.log(Object.keys(userSettings).length);
|
||||
if (Object.keys(userSettings).length == 0) {
|
||||
const uuid = crypto.randomUUID(); // Generates a random UUID
|
||||
console.log(uuid);
|
||||
GM.setValue('bmUserSettings', JSON.stringify({
|
||||
'uuid': uuid
|
||||
}));
|
||||
}
|
||||
setInterval(() => apiManager.sendHeartbeat(version), 1000 * 60 * 30); // Sends a heartbeat every 30 minutes
|
||||
|
||||
console.log(`Telemetry is ${!(userSettings?.telemetry == undefined)}`);
|
||||
if ((userSettings?.telemetry == undefined) || (userSettings?.telemetry > 1)) { // Increment 1 to retrigger telemetry notice
|
||||
const telemetryOverlay = new Overlay(name, version);
|
||||
telemetryOverlay.setApiManager(apiManager); // Sets the API manager for the telemetry overlay
|
||||
buildTelemetryOverlay(telemetryOverlay); // Notifies the user about telemetry
|
||||
}
|
||||
|
||||
buildOverlayMain(); // Builds the main overlay
|
||||
|
||||
overlayMain.handleDrag('#bm-overlay', '#bm-bar-drag'); // Creates dragging capability on the drag bar for dragging the overlay
|
||||
|
|
@ -242,6 +261,19 @@ function observeBlack() {
|
|||
*/
|
||||
function buildOverlayMain() {
|
||||
let isMinimized = false; // Overlay state tracker (false = maximized, true = minimized)
|
||||
// Load last saved coordinates (if any)
|
||||
let savedCoords = {};
|
||||
try { savedCoords = JSON.parse(GM_getValue('bmCoords', '{}')) || {}; } catch (_) { savedCoords = {}; }
|
||||
const persistCoords = () => {
|
||||
try {
|
||||
const tx = Number(document.querySelector('#bm-input-tx')?.value || '');
|
||||
const ty = Number(document.querySelector('#bm-input-ty')?.value || '');
|
||||
const px = Number(document.querySelector('#bm-input-px')?.value || '');
|
||||
const py = Number(document.querySelector('#bm-input-py')?.value || '');
|
||||
const data = { tx, ty, px, py };
|
||||
GM.setValue('bmCoords', JSON.stringify(data));
|
||||
} catch (_) {}
|
||||
};
|
||||
|
||||
overlayMain.addDiv({'id': 'bm-overlay', 'style': 'top: 10px; right: 75px;'})
|
||||
.addDiv({'id': 'bm-contain-header'})
|
||||
|
|
@ -296,7 +328,8 @@ function buildOverlayMain() {
|
|||
'#bm-contain-automation > *:not(#bm-contain-coords)', // Automation section excluding coordinates
|
||||
'#bm-input-file-template', // Template file upload interface
|
||||
'#bm-contain-buttons-action', // Action buttons container
|
||||
`#${instance.outputStatusId}` // Status log textarea for user feedback
|
||||
`#${instance.outputStatusId}`, // Status log textarea for user feedback
|
||||
'#bm-contain-colorfilter' // Color filter UI
|
||||
];
|
||||
|
||||
// Apply visibility changes to all toggleable elements
|
||||
|
|
@ -475,13 +508,70 @@ function buildOverlayMain() {
|
|||
instance.updateInnerHTML('bm-input-ty', coords?.[1] || '');
|
||||
instance.updateInnerHTML('bm-input-px', coords?.[2] || '');
|
||||
instance.updateInnerHTML('bm-input-py', coords?.[3] || '');
|
||||
persistCoords();
|
||||
}
|
||||
}
|
||||
).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-tx', 'placeholder': 'Tl X', 'min': 0, 'max': 2047, 'step': 1, 'required': true}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-ty', 'placeholder': 'Tl Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-px', 'placeholder': 'Px X', 'min': 0, 'max': 2047, 'step': 1, 'required': true}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-py', 'placeholder': 'Px Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-tx', 'placeholder': 'Tl X', 'min': 0, 'max': 2047, 'step': 1, 'required': true, 'value': (savedCoords.tx ?? '')}, (instance, input) => {
|
||||
//if a paste happens on tx, split and format it into other coordinates if possible
|
||||
input.addEventListener("paste", (event) => {
|
||||
let splitText = (event.clipboardData || window.clipboardData).getData("text").split(" ").filter(n => n).map(Number).filter(n => !isNaN(n)); //split and filter all Non Numbers
|
||||
|
||||
if (splitText.length !== 4 ) { // If we don't have 4 clean coordinates, end the function.
|
||||
return;
|
||||
}
|
||||
|
||||
let coords = selectAllCoordinateInputs(document);
|
||||
|
||||
for (let i = 0; i < coords.length; i++) {
|
||||
coords[i].value = splitText[i]; //add the split vales
|
||||
}
|
||||
|
||||
event.preventDefault(); //prevent the pasting of the original paste that would overide the split value
|
||||
})
|
||||
const handler = () => persistCoords();
|
||||
input.addEventListener('input', handler);
|
||||
input.addEventListener('change', handler);
|
||||
}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-ty', 'placeholder': 'Tl Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true, 'value': (savedCoords.ty ?? '')}, (instance, input) => {
|
||||
const handler = () => persistCoords();
|
||||
input.addEventListener('input', handler);
|
||||
input.addEventListener('change', handler);
|
||||
}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-px', 'placeholder': 'Px X', 'min': 0, 'max': 2047, 'step': 1, 'required': true, 'value': (savedCoords.px ?? '')}, (instance, input) => {
|
||||
const handler = () => persistCoords();
|
||||
input.addEventListener('input', handler);
|
||||
input.addEventListener('change', handler);
|
||||
}).buildElement()
|
||||
.addInput({'type': 'number', 'id': 'bm-input-py', 'placeholder': 'Px Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true, 'value': (savedCoords.py ?? '')}, (instance, input) => {
|
||||
const handler = () => persistCoords();
|
||||
input.addEventListener('input', handler);
|
||||
input.addEventListener('change', handler);
|
||||
}).buildElement()
|
||||
.buildElement()
|
||||
// Color filter UI
|
||||
.addDiv({'id': 'bm-contain-colorfilter', 'style': 'max-height: 140px; overflow: auto; border: 1px solid rgba(255,255,255,0.1); padding: 4px; border-radius: 4px; display: none;'})
|
||||
.addDiv({'style': 'display: flex; gap: 6px; margin-bottom: 6px;'})
|
||||
.addButton({'id': 'bm-button-colors-enable-all', 'textContent': 'Enable All'}, (instance, button) => {
|
||||
button.onclick = () => {
|
||||
const t = templateManager.templatesArray[0];
|
||||
if (!t?.colorPalette) { return; }
|
||||
Object.values(t.colorPalette).forEach(v => v.enabled = true);
|
||||
buildColorFilterList();
|
||||
instance.handleDisplayStatus('Enabled all colors');
|
||||
};
|
||||
}).buildElement()
|
||||
.addButton({'id': 'bm-button-colors-disable-all', 'textContent': 'Disable All'}, (instance, button) => {
|
||||
button.onclick = () => {
|
||||
const t = templateManager.templatesArray[0];
|
||||
if (!t?.colorPalette) { return; }
|
||||
Object.values(t.colorPalette).forEach(v => v.enabled = false);
|
||||
buildColorFilterList();
|
||||
instance.handleDisplayStatus('Disabled all colors');
|
||||
};
|
||||
}).buildElement()
|
||||
.buildElement()
|
||||
.addDiv({'id': 'bm-colorfilter-list'}).buildElement()
|
||||
.buildElement()
|
||||
.addInputFile({'id': 'bm-input-file-template', 'textContent': 'Upload Template', 'accept': 'image/png, image/jpeg, image/webp, image/bmp, image/gif'}).buildElement()
|
||||
.addDiv({'id': 'bm-contain-buttons-template'})
|
||||
|
|
@ -536,11 +626,150 @@ function buildOverlayMain() {
|
|||
window.open('https://pepoafonso.github.io/color_converter_wplace/', '_blank', 'noopener noreferrer');
|
||||
});
|
||||
}).buildElement()
|
||||
.addButton({'id': 'bm-button-website', 'className': 'bm-help', 'innerHTML': '🌐', 'title': 'Official Blue Marble Website'},
|
||||
(instance, button) => {
|
||||
button.addEventListener('click', () => {
|
||||
window.open('https://bluemarble.camilledaguin.fr/', '_blank', 'noopener noreferrer');
|
||||
});
|
||||
}).buildElement()
|
||||
.buildElement()
|
||||
.addSmall({'textContent': 'Made by SwingTheVine', 'style': 'margin-top: auto;'}).buildElement()
|
||||
.buildElement()
|
||||
.buildElement()
|
||||
.buildOverlay(document.body);
|
||||
|
||||
// ------- Helper: Build the color filter list -------
|
||||
window.buildColorFilterList = function buildColorFilterList() {
|
||||
const listContainer = document.querySelector('#bm-colorfilter-list');
|
||||
const t = templateManager.templatesArray?.[0];
|
||||
if (!listContainer || !t?.colorPalette) {
|
||||
if (listContainer) { listContainer.innerHTML = '<small>No template colors to display.</small>'; }
|
||||
return;
|
||||
}
|
||||
|
||||
listContainer.innerHTML = '';
|
||||
const entries = Object.entries(t.colorPalette)
|
||||
.sort((a,b) => b[1].count - a[1].count); // sort by frequency desc
|
||||
|
||||
for (const [rgb, meta] of entries) {
|
||||
const [r,g,b] = rgb.split(',').map(Number);
|
||||
|
||||
const row = document.createElement('div');
|
||||
row.style.display = 'flex';
|
||||
row.style.alignItems = 'center';
|
||||
row.style.gap = '8px';
|
||||
row.style.margin = '4px 0';
|
||||
|
||||
const swatch = document.createElement('div');
|
||||
swatch.style.width = '14px';
|
||||
swatch.style.height = '14px';
|
||||
swatch.style.border = '1px solid rgba(255,255,255,0.5)';
|
||||
swatch.style.background = `rgb(${r},${g},${b})`;
|
||||
|
||||
const label = document.createElement('span');
|
||||
label.style.fontSize = '12px';
|
||||
let labelText = `${meta.count.toLocaleString()}`;
|
||||
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 (_) {}
|
||||
label.textContent = labelText;
|
||||
|
||||
const toggle = document.createElement('input');
|
||||
toggle.type = 'checkbox';
|
||||
toggle.checked = !!meta.enabled;
|
||||
toggle.addEventListener('change', () => {
|
||||
meta.enabled = toggle.checked;
|
||||
overlayMain.handleDisplayStatus(`${toggle.checked ? 'Enabled' : 'Disabled'} ${rgb}`);
|
||||
try {
|
||||
const t = templateManager.templatesArray?.[0];
|
||||
const key = t?.storageKey;
|
||||
if (t && key && templateManager.templatesJSON?.templates?.[key]) {
|
||||
templateManager.templatesJSON.templates[key].palette = t.colorPalette;
|
||||
// persist immediately
|
||||
GM.setValue('bmTemplates', JSON.stringify(templateManager.templatesJSON));
|
||||
}
|
||||
} catch (_) {}
|
||||
});
|
||||
|
||||
row.appendChild(toggle);
|
||||
row.appendChild(swatch);
|
||||
row.appendChild(label);
|
||||
listContainer.appendChild(row);
|
||||
}
|
||||
};
|
||||
|
||||
// Listen for template creation/import completion to (re)build palette list
|
||||
window.addEventListener('message', (event) => {
|
||||
if (event?.data?.bmEvent === 'bm-rebuild-color-list') {
|
||||
try { buildColorFilterList(); } catch (_) {}
|
||||
}
|
||||
});
|
||||
|
||||
// If a template was already loaded from storage, show the color UI and build list
|
||||
setTimeout(() => {
|
||||
try {
|
||||
if (templateManager.templatesArray?.length > 0) {
|
||||
const colorUI = document.querySelector('#bm-contain-colorfilter');
|
||||
if (colorUI) { colorUI.style.display = ''; }
|
||||
buildColorFilterList();
|
||||
}
|
||||
} catch (_) {}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function buildTelemetryOverlay(overlay) {
|
||||
overlay.addDiv({'id': 'bm-overlay-telemetry', style: 'top: 0px; left: 0px; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; z-index: 9999;'})
|
||||
.addDiv({'id': 'bm-contain-all-telemetry', style: 'display: flex; flex-direction: column; align-items: center;'})
|
||||
.addDiv({'id': 'bm-contain-header-telemetry', style: 'margin-top: 10%;'})
|
||||
.addHeader(1, {'textContent': `${name} Telemetry`}).buildElement()
|
||||
.buildElement()
|
||||
|
||||
.addDiv({'id': 'bm-contain-telemetry', style: 'max-width: 50%; overflow-y: auto; max-height: 80vh;'})
|
||||
.addHr().buildElement()
|
||||
.addBr().buildElement()
|
||||
.addDiv({'style': 'width: fit-content; margin: auto; text-align: center;'})
|
||||
.addButton({'id': 'bm-button-telemetry-more', 'textContent': 'More Information'}, (instance, button) => {
|
||||
button.onclick = () => {
|
||||
window.open('https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data', '_blank', 'noopener noreferrer');
|
||||
}
|
||||
}).buildElement()
|
||||
.buildElement()
|
||||
.addBr().buildElement()
|
||||
.addDiv({style: 'width: fit-content; margin: auto; text-align: center;'})
|
||||
.addButton({'id': 'bm-button-telemetry-enable', 'textContent': 'Enable Telemetry', 'style': 'margin-right: 2ch;'}, (instance, button) => {
|
||||
button.onclick = () => {
|
||||
const userSettings = JSON.parse(GM_getValue('bmUserSettings', '{}'));
|
||||
userSettings.telemetry = 1;
|
||||
GM.setValue('bmUserSettings', JSON.stringify(userSettings));
|
||||
const element = document.getElementById('bm-overlay-telemetry');
|
||||
if (element) {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}).buildElement()
|
||||
.addButton({'id': 'bm-button-telemetry-disable', 'textContent': 'Disable Telemetry'}, (instance, button) => {
|
||||
button.onclick = () => {
|
||||
const userSettings = JSON.parse(GM_getValue('bmUserSettings', '{}'));
|
||||
userSettings.telemetry = 0;
|
||||
GM.setValue('bmUserSettings', JSON.stringify(userSettings));
|
||||
const element = document.getElementById('bm-overlay-telemetry');
|
||||
if (element) {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}).buildElement()
|
||||
.buildElement()
|
||||
.addBr().buildElement()
|
||||
.addP({'textContent': 'We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the \'Disable\' button, but keeping it on helps us improve features and reliability faster. Thank you for supporting the Blue Marble!'}).buildElement()
|
||||
.addP({'textContent': 'You can disable telemetry by pressing the "Disable" button below.'}).buildElement()
|
||||
.buildElement()
|
||||
.buildElement()
|
||||
.buildOverlay(document.body);
|
||||
}
|
||||
|
||||
function buildOverlayTabTemplate() {
|
||||
|
|
@ -565,4 +794,4 @@ function buildOverlayTabTemplate() {
|
|||
.buildElement()
|
||||
.buildElement()
|
||||
.buildOverlay();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* @since 0.5.1 */
|
||||
|
||||
/* The entire overlay */
|
||||
#bm-overlay {
|
||||
#bm-overlay, #bm-overlay-telemetry {
|
||||
position: fixed;
|
||||
background-color: rgba(21, 48, 99, 0.9);
|
||||
color: white;
|
||||
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
/* Smooth transitions for minimize/maximize functionality */
|
||||
#bm-contain-userinfo,
|
||||
#bm-overlay hr,
|
||||
#bm-overlay hr, #bm-overlay-telemetry hr,
|
||||
#bm-contain-automation,
|
||||
#bm-contain-buttons-action {
|
||||
transition: opacity 0.2s ease, height 0.2s ease;
|
||||
}
|
||||
|
||||
/* The entire overlay BUT it is cascading */
|
||||
div#bm-overlay {
|
||||
div#bm-overlay, div#bm-overlay-telemetry {
|
||||
/* Font stack is as follows:
|
||||
* Highest Priority (Roboto Mono)
|
||||
* Windows fallback (Courier New)
|
||||
|
|
@ -41,7 +41,7 @@ div#bm-overlay {
|
|||
}
|
||||
|
||||
/* The drag bar */
|
||||
#bm-bar-drag {
|
||||
#bm-bar-drag, #bm-bar-drag-telemetry {
|
||||
margin-bottom: 0.5em;
|
||||
/* For background circles, width & height should be odd, cx & cy should be half of width & height, and r should be less than or equal to cx & cy */
|
||||
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="5" height="5"><circle cx="3" cy="3" r="1.5" fill="CornflowerBlue" /></svg>') repeat;
|
||||
|
|
@ -51,12 +51,12 @@ div#bm-overlay {
|
|||
}
|
||||
|
||||
/* When the overlay is being dragged */
|
||||
#bm-bar-drag.dragging {
|
||||
#bm-bar-drag.dragging, #bm-bar-drag-telemetry.dragging {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* Disable interactions during drag for better performance */
|
||||
#bm-overlay:has(#bm-bar-drag.dragging) {
|
||||
#bm-overlay:has(#bm-bar-drag.dragging), #bm-overlay-telemetry:has(#bm-bar-drag-telemetry.dragging) {
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
|
|
@ -65,17 +65,17 @@ div#bm-overlay {
|
|||
}
|
||||
|
||||
/* Keep drag bar interactive when dragging */
|
||||
#bm-bar-drag.dragging {
|
||||
#bm-bar-drag.dragging, #bm-bar-drag-telemetry.dragging {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* The container for the overlay header */
|
||||
#bm-contain-header {
|
||||
#bm-contain-header, #bm-contain-header-telemetry {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
/* When minimized, adjust header container */
|
||||
#bm-contain-header[style*="text-align: center"] {
|
||||
#bm-contain-header[style*="text-align: center"], #bm-contain-header-telemetry[style*="text-align: center"] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
|
@ -83,7 +83,7 @@ div#bm-overlay {
|
|||
}
|
||||
|
||||
/* Ensure overlay maintains consistent width when minimized */
|
||||
#bm-overlay[style*="padding: 5px"] {
|
||||
#bm-overlay[style*="padding: 5px"], #bm-overlay-telemetry[style*="padding: 5px"] {
|
||||
width: auto !important;
|
||||
max-width: 300px;
|
||||
min-width: 200px;
|
||||
|
|
@ -107,12 +107,12 @@ div#bm-overlay {
|
|||
}
|
||||
|
||||
/* Ensure drag bar remains functional when minimized */
|
||||
#bm-bar-drag {
|
||||
#bm-bar-drag, #bm-bar-drag-telemetry {
|
||||
transition: margin-bottom 0.2s ease;
|
||||
}
|
||||
|
||||
/* The Blue Marble header */
|
||||
#bm-overlay h1 {
|
||||
#bm-overlay h1, #bm-overlay-telemetry h1 {
|
||||
display: inline-block;
|
||||
font-size: x-large;
|
||||
font-weight: bold;
|
||||
|
|
@ -255,24 +255,24 @@ div:has(> #bm-input-file-template),
|
|||
}
|
||||
|
||||
/* All overlay buttons */
|
||||
#bm-overlay button {
|
||||
#bm-overlay button, #bm-overlay-telemetry button {
|
||||
background-color: #144eb9;
|
||||
border-radius: 1em;
|
||||
padding: 0 0.75ch;
|
||||
}
|
||||
|
||||
/* All overlay buttons when hovered/focused */
|
||||
#bm-overlay button:hover, #bm-overlay button:focus-visible {
|
||||
#bm-overlay button:hover, #bm-overlay button:focus-visible, #bm-overlay-telemetry button:hover, #bm-overlay-telemetry button:focus-visible {
|
||||
background-color: #1061e5;
|
||||
}
|
||||
|
||||
/* All overlay buttons when pressed (plus disabled color) */
|
||||
#bm-overlay button:active,
|
||||
#bm-overlay button:disabled {
|
||||
#bm-overlay button:active, #bm-overlay-telemetry button:active
|
||||
#bm-overlay button:disabled, #bm-overlay-telemetry button:disabled {
|
||||
background-color: #2e97ff;
|
||||
}
|
||||
|
||||
/* All overlay buttons when disabled */
|
||||
#bm-overlay button:disabled {
|
||||
#bm-overlay button:disabled, #bm-overlay-telemetry button:disabled {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
|
@ -61,6 +61,7 @@ export default class TemplateManager {
|
|||
this.templatesArray = []; // All Template instnaces currently loaded (Template)
|
||||
this.templatesJSON = null; // All templates currently loaded (JSON)
|
||||
this.templatesShouldBeDrawn = true; // Should ALL templates be drawn to the canvas?
|
||||
this.tileProgress = new Map(); // Tracks per-tile progress stats {painted, required, wrong}
|
||||
}
|
||||
|
||||
/** Retrieves the pixel art canvas.
|
||||
|
|
@ -143,11 +144,14 @@ export default class TemplateManager {
|
|||
|
||||
// Appends a child into the templates object
|
||||
// The child's name is the number of templates already in the list (sort order) plus the encoded player ID
|
||||
this.templatesJSON.templates[`${template.sortID} ${template.authorID}`] = {
|
||||
const storageKey = `${template.sortID} ${template.authorID}`;
|
||||
template.storageKey = storageKey;
|
||||
this.templatesJSON.templates[storageKey] = {
|
||||
"name": template.displayName, // Display name of template
|
||||
"coords": coords.join(', '), // The coords of the template
|
||||
"enabled": true,
|
||||
"tiles": templateTilesBuffers // Stores the chunked tile buffers
|
||||
"tiles": templateTilesBuffers, // Stores the chunked tile buffers
|
||||
"palette": template.colorPalette // Persist palette and enabled flags
|
||||
};
|
||||
|
||||
this.templatesArray = []; // Remove this to enable multiple templates (2/2)
|
||||
|
|
@ -159,6 +163,14 @@ export default class TemplateManager {
|
|||
const pixelCountFormatted = new Intl.NumberFormat().format(template.pixelCount);
|
||||
this.overlay.handleDisplayStatus(`Template created at ${coords.join(', ')}! Total pixels: ${pixelCountFormatted}`);
|
||||
|
||||
// Ensure color filter UI is visible when a template is created
|
||||
try {
|
||||
const colorUI = document.querySelector('#bm-contain-colorfilter');
|
||||
if (colorUI) { colorUI.style.display = ''; }
|
||||
// Deferred palette list rendering; actual DOM is built in main via helper
|
||||
window.postMessage({ source: 'blue-marble', bmEvent: 'bm-rebuild-color-list' }, '*');
|
||||
} catch (_) { /* no-op */ }
|
||||
|
||||
console.log(Object.keys(this.templatesJSON.templates).length);
|
||||
console.log(this.templatesJSON);
|
||||
console.log(this.templatesArray);
|
||||
|
|
@ -223,6 +235,18 @@ export default class TemplateManager {
|
|||
|
||||
console.log(templateArray);
|
||||
|
||||
// Early exit if none of the active templates touch this tile
|
||||
const anyTouches = templateArray.some(t => {
|
||||
if (!t?.chunked) { return false; }
|
||||
// Fast path via recorded tile prefixes if available
|
||||
if (t.tilePrefixes && t.tilePrefixes.size > 0) {
|
||||
return t.tilePrefixes.has(tileCoords);
|
||||
}
|
||||
// Fallback: scan chunked keys
|
||||
return Object.keys(t.chunked).some(k => k.startsWith(tileCoords));
|
||||
});
|
||||
if (!anyTouches) { return tileBlob; }
|
||||
|
||||
// Retrieves the relavent template tile blobs
|
||||
const templatesToDraw = templateArray
|
||||
.map(template => {
|
||||
|
|
@ -253,31 +277,10 @@ export default class TemplateManager {
|
|||
const templateCount = templatesToDraw?.length || 0; // Number of templates to draw on this tile
|
||||
console.log(`templateCount = ${templateCount}`);
|
||||
|
||||
if (templateCount > 0) {
|
||||
|
||||
// Calculate total pixel count for templates actively being displayed in this tile
|
||||
const totalPixels = templateArray
|
||||
.filter(template => {
|
||||
// Filter templates to include only those with tiles matching current coordinates
|
||||
// This ensures we count pixels only for templates actually being rendered
|
||||
const matchingTiles = Object.keys(template.chunked).filter(tile =>
|
||||
tile.startsWith(tileCoords)
|
||||
);
|
||||
return matchingTiles.length > 0;
|
||||
})
|
||||
.reduce((sum, template) => sum + (template.pixelCount || 0), 0);
|
||||
|
||||
// Format pixel count with locale-appropriate thousands separators for better readability
|
||||
// Examples: "1,234,567" (US), "1.234.567" (DE), "1 234 567" (FR)
|
||||
const pixelCountFormatted = new Intl.NumberFormat().format(totalPixels);
|
||||
|
||||
// Display status information about the templates being rendered
|
||||
this.overlay.handleDisplayStatus(
|
||||
`Displaying ${templateCount} template${templateCount == 1 ? '' : 's'}.\nTotal pixels: ${pixelCountFormatted}`
|
||||
);
|
||||
} else {
|
||||
this.overlay.handleDisplayStatus(`Displaying ${templateCount} templates.`);
|
||||
}
|
||||
// We'll compute per-tile painted/wrong/required counts when templates exist for this tile
|
||||
let paintedCount = 0;
|
||||
let wrongCount = 0;
|
||||
let requiredCount = 0;
|
||||
|
||||
const tileBitmap = await createImageBitmap(tileBlob);
|
||||
|
||||
|
|
@ -294,13 +297,175 @@ export default class TemplateManager {
|
|||
context.clearRect(0, 0, drawSize, drawSize); // Draws transparent background
|
||||
context.drawImage(tileBitmap, 0, 0, drawSize, drawSize);
|
||||
|
||||
// Grab a snapshot of the tile pixels BEFORE we draw any template overlays
|
||||
let tilePixels = null;
|
||||
try {
|
||||
tilePixels = context.getImageData(0, 0, drawSize, drawSize).data;
|
||||
} catch (_) {
|
||||
// If reading fails for any reason, we will skip stats
|
||||
}
|
||||
|
||||
// For each template in this tile, draw them.
|
||||
for (const template of templatesToDraw) {
|
||||
console.log(`Template:`);
|
||||
console.log(template);
|
||||
|
||||
// Draws the each template on the tile based on it's relative position
|
||||
context.drawImage(template.bitmap, Number(template.pixelCoords[0]) * this.drawMult, Number(template.pixelCoords[1]) * this.drawMult);
|
||||
// Compute stats by sampling template center pixels against tile pixels,
|
||||
// honoring color enable/disable from the active template's palette
|
||||
if (tilePixels) {
|
||||
try {
|
||||
const tempW = template.bitmap.width;
|
||||
const tempH = template.bitmap.height;
|
||||
const tempCanvas = new OffscreenCanvas(tempW, tempH);
|
||||
const tempCtx = tempCanvas.getContext('2d', { willReadFrequently: true });
|
||||
tempCtx.imageSmoothingEnabled = false;
|
||||
tempCtx.clearRect(0, 0, tempW, tempH);
|
||||
tempCtx.drawImage(template.bitmap, 0, 0);
|
||||
const tImg = tempCtx.getImageData(0, 0, tempW, tempH);
|
||||
const tData = tImg.data;
|
||||
|
||||
const offsetX = Number(template.pixelCoords[0]) * this.drawMult;
|
||||
const offsetY = Number(template.pixelCoords[1]) * this.drawMult;
|
||||
|
||||
for (let y = 0; y < tempH; y++) {
|
||||
for (let x = 0; x < tempW; x++) {
|
||||
// Only evaluate the center pixel of each shread block
|
||||
if ((x % this.drawMult) !== 1 || (y % this.drawMult) !== 1) { continue; }
|
||||
const gx = x + offsetX;
|
||||
const gy = y + offsetY;
|
||||
if (gx < 0 || gy < 0 || gx >= drawSize || gy >= drawSize) { continue; }
|
||||
const tIdx = (y * tempW + x) * 4;
|
||||
const tr = tData[tIdx];
|
||||
const tg = tData[tIdx + 1];
|
||||
const tb = tData[tIdx + 2];
|
||||
const ta = tData[tIdx + 3];
|
||||
// Handle template transparent pixel (alpha < 64): wrong if board has any site palette color here
|
||||
if (ta < 64) {
|
||||
try {
|
||||
const activeTemplate = this.templatesArray?.[0];
|
||||
const tileIdx = (gy * drawSize + gx) * 4;
|
||||
const pr = tilePixels[tileIdx];
|
||||
const pg = tilePixels[tileIdx + 1];
|
||||
const pb = tilePixels[tileIdx + 2];
|
||||
const pa = tilePixels[tileIdx + 3];
|
||||
const key = `${pr},${pg},${pb}`;
|
||||
const isSiteColor = activeTemplate?.allowedColorsSet ? activeTemplate.allowedColorsSet.has(key) : false;
|
||||
if (pa >= 64 && isSiteColor) {
|
||||
wrongCount++;
|
||||
}
|
||||
} catch (_) {}
|
||||
continue;
|
||||
}
|
||||
// Treat #deface as Transparent palette color (required and paintable)
|
||||
// Ignore non-palette colors (match against allowed set when available)
|
||||
try {
|
||||
const activeTemplate = this.templatesArray?.[0];
|
||||
if (activeTemplate?.allowedColorsSet && !activeTemplate.allowedColorsSet.has(`${tr},${tg},${tb}`)) {
|
||||
continue;
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
requiredCount++;
|
||||
|
||||
// Strict center-pixel matching. Treat transparent tile pixels as unpainted (not wrong)
|
||||
const tileIdx = (gy * drawSize + gx) * 4;
|
||||
const pr = tilePixels[tileIdx];
|
||||
const pg = tilePixels[tileIdx + 1];
|
||||
const pb = tilePixels[tileIdx + 2];
|
||||
const pa = tilePixels[tileIdx + 3];
|
||||
|
||||
if (pa < 64) {
|
||||
// Unpainted -> neither painted nor wrong
|
||||
} else if (pr === tr && pg === tg && pb === tb) {
|
||||
paintedCount++;
|
||||
} else {
|
||||
wrongCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Failed to compute per-tile painted/wrong stats:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the template overlay for visual guidance, honoring color filter
|
||||
try {
|
||||
const activeTemplate = this.templatesArray?.[0];
|
||||
const palette = activeTemplate?.colorPalette || {};
|
||||
const hasDisabled = Object.values(palette).some(v => v?.enabled === false);
|
||||
if (!hasDisabled) {
|
||||
context.drawImage(template.bitmap, Number(template.pixelCoords[0]) * this.drawMult, Number(template.pixelCoords[1]) * this.drawMult);
|
||||
} else {
|
||||
const tempW = template.bitmap.width;
|
||||
const tempH = template.bitmap.height;
|
||||
const filterCanvas = new OffscreenCanvas(tempW, tempH);
|
||||
const filterCtx = filterCanvas.getContext('2d', { willReadFrequently: true });
|
||||
filterCtx.imageSmoothingEnabled = false;
|
||||
filterCtx.clearRect(0, 0, tempW, tempH);
|
||||
filterCtx.drawImage(template.bitmap, 0, 0);
|
||||
const img = filterCtx.getImageData(0, 0, tempW, tempH);
|
||||
const data = img.data;
|
||||
for (let y = 0; y < tempH; y++) {
|
||||
for (let x = 0; x < tempW; x++) {
|
||||
if ((x % this.drawMult) !== 1 || (y % this.drawMult) !== 1) { continue; }
|
||||
const idx = (y * tempW + x) * 4;
|
||||
const r = data[idx];
|
||||
const g = data[idx + 1];
|
||||
const b = data[idx + 2];
|
||||
const a = data[idx + 3];
|
||||
if (a < 1) { continue; }
|
||||
const key = `${r},${g},${b}`;
|
||||
// Hide if color is not in allowed palette or explicitly disabled
|
||||
const inSitePalette = activeTemplate?.allowedColorsSet ? activeTemplate.allowedColorsSet.has(key) : true;
|
||||
const enabled = palette?.[key]?.enabled !== false;
|
||||
if (!inSitePalette || !enabled) {
|
||||
data[idx + 3] = 0; // hide disabled color center pixel
|
||||
}
|
||||
}
|
||||
}
|
||||
filterCtx.putImageData(img, 0, 0);
|
||||
context.drawImage(filterCanvas, Number(template.pixelCoords[0]) * this.drawMult, Number(template.pixelCoords[1]) * this.drawMult);
|
||||
}
|
||||
} catch (_) {
|
||||
// Fallback to drawing raw bitmap if filtering fails
|
||||
context.drawImage(template.bitmap, Number(template.pixelCoords[0]) * this.drawMult, Number(template.pixelCoords[1]) * this.drawMult);
|
||||
}
|
||||
}
|
||||
|
||||
// Save per-tile stats and compute global aggregates across all processed tiles
|
||||
if (templateCount > 0) {
|
||||
const tileKey = tileCoords; // already padded string "xxxx,yyyy"
|
||||
this.tileProgress.set(tileKey, {
|
||||
painted: paintedCount,
|
||||
required: requiredCount,
|
||||
wrong: wrongCount,
|
||||
});
|
||||
|
||||
// Aggregate painted/wrong across tiles we've processed
|
||||
let aggPainted = 0;
|
||||
let aggRequiredTiles = 0;
|
||||
let aggWrong = 0;
|
||||
for (const stats of this.tileProgress.values()) {
|
||||
aggPainted += stats.painted || 0;
|
||||
aggRequiredTiles += stats.required || 0;
|
||||
aggWrong += stats.wrong || 0;
|
||||
}
|
||||
|
||||
// Determine total required across all templates
|
||||
// Prefer precomputed per-template required counts; fall back to sum of processed tiles
|
||||
const totalRequiredTemplates = this.templatesArray.reduce((sum, t) =>
|
||||
sum + (t.requiredPixelCount || t.pixelCount || 0), 0);
|
||||
const totalRequired = totalRequiredTemplates > 0 ? totalRequiredTemplates : aggRequiredTiles;
|
||||
|
||||
const paintedStr = new Intl.NumberFormat().format(aggPainted);
|
||||
const requiredStr = new Intl.NumberFormat().format(totalRequired);
|
||||
const wrongStr = new Intl.NumberFormat().format(totalRequired - aggPainted); // Used to be aggWrong, but that is bugged
|
||||
|
||||
this.overlay.handleDisplayStatus(
|
||||
`Displaying ${templateCount} template${templateCount == 1 ? '' : 's'}.\nPainted ${paintedStr} / ${requiredStr} • Wrong ${wrongStr}`
|
||||
);
|
||||
} else {
|
||||
this.overlay.handleDisplayStatus(`Displaying ${templateCount} templates.`);
|
||||
}
|
||||
|
||||
return await canvas.convertToBlob({ type: 'image/png' });
|
||||
|
|
@ -349,6 +514,8 @@ export default class TemplateManager {
|
|||
//const coords = templateValue?.coords?.split(',').map(Number); // "1,2,3,4" -> [1, 2, 3, 4]
|
||||
const tilesbase64 = templateValue.tiles;
|
||||
const templateTiles = {}; // Stores the template bitmap tiles for each tile.
|
||||
let requiredPixelCount = 0; // Global required pixel count for this imported template
|
||||
const paletteMap = new Map(); // Accumulates color counts across tiles (center pixels only)
|
||||
|
||||
for (const tile in tilesbase64) {
|
||||
console.log(tile);
|
||||
|
|
@ -359,6 +526,36 @@ export default class TemplateManager {
|
|||
const templateBlob = new Blob([templateUint8Array], { type: "image/png" }); // Uint8Array -> Blob
|
||||
const templateBitmap = await createImageBitmap(templateBlob) // Blob -> Bitmap
|
||||
templateTiles[tile] = templateBitmap;
|
||||
|
||||
// Count required pixels in this bitmap (center pixels with alpha >= 64 and not #deface)
|
||||
try {
|
||||
const w = templateBitmap.width;
|
||||
const h = templateBitmap.height;
|
||||
const c = new OffscreenCanvas(w, h);
|
||||
const cx = c.getContext('2d', { willReadFrequently: true });
|
||||
cx.imageSmoothingEnabled = false;
|
||||
cx.clearRect(0, 0, w, h);
|
||||
cx.drawImage(templateBitmap, 0, 0);
|
||||
const data = cx.getImageData(0, 0, w, h).data;
|
||||
for (let y = 0; y < h; y++) {
|
||||
for (let x = 0; x < w; x++) {
|
||||
// Only count center pixels of 3x blocks
|
||||
if ((x % this.drawMult) !== 1 || (y % this.drawMult) !== 1) { continue; }
|
||||
const idx = (y * w + x) * 4;
|
||||
const r = data[idx];
|
||||
const g = data[idx + 1];
|
||||
const b = data[idx + 2];
|
||||
const a = data[idx + 3];
|
||||
if (a < 64) { continue; }
|
||||
if (r === 222 && g === 250 && b === 206) { continue; }
|
||||
requiredPixelCount++;
|
||||
const key = `${r},${g},${b}`;
|
||||
paletteMap.set(key, (paletteMap.get(key) || 0) + 1);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Failed to count required pixels for imported tile', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -370,11 +567,39 @@ export default class TemplateManager {
|
|||
//coords: coords
|
||||
});
|
||||
template.chunked = templateTiles;
|
||||
template.requiredPixelCount = requiredPixelCount;
|
||||
// Construct colorPalette from paletteMap
|
||||
const paletteObj = {};
|
||||
for (const [key, count] of paletteMap.entries()) { paletteObj[key] = { count, enabled: true }; }
|
||||
template.colorPalette = paletteObj;
|
||||
// Populate tilePrefixes for fast-scoping
|
||||
try { Object.keys(templateTiles).forEach(k => { template.tilePrefixes?.add(k.split(',').slice(0,2).join(',')); }); } catch (_) {}
|
||||
// Merge persisted palette (enabled/disabled) if present
|
||||
try {
|
||||
const persisted = templates?.[templateKey]?.palette;
|
||||
if (persisted) {
|
||||
for (const [rgb, meta] of Object.entries(persisted)) {
|
||||
if (!template.colorPalette[rgb]) {
|
||||
template.colorPalette[rgb] = { count: meta?.count || 0, enabled: !!meta?.enabled };
|
||||
} else {
|
||||
template.colorPalette[rgb].enabled = !!meta?.enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
// Store storageKey for later writes
|
||||
template.storageKey = templateKey;
|
||||
this.templatesArray.push(template);
|
||||
console.log(this.templatesArray);
|
||||
console.log(`^^^ This ^^^`);
|
||||
}
|
||||
}
|
||||
// After importing templates from storage, reveal color UI and request palette list build
|
||||
try {
|
||||
const colorUI = document.querySelector('#bm-contain-colorfilter');
|
||||
if (colorUI) { colorUI.style.display = ''; }
|
||||
window.postMessage({ source: 'blue-marble', bmEvent: 'bm-rebuild-color-list' }, '*');
|
||||
} catch (_) { /* no-op */ }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
338
src/utils.js
338
src/utils.js
|
|
@ -127,6 +127,21 @@ export function base64ToUint8(base64) {
|
|||
return array;
|
||||
}
|
||||
|
||||
/** Returns the coordinate input fields
|
||||
* @returns {Element[]} The 4 coordinate Inputs
|
||||
* @since 0.74.0
|
||||
*/
|
||||
export function selectAllCoordinateInputs(document) {
|
||||
coords = [];
|
||||
|
||||
coords.push(document.querySelector('#bm-input-tx'));
|
||||
coords.push(document.querySelector('#bm-input-ty'));
|
||||
coords.push(document.querySelector('#bm-input-px'));
|
||||
coords.push(document.querySelector('#bm-input-py'));
|
||||
|
||||
return coords;
|
||||
}
|
||||
|
||||
/** The color palette used by wplace.live
|
||||
* @since 0.78.0
|
||||
* @examples
|
||||
|
|
@ -135,260 +150,69 @@ export function base64ToUint8(base64) {
|
|||
* console.log(utils[5]?.rgb); // [255, 255, 255]
|
||||
*/
|
||||
export const colorpalette = [
|
||||
{
|
||||
"name": "Transparent",
|
||||
"rgb": [0, 0, 0]
|
||||
},
|
||||
{
|
||||
"name": "Black",
|
||||
"rgb": [0, 0, 0]
|
||||
},
|
||||
{
|
||||
"name": "Dark Gray",
|
||||
"rgb": [60, 60, 60]
|
||||
},
|
||||
{
|
||||
"name": "Gray",
|
||||
"rgb": [120, 120, 120]
|
||||
},
|
||||
{
|
||||
"name": "Light Gray",
|
||||
"rgb": [210, 210, 210]
|
||||
},
|
||||
{
|
||||
"name": "White",
|
||||
"rgb": [255, 255, 255]
|
||||
},
|
||||
{
|
||||
"name": "Deep Red",
|
||||
"rgb": [96, 0, 24]
|
||||
},
|
||||
{
|
||||
"name": "Red",
|
||||
"rgb": [237, 28, 36]
|
||||
},
|
||||
{
|
||||
"name": "Orange",
|
||||
"rgb": [255, 127, 39]
|
||||
},
|
||||
{
|
||||
"name": "Gold",
|
||||
"rgb": [246, 170, 9]
|
||||
},
|
||||
{
|
||||
"name": "Yellow",
|
||||
"rgb": [249, 221, 59]
|
||||
},
|
||||
{
|
||||
"name": "Light Yellow",
|
||||
"rgb": [255, 250, 188]
|
||||
},
|
||||
{
|
||||
"name": "Dark Green",
|
||||
"rgb": [14, 185, 104]
|
||||
},
|
||||
{
|
||||
"name": "Green",
|
||||
"rgb": [19, 230, 123]
|
||||
},
|
||||
{
|
||||
"name": "Light Green",
|
||||
"rgb": [135, 255, 94]
|
||||
},
|
||||
{
|
||||
"name": "Dark Teal",
|
||||
"rgb": [12, 129, 110]
|
||||
},
|
||||
{
|
||||
"name": "Teal",
|
||||
"rgb": [16, 174, 166]
|
||||
},
|
||||
{
|
||||
"name": "Light Teal",
|
||||
"rgb": [19, 225, 190]
|
||||
},
|
||||
{
|
||||
"name": "Dark Blue",
|
||||
"rgb": [40, 80, 158]
|
||||
},
|
||||
{
|
||||
"name": "Blue",
|
||||
"rgb": [64, 147, 228]
|
||||
},
|
||||
{
|
||||
"name": "Cyan",
|
||||
"rgb": [96, 247, 242]
|
||||
},
|
||||
{
|
||||
"name": "Indigo",
|
||||
"rgb": [107, 80, 246]
|
||||
},
|
||||
{
|
||||
"name": "Light Indigo",
|
||||
"rgb": [153, 177, 251]
|
||||
},
|
||||
{
|
||||
"name": "Dark Purple",
|
||||
"rgb": [120, 12, 153]
|
||||
},
|
||||
{
|
||||
"name": "Purple",
|
||||
"rgb": [170, 56, 185]
|
||||
},
|
||||
{
|
||||
"name": "Light Purple",
|
||||
"rgb": [224, 159, 249]
|
||||
},
|
||||
{
|
||||
"name": "Dark Pink",
|
||||
"rgb": [203, 0, 122]
|
||||
},
|
||||
{
|
||||
"name": "Pink",
|
||||
"rgb": [236, 31, 128]
|
||||
},
|
||||
{
|
||||
"name": "Light Pink",
|
||||
"rgb": [243, 141, 169]
|
||||
},
|
||||
{
|
||||
"name": "Dark Brown",
|
||||
"rgb": [104, 70, 52]
|
||||
},
|
||||
{
|
||||
"name": "Brown",
|
||||
"rgb": [149, 104, 42]
|
||||
},
|
||||
{
|
||||
"name": "Beige",
|
||||
"rgb": [248, 178, 119]
|
||||
},
|
||||
{
|
||||
"name": "Medium Gray",
|
||||
"rgb": [170, 170, 170]
|
||||
},
|
||||
{
|
||||
"name": "Dark Red",
|
||||
"rgb": [165, 14, 30]
|
||||
},
|
||||
{
|
||||
"name": "Light Red",
|
||||
"rgb": [250, 128, 114]
|
||||
},
|
||||
{
|
||||
"name": "Dark Orange",
|
||||
"rgb": [228, 92, 26]
|
||||
},
|
||||
{
|
||||
"name": "Light Tan",
|
||||
"rgb": [214, 181, 148]
|
||||
},
|
||||
{
|
||||
"name": "Dark Goldenrod",
|
||||
"rgb": [156, 132, 49]
|
||||
},
|
||||
{
|
||||
"name": "Goldenrod",
|
||||
"rgb": [197, 173, 49]
|
||||
},
|
||||
{
|
||||
"name": "Light Goldenrod",
|
||||
"rgb": [232, 212, 95]
|
||||
},
|
||||
{
|
||||
"name": "Dark Olive",
|
||||
"rgb": [74, 107, 58]
|
||||
},
|
||||
{
|
||||
"name": "Olive",
|
||||
"rgb": [90, 148, 74]
|
||||
},
|
||||
{
|
||||
"name": "Light Olive",
|
||||
"rgb": [132, 197, 115]
|
||||
},
|
||||
{
|
||||
"name": "Dark Cyan",
|
||||
"rgb": [15, 121, 159]
|
||||
},
|
||||
{
|
||||
"name": "Light Cyan",
|
||||
"rgb": [187, 250, 242]
|
||||
},
|
||||
{
|
||||
"name": "Light Blue",
|
||||
"rgb": [125, 199, 255]
|
||||
},
|
||||
{
|
||||
"name": "Dark Indigo",
|
||||
"rgb": [77, 49, 184]
|
||||
},
|
||||
{
|
||||
"name": "Dark Slate Blue",
|
||||
"rgb": [74, 66, 132]
|
||||
},
|
||||
{
|
||||
"name": "Slate Blue",
|
||||
"rgb": [122, 113, 196]
|
||||
},
|
||||
{
|
||||
"name": "Light Slate Blue",
|
||||
"rgb": [181, 174, 241]
|
||||
},
|
||||
{
|
||||
"name": "Light Brown",
|
||||
"rgb": [219, 164, 99]
|
||||
},
|
||||
{
|
||||
"name": "Dark Beige",
|
||||
"rgb": [209, 128, 81]
|
||||
},
|
||||
{
|
||||
"name": "Light Beige",
|
||||
"rgb": [255, 197, 165]
|
||||
},
|
||||
{
|
||||
"name": "Dark Peach",
|
||||
"rgb": [155, 82, 73]
|
||||
},
|
||||
{
|
||||
"name": "Peach",
|
||||
"rgb": [209, 128, 120]
|
||||
},
|
||||
{
|
||||
"name": "Light Peach",
|
||||
"rgb": [250, 182, 164]
|
||||
},
|
||||
{
|
||||
"name": "Dark Tan",
|
||||
"rgb": [123, 99, 82]
|
||||
},
|
||||
{
|
||||
"name": "Tan",
|
||||
"rgb": [156, 132, 107]
|
||||
},
|
||||
{
|
||||
"name": "Dark Slate",
|
||||
"rgb": [51, 57, 65]
|
||||
},
|
||||
{
|
||||
"name": "Slate",
|
||||
"rgb": [109, 117, 141]
|
||||
},
|
||||
{
|
||||
"name": "Light Slate",
|
||||
"rgb": [179, 185, 209]
|
||||
},
|
||||
{
|
||||
"name": "Dark Stone",
|
||||
"rgb": [109, 100, 63]
|
||||
},
|
||||
{
|
||||
"name": "Stone",
|
||||
"rgb": [148, 140, 107]
|
||||
},
|
||||
{
|
||||
"name": "Light Stone",
|
||||
"rgb": [205, 197, 158]
|
||||
}
|
||||
];
|
||||
{ "id": 0, "premium": false, "name": "Transparent", "rgb": [0, 0, 0] },
|
||||
{ "id": 1, "premium": false, "name": "Black", "rgb": [0, 0, 0] },
|
||||
{ "id": 2, "premium": false, "name": "Dark Gray", "rgb": [60, 60, 60] },
|
||||
{ "id": 3, "premium": false, "name": "Gray", "rgb": [120, 120, 120] },
|
||||
{ "id": 4, "premium": false, "name": "Light Gray", "rgb": [210, 210, 210] },
|
||||
{ "id": 5, "premium": false, "name": "White", "rgb": [255, 255, 255] },
|
||||
{ "id": 6, "premium": false, "name": "Deep Red", "rgb": [96, 0, 24] },
|
||||
{ "id": 7, "premium": false, "name": "Red", "rgb": [237, 28, 36] },
|
||||
{ "id": 8, "premium": false, "name": "Orange", "rgb": [255, 127, 39] },
|
||||
{ "id": 9, "premium": false, "name": "Gold", "rgb": [246, 170, 9] },
|
||||
{ "id": 10, "premium": false, "name": "Yellow", "rgb": [249, 221, 59] },
|
||||
{ "id": 11, "premium": false, "name": "Light Yellow", "rgb": [255, 250, 188] },
|
||||
{ "id": 12, "premium": false, "name": "Dark Green", "rgb": [14, 185, 104] },
|
||||
{ "id": 13, "premium": false, "name": "Green", "rgb": [19, 230, 123] },
|
||||
{ "id": 14, "premium": false, "name": "Light Green", "rgb": [135, 255, 94] },
|
||||
{ "id": 15, "premium": false, "name": "Dark Teal", "rgb": [12, 129, 110] },
|
||||
{ "id": 16, "premium": false, "name": "Teal", "rgb": [16, 174, 166] },
|
||||
{ "id": 17, "premium": false, "name": "Light Teal", "rgb": [19, 225, 190] },
|
||||
{ "id": 18, "premium": false, "name": "Dark Blue", "rgb": [40, 80, 158] },
|
||||
{ "id": 19, "premium": false, "name": "Blue", "rgb": [64, 147, 228] },
|
||||
{ "id": 20, "premium": false, "name": "Cyan", "rgb": [96, 247, 242] },
|
||||
{ "id": 21, "premium": false, "name": "Indigo", "rgb": [107, 80, 246] },
|
||||
{ "id": 22, "premium": false, "name": "Light Indigo", "rgb": [153, 177, 251] },
|
||||
{ "id": 23, "premium": false, "name": "Dark Purple", "rgb": [120, 12, 153] },
|
||||
{ "id": 24, "premium": false, "name": "Purple", "rgb": [170, 56, 185] },
|
||||
{ "id": 25, "premium": false, "name": "Light Purple", "rgb": [224, 159, 249] },
|
||||
{ "id": 26, "premium": false, "name": "Dark Pink", "rgb": [203, 0, 122] },
|
||||
{ "id": 27, "premium": false, "name": "Pink", "rgb": [236, 31, 128] },
|
||||
{ "id": 28, "premium": false, "name": "Light Pink", "rgb": [243, 141, 169] },
|
||||
{ "id": 29, "premium": false, "name": "Dark Brown", "rgb": [104, 70, 52] },
|
||||
{ "id": 30, "premium": false, "name": "Brown", "rgb": [149, 104, 42] },
|
||||
{ "id": 31, "premium": false, "name": "Beige", "rgb": [248, 178, 119] },
|
||||
{ "id": 32, "premium": true, "name": "Medium Gray", "rgb": [170, 170, 170] },
|
||||
{ "id": 33, "premium": true, "name": "Dark Red", "rgb": [165, 14, 30] },
|
||||
{ "id": 34, "premium": true, "name": "Light Red", "rgb": [250, 128, 114] },
|
||||
{ "id": 35, "premium": true, "name": "Dark Orange", "rgb": [228, 92, 26] },
|
||||
{ "id": 36, "premium": true, "name": "Light Tan", "rgb": [214, 181, 148] },
|
||||
{ "id": 37, "premium": true, "name": "Dark Goldenrod","rgb": [156, 132, 49] },
|
||||
{ "id": 38, "premium": true, "name": "Goldenrod", "rgb": [197, 173, 49] },
|
||||
{ "id": 39, "premium": true, "name": "Light Goldenrod","rgb": [232, 212, 95] },
|
||||
{ "id": 40, "premium": true, "name": "Dark Olive", "rgb": [74, 107, 58] },
|
||||
{ "id": 41, "premium": true, "name": "Olive", "rgb": [90, 148, 74] },
|
||||
{ "id": 42, "premium": true, "name": "Light Olive", "rgb": [132, 197, 115] },
|
||||
{ "id": 43, "premium": true, "name": "Dark Cyan", "rgb": [15, 121, 159] },
|
||||
{ "id": 44, "premium": true, "name": "Light Cyan", "rgb": [187, 250, 242] },
|
||||
{ "id": 45, "premium": true, "name": "Light Blue", "rgb": [125, 199, 255] },
|
||||
{ "id": 46, "premium": true, "name": "Dark Indigo", "rgb": [77, 49, 184] },
|
||||
{ "id": 47, "premium": true, "name": "Dark Slate Blue","rgb": [74, 66, 132] },
|
||||
{ "id": 48, "premium": true, "name": "Slate Blue", "rgb": [122, 113, 196] },
|
||||
{ "id": 49, "premium": true, "name": "Light Slate Blue","rgb": [181, 174, 241] },
|
||||
{ "id": 50, "premium": true, "name": "Light Brown", "rgb": [219, 164, 99] },
|
||||
{ "id": 51, "premium": true, "name": "Dark Beige", "rgb": [209, 128, 81] },
|
||||
{ "id": 52, "premium": true, "name": "Light Beige", "rgb": [255, 197, 165] },
|
||||
{ "id": 53, "premium": true, "name": "Dark Peach", "rgb": [155, 82, 73] },
|
||||
{ "id": 54, "premium": true, "name": "Peach", "rgb": [209, 128, 120] },
|
||||
{ "id": 55, "premium": true, "name": "Light Peach", "rgb": [250, 182, 164] },
|
||||
{ "id": 56, "premium": true, "name": "Dark Tan", "rgb": [123, 99, 82] },
|
||||
{ "id": 57, "premium": true, "name": "Tan", "rgb": [156, 132, 107] },
|
||||
{ "id": 58, "premium": true, "name": "Dark Slate", "rgb": [51, 57, 65] },
|
||||
{ "id": 59, "premium": true, "name": "Slate", "rgb": [109, 117, 141] },
|
||||
{ "id": 60, "premium": true, "name": "Light Slate", "rgb": [179, 185, 209] },
|
||||
{ "id": 61, "premium": true, "name": "Dark Stone", "rgb": [109, 100, 63] },
|
||||
{ "id": 62, "premium": true, "name": "Stone", "rgb": [148, 140, 107] },
|
||||
{ "id": 63, "premium": true, "name": "Light Stone", "rgb": [205, 197, 158] }
|
||||
];
|
||||
// All entries include fixed id (index-based) and premium flag by design.
|
||||
|
|
|
|||
Loading…
Reference in a new issue