The website uses <model-viewer> to display a 3D model of the Little Luggable.
There are a number of steps to generate a suitable model:
scripts/blender-materials.py.scripts/optimize-model.sh \
exports/little-luggable.glb \
docs/models/little-luggable.glb
Important
Do not check the un-optimized model in; it’s massive.
<model-viewer> supports a ‘poster’ which is displayed while the model is loading, or if JavaScript is disabled. This is generated using <model-viewer> itself to ensure it displays identically and the transition from poster to model is seamless.
cd docs
bundle install
bundle exec jekyll serve --watch
docs/images/:
const v = document.querySelector('#model');
const blob = await v.toBlob({ idealAspect: true, mimeType: 'image/webp', qualityArgument: 0.85 });
Object.assign(document.createElement('a'), {
href: URL.createObjectURL(blob),
download: 'poster.webp',
}).click();
poster="/images/poster.webp".