cloudfour / lite-model-viewer

A lazy-loaded model-viewer web component
https://lite-model-viewer.netlify.app
MIT License
9 stars 1 forks source link

Support providing an image for progressive enhancement #2

Open spaceninja opened 9 months ago

spaceninja commented 9 months ago

@Paul-Hebert suggested:

From a progressive enhancement perspective it would be kind of nice if the poster image was a slotted img tag but I realize this would diverge from the model-viewer API so I understand if that goes against your goals.

<lite-model-viewer>
  <img alt="" src="" slot="poster" />
</lite-model-viewer>
spaceninja commented 9 months ago

This is a slick idea — if we added it, I think we'd update the JS to check for an img in the "poster" slot, and grab the src value to apply as the poster.

I only hesitated to pull the trigger on this because it's unclear what value a non-JS experience provides here, given that <model-viewer> itself is JS-only.