Jump to content

Widget:ModelViewer: Difference between revisions

From Survivalcraft Wiki
No edit summary
No edit summary
Line 1: Line 1:
<widget xmlns="http://www.mediawiki.org/xmlns/widget/1.0">
<model-viewer
   <param name="src"/>
   src="{$src|escape}"  
   <param name="alt" default="3D model"/>
   alt="{$alt|escape}"
   <content>
  {if $width}width="{$width|escape}"{/if}
    <![CDATA[
   {if $height}height="{$height|escape}"{/if}
      <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
  {if $autorotate}auto-rotate{/if}
      <model-viewer
  {if $cameracontrols}camera-controls{/if}
        src="$src"
  {if $backgroundcolor}background-color="{$backgroundcolor|escape}"{/if}>
        alt="$alt"
</model-viewer>
        camera-controls
        auto-rotate
        style="width: 100%; height: 500px;">
      </model-viewer>
    ]]>
  </content>
</widget>

Revision as of 15:48, 30 July 2025

<model-viewer

 src="{$src|escape}" 
 alt="{$alt|escape}"
 {if $width}width="{$width|escape}"{/if}
 {if $height}height="{$height|escape}"{/if}
 {if $autorotate}auto-rotate{/if}
 {if $cameracontrols}camera-controls{/if}
 {if $backgroundcolor}background-color="{$backgroundcolor|escape}"{/if}>

</model-viewer>