MediaWiki:Common.less/leaflet.less: Difference between revisions

No edit summary
(Add Pencil icon, and use map_icon instead of small_icon for entities)
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
//<pre>
/* MAPS */
.map {
float: right;
clear: right;
}
.leaflet-container {
background: #444444;
}
.leaflet-wiki-coordinates.leaflet-control {
margin: 0;
color: white;
padding: 5px 10px;
filter: drop-shadow(0 0 2px black);
}
.leaflet-tile-loaded {
image-rendering: pixelated;
}
// Prevents stuttery zoom when prefers-reduced-motion
@media (prefers-reduced-motion: reduce) {
.leaflet-zoom-anim .leaflet-zoom-animated {
transition-duration: 0.25s !important;
}
}


@square: 5px;
.map.leaflet-container {
@circle: 50%;
.leaflet-wiki-coordinates.leaflet-control {

margin: 0;
@none: ~'';
color: white;
@chef: #9C8474;
padding: 5px 10px;
@fisher: #98D3CC;
filter: drop-shadow(0 0 2px black);
@forager: #DDDB93;
}
@alchemist: #83C8A1;
@gatherer: #C8C87C;
/* ICONS */
@woodcutter: #78C86C;
@carpenter: #9C8A7C;
.leaflet-marker-icon {
@bonewright: #B0B897;
border-radius: 3px;
@miner: #749696;
@blacksmith: #B4A432;
/* professions */
@stonemason: #9C8A7C;
&.guard {
@detective: #5AB2BE;
background: #CA9C62 url(/images/Guard_small_icon.png) no-repeat center / contain;
@leatherworker: #866E62;
}
@merchant: #78B492;
&.chef,
@builder: #9C8A7C;
&.theme-chef {
@palette: #DEDAD4;
background: #8E7A6C url(/images/Chef_small_icon.png) no-repeat center / contain;
@item: #90908C;
}
@obstacle: #927DCE;
&.fisher,
@neutral: #C0925A;
&.theme-fisher {
@aggressive: #D75650;
background: #98D3CC url(/images/Fisher_small_icon.png) no-repeat center / contain;

}
// classname color icon shape
&.forager {
// All these icons should also be found here: https://brightershoreswiki.org/w/Brighter_Shores:Orphanage
background: #DDDB93 url(/images/Forager_small_icon.png) no-repeat center / contain;
@icons: guard none Guard @circle,
}
chef chef Chef @square,
&.alchemist,
fisher fisher Fisher @circle,
&.theme-alchemist {
forager forager Forager @square,
background: #84CAA2 url(/images/Alchemist_small_icon.png) no-repeat center / contain;
alchemist alchemist Alchemist @square,
}
&.scout {
scout none Scout @circle,
gatherer gatherer Gatherer @square,
background: #C09A60 url(/images/Scout_small_icon.png) no-repeat center / contain;
woodcutter woodcutter Woodcutter @square,
}
carpenter carpenter Carpenter @square,
&.gatherer {
minefighter none Minefighter @circle,
background: #C8C87C url(/images/Gatherer_small_icon.png) no-repeat center / contain;
bonewright bonewright Bonewright @square,
}
miner miner Miner @square,
&.woodcutter,
blacksmith blacksmith Blacksmith @square,
&.theme-woodcutter {
stonemason stonemason Stonemason @square,
background: #78C86C url(/images/Woodcutter_small_icon.png) no-repeat center / contain;
watchperson none Watchperson @circle,
}
detective detective Detective @square,
&.carpenter,
leatherworker leatherworker Leatherworker @square,
&.theme-carpenter {
merchant merchant Merchant @square,
background: red url(/images/Carpenter_small_icon.png) no-repeat center / contain;
builder builder Builder @square,
}
bank none Bank @square,
&.minefighter {
clipboard chef Clipboard @square,
background: #B2865D url(/images/Minefighter_small_icon.png) no-repeat center / contain;
enchantress item Enchantress @circle,
}
hairdresser obstacle Hairdresser @circle,
&.bonewright,
item item Item @square,
&.theme-bonewright {
talk item Talk @circle,
background: #B0B897 url(/images/Bonewright_small_icon.png) no-repeat center / contain;
obelisk item Obelisk @square,
}
obstacle obstacle Obstacle @square,
&.miner {
palette palette Palette @square,
background: #749696 url(/images/Miner_small_icon.png) no-repeat center / contain;
pencil item Pencil @circle,
}
portal_stone item Portal_Stone @square,
&.blacksmith {
recipe none Recipe @square,
background: #B4A432 url(/images/Blacksmith_small_icon.png) no-repeat center / contain;
search item Search @square,
}
shop none Shop @circle,
&.stonemason,
storage item Storage @square,
&.theme-stonemason {
venture none Venture @square;
background: #808789 url(/images/Stonemason_small_icon.png) no-repeat center / contain;

}
@themes: aggressive aggressive,
&.watchperson {
neutral neutral;
background: #AE8653 url(/images/Watchperson_small_icon.png) no-repeat center / contain;

}
.generate-map-icon-rules(@classname, @color, @image, @shape) {
&.detective {
.leaflet-marker-icon-icon-@{classname} {
background: #5AB2BE url(/images/Detective_small_icon.png) no-repeat center / contain;
background: @@color url('/images/@{image}_map_icon.png') no-repeat center / contain;
}
border-radius: @shape;
&.leatherworker {
}
background: #866E62 url(/images/Leatherworker_small_icon.png) no-repeat center / contain;
}
}
.generate-map-theme-rules(@classname, @color) when (@classname = @color) {
&.merchant {
.leaflet-marker-icon-theme-@{classname} {
background: #78B492 url(/images/Merchant_small_icon.png) no-repeat center / contain;
background-color: @@color;
}
}
&.shieldbearer {
}
background: red url(/images/Shieldbearer_small_icon.png) no-repeat center / contain;

}
// Highlight bad unclassified entities in red to catch errors
&.builder {
.leaflet-marker-icon-entity {
background: red url(/images/Builder_small_icon.png) no-repeat center / contain;
background-color: red;
}
box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 2px 2px;
&.armorer {
}
background: red url(/images/Armorer_small_icon.png) no-repeat center / contain;
each(@icons, {
}
@classname: extract(@value, 1);
@color: extract(@value, 2);
/* extra themes */
@image: extract(@value, 3);
&.theme-neutral {
@shape: extract(@value, 4);
background-color: #C0925A;
.generate-map-icon-rules(@classname, @color, @image, @shape);
}
});
&.theme-aggressive {
each(@icons, {
background-color: #C44A44;
@classname: extract(@value, 1);
}
@color: extract(@value, 2);
.generate-map-theme-rules(@classname, @color)
/* shapes */
});
each(@themes, {
&.shape-square,
@classname: extract(@value, 1);
&.theme-square {
@color: extract(@value, 2);
border-radius: none;
.generate-map-theme-rules(@classname, @color)
}
});
&.shape-circle {
.leaflet-marker-icon-shape-circle {
border-radius: 50px;
border-radius: @circle;
}
}
.leaflet-marker-icon-shape-square {
/* other */
border-radius: @square;
&.strange_stone,
&.portal_stone {
background-color: #949A90;
}
}
}
}
//</pre>

Latest revision as of 00:54, 15 December 2024

//<pre>
.map {
    float: right;
    clear: right;
}
.leaflet-container {
    background: #444444;
}
.leaflet-wiki-coordinates.leaflet-control {
    margin: 0;
    color: white;
    padding: 5px 10px;
    filter: drop-shadow(0 0 2px black);
}
.leaflet-tile-loaded {
    image-rendering: pixelated;
}
// Prevents stuttery zoom when prefers-reduced-motion
@media (prefers-reduced-motion: reduce) {
  .leaflet-zoom-anim .leaflet-zoom-animated {
    transition-duration: 0.25s !important;
  }
}

@square: 5px;
@circle: 50%;

@none: ~'';
@chef: #9C8474;
@fisher: #98D3CC;
@forager: #DDDB93;
@alchemist: #83C8A1;
@gatherer: #C8C87C;
@woodcutter: #78C86C;
@carpenter: #9C8A7C;
@bonewright: #B0B897;
@miner: #749696;
@blacksmith: #B4A432;
@stonemason: #9C8A7C;
@detective: #5AB2BE;
@leatherworker: #866E62;
@merchant: #78B492;
@builder: #9C8A7C;
@palette: #DEDAD4;
@item: #90908C;
@obstacle: #927DCE;
@neutral: #C0925A;
@aggressive: #D75650;

// classname color icon shape
// All these icons should also be found here: https://brightershoreswiki.org/w/Brighter_Shores:Orphanage
@icons: guard none Guard @circle,
    chef chef Chef @square,
    fisher fisher Fisher @circle,
    forager forager Forager @square,
    alchemist alchemist Alchemist @square,
    scout none Scout @circle,
    gatherer gatherer Gatherer @square,
    woodcutter woodcutter Woodcutter @square,
    carpenter carpenter Carpenter @square,
    minefighter none Minefighter @circle,
    bonewright bonewright Bonewright @square,
    miner miner Miner @square,
    blacksmith blacksmith Blacksmith @square,
    stonemason stonemason Stonemason @square,
    watchperson none Watchperson @circle,
    detective detective Detective @square,
    leatherworker leatherworker Leatherworker @square,
    merchant merchant Merchant @square,
    builder builder Builder @square,
    bank none Bank @square,
    clipboard chef Clipboard @square,
    enchantress item Enchantress @circle,
    hairdresser obstacle Hairdresser @circle,
    item item Item @square,
    talk item Talk @circle,
    obelisk item Obelisk @square,
    obstacle obstacle Obstacle @square,
    palette palette Palette @square,
    pencil item Pencil @circle,
    portal_stone item Portal_Stone @square,
    recipe none Recipe @square,
    search item Search @square,
    shop none Shop @circle,
    storage item Storage @square,
    venture none Venture @square;

@themes: aggressive aggressive,
    neutral neutral;

.generate-map-icon-rules(@classname, @color, @image, @shape) {
    .leaflet-marker-icon-icon-@{classname} {
        background: @@color url('/images/@{image}_map_icon.png') no-repeat center / contain;
        border-radius: @shape;
    }
}
.generate-map-theme-rules(@classname, @color) when (@classname = @color) {
    .leaflet-marker-icon-theme-@{classname} {
        background-color: @@color;
    }
}

// Highlight bad unclassified entities in red to catch errors
.leaflet-marker-icon-entity {
    background-color: red;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 2px 2px;
}
each(@icons, {
    @classname: extract(@value, 1);
    @color: extract(@value, 2);
    @image: extract(@value, 3);
    @shape: extract(@value, 4);
    .generate-map-icon-rules(@classname, @color, @image, @shape);
});
each(@icons, {
    @classname: extract(@value, 1);
    @color: extract(@value, 2);
    .generate-map-theme-rules(@classname, @color)
});
each(@themes, {
    @classname: extract(@value, 1);
    @color: extract(@value, 2);
    .generate-map-theme-rules(@classname, @color)
});
.leaflet-marker-icon-shape-circle {
    border-radius: @circle;
}
.leaflet-marker-icon-shape-square {
    border-radius: @square;
}
//</pre>