Template:LCARS Toggle: Difference between revisions

From 118Wiki
Jump to navigation Jump to search
(making a template for a LCARS-y thing I've been using on my page, so that I can stop having to copy and paste it (and hopefully my code will look better!))
 
m (testing again, adding in visibility:hidden)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><hr style="height:1px; visibility:hidden;" />
<includeonly>{{#switch: {{{Header}}}
<div class="LCARS"><div class="mw-customtoggle-{{{Toggle Name}}}"">
|Yes=<h{{{Header Level}}} style="visibility:hidden;">{{{Title}}}</h{{{Header Level}}}>
|}}<div class="LCARS"><div class="mw-customtoggle-{{{Toggle Name}}}"">
{|style="width: 100%; align: center;"
{|style="width: 100%; align: center;"
|width="40px" height="16px" style="background:{{{Color}}}; border:0px; border-radius: 20px 0px 0px 20px"|
|width="40px" height="16px" style="background:{{{Color}}}; border:0px; border-radius: 20px 0px 0px 20px"|
{{#switch: {{{Side}}}
{{#switch: {{{Side}}}
|Left=!style{{=}}"width:1px; padding-top: 0px; padding-bottom: 0px; padding-left: 5px; padding-right: 5px; white-space:nowrap; text-transform:uppercase; font-family:Arial, Helvetica, sans-serif; font-size:large; line-height: 100%;"{{!}}{{{Title}}}
|Left=!style{{=}}"width:1px; padding-top: 0px; padding-bottom: 0px; padding-left: 5px; padding-right: 5px; white-space:nowrap; text-transform:uppercase; font-family:Arial, Helvetica, sans-serif; font-size:large; line-height: 100%;"{{!}}{{{Title}}} {{#if: {{{Expand Indicator|}}} | {{{Expand Indicator}}} |  }}
|Right={{!}}width{{=}}"5px"{{!}}
|Right={{!}}width{{=}}"5px"{{!}}
|{{!}}width{{=}}"5px"{{!}}
|{{!}}width{{=}}"5px"{{!}}
Line 10: Line 11:
|style="background:{{{Color}}}; border:0px;"|
|style="background:{{{Color}}}; border:0px;"|
{{#switch: {{{Side}}}
{{#switch: {{{Side}}}
|Right=!style{{=}}"width:1px; padding-top: 0px; padding-bottom: 0px; padding-left: 5px; padding-right: 5px; white-space:nowrap; text-transform:uppercase; font-family:Arial, Helvetica, sans-serif; font-size:large; line-height: 100%;"{{!}}{{{Title}}}
|Right=!style{{=}}"width:1px; padding-top: 0px; padding-bottom: 0px; padding-left: 5px; padding-right: 5px; white-space:nowrap; text-transform:uppercase; font-family:Arial, Helvetica, sans-serif; font-size:large; line-height: 100%;"{{!}}{{{Title}}} {{#if: {{{Expand Indicator|}}} | {{{Expand Indicator}}} |  }}
|Left={{!}}width{{=}}"5px"{{!}}
|Left={{!}}width{{=}}"5px"{{!}}
|{{!}}width{{=}}"5px"{{!}}
|{{!}}width{{=}}"5px"{{!}}
Line 22: Line 23:
Creates a toggle-able LCARS menu! <!-- Also, this is my first template, hoorah! -->
Creates a toggle-able LCARS menu! <!-- Also, this is my first template, hoorah! -->


===Example===
<pre>NOTE: To include things like tables and any sort of formatting that uses | characters within the content section of the template, substitute any | characters with {{!}}, and the code should work just fine.
 
The "Expand Indicator" variable allows one to set any unicode symbol as a marker to "click here". Hopefully this will increase the salience of the LCARS toggle button! Some characters that might work include: ˅, ⌄, ↕, ⇕, ⇳, ☟, ⬍, ⭥, 𝅎, 𝅏, 🡙 (but you can use whatever you want).</pre>
 
'''Example'''
<pre>
<pre>
{{LCARS Toggle
{{LCARS Toggle
Line 29: Line 34:
|Color = steelblue
|Color = steelblue
|Title = Shore Leave!
|Title = Shore Leave!
|Expand Indicator = ⮟
|Content = This is some writing, blarg.
|Content = This is some writing, blarg.
}}
}}
Line 39: Line 45:
|Color = steelblue
|Color = steelblue
|Title = Shore Leave!
|Title = Shore Leave!
|Expand Indicator = ⮟
|Content = This is some writing, blarg.
|Content = This is some writing, blarg.
}}
}}
===Different Sides!===
 
'''Different Sides!'''
You can also switch the side that the text is on!
You can also switch the side that the text is on!
{{LCARS Toggle
{{LCARS Toggle
Line 48: Line 56:
|Color = steelblue
|Color = steelblue
|Title = Shore Leave!
|Title = Shore Leave!
|Expand Indicator = ⮟
|Content = This is some writing, blarg.
}}
'''Header Optionality!'''
If you want this to act as a header (aka: show up in the TOC) there is a toggle to turn that on - it is off by default. If chosen, you must specify the header level that it will appear as in the TOC (I recommend 2, and 3 for sub-headers).
__TOC__
<pre>
{{LCARS Toggle
|Toggle Name = SH
|Side = Right
|Color = steelblue
|Title = Woah, a header!
|Expand Indicator = ⮟
|Header = Yes
|Header Level = 2
|Content = This is some writing, blarg.
}}
</pre>
{{LCARS Toggle
|Toggle Name = SH
|Side = Right
|Color = steelblue
|Title = Woah, a header!
|Expand Indicator = ⮟
|Header = Yes
|Header Level = 2
|Content = This is some writing, blarg.
}}
Here's an example of using header level 3.
{{LCARS Toggle
|Toggle Name = SubH
|Side = Right
|Color = steelblue
|Title = This should be a sub-heading :)
|Expand Indicator = ⮟
|Header = Yes
|Header Level = 3
|Content = This is some writing, blarg.
|Content = This is some writing, blarg.
}}
}}


[[Category:Templates]]</noinclude>
[[Category:Templates]]</noinclude>

Latest revision as of 21:59, 15 July 2024

Creates a toggle-able LCARS menu!

NOTE: To include things like tables and any sort of formatting that uses | characters within the content section of the template, substitute any | characters with {{!}}, and the code should work just fine.

The "Expand Indicator" variable allows one to set any unicode symbol as a marker to "click here". Hopefully this will increase the salience of the LCARS toggle button! Some characters that might work include: ˅, ⌄, ↕, ⇕, ⇳, ☟, ⬍, ⭥, 𝅎, 𝅏, 🡙 (but you can use whatever you want).

Example

{{LCARS Toggle
|Toggle Name = SL
|Side = Left
|Color = steelblue
|Title = Shore Leave!
|Expand Indicator = ⮟
|Content = This is some writing, blarg.
}}

which gives you

Shore Leave! ⮟

This is some writing, blarg.

Different Sides! You can also switch the side that the text is on!

Shore Leave! ⮟

This is some writing, blarg.

Header Optionality! If you want this to act as a header (aka: show up in the TOC) there is a toggle to turn that on - it is off by default. If chosen, you must specify the header level that it will appear as in the TOC (I recommend 2, and 3 for sub-headers).

{{LCARS Toggle
|Toggle Name = SH
|Side = Right
|Color = steelblue
|Title = Woah, a header!
|Expand Indicator = ⮟
|Header = Yes
|Header Level = 2
|Content = This is some writing, blarg.
}}

Woah, a header!

Woah, a header! ⮟

This is some writing, blarg.

Here's an example of using header level 3.

This should be a sub-heading :)

This should be a sub-heading :) ⮟

This is some writing, blarg.