-
Notifications
You must be signed in to change notification settings - Fork 2
Initial suite of samples #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Using the teapot character, demonstrating the API as discussed so far.
@mkeblx These are the samples I mentioned! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start on some samples 🫖 👍
A few minor things
autoplay-loop.html
Outdated
</p> | ||
|
||
<pre> | ||
<model autoplay alt="A model of a teapot with a hidden creature"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No loop
attribute present here in code sample
autorotate.html
Outdated
|
||
<h2>HTML</h2> | ||
<pre> | ||
<model id="model" alt="A model of a teapot"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these code sections I believe want to also excape the > chars.
</body> | ||
<script type="module"> | ||
let initialTransform; | ||
await model.ready; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some samples like here use the more ~legacy fact that HTML element with ID x
shows up window.x
, while others do not. Can we always explicitly reference the element via a selector?
basic-data-url.html
Outdated
const model = document.querySelector('model'); | ||
const {src, type} = model.dataset; | ||
const bytes = await (await fetch(src)).bytes(); | ||
const srcString = URL.createObjectURL(new Blob([bytes], {type})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a blob URL test case, as using createObjectURL => blob.
Blob URL:
const response = await fetch(url);
const blob = await response.blob(); // this should maintain type too
const objectURL = URL.createObjectURL(blob);
We should probably have two demo pages, one for data URL, and blob URL.
~data URL:
const response = await fetch(url);
const blob = await response.blob();
const reader = new FileReader();
reader.readAsDataURL(blob);
currenttime.html
Outdated
</body> | ||
|
||
<script> | ||
(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like other samples, can we use script type="module"
which has top level await and remove this async wrapper?
jsorbit.html
Outdated
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Model: Orbit test</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JS-Orbit in title, like H1
playbackrate.html
Outdated
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Model: basic test</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Playbackrate in title
currenttime.html
Outdated
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Model: basic test</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currentTime in title like H1
boundingbox.html
Outdated
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Model: basic test</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boundingBox in title
background.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No title tag in head
Replaced the `>` characters in the `pre` sections with the escaped character, Made use of type="module" script tags and omitted the script tags in their respective `pre` sections, Added and updated the titles, Renamed the DataURL test to accurately reflect that it's a Blob URL test, Made sure there is a valid query selector rather than relying on the global-namespaced references by ID.
@mkeblx Thank you so much for catching all that! Take a look again when you can. |
Using the teapot character, demonstrating the API as discussed so far!