11< html >
2- < head >
3- < title > A-Frame Super Hands Component</ title >
4- < style >
5- html {
6- background : # 33425B ;
7- color : # FAFAFA ;
8- font-family : sans-serif;
9- font-size : 20px ;
10- padding : 10px 20px ;
11- max-width : 41em ;
12- margin : 0 auto;
13- }
14- h1 , h2 {
15- font-weight : 300 ;
16- font-family : serif;
17- }
18- a {
19- color : # FAFAFA ;
20- }
21- a .example {
22- padding : 15px 0 ;
23- font-size : 24px ;
24- display : block;
25- }
26- code , pre {
27- font-family : monospace;
28- background-color : # 3f506d ;
29- color : # BBB ;
30- }
31- .unemph {
32- font-size : smaller;
33- color : # BBB ;
34- }
35- .preview {
36- width : 192px ;
37- height : 96px ;
38- display : block;
39- margin : 3px 0px ;
40- float : left;
41- }
42- .bonus {
43- color : # f4f4a1 ;
44- background-color : # 3f506d7e ;
45- font-size : 18px ;
46- width : 93px ;
47- height : 96px ;
48- float : left;
49- margin : 3px 0px ;
50- padding : 0 0 0 5px ;
51- position : absolute;
52- overflow : hidden;
53- }
54- .bonus ::after {
55- content : 'Motion-Captured Preview Available'
56- }
57- .bonus + p , .preview + p , .example + p {
58- clear : both;
59- }
60- </ style >
61- < script src ="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js "> </ script >
62- </ head >
63- < body >
64- < h1 > A-Frame Super Hands Component</ h1 >
65- < p > This is the examples page for the
66- < a href ="http://github.com/c-frame/aframe-super-hands-component ">
67- super-hands A-Frame component package
68- </ a >
69- for super-easy hand controller interactivity in A-Frame WebVR experiences.
70- </ p >
71- < a id ="physics " class ="example " href ="physics/ "> Hand controls
72- with physics< br />
73- < img class ="preview " src ="./assets/physics.jpg "/>
74- <!-- <div class="bonus"></div> -->
2+
3+ < head >
4+ < title > A-Frame Super Hands Component</ title >
5+ < style >
6+ html {
7+ background : # 33425B ;
8+ color : # FAFAFA ;
9+ font-family : sans-serif;
10+ font-size : 20px ;
11+ padding : 10px 20px ;
12+ max-width : 41em ;
13+ margin : 0 auto;
14+ }
15+
16+ h1 ,
17+ h2 {
18+ font-weight : 300 ;
19+ font-family : serif;
20+ }
21+
22+ a {
23+ color : # FAFAFA ;
24+ }
25+
26+ a .example {
27+ padding : 15px 0 ;
28+ font-size : 24px ;
29+ display : block;
30+ }
31+
32+ code ,
33+ pre {
34+ font-family : monospace;
35+ background-color : # 3f506d ;
36+ color : # BBB ;
37+ }
38+
39+ .unemph {
40+ font-size : smaller;
41+ color : # BBB ;
42+ }
43+
44+ .preview {
45+ width : 192px ;
46+ height : 96px ;
47+ display : block;
48+ margin : 3px 0px ;
49+ float : left;
50+ }
51+
52+ .bonus {
53+ color : # f4f4a1 ;
54+ background-color : # 3f506d7e ;
55+ font-size : 18px ;
56+ width : 93px ;
57+ height : 96px ;
58+ float : left;
59+ margin : 3px 0px ;
60+ padding : 0 0 0 5px ;
61+ position : absolute;
62+ overflow : hidden;
63+ }
64+
65+ .bonus ::after {
66+ content : 'Motion-Captured Preview Available'
67+ }
68+
69+ .bonus + p ,
70+ .preview + p ,
71+ .example + p {
72+ clear : both;
73+ }
74+ </ style >
75+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js "> </ script >
76+ </ head >
77+
78+ < body >
79+ < h1 > A-Frame Super Hands Component</ h1 >
80+ < p > This is the examples page for the
81+ < a href ="http://github.com/c-frame/aframe-super-hands-component ">
82+ super-hands A-Frame component package
7583 </ a >
76- < p > < a href ="physics/index-mouse.html "> Mouse cursor based version for desktop</ a > </ p >
77- < p > < ul >
78- < li > Grabbed boxes lock position and rotation to controller</ li >
79- < li > < code > color-randomizer</ code > changes the color of entities dropped inside of the color changer box</ li >
80- < li > Boxes can be stretched with two hands to change size, updating their physics bodies</ li >
81- </ ul > </ p >
82- < p > Example of super-hands interactivity with roomscale tracked controllers
83- and < code > aframe-physics-system</ code > . Also showcases creating a simple
84- custom reaction component.</ p >
85- < pre >
84+ for super-easy hand controller interactivity in A-Frame WebVR experiences.
85+ </ p >
86+ < a id ="physics " class ="example " href ="physics/ "> Hand controls
87+ with physics (CANNON.js)< br />
88+ < img class ="preview " src ="./assets/physics.jpg " />
89+ <!-- <div class="bonus"></div> -->
90+ </ a >
91+ < p > < a href ="physics/index-mouse.html "> Mouse cursor based version for desktop</ a > </ p >
92+ < a id ="physics " class ="example " href ="physics/index-ammo.html "> Hand controls
93+ with physics (Ammo.js)< br />
94+ < img class ="preview " src ="./assets/physics.jpg " />
95+ <!-- <div class="bonus"></div> -->
96+ </ a >
97+ < p > < a href ="physics/index-ammo-keys.html "> Mouse cursor based version for desktop</ a > </ p >
98+ < p >
99+ < ul >
100+ < li > Grabbed boxes lock position and rotation to controller</ li >
101+ < li > < code > color-randomizer</ code > changes the color of entities dropped inside of the color changer box</ li >
102+ < li > Boxes can be stretched with two hands to change size, updating their physics bodies</ li >
103+ </ ul >
104+ </ p >
105+ < p > Example of super-hands interactivity with roomscale tracked controllers
106+ and < code > aframe-physics-system</ code > . Also showcases creating a simple
107+ custom reaction component.</ p >
108+ < pre >
86109 AFRAME.registerComponent('color-randomizer', {
87110 play: function() {
88111 this.el.addEventListener('drag-drop', function(evt) {
@@ -94,42 +117,47 @@ <h1>A-Frame Super Hands Component</h1>
94117 }
95118 })
96119 </ pre >
97- < p class = "unemph "> Credit for random color generator code: < a href ="http://stackoverflow.com/questions/1484506/random-color-generator-in-javascript#comment6801353_5365036 "> Mohsen via StackOverflow</ a > </ p >
98- < a id ="mouse " class ="example " href ="mouse/ ">
99- Gaze and laser pointer controls without physics
100- < br />
101- < img class ="preview " src ="./assets/hand-controls.jpg "/>
102- <!-- <div class="bonus"></div> -->
103- </ a >
104- < p > < a href ="mouse/index-mouse.html "> Mouse cursor based version for desktop</ a > </ p >
105- < p > < ul >
106- < li > Grabbed entities move by controller position and rotation</ li >
107- < li > Drag-drop targets and their hovering entity appear in wireframe</ li >
108- < li > Entities change to spheres upon completing drag-drop interaction via the
109- < code > event-set</ code > component listening for the 'drag-drop' event</ li >
110- </ ul > </ p >
111- < p > < code > super-hands</ code > can also be use with other types of input
112- including 3DOF controllers, mouse, and touch. In these cases, a
113- raycasting can be used intead of collision detection.
114- The confugration below works with the A-Frame < code > raycaster</ code >
115- component.
116- < pre >
120+ < p class ="unemph "> Credit for random color generator code: < a
121+ href ="http://stackoverflow.com/questions/1484506/random-color-generator-in-javascript#comment6801353_5365036 "> Mohsen
122+ via StackOverflow</ a > </ p >
123+ < a id ="mouse " class ="example " href ="mouse/ ">
124+ Gaze and laser pointer controls without physics
125+ < br />
126+ < img class ="preview " src ="./assets/hand-controls.jpg " />
127+ <!-- <div class="bonus"></div> -->
128+ </ a >
129+ < p > < a href ="mouse/index-mouse.html "> Mouse cursor based version for desktop</ a > </ p >
130+ < p >
131+ < ul >
132+ < li > Grabbed entities move by controller position and rotation</ li >
133+ < li > Drag-drop targets and their hovering entity appear in wireframe</ li >
134+ < li > Entities change to spheres upon completing drag-drop interaction via the
135+ < code > event-set</ code > component listening for the 'drag-drop' event
136+ </ li >
137+ </ ul >
138+ </ p >
139+ < p > < code > super-hands</ code > can also be use with other types of input
140+ including 3DOF controllers, mouse, and touch. In these cases, a
141+ raycasting can be used intead of collision detection.
142+ The confugration below works with the A-Frame < code > raycaster</ code >
143+ component.
144+ < pre >
117145super-hands="colliderEvent: raycaster-intersection;
118146 colliderEventProperty: els;
119147 colliderEndEvent: raycaster-intersection-cleared;
120148 colliderEndEventProperty: clearedEls"</ pre >
121- < p > This scene also shows the fallback movement that occurs when physics
122- is not available.</ p >
149+ < p > This scene also shows the fallback movement that occurs when physics
150+ is not available.</ p >
123151 < h2 > Quick guide to adding making something grabbable with physics on your site</ h2 >
124152 < div id ="dynamic-guide-here "> </ div >
125153 < script >
126- ( async function ( ) {
127- var converter = new showdown . Converter ( ) ;
128- var response = await fetch ( 'https://raw.githubusercontent.com/c-frame/aframe-super-hands-component/master/getting-started.md' ) ;
129- var md = await response . text ( )
130- var html = converter . makeHtml ( md ) ;
131- document . querySelector ( '#dynamic-guide-here' ) . innerHTML = html ;
132- } ) ( )
154+ ( async function ( ) {
155+ var converter = new showdown . Converter ( ) ;
156+ var response = await fetch ( 'https://raw.githubusercontent.com/c-frame/aframe-super-hands-component/master/getting-started.md' ) ;
157+ var md = await response . text ( )
158+ var html = converter . makeHtml ( md ) ;
159+ document . querySelector ( '#dynamic-guide-here' ) . innerHTML = html ;
160+ } ) ( )
133161 </ script >
134162 <!--
135163 <a id="sticky" class="example" href="sticky/">Sticky Grab via
@@ -144,14 +172,52 @@ <h2>Quick guide to adding making something grabbable with physics on your site</
144172 <li>Stretch the balls by pressing both trackpads</li>
145173 </ul>
146174 -->
147- <!-- GitHub Corner. -->
148- < a href ="https://github.com/c-frame/aframe-super-hands-component " class ="github-corner ">
149- < svg width ="80 " height ="80 " viewBox ="0 0 250 250 " style ="fill:#222; color:#fff; position: absolute; top: 0; border: 0; right: 0; ">
150- < path d ="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z "> </ path > < path d ="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2 " fill ="currentColor " style ="transform-origin: 130px 106px; " class ="octo-arm "> </ path > < path d ="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z " fill ="currentColor " class ="octo-body "> </ path >
151- </ svg >
152- </ a >
153- < style > .github-corner : hover .octo-arm {animation : octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0% , 100%{transform : rotate (0 )}20% , 60% {transform : rotate (-25deg )}40% , 80% {transform : rotate (10deg )}}@media (max-width : 500px ){.github-corner : hover .octo-arm {animation : none}.github-corner .octo-arm {animation : octocat-wave 560ms ease-in-out}}
154- </ style >
155- </ body >
156-
157- </ html >
175+ <!-- GitHub Corner. -->
176+ < a href ="https://github.com/c-frame/aframe-super-hands-component " class ="github-corner ">
177+ < svg width ="80 " height ="80 " viewBox ="0 0 250 250 "
178+ style ="fill:#222; color:#fff; position: absolute; top: 0; border: 0; right: 0; ">
179+ < path d ="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z "> </ path >
180+ < path
181+ d ="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2 "
182+ fill ="currentColor " style ="transform-origin: 130px 106px; " class ="octo-arm "> </ path >
183+ < path
184+ d ="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z "
185+ fill ="currentColor " class ="octo-body "> </ path >
186+ </ svg >
187+ </ a >
188+ < style >
189+ .github-corner : hover .octo-arm {
190+ animation : octocat-wave 560ms ease-in-out
191+ }
192+
193+ @keyframes octocat-wave {
194+
195+ 0% ,
196+ 100% {
197+ transform : rotate (0 )
198+ }
199+
200+ 20% ,
201+ 60% {
202+ transform : rotate (-25deg )
203+ }
204+
205+ 40% ,
206+ 80% {
207+ transform : rotate (10deg )
208+ }
209+ }
210+
211+ @media (max-width : 500px ) {
212+ .github-corner : hover .octo-arm {
213+ animation : none
214+ }
215+
216+ .github-corner .octo-arm {
217+ animation : octocat-wave 560ms ease-in-out
218+ }
219+ }
220+ </ style >
221+ </ body >
222+
223+ </ html >
0 commit comments