Template:3DCube: Difference between revisions
From SNCApedia, the shit nobody cares about encyclopedia
Jump to navigationJump to search
SomebodyRum (talk | contribs) my attempt |
SomebodyRum (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
<!-- | |||
================================================== | |||
TEMPLATE NAME: 3DCube | |||
Creates a spinning isometric cube using a 2D matrix | |||
projection (compatible with MediaWiki sanitizers). | |||
================================================== | |||
USAGE: | |||
{{3DCube | |||
| image = | |||
| front = | |||
| back = | |||
| left = | |||
| right = | |||
| top = | |||
| bottom = | |||
| size = | |||
| link = | |||
}} | |||
PARAMETERS: | |||
- image: Default filename for all 6 faces (e.g., Example.png). | |||
- front, back, left, right, top, bottom: Override image for a specific face. | |||
- size: Target width/height of the cube in pixels. Defaults to 200. | |||
- link: Page to link to when the cube is clicked. | |||
- rendering: CSS image-rendering property. Defaults to auto (e.g., pixelated). | |||
================================================== | |||
--> | |||
<templatestyles src="Template:3DCube/style.css" /> | <templatestyles src="Template:3DCube/style.css" /> | ||
<div | <div style="display: inline-block; width: {{{size|200}}}px; height: {{{size|200}}}px; margin: 2em; overflow: visible;"> | ||
<div class=" | <div class="mw-3dcube-scene" style="transform: scale({{#expr: {{{size|200}}} / 200}}); transform-origin: top left; image-rendering: {{{rendering|auto}}};"> | ||
<div class=" | <div class="mw-3dcube"> | ||
<div class="mw-3dcube-face mw-3dcube-front"> | |||
{{#if: {{{front|{{{image|}}}}}} | [[File:{{{front|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }} | |||
</div> | |||
<div class="mw-3dcube-face mw-3dcube-right"> | |||
{{#if: {{{right|{{{image|}}}}}} | [[File:{{{right|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }} | |||
</div> | |||
<div class="mw-3dcube-face mw-3dcube-back"> | |||
{{#if: {{{back|{{{image|}}}}}} | [[File:{{{back|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }} | |||
</div> | |||
<div class="mw-3dcube-face mw-3dcube-left"> | |||
{{#if: {{{left|{{{image|}}}}}} | [[File:{{{left|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }} | |||
</div> | |||
<div class="mw-3dcube-face mw-3dcube-top"> | |||
{{#if: {{{top|{{{image|}}}}}} | [[File:{{{top|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }} | |||
</div> | |||
<div class="mw-3dcube-face mw-3dcube-bottom"> | |||
{{#if: {{{bottom|{{{image|}}}}}} | [[File:{{{bottom|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }} | |||
</div> | |||
</div> | |||
</div> | </div> | ||
</div> | </div> | ||
<noinclude> | |||
== Usage == | |||
Basic usage with one image for all sides: | |||
<pre> | |||
{{3DCube | |||
| image = Smoboicon.png | |||
}} | |||
</pre> | |||
Customizing sides, size, and rendering: | |||
<pre> | |||
{{3DCube | |||
| size = 100 | |||
| rendering = pixelated | |||
| front = Face_Front.png | |||
| top = Face_Top.png | |||
| image = Face_Generic.png <!-- Fallback for other sides --> | |||
}} | |||
</pre> | |||
[[Category:Formatting templates]] | |||
[[Category:Pages containing a rotating css cube]] | |||
</noinclude> | |||
Latest revision as of 16:42, 12 April 2026
Usage
[edit source]Basic usage with one image for all sides:
{{3DCube
| image = Smoboicon.png
}}
Customizing sides, size, and rendering:
{{3DCube
| size = 100
| rendering = pixelated
| front = Face_Front.png
| top = Face_Top.png
| image = Face_Generic.png <!-- Fallback for other sides -->
}}