Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>AFRAME.utils.device.isMobile ()
- if (isMobile = true){
- console.log('hallo mobile');
- } else {
- console.log('hallo browser');
- }
- </script>
- <!--camera-->
- <a-entity rotation="0 90 0">
- <a-camera user-height="0" look-controls>
- <a-cursor cursor="fuse: true; fuseTimeout: 2000"
- position="0 0 -0.1"
- geometry="primitive: ring;
- radiusInner: 0.002;
- radiusOuter: 0.003"
- material="color: red; shader: flat">
- <a-animation attribute="scale"
- to="3 3 3"
- dur="2000"
- begin="cursor-fusing"
- fill="backwards"
- easing="linear">
- </a-animation>
- </a-cursor>
- <a-entity position="0 0 -0.1"
- geometry="primitive: ring;
- radiusInner: 0.009;
- radiusOuter: 0.0095"
- material="color: red; opacity: 0.25; shader: flat"></a-entity>
- </a-camera>
- </a-entity>
- AFRAME.registerComponent("foo", {
- init: function() {
- var cursor = document.querySelector("a-cursor")
- if (AFRAME.utils.device.isMobile === false) {
- cursor.setAttribute("visible", false);
- }
- }
- })
- <!--camera-->
- <a-entity foo rotation="0 90 0">
- <a-camera user-height="0" look-controls>
- <a-cursor fuse="true" fuseTimeout="2000"
- position="0 0 -0.1"
- geometry="primitive: ring;
- radiusInner: 0.002;
- radiusOuter: 0.003"
- material="color: red; shader: flat">
- <a-animation attribute="scale"
- to="3 3 3"
- dur="2000"
- begin="cursor-fusing"
- fill="backwards"
- easing="linear">
- </a-animation>
- </a-cursor>
- </a-camera>
- </a-entity>
Add Comment
Please, Sign In to add comment