-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Documentation: Guide update: 360 image gallery #5214
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b22d12
Copy example from glitch
diarmidmackenzie 168fca9
Align documentation & example
diarmidmackenzie 6c4a216
Add 360 Gallery to showcase index
diarmidmackenzie d1ea53b
Remove reference to glitch
diarmidmackenzie 526e567
Use master A-Frame
diarmidmackenzie 75fbf2c
Merge remote-tracking branch 'upstream/master' into 360-image-gallery
diarmidmackenzie 774208c
moved from examples/showcase to examples/docs
diarmidmackenzie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>360° Image Gallery</title> | ||
<meta name="description" content="360° Image Gallery - A-Frame"> | ||
<!-- If running this example without a local copy of A-Frame, replace this next line with: | ||
<script src="https://aframe.io/releases/<release_number>/aframe.min.js"></script> | ||
--> | ||
<script src="../../../dist/aframe-master.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/aframe-template-component.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/aframe-layout-component.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/aframe-event-set-component.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/aframe-proxy-event-component.min.jss"></script> | ||
|
||
<!-- Image link template to be reused. --> | ||
<script id="link" type="text/html"> | ||
<a-entity class="link" | ||
geometry="primitive: plane; height: 1; width: 1" | ||
material="shader: flat; src: ${thumb}" | ||
sound="on: click; src: #click-sound" | ||
event-set__mouseenter="scale: 1.2 1.2 1" | ||
event-set__mouseleave="scale: 1 1 1" | ||
event-set__click="_target: #image-360; _delay: 300; material.src: ${src}" | ||
proxy-event="event: click; to: #image-360; as: fade"></a-entity> | ||
</script> | ||
</head> | ||
<body> | ||
<a-scene> | ||
<a-assets> | ||
<img id="city" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg"> | ||
<img id="city-thumb" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/thumb-city.jpg"> | ||
<img id="cubes-thumb" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/thumb-cubes.jpg"> | ||
<img id="sechelt-thumb" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/thumb-sechelt.jpg"> | ||
<audio id="click-sound" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/audio/click.ogg"></audio> | ||
<img id="cubes" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/cubes.jpg"> | ||
<img id="sechelt" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/sechelt.jpg"> | ||
|
||
</a-assets> | ||
|
||
<!-- 360-degree image. --> | ||
<a-sky id="image-360" radius="10" src="#city" | ||
animation__fade="property: components.material.material.color; type: color; from: #FFF; to: #000; dur: 300; startEvents: fade" | ||
animation__fadeback="property: components.material.material.color; type: color; from: #000; to: #FFF; dur: 300; startEvents: animationcomplete__fade"></a-sky> | ||
|
||
<!-- Image links. --> | ||
<a-entity id="links" layout="type: line; margin: 1.5" position="-1.5 -1 -4"> | ||
<a-entity template="src: #link" data-src="#city" data-thumb="#city-thumb"></a-entity> | ||
<a-entity template="src: #link" data-src="#cubes" data-thumb="#cubes-thumb"></a-entity> | ||
<a-entity template="src: #link" data-src="#sechelt" data-thumb="#sechelt-thumb"></a-entity> | ||
</a-entity> | ||
|
||
<!-- Camera + cursor. --> | ||
<a-entity camera look-controls> | ||
<a-cursor | ||
id="cursor" | ||
animation__click="property: scale; startEvents: click; from: 0.1 0.1 0.1; to: 1 1 1; dur: 150" | ||
animation__fusing="property: fusing; startEvents: fusing; from: 1 1 1; to: 0.1 0.1 0.1; dur: 1500" | ||
event-set__mouseenter="_event: mouseenter; color: springgreen" | ||
event-set__mouseleave="_event: mouseleave; color: black" | ||
raycaster="objects: .link"></a-cursor> | ||
</a-entity> | ||
</a-scene> | ||
</body> | ||
</html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I wish we could have both from both worlds for the docs. Easy forkability of glich + easier maintenance of a github repo. Is there any solution out there we can look at?
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.
If each example is it's own github repo, you can push to glitch git repo:
https://dev.to/elvezpablo/using-git-with-glitch-5832
You could also do it automatically with a GitHub Action https://github.com/marketplace/actions/glitch-project-sync
I personally do it the other way, from the glitch console I'm git pull to sync from the github repo:
https://github.com/networked-aframe/networked-aframe/blob/master/docs/release-instructions.md
With an alternate solution like codesandbox, you can start a project from a folder in a github repo, example this url:
https://codesandbox.io/s/github/LXSMNSYC/solid-headless/tree/main/examples/accordion-example
takes the code directly from github:
https://github.com/lxsmnsyc/solid-headless/tree/main/examples/accordion-example
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.
You can sync to glitch from a sub-path within a repo too.
I created this one by:
https://aframe.io/releases/1.4.1/aframe.min.js
See screenshot for steps...
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 codesandbox.io, the following URL will automatically clone from GitHub nto codesandbox.
https://githubbox.com/aframevr/aframe/tree/master/examples/docs/aincraft
To make it work, you need to fork the sandbox & modify the A-Frame path to https://aframe.io/releases/1.4.1/aframe.min.js
IMO it would be nice to update the code to use a CDN URL already, to avoid users having to do that.
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.
Codesandbox is the lowest maintenance solution, just requires that we:
Suggest we also update the
npm run prerelease
command to update A-Frame version strings in HTML files in theexamples\docs
folder.#5213 (comment)
I think that could be a one-liner here like this:
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.
Proposal: let's get to a stable state with consistent up-to-date working code for all examples in examples/docs.
Then drive the sync to glitch and/or codesandbox as a separate issue/PR.
Now that #5215 is merged I'll update the remaining PRs to refer to examples/docs, which will get us to a consistent stable position, and we can move forwards from there.
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.
One more lead - https://glitch.new/
"Just type glitch.new in front of any GitHub repo URL to import it directly to Glitch, like glitch.new/github.com/11ty/eleventy-base-blog."
Unfortunately this only seems to work with a whole repo (aframevr/aframe), not a sub-part of that repo. That would be a nice enhancement to get from glitch.
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.
I raised an enhancement request in glitch support forum.
https://support.glitch.com/t/glitch-new-for-sub-trees-of-github-repos/59049
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.
glitch design looks cleaner and it's what the community is used to. It will take time to reeducate and there's so much stuff on glitch already. Not sure I understand the drawback with glitch if we can sync directly from the repo.
About pointing
examples/docs
to a release. It will make harder to test locally those examples.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.
Moving discussion to #5222
Looks like a solution base on https://github.com/javierarce/glitchub is going to be the best way forwards.