Difference between revisions of "Template:Ribbon2"
From Geohashing
(strike out "Make the {{{image}}} parameter work") |
(i've been nerd-sniped) |
||
Line 1: | Line 1: | ||
<!-- this css MUST NOT have any variables in it - someday, it'll be moved to [[MediaWiki:Common.css]] --> | <!-- this css MUST NOT have any variables in it - someday, it'll be moved to [[MediaWiki:Common.css]] --> | ||
{{#css: | {{#css: | ||
− | |||
− | |||
− | |||
.ribbon2 { | .ribbon2 { | ||
− | padding: 5px | + | padding: 5px; |
margin: 2px 0; | margin: 2px 0; | ||
max-width: 100%; | max-width: 100%; | ||
border: 1px solid lightgray; | border: 1px solid lightgray; | ||
− | border-left: 5px solid # | + | border-left: 5px solid #e8bf78; |
+ | border-radius: 1px; | ||
align-items: center; | align-items: center; | ||
width: fit-content; | width: fit-content; | ||
− | |||
− | .ribbon2-grid | + | .ribbon2-icon { |
− | + | grid-area: icon; | |
− | + | display: flex; | |
− | + | place-items: center; | |
− | + | img { | |
− | + | width: 3em; | |
− | } | + | height: 3em; |
+ | } | ||
+ | } | ||
− | .ribbon2- | + | .ribbon2-achievement { |
− | + | font-weight: bold; | |
− | } | + | grid-area: achievement; |
+ | } | ||
− | .ribbon2- | + | .ribbon2-action { |
− | + | grid-area: action; | |
− | + | } | |
− | } | ||
− | + | .ribbon2-image { | |
− | + | grid-area: image; | |
− | + | display: flex; | |
− | .ribbon2- | + | place-items: center; |
− | + | align-self: stretch; | |
− | + | } | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | } | ||
− | |||
− | |||
} | } | ||
− | .ribbon2- | + | .ribbon2[data-ribbon2-theme=default] { |
− | + | display: grid; | |
− | + | grid-template-areas: | |
− | + | "icon achievement achievement image" | |
− | + | "icon . action image"; | |
− | + | grid-template-columns: auto 3em 1fr auto; | |
− | + | gap: 0 1ch; | |
− | |||
align-items: center; | align-items: center; | ||
− | |||
} | } | ||
− | + | }}<div class="ribbon2" style="border-left-color={{{color}}}" data-ribbon2-theme="{{#var:ribbontheme|default}}"> | |
− | + | <div class="ribbon2-icon">{{{iconcode|[[File:{{{icon|Landgeohash.png}}}|70px]]}}}</div> | |
− | + | <div class="ribbon2-achievement">{{{achievement}}}</div> | |
− | + | <div class="ribbon2-action">{{{action}}}</div> | |
− | } | + | <div class="ribbon2-image">{{#if:{{{image|}}}|[[Image:{{{image}}}|50px]]}}</div> |
− | + | </div><noinclude> | |
− | |||
− | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | }}<noinclude> | ||
== Tests == | == Tests == | ||
Line 99: | Line 61: | ||
{{Frozen Geohash|latitude=43|longitude=-79|date=2020-02-08|temperature=-17°C|name=SIGSTKFLT|multiplier=3|image=2020-02-08_43_-79_SIGSTKFLT-stupidgrin.jpg}} | {{Frozen Geohash|latitude=43|longitude=-79|date=2020-02-08|temperature=-17°C|name=SIGSTKFLT|multiplier=3|image=2020-02-08_43_-79_SIGSTKFLT-stupidgrin.jpg}} | ||
{{Ribbon2}} | {{Ribbon2}} | ||
+ | === Mini === | ||
{{#vardefine:ribbontheme|mini}} | {{#vardefine:ribbontheme|mini}} | ||
{{Ribbon2}} | {{Ribbon2}} | ||
{{Ribbon2|action={{Lipsum}}}} | {{Ribbon2|action={{Lipsum}}}} | ||
+ | === Micro === | ||
{{#vardefine:ribbontheme|micro}} | {{#vardefine:ribbontheme|micro}} | ||
{{Ribbon2|achievement=foo|expedition=bar}} | {{Ribbon2|achievement=foo|expedition=bar}} |
Revision as of 01:25, 18 November 2024
{{{achievement}}}
{{{action}}}
Tests
{{{achievement}}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
DanQ earned the Dark Ages achievement
|
SIGSTKFLT earned the Frozen Geohash Achievement
|
{{{achievement}}}
{{{action}}}
Mini
{{{achievement}}}
{{{action}}}
{{{achievement}}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Micro
foo
{{{action}}}
TODO
Handle long actions in mini and micro themesSplit themes into their own templates?Make the {{{image}}} parameter work