Skip to content

Commit

Permalink
Adding a hint/message to all examples that require you to be inside A…
Browse files Browse the repository at this point in the history
…ltspace to see the example code working.
  • Loading branch information
Fasani committed Nov 16, 2016
1 parent 2a5a01e commit 9105c4d
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 11 deletions.
4 changes: 4 additions & 0 deletions examples/basic-cube.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
</head>
<body>
<script>
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

var scene = new THREE.Scene();
var renderer = altspace.getThreeJSRenderer({version:'0.2.0'});

Expand Down
14 changes: 13 additions & 1 deletion examples/bubbling.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
background-color: rgba(1, 0, 0, 0);
box-shadow: 0 0 8px 600px rgba(0, 0, 0, .8);
}

.ontop {
position: absolute;
padding-left: 10px;
}

.ontop a {
color: white;
}
</style>
</head>
<body>
Expand All @@ -34,6 +43,9 @@
<script src="../dist/altspace.min.js"></script>

<script>
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3 class="ontop">To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

var scene, renderer;

Expand Down Expand Up @@ -93,7 +105,7 @@
testFrame.style.fontSize = '18px';
throw new Error(errorMsg);
}

loader.load('models/solar-system/sun.obj', 'models/solar-system/sun.mtl', function (sun) {

sun.scale.x = 1;
Expand Down
4 changes: 4 additions & 0 deletions examples/circle-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
</head>
<body>
<script>
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

var scene = new THREE.Scene();
var renderer = altspace.getThreeJSRenderer({ version: '0.2.0' });

Expand Down
4 changes: 3 additions & 1 deletion examples/hats.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
</head>
<body>
<script>
if (!window.altspace || !window.altspace.inClient) document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

HatsApp = (function () {

Expand Down
4 changes: 3 additions & 1 deletion examples/hello-hands.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
</head>
<body>
<script>
if (!window.altspace) document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3 class="ontop">To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

var text = "HelloHands";//"AltspaceVR"

Expand Down
4 changes: 3 additions & 1 deletion examples/hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</head>
<body>
<script>
if (!window.altspace) document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3>To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

var text = "Hello World";

Expand Down
6 changes: 3 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
'solar-system.html',
'synced-dice.html',
'hats.html',
'living-room/living-room.html',
'tests',
'hello-hands.html',
'gamepad-cube.html',
'telekenetic-cubes/index.html',
'touchpad-cube.html',
'living-room/living-room.html',
'telekenetic-cubes/index.html',
'steamvr/index.html',
'popup/index.html',
'tests'
].forEach(function (example) {
var li = document.createElement('li');
var a = document.createElement('a');
Expand Down
10 changes: 7 additions & 3 deletions examples/popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

<body>
<script>
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3 class="ontop">To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

var sim = altspace.utilities.Simulation();
var config = { authorId: 'AltspaceVR', appId: 'Popup' };
var sceneSync, popup;
Expand All @@ -30,12 +34,12 @@
icon: getFullUrl('favicon.png'),
hidden: true
}).then(function (_popup) {
// Save a reference to the popup so that we can open it when a user clicks
// Save a reference to the popup so that we can open it when a user clicks
// on any shape via the ShowPopup behavior.
popup = _popup;
});

// This example uses Firebase to communicate between the popup and the main app.
// This example uses Firebase to communicate between the popup and the main app.
// The form in the popup adds shapes to Firebase. When that happens, we instantiate the corresponding shape here.
connection.instance.child('things').on('child_added', function (snapshot) {
var thing = snapshot.val();
Expand Down Expand Up @@ -95,7 +99,7 @@
altspace.utilities.behaviors.Object3DSync(),
ShowPopup()
);
if (options.user) {
if (options.user) {
var label = new THREE.Mesh(
new THREE.PlaneGeometry(100, 50),
new THREE.MeshBasicMaterial({
Expand Down
13 changes: 12 additions & 1 deletion examples/solar-system.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,26 @@
left: -300px;
position: absolute;
}
.ontop {
position: absolute;
padding-left: 10px;
}

.ontop a {
color: white;
}
</style>
</head>
<body>
<div id="test-frame">
<ul id="planet-list">
</ul>
</div>
</div>
</body>
<script>
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3 class="ontop">To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}

SolarSystemApp = (function(){

Expand Down
5 changes: 5 additions & 0 deletions examples/steamvr/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body>
<script>
if (!window.altspace || !window.altspace.inClient) {
document.write('<h3 class="ontop">To view this example, please open this page in <a href="http://altvr.com"> AltspaceVR </a></h3>');
}
</script>
<div class="container"></div>
</body>
<script src="bundle.js"></script>
Expand Down

0 comments on commit 9105c4d

Please sign in to comment.