Difference between revisions of "Template:Ribbon2"
From Geohashing
(Undo revision 744320 by Fippe (talk) -- Adding this period is Template:Achievement) (Tag: Undo) |
(strike out "Make the {{{image}}} parameter work") |
||
(20 intermediate revisions by 2 users not shown) | |||
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-wrapper { |
− | display: | + | display:flex; |
+ | } | ||
+ | .ribbon2 { | ||
padding: 5px 5px 5px 0; | padding: 5px 5px 5px 0; | ||
margin: 2px 0; | margin: 2px 0; | ||
Line 8: | Line 10: | ||
border: 1px solid lightgray; | border: 1px solid lightgray; | ||
border-left: 5px solid #bada55; | border-left: 5px solid #bada55; | ||
− | + | align-items: center; | |
+ | width: fit-content; | ||
+ | } | ||
+ | |||
+ | .ribbon2-grid { | ||
+ | display: grid; | ||
grid-template-areas: | grid-template-areas: | ||
− | "icon achv | + | "icon achv imag xtra" |
− | "icon actn | + | "icon actn imag xtra"; |
− | grid-template-columns: min-content auto | + | grid-template-columns: min-content auto min-content min-content; |
− | |||
} | } | ||
− | . | + | |
+ | .ribbon2-flex { | ||
display:flex; | display:flex; | ||
} | } | ||
− | . | + | |
+ | .ribbon2-flex .ribbon2-actn { | ||
+ | max-height: 4em; | ||
+ | overflow-y: auto; | ||
+ | } | ||
+ | |||
+ | .ribbon2 > * { | ||
margin: 0 5px; | margin: 0 5px; | ||
} | } | ||
− | . | + | .ribbon2-icon { |
grid-area: icon; | grid-area: icon; | ||
− | |||
} | } | ||
− | . | + | .ribbon2-achv { |
− | |||
− | |||
grid-area: achv; | grid-area: achv; | ||
font-weight: bold; | font-weight: bold; | ||
} | } | ||
− | + | .ribbon2-grid .ribbon2-actn { | |
− | . | ||
grid-area: actn; | grid-area: actn; | ||
padding-left: 1em; | padding-left: 1em; | ||
+ | } | ||
+ | .ribbon2-xtra { | ||
+ | grid-area: xtra; | ||
+ | } | ||
+ | .ribbon2-imag { | ||
+ | grid-area: imag; | ||
} | } | ||
− | . | + | .ribbon2-icon a { display: flex; } |
+ | .ribbon2-theme-default .ribbon2-icon {width: 70px;} | ||
+ | |||
+ | .ribbon2-xtra, .ribbon2-imag { | ||
padding-left: 10px; | padding-left: 10px; | ||
border-left: 1px solid lightgray; | border-left: 1px solid lightgray; | ||
Line 47: | Line 65: | ||
− | . | + | .ribbon2-theme-mini { |
− | grid-template-areas: "icon achv actn xtra"; | + | grid-template-areas: "icon achv actn . imag xtra"; |
+ | grid-template-columns: min-content max-content max-content auto min-content min-content; | ||
padding: 0; | padding: 0; | ||
} | } | ||
− | . | + | .ribbon2-theme-mini .ribbon2-actn { |
padding-left: 0; | padding-left: 0; | ||
} | } | ||
− | . | + | .ribbon2-theme-mini .ribbon2-achv::after { |
/* for some reason `content: " ";` doesn't work */ | /* for some reason `content: " ";` doesn't work */ | ||
content: " "; | content: " "; | ||
} | } | ||
− | . | + | .ribbon2-theme-mini img { |
width: 22px; | width: 22px; | ||
height: 22px; | height: 22px; | ||
} | } | ||
− | }} | + | }}{{Ribbon2/{{#switch:{{#var:ribbontheme}}|mini=mini|micro=micro|#default=default}} |
− | + | |style=border-left-color:{{{color|#bada55}}};background:{{{background|white}}};color:{{{fontcolor|black}}};width:{{#var:ribbonwidth|fit-content}} | |
− | + | |color={{{color|#bada55}}} | |
− | + | |icon={{{icon|landgeohash.png}}} | |
− | + | |achievement={{{achievement}}} | |
− | + | |action={{{action}}} | |
− | + | |expedition={{{expedition}}} | |
− | + | |background={{{background|white}}} | |
− | + | |fontcolor={{{fontcolor|black}}} | |
+ | |image={{{image|}}} | ||
+ | }}<noinclude> | ||
== Tests == | == Tests == | ||
+ | {{Ribbon2|action={{Lipsum}}|image=2020-02-08_43_-79_SIGSTKFLT-stupidgrin.jpg}} | ||
+ | {{Dark Ages|latitude=51|longitude=-1|date=2019-11-29|name=[[User:DanQ|DanQ]]|image=Vlcsnap-2019-11-29-15h55m24s199.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}} | ||
+ | {{#vardefine:ribbontheme|mini}} | ||
+ | {{Ribbon2}} | ||
+ | {{Ribbon2|action={{Lipsum}}}} | ||
+ | {{#vardefine:ribbontheme|micro}} | ||
+ | {{Ribbon2|achievement=foo|expedition=bar}} | ||
+ | |||
+ | == TODO == | ||
− | {{ | + | * <s>Handle long actions in mini and micro themes</s> |
− | + | * <s>Split themes into their own templates?</s> | |
+ | * <s>Make the <nowiki>{{{image}}}</nowiki> parameter work</s> | ||
</noinclude> | </noinclude> |
Latest revision as of 23:41, 12 January 2021
{{{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
by going on an expedition to the (51, -1) geohash on 2019-11-29.
SIGSTKFLT earned the Frozen Geohash Achievement
by reaching the (43, -79) geohash on 2020-02-08 while the temperature was -17°C.
{{{achievement}}}
{{{action}}}
{{{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.
foo:
bar
TODO
Handle long actions in mini and micro themesSplit themes into their own templates?Make the {{{image}}} parameter work