|
@@ -5,32 +5,13 @@
|
|
|
|
|
|
var WEBVR = {
|
|
|
|
|
|
- button: function ( effect ) {
|
|
|
+ isAvailable: function () {
|
|
|
|
|
|
- var button = document.createElement( 'button' );
|
|
|
- button.style.position = 'absolute';
|
|
|
- button.style.left = 'calc(50% - 30px)';
|
|
|
- button.style.bottom = '20px';
|
|
|
- button.style.border = '0';
|
|
|
- button.style.padding = '8px';
|
|
|
- button.style.cursor = 'pointer';
|
|
|
- button.style.backgroundColor = '#000';
|
|
|
- button.style.color = '#fff';
|
|
|
- button.style.fontFamily = 'sans-serif';
|
|
|
- button.style.fontSize = '13px';
|
|
|
- button.style.fontStyle = 'normal';
|
|
|
- button.style.zIndex = '999';
|
|
|
- button.textContent = 'ENTER VR';
|
|
|
- button.onclick = function() {
|
|
|
-
|
|
|
- effect.setFullScreen( true );
|
|
|
-
|
|
|
- };
|
|
|
- document.body.appendChild( button );
|
|
|
+ return navigator.getVRDisplays;
|
|
|
|
|
|
},
|
|
|
|
|
|
- test: function () {
|
|
|
+ getMessage: function () {
|
|
|
|
|
|
var message;
|
|
|
|
|
@@ -61,7 +42,6 @@ var WEBVR = {
|
|
|
container.style.right = '0';
|
|
|
container.style.zIndex = '999';
|
|
|
container.align = 'center';
|
|
|
- document.body.appendChild( container );
|
|
|
|
|
|
var error = document.createElement( 'div' );
|
|
|
error.style.fontFamily = 'sans-serif';
|
|
@@ -76,8 +56,36 @@ var WEBVR = {
|
|
|
error.innerHTML = message;
|
|
|
container.appendChild( error );
|
|
|
|
|
|
+ return container;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ },
|
|
|
+
|
|
|
+ getButton: function ( effect ) {
|
|
|
+
|
|
|
+ var button = document.createElement( 'button' );
|
|
|
+ button.style.position = 'absolute';
|
|
|
+ button.style.left = 'calc(50% - 30px)';
|
|
|
+ button.style.bottom = '20px';
|
|
|
+ button.style.border = '0';
|
|
|
+ button.style.padding = '8px';
|
|
|
+ button.style.cursor = 'pointer';
|
|
|
+ button.style.backgroundColor = '#000';
|
|
|
+ button.style.color = '#fff';
|
|
|
+ button.style.fontFamily = 'sans-serif';
|
|
|
+ button.style.fontSize = '13px';
|
|
|
+ button.style.fontStyle = 'normal';
|
|
|
+ button.style.zIndex = '999';
|
|
|
+ button.textContent = 'ENTER VR';
|
|
|
+ button.onclick = function() {
|
|
|
+
|
|
|
+ effect.setFullScreen( true );
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ return button;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
};
|