Display color next to layer name

This should make it easier to disambiguate layers that are otherwise hard to tell apart.
main
Chandler Swift 2024-10-19 19:05:29 -05:00
parent 1ad82c55ee
commit 26c5b56d58
Signed by: chandlerswift
GPG Key ID: A851D929D52FB93F
2 changed files with 10 additions and 1 deletions

View File

@ -218,7 +218,7 @@ function newCustomLayer(name, sourceURL, colorString) {
}),
});
li.innerHTML = `
<label><input type="checkbox" checked> ${name}</label>
<label><input type="checkbox" checked><div class="color-badge" style="background-color: rgb(${color.join(', ')});"></div> ${name}</label>
`;
li.querySelector("input").addEventListener("change", function(e){
if (e.target.checked) {

View File

@ -70,6 +70,15 @@ aside summary {
font-weight: bold;
}
.color-badge {
display: inline-block;
height: 1em;
width: 2em;
vertical-align: middle;
border: 1px #444 solid;
border-radius: 4px;
}
@media (max-width: 400px) {
.nav-open #map {
left: 100%;