src/components/scene/vr-mode-ui.js
function createEnterVRButton (onClick) {
  var vrButton;
  var wrapper;

  // Create elements.
  wrapper = document.createElement('div');
  wrapper.classList.add(ENTER_VR_CLASS);
  wrapper.setAttribute(constants.AFRAME_INJECTED, '');
  vrButton = document.createElement('button');
  vrButton.className = ENTER_VR_BTN_CLASS;
  vrButton.setAttribute('title',
    'Enter VR mode with a headset or fullscreen mode on a desktop. ' +
    'Visit https://webvr.rocks or https://webvr.info for more information.');
  vrButton.setAttribute(constants.AFRAME_INJECTED, '');

  // Insert elements.
  wrapper.appendChild(vrButton);
  vrButton.addEventListener('click', function (evt) {
    onClick();
    evt.stopPropagation();
  });
  return wrapper;
}
function createEnterVRButton (onClick) {
  var vrButton;
  var wrapper;

  // Create elements.
  wrapper = document.createElement('div');
  wrapper.classList.add(ENTER_VR_CLASS);
  wrapper.setAttribute(constants.AFRAME_INJECTED, '');
  vrButton = document.createElement('button');
  vrButton.className = ENTER_VR_BTN_CLASS;
  vrButton.setAttribute('title',
    'Enter VR mode with a headset or fullscreen mode on a desktop. ' +
    'Visit https://webvr.rocks or https://webvr.info for more information.');
  vrButton.setAttribute(constants.AFRAME_INJECTED, '');

  // Insert elements.
  wrapper.appendChild(vrButton);
  vrButton.addEventListener('click', function (evt) {
    onClick();
    evt.stopPropagation();
  });
  return wrapper;
}
function createEnterVRButton ( onClick ) { var vrButton ; var wrapper ; // Create elements. wrapper = document . createElement ( 'div' ) ; wrapper . classList . add ( ENTER_VR_CLASS ) ; wrapper . setAttribute ( constants . AFRAME_INJECTED , '' ) ; vrButton = document . createElement ( 'button' ) ; vrButton . className = ENTER_VR_BTN_CLASS ; vrButton . setAttribute ( 'title' , 'Enter VR mode with a headset or fullscreen mode on a desktop. ' + 'Visit https://webvr.rocks or https://webvr.info for more information.' ) ; vrButton . setAttribute ( constants . AFRAME_INJECTED , '' ) ; // Insert elements. wrapper . appendChild ( vrButton ) ; vrButton . addEventListener ( 'click' , function ( evt ) { onClick ( ) ; evt . stopPropagation ( ) ; } ) ; return wrapper ; }
Create a button that when clicked will enter into stereo-rendering mode for VR.

Structure: <div><button></div>

@param {function} onClick - click event handler
@returns {Element} Wrapper <div>.
Create a button that when clicked will enter into stereo - rendering mode for VR .