Jump to content

Widget:ModelViewer: Difference between revisions

From Survivalcraft Wiki
No edit summary
No edit summary
Line 1: Line 1:
<span>
<includeonly>
<model-viewer  
<model-viewer  
     src="<!--{$src|escape}-->"  
     src="<!--{$src|escape}-->"  
Line 54: Line 56:
     >  
     >  
</model-viewer>
</model-viewer>
</includeonly>
</span>
<noinclude>
<noinclude>
{{Documentation}}
{{Documentation}}

Revision as of 01:00, 31 July 2025

Embeds a 3D model using the <model-viewer> web component. Supports many configuration parameters like camera controls, AR, environment, and animations.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Sourcesrc

URL to the 3D model file (e.g., .glb or .gltf).

Stringrequired
Alt textalt

Alternative text describing the model.

Default
3D Model
Stringoptional
Widthwidth

Width of the viewer (e.g., '100%' or '500px').

Default
100%
Stringoptional
Heightheight

Height of the viewer (e.g., '300px').

Default
300px
Stringoptional
Poster imageposter

URL to an image displayed before the model loads.

Stringoptional
Loadingloading

Loading behavior ('eager' or 'lazy').

Stringoptional
Revealreveal

When to reveal the model ('auto', 'interaction').

Stringoptional
With credentialswithCredentials

Use cross-origin credentials when fetching resources.

Booleanoptional
Auto-rotateautoRotate

Automatically rotate the model.

Booleanoptional
Auto-rotate delayautoRotateDelay

Delay before auto-rotation starts, in milliseconds.

Stringoptional
Camera controlscameraControls

Allow user to control camera.

Booleanoptional
Background colorbackgroundColor

CSS color value for the viewer background.

Stringoptional
AR modear

Enable AR features.

Booleanoptional
iOS sourceiosSrc

URL to the USDZ model for AR on iOS.

Stringoptional
AR button textarButtonText

Custom text for the AR button.

Stringoptional
Loading textloadingText

Custom text to display while loading.

Stringoptional
Error texterrorText

Custom text to display if loading fails.

Stringoptional