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

(wip)
(Add Pencil icon, and use map_icon instead of small_icon for entities)
 
(41 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;
&.guard {
@miner: #749696;
background-color: red;
@blacksmith: #B4A432;
background-image: url(/images/Guard_icon.png);
@stonemason: #9C8A7C;
}
@detective: #5AB2BE;
&.chef {
@leatherworker: #866E62;
background-color: red;
@merchant: #78B492;
background-image: url(/images/Chef_icon.png);
@builder: #9C8A7C;
}
@palette: #DEDAD4;
&.fisher {
@item: #90908C;
background-color: red;
@obstacle: #927DCE;
background-image: url(/images/Fisher_icon.png);
@neutral: #C0925A;
}
@aggressive: #D75650;
&.forager {

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

}
@themes: aggressive aggressive,
&.stonemason {
neutral neutral;
background-color: red;

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

background-image: url(/images/Leatherworker_icon.png);
// Highlight bad unclassified entities in red to catch errors
}
.leaflet-marker-icon-entity {
&.merchant {
background-color: red;
background-color: red;
box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 2px 2px;
background-image: url(/images/Merchant_icon.png);
}
}
each(@icons, {
&.shieldbearer {
@classname: extract(@value, 1);
background-color: red;
@color: extract(@value, 2);
background-image: url(/images/Shieldbearer_icon.png);
@image: extract(@value, 3);
}
@shape: extract(@value, 4);
&.builder {
.generate-map-icon-rules(@classname, @color, @image, @shape);
background-color: red;
});
background-image: url(/images/Builder_icon.png);
each(@icons, {
}
@classname: extract(@value, 1);
&.Armorer {
@color: extract(@value, 2);
background-color: red;
.generate-map-theme-rules(@classname, @color)
background-image: url(/images/Armorer_icon.png);
});
}
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>

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>