source: other-projects/playing-in-the-street/summer-2013/trunk/Playing-in-the-Street-WPF/Content/Web/tutorial.js@ 30121

Last change on this file since 30121 was 28897, checked in by davidb, 10 years ago

GUI front-end to server base plus web page content

File size: 2.0 KB
Line 
1window.setTimeout(shoulders,100)
2var startPano = panorama.pano;
3
4var msgBox;
5function shoulders(){
6 msgBox = document.getElementById("tutorialBox");
7 msgBox.innerHTML = "move your shoulders side to side to look around. <br> keep the cursor on screen to use hand controls.";
8 window.setTimeout(grip,6000);
9}
10
11function grip(){
12 document.getElementById( "pano" ).addEventListener( "handPointerLeave", handLeft);
13 document.getElementById( "pano" ).addEventListener("handPointerEnter", handEntered);
14 console.log("added annoying hand listeners");
15 msgBox.innerHTML = "Close your hand into a grip and hold it to steady your view. <br> If the cursor doesn't close to a grip the kinect didn't notice so try again.";
16 window.addEventListener("handPointerGrip",didGrip);
17}
18
19var oldMessage;
20function handLeft() {
21 oldMessage = msgBox.innerHTML;
22 msgBox.innerHTML = "please move your hand over the screen";
23}
24
25function handEntered() {
26 msgBox.innerHTML = oldMessage;
27}
28
29function didGrip(){
30 window.removeEventListener("handPointerGrip", didGrip);
31 msgBox.innerHTML = "Great! <br> You may now move your gripped hand up and down to select and jump to distant panoramas.";
32 window.addEventListener("handPointerGripRelease",lostGrip);
33}
34
35function lostGrip(){
36 //document.getElementById("kinectgripthing").innerHTML = jumpTargetLink;
37 //alert("lostGrip " + jumpTargetLink);
38 if(panorama.pano != startPano) {
39 window.removeEventListener("handPointerGripRelease", lostGrip);
40 //window.removeEventListener("handPointerLeave", handLeft);
41 //window.removeEventListener("handPointerEnter", handEntered);
42 msgBox.innerHTML = "Good work. This concludes the tutorial. <br> Have fun playing with the street!";
43 window.setTimeout(end,5000);
44 }
45 else {
46 window.addEventListener("handPointerGrip",didGrip);
47 msgBox.innerHTML = "You don't seem to be gripping; grip again to resume the tutorial.";
48 }
49}
50
51function end(){
52 //alert("end");
53 msgBox.style.display = 'none';
54}
Note: See TracBrowser for help on using the repository browser.