New mission: revamp the portals to make them look actually tolerable to the eye. They are currently placeholders as of now.
The Gold Network: Soyworld | SNCApedia | SoyPlace


I'm not dead, just inactive for the moment. Faggot (talk) 20:16, 9 April 2026 (UTC)

Template:3DCube: Difference between revisions

From SNCApedia, the shit nobody cares about encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!--
<!--
==================================================
==================================================
TEMPLATE NAME: 3DCube
TEMPLATE NAME: 3DCube
Creates a spinning isometric cube using a 2D matrix
A hollow, tumbling 3D cube that accepts either a  
projection (compatible with MediaWiki sanitizers).
global file, or modular wikitext on its 6 faces.
==================================================
==================================================


USAGE:
USAGE:
{{3DCube
{{3DCube
| size  =
  | image  =  
  | image  =  
  | front  =  
  | front  =  
  | back  =  
  | back  =  
| right  =
  | left  =  
  | left  =  
| right  =
  | top    =  
  | top    =  
  | bottom =  
  | bottom =  
| size  =
| link  =
}}
}}


PARAMETERS:
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.
- size: Target width/height of the cube in pixels. Defaults to 200.
- link: Page to link to when the cube is clicked.
- image: Convenience parameter. Can be an image, GIF, Audio, or Video (e.g., File.png).
- rendering: CSS image-rendering property. Defaults to auto (e.g., pixelated).
- front, back, right, left, top, bottom: Arbitrary wikitext. Overrides "image".
==================================================
==================================================
-->
-->
 
<templatestyles src="Template:3DCube/style.css"/>
<templatestyles src="Template:3DCube/style.css" />
<div class="cc-scene" style="perspective: 600px; width: {{{size|200}}}px; height: {{{size|200}}}px;">
<div style="display: inline-block; width: {{{size|200}}}px; height: {{{size|200}}}px; margin: 2em; overflow: visible;">
    <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="mw-3dcube-scene" style="transform: scale({{#expr: {{{size|200}}} / 200}}); transform-origin: top left; image-rendering: {{{rendering|auto}}};">
        <div class="cc-center" style="transform-style: preserve-3d;">
    <div class="mw-3dcube">
            <div class="cc-side front" style="transform: rotateY(0deg) translateZ({{#expr: {{{size|200}}} / 2}}px);">
      <div class="mw-3dcube-face mw-3dcube-front">
{{{front|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}}
        {{#if: {{{front|{{{image|}}}}}} | [[File:{{{front|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }}
            </div>
      </div>
            <div class="cc-side back" style="transform: rotateY(180deg) translateZ({{#expr: {{{size|200}}} / 2}}px);">
      <div class="mw-3dcube-face mw-3dcube-right">
{{{back|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}}
        {{#if: {{{right|{{{image|}}}}}} | [[File:{{{right|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }}
            </div>
      </div>
            <div class="cc-side right" style="transform: rotateY(90deg) translateZ({{#expr: {{{size|200}}} / 2}}px) rotateZ(-90deg);">
      <div class="mw-3dcube-face mw-3dcube-back">
{{{right|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}}
        {{#if: {{{back|{{{image|}}}}}} | [[File:{{{back|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }}
            </div>
      </div>
            <div class="cc-side left" style="transform: rotateY(-90deg) translateZ({{#expr: {{{size|200}}} / 2}}px) rotateZ(90deg);">
      <div class="mw-3dcube-face mw-3dcube-left">
{{{left|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}}
        {{#if: {{{left|{{{image|}}}}}} | [[File:{{{left|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }}
            </div>
      </div>
            <div class="cc-side top" style="transform: rotateX(90deg) translateZ({{#expr: {{{size|200}}} / 2}}px) rotateZ(180deg);">
      <div class="mw-3dcube-face mw-3dcube-top">
{{{top|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}}
        {{#if: {{{top|{{{image|}}}}}} | [[File:{{{top|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }}
            </div>
      </div>
            <div class="cc-side bottom" style="transform: rotateX(-90deg) translateZ({{#expr: {{{size|200}}} / 2}}px);">
      <div class="mw-3dcube-face mw-3dcube-bottom">
{{{bottom|{{#if:{{{image|}}}|[[File:{{{image}}}|{{{size|200}}}px]]}}}}}
        {{#if: {{{bottom|{{{image|}}}}}} | [[File:{{{bottom|{{{image}}}}}}|{{{size|200}}}px|link={{{link|}}}]] }}
            </div>
      </div>
           
    </div>
        </div>
  </div>
    </div>  
</div>
</div>
<noinclude>
<noinclude>
== Usage ==
== Usage ==
Basic usage with one image for all sides:
Supports standard images, GIFs, Audio files (OGG/MP3), and Videos (MP4).
 
'''Convenience usage (same file on all sides):'''
<pre>
<pre>
{{3DCube
{{3DCube
  | image = Smoboicon.png
| size = 200
  | image = Some_Video.mp4
}}
}}
</pre>
</pre>


Customizing sides, size, and rendering:
'''Mixed content override:'''
You can set a global file, but override specific sides using wikitext.
<pre>
<pre>
{{3DCube
{{3DCube
  | size = 100
  | size = 200
  | rendering = pixelated
  | image = Standard_Block.png
| front = Face_Front.png
  | top = <span class="cc-text">TOP</span>
  | top = Face_Top.png
  | bottom = [[File:Music.ogg]]
  | image = Face_Generic.png <!-- Fallback for other sides -->
}}
}}
</pre>
</pre>


[[Category:Formatting templates]]
[[Category:Formatting templates]]
[[Category:Pages containing a rotating css cube]]
</noinclude>
</noinclude>

Latest revision as of 21:02, 13 April 2026

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]]
}}