Template:Alert: Difference between revisions

From Step Mods | Change The Game
(Created page with "<includeonly>{| class="alertLarge" style="border-color:#{{#switch:{{{bordercolor|{{{type}}}}}} |bug=3d9837 |construction=77749e |mcm=a9843f |mo=5293c1 |notice=3974b3 |warning=...")
 
No edit summary
Line 1: Line 1:
<includeonly>{| class="alertLarge" style="border-color:#{{#switch:{{{bordercolor|{{{type}}}}}}
<includeonly>{{#vardefine:color|{{#switch:{{lc:{{{type|}}}}}
|bug=3d9837
|bug=green
|construction=77749e
|construction=purple
|mcm=a9843f
|mcm=yellow
|mo=5293c1
|mo=blue
|notice=3974b3
|notice=blue
|warning=c13543
|warning=red
|#default=3974b3}};background:#{{#switch:{{{bgcolor|{{{type}}}}}}
|#default=blue}}}}{| class="{{{bgcolor|{{#var:color}}}}}bg alertLarge hltxt neutbd" style="width:{{#if:{{{size|}}}|{{#switch:{{{size|}}}
|bug=3d983742
|construction=77749e42
|mcm=a9843f42
|mo=5293c142
|notice=3974b342
|warning=c1354342
|#default=3974b342}};width:{{#if:{{{size|}}}|{{#switch:{{{size|}}}
|max=70
|max=70
|mid=55
|mid=55
|min=30
|min=30
|#default={{{size}}}}}|70}}%;"
|#default={{{size}}}}}|70}}%;"
|-
! rowspan="2" | [[File:{{#switch:{{{icon|{{lc:{{{type}}}}}}}}
| rowspan="2" class="alertImg" | [[Image:{{#switch:{{{icon|{{{type}}}}}}
|bug=Bug-Logo.png
|bug=Bug-Logo.png
|construction=Weapon.png
|construction=Weapon.png
Line 26: Line 18:
|notice=Info-Logo.png
|notice=Info-Logo.png
|warning=Warning-Logo.png
|warning=Warning-Logo.png
|#default=Info-Logo.png}}|35px]] || class="alertType" | {{#switch:{{lc:{{{type|}}}}}
|#default={{{icon|Info-Logo.png}}}}}|35px]] !! {{#switch:{{lc:{{{type|}}}}}
|bug=Bug
|bug=Bug
|construction=Under Construction
|construction=Under Construction
Line 38: Line 30:
|}
|}
</includeonly><noinclude>
</includeonly><noinclude>
{{#css:
.alertLarge{
box-shadow: 0 0 15px -2px #00000078;
border: 2px solid;
border-collapse: inherit;
border-radius: 5px !important;
margin: 1rem auto;
}
.alertLarge td, th{
padding: 0.5rem;
vertical-align: top;
}
.alertLarge th{
font-weight: bolder;
font-size: larger;
padding-bottom: 0 !important;
}
.alertLarge th:first-child{
width: 35px;
}
}}


== Purpose & Usage ==
== Purpose & Usage ==
Line 59: Line 75:
=== Optional Parameters ===
=== Optional Parameters ===
; size
; size
: Defined: <code>size=''value''</code>
: Default: ''max''
: Default: ''max''
: Determines the width by percentage. Accepts any integer from 0 - 100, but standard sizes are preferred using the appropriate keyword:
: Determines the width by percentage. Accepts any integer from 0 - 100, but standard sizes are preferred using the appropriate keyword:
Line 64: Line 81:
::* '''mid''' = 55%
::* '''mid''' = 55%
::* '''max''' = 70%
::* '''max''' = 70%
;icon
: Defined: <code>icon=''image.png''</code>
: Default: ''Info-Logo.png''
: Sets the icon image. This is set automatically if using one of the predefined types, but can be overridden here.
;bgcolor
: Defined: <code>bgcolor=''color''</code>
: Default: ''blue''
: Sets the background color. This is set automatically if using one of the predefined types, but can be overridden here. Keywords available are:
::* {{Fc|magenta|magent}}
::* {{Fc|purple|purple}}
::* {{Fc|blue|blue}}
::* {{Fc|green|green}}
::* {{Fc|chartreuse|chartr}}
::* {{Fc|yellow|yellow}}
::* {{Fc|orange|orange}}
::* {{Fc|salmon|salmon}}
::* {{Fc|red|red}}


== Examples ==
== Examples ==
=== General Notice ===
=== General Notice ===
This is the template's default thus leaving the '''type''' parameter out will result in a general notification. Thus the following two codings will have the same results:
This is the template's default thus leaving the '''type''' parameter out will result in a general notification. Thus the following two codings will have the same results:
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  
: '''Code:'''  
<pre>{{User:DoubleYou/Sandbox/Alert|type=notice|text=Your text here, and it's a lot of text with a list even:
<pre>{{Alert|type=notice|text=Your text here, and it's a lot of text with a list even:
* list item 1
* list item 1
* list item 2
* list item 2
Line 76: Line 112:
</pre><br>
</pre><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=notice|text=Your text here, and it's a lot of text with a list even:
{{Alert|type=notice|text=Your text here, and it's a lot of text with a list even:
* list item 1
* list item 1
* list item 2
* list item 2
Line 82: Line 118:


=== Bug ===
=== Bug ===
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=bug|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|type=bug|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=bug|text=Your text here.}}
{{Alert|type=bug|text=Your text here.}}


=== Construction ===
=== Construction ===
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=construction|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|type=construction|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=construction|text=Your text here.}}
{{Alert|type=construction|text=Your text here.}}


=== MCM ===
=== MCM ===
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=mcm|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|type=mcm|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=mcm|text=Your text here.}}
{{Alert|type=mcm|text=Your text here.}}


=== Mod Organizer ===
=== Mod Organizer ===
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=mo|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|type=mo|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=mo|text=Your text here.}}
{{Alert|type=mo|text=Your text here.}}


=== Warning ===
=== Warning ===
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=warning|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|type=warning|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=warning|text=Your text here.}}
{{Alert|type=warning|text=Your text here.}}


=== Adjusting the Size ===
=== Adjusting the Size ===
Altering the size (%) using a defined keyword.<br>
Altering the size (%) using a defined keyword.<br>
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=warning|size=mid|text=Your text here.}}</nowiki></code><br>
: '''Code:'''  <code><nowiki>{{Alert|type=warning|size=mid|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=warning|size=mid|text=Your text here.}}
{{Alert|type=warning|size=mid|text=Your text here.}}


Explicitly define a size (%) using an integer between 0 - 100.
Explicitly define a size (%) using an integer between 0 - 100.
: '''Code:'''  <code><nowiki>{{User:DoubleYou/Sandbox/Alert|type=warning|size=25|text=Your text here.}}</nowiki></code>
: '''Code:'''  <code><nowiki>{{Alert|type=warning|size=25|text=Your text here.}}</nowiki></code>
: '''Result:'''
: '''Result:'''
{{User:DoubleYou/Sandbox/Alert|type=warning|size=25|text=Your text here.}}
{{Alert|type=warning|size=25|text=Your text here.}}


== Related Templates ==
== Related Templates ==
*[[:Template:Alert small]] - A smaller and more condensed version (can be used in lists).
*[[:Template:AlertSmall]] - A smaller and more condensed version (can be used in lists).


</noinclude>
</noinclude>

Revision as of 03:35, January 15, 2021

{{#css: .alertLarge{ box-shadow: 0 0 15px -2px #00000078; border: 2px solid; border-collapse: inherit; border-radius: 5px !important; margin: 1rem auto; }

.alertLarge td, th{ padding: 0.5rem; vertical-align: top; }

.alertLarge th{ font-weight: bolder; font-size: larger; padding-bottom: 0 !important; }

.alertLarge th:first-child{ width: 35px; } }}

Purpose & Usage[edit source]

This template displays a blocked out "alert" on the page.

Required Parameters[edit source]

type
Defined: type=keyword
Determines the style of alert to display. The options are:
  • bug : a general bug notice.
  • construction : an "under construction" alert.
  • mcm : a MCM notice.
  • mo : a Mod Organizer user notice.
  • notice : a general notice.
  • warning : a warning.
text
Defined: text=textHere
Defines the content for the notification. Most formatting is accepted.

Optional Parameters[edit source]

size
Defined: size=value
Default: max
Determines the width by percentage. Accepts any integer from 0 - 100, but standard sizes are preferred using the appropriate keyword:
  • min = 30%
  • mid = 55%
  • max = 70%
icon
Defined: icon=image.png
Default: Info-Logo.png
Sets the icon image. This is set automatically if using one of the predefined types, but can be overridden here.
bgcolor
Defined: bgcolor=color
Default: blue
Sets the background color. This is set automatically if using one of the predefined types, but can be overridden here. Keywords available are:
  • magent
  • purple
  • blue
  • green
  • chartr
  • yellow
  • orange
  • salmon
  • red

Examples[edit source]

General Notice[edit source]

This is the template's default thus leaving the type parameter out will result in a general notification. Thus the following two codings will have the same results:

Code: {{Alert|text=Your text here.}}
Code:
{{Alert|type=notice|text=Your text here, and it's a lot of text with a list even:
* list item 1
* list item 2
... and that's it.}}


Result:
Info-Logo.png Notice:
Your text here, and it's a lot of text with a list even:
  • list item 1
  • list item 2

... and that's it.


Bug[edit source]

Code: {{Alert|type=bug|text=Your text here.}}
Result:
Bug-Logo.png Bug:
Your text here.


Construction[edit source]

Code: {{Alert|type=construction|text=Your text here.}}
Result:
Weapon.png Under Construction:
Your text here.


MCM[edit source]

Code: {{Alert|type=mcm|text=Your text here.}}
Result:
Mcmicon1.png Mod Configuration Menu:
Your text here.


Mod Organizer[edit source]

Code: {{Alert|type=mo|text=Your text here.}}
Result:
Moicon.png MO Users:
Your text here.


Warning[edit source]

Code: {{Alert|type=warning|text=Your text here.}}
Result:
Warning-Logo.png Warning:
Your text here.


Adjusting the Size[edit source]

Altering the size (%) using a defined keyword.

Code: {{Alert|type=warning|size=mid|text=Your text here.}}
Result:
Warning-Logo.png Warning:
Your text here.


Explicitly define a size (%) using an integer between 0 - 100.

Code: {{Alert|type=warning|size=25|text=Your text here.}}
Result:
Warning-Logo.png Warning:
Your text here.


Related Templates[edit source]