Skip to content

Examples revamp - #113

Merged
jsantell merged 1 commit into
masterfrom
examples-revamp
Nov 9, 2018
Merged

jsantell merged 1 commit into
masterfrom
examples-revamp

Conversation

@jsantell

@jsantell jsantell commented Nov 9, 2018

Copy link
Copy Markdown
Contributor

Clean up and standardize the examples, remove unused fonts/styles, use demo-snippet for nicer examples, lazy load bandwidth-heavy pages, and add more scripting interaction in tests. Fixes #85

Details:

  • Remove fira
  • Remove unused styles
  • demo-snippet-ify demos
  • Add link to index.html
  • examples/dependencies build to examples/built
  • Added some scripts to examples to test mutation states, little helpers to the loading examples that were useful, shaking up some bugs (filing shortly)

@jsantell
jsantell requested a review from cdata November 9, 2018 22:17
@jsantell

jsantell commented Nov 9, 2018

Copy link
Copy Markdown
Contributor Author

The PBR models are 70MB total, so added a lazy loading widget to execute those:

screenshot from 2018-11-09 14-06-20

@cdata cdata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor feedback, otherwise looks great!

<template>
<model-viewer id="toggle-image" backgroud-color="#ff0077" src="assets/DamagedHelmet/DamagedHelmet.gltf" controls auto-rotate></model-viewer>
<script>
const images = ['assets/equirectangular.png', 'does-not-exist.png', ''];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit jarring to watch this demo. Without additional context it looks broken.

dnebackground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is broken!! Filing follow ups

Comment thread examples/loading.html
$('#reveal').addEventListener('load', e => {
e.target.style.border = '2px solid red';
}, { once: true });
</script>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to leave this script in there? Maybe add a comment if it is intentional, to explain its relevance to the example? Otherwise users just skimming might mistake it as a necessary part of the loading features.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did, to expose the loading status -- I'll add comments indicating that it's only for illustrative purposes

Comment thread examples/sources.html Outdated
<h2>With glTF model</h2>
<template>
<model-viewer
background-color='#db3236';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you dropped a CSS property in here and it sort of worked ;P remove the ; and probably better to use consistent quotation marks. Same for several other examples in this file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops!

Comment thread examples/sources.html

</div>
<demo-snippet>
<h2>Cycling different models</h2>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cool demo 💯

<div id="container">
<h1>&lt;model-viewer&gt; - Multiple Canvases</h1>
<p class="desc">This page tests many models on the same page.</p>
<h1>&lt;model-viewer&gt; - Multiple Elements</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking sharp 💎
image

Comment thread examples/pbr.html
</head>
<body>
<div id="container">
<h1>&lt;model-viewer&gt; - Physically Based Rendering Materials</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This demo is 🔥

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

…e demo-snippet for nicer examples, lazy load bandwidth-heavy pages, and add more scripting interaction in tests. Fixes #85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants