Template:3DCube: Difference between revisions
From SNCApedia, the shit nobody cares about encyclopedia
Jump to navigationJump to search
SomebodyRum (talk | contribs) tried to make it 3D but i guess we'll have this "carousel" illusion |
SomebodyRum (talk | contribs) No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
< | <!-- | ||
<div class="scene"> | ================================================== | ||
TEMPLATE NAME: 3DCube | |||
A hollow, tumbling 3D cube that accepts either a | |||
global file, or modular wikitext on its 6 faces. | |||
================================================== | |||
USAGE: | |||
{{3DCube | |||
| size = | |||
| image = | |||
| front = | |||
| back = | |||
| right = | |||
| left = | |||
| top = | |||
| bottom = | |||
}} | |||
PARAMETERS: | |||
- size: Target width/height of the cube in pixels. Defaults to 200. | |||
- image: Convenience parameter. Can be an image, GIF, Audio, or Video (e.g., File.png). | |||
- front, back, right, left, top, bottom: Arbitrary wikitext. Overrides "image". | |||
================================================== | |||
--> | |||
<templatestyles src="Template:3DCube/style.css"/> | |||
<div class="cc-scene" style="perspective: 600px; width: {{{size|200}}}px; height: {{{size|200}}}px;"> | |||
<div class="cc-cube" style="transform-style: preserve-3d; transform: translateZ(-{{#expr: {{{size|200}}} / 2}}px) rotate3d(1,0,0,60deg) rotate3d(0,0,1,40deg);"> | |||
<div class="cc-center" style="transform-style: preserve-3d;"> | |||
<div class="cc-side front" style="transform: rotateY(0deg) translateZ({{#expr: {{{size|200}}} / 2}}px);"> | |||
{{{front|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}} | |||
</div> | |||
<div class="cc-side back" style="transform: rotateY(180deg) translateZ({{#expr: {{{size|200}}} / 2}}px);"> | |||
{{{back|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}} | |||
</div> | |||
<div class="cc-side right" style="transform: rotateY(90deg) translateZ({{#expr: {{{size|200}}} / 2}}px) rotateZ(-90deg);"> | |||
{{{right|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}} | |||
</div> | |||
<div class="cc-side left" style="transform: rotateY(-90deg) translateZ({{#expr: {{{size|200}}} / 2}}px) rotateZ(90deg);"> | |||
{{{left|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}} | |||
</div> | |||
<div class="cc-side top" style="transform: rotateX(90deg) translateZ({{#expr: {{{size|200}}} / 2}}px) rotateZ(180deg);"> | |||
{{{top|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}} | |||
</div> | |||
<div class="cc-side bottom" style="transform: rotateX(-90deg) translateZ({{#expr: {{{size|200}}} / 2}}px);"> | |||
{{{bottom|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}} | |||
</div> | |||
</div> | |||
</div> | |||
</div> | </div> | ||
<noinclude> | |||
== Usage == | == Usage == | ||
{{3DCube | image = | Supports standard images, GIFs, Audio files (OGG/MP3), and Videos (MP4). | ||
'''Convenience usage (same file on all sides):''' | |||
<pre> | |||
{{3DCube | |||
| size = 200 | |||
| image = Some_Video.mp4 | |||
}} | |||
</pre> | |||
'''Mixed content override:''' | |||
You can set a global file, but override specific sides using wikitext. | |||
<pre> | |||
{{3DCube | |||
| size = 200 | |||
| image = Standard_Block.png | |||
| top = <span class="cc-text">TOP</span> | |||
| bottom = [[File:Music.ogg]] | |||
}} | |||
</pre> | |||
[[Category:Formatting templates]] | |||
</noinclude> | </noinclude> | ||
Latest revision as of 21:02, 13 April 2026
Usage
[edit source]Supports standard images, GIFs, Audio files (OGG/MP3), and Videos (MP4).
Convenience usage (same file on all sides):
{{3DCube
| size = 200
| image = Some_Video.mp4
}}
Mixed content override: You can set a global file, but override specific sides using wikitext.
{{3DCube
| size = 200
| image = Standard_Block.png
| top = <span class="cc-text">TOP</span>
| bottom = [[File:Music.ogg]]
}}