Guest User

Untitled

a guest
May 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <script>AFRAME.utils.device.isMobile ()
  2. if (isMobile = true){
  3. console.log('hallo mobile');
  4. } else {
  5. console.log('hallo browser');
  6. }
  7. </script>
  8.  
  9. <!--camera-->
  10. <a-entity rotation="0 90 0">
  11. <a-camera user-height="0" look-controls>
  12. <a-cursor cursor="fuse: true; fuseTimeout: 2000"
  13. position="0 0 -0.1"
  14. geometry="primitive: ring;
  15. radiusInner: 0.002;
  16. radiusOuter: 0.003"
  17. material="color: red; shader: flat">
  18. <a-animation attribute="scale"
  19. to="3 3 3"
  20. dur="2000"
  21. begin="cursor-fusing"
  22. fill="backwards"
  23. easing="linear">
  24. </a-animation>
  25. </a-cursor>
  26. <a-entity position="0 0 -0.1"
  27. geometry="primitive: ring;
  28. radiusInner: 0.009;
  29. radiusOuter: 0.0095"
  30. material="color: red; opacity: 0.25; shader: flat"></a-entity>
  31. </a-camera>
  32. </a-entity>
  33.  
  34. AFRAME.registerComponent("foo", {
  35. init: function() {
  36. var cursor = document.querySelector("a-cursor")
  37. if (AFRAME.utils.device.isMobile === false) {
  38. cursor.setAttribute("visible", false);
  39. }
  40. }
  41. })
  42.  
  43. <!--camera-->
  44. <a-entity foo rotation="0 90 0">
  45. <a-camera user-height="0" look-controls>
  46. <a-cursor fuse="true" fuseTimeout="2000"
  47. position="0 0 -0.1"
  48. geometry="primitive: ring;
  49. radiusInner: 0.002;
  50. radiusOuter: 0.003"
  51. material="color: red; shader: flat">
  52. <a-animation attribute="scale"
  53. to="3 3 3"
  54. dur="2000"
  55. begin="cursor-fusing"
  56. fill="backwards"
  57. easing="linear">
  58. </a-animation>
  59. </a-cursor>
  60. </a-camera>
  61. </a-entity>
Add Comment
Please, Sign In to add comment