Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script>
 AFRAME.registerComponent('move-box',{
  init:function(){
  var view = document.getElementById("umbraco");
     this.el.addEventListener('click',function(){
         view.emit("startAnimation");
     });
  }
});
</script>

<a-scene fog="type: exponential; color: #c1c1c1; density: 0.035;">
      <!-- Assets for the Umbraco statue -->
      <a-assets>
        <a-asset-item id="umbraco-obj" src="https://cdn.rawgit.com/MMasey/Virtual-Umbrality/master/umbraco.obj"></a-asset-item>
        <a-asset-item id="umbraco-mtl" src="https://cdn.rawgit.com/MMasey/Virtual-Umbrality/master/umbraco.mtl"></a-asset-item>
      </a-assets>

      <!-- Creates the umbraco statue -->
       <a-entity>
        <a-entity id="umbraco" position="6 4.7 -5" rotation="0 -30 0" obj-model="obj: #umbraco-obj; mtl: #umbraco-mtl"  shadow="cast: true; receive: true">
        <a-animation attribute="position" begin="startAnimation" repeat="0" from="6 4.7 -5" to="0 4.7 10" dur="2000" direction="alternate" easing="ease-in-out"></a-animation>
        <a-animation attribute="rotation" begin="startAnimation" repeat="0" from="0 -30 0" to="0 0 0" dur="2000" direction="alternate" easing="ease-in-out"></a-animation>
        </a-entity>
      </a-entity>

    
      <!-- Creates the ground -->
      <a-plane rotation="-90 0 0" width="300" height="300" color="#eee" shadow="cast: true; receive: true"></a-plane>

      <!-- Creates the sky -->
      <a-sky color="#ffffff" radius="500" position="" rotation="" scale="" visible="" material="" geometry=""></a-sky>
      
      <!-- Creates some lights to make shadows and light the environment -->
      <a-light type="directional" color="#FFF" intensity="0.45" position="4 2 1" rotation="" scale="" visible="" light=""></a-light>
      <a-light type="directional" color="#FFF" intensity="0.45" position="0 7 -25" rotation="0 0 0" scale="1 1 1" visible="true" light="shadowCameraRight:15;shadowCameraLeft: -12;type:directional;color:#FFF; shadowCameraTop: 16,  intensity: 0.45; castShadow: true"></a-light>
      <a-light type="ambient" color="#A8A8A8" position="" rotation="" scale="" visible="" light=""></a-light>

      <!-- Create a camera -->
      <a-entity camera="userHeight:1.6;" wasd-controls look-controls="" position="0 1.46 15" rotation="5.6149863922820655 -0.34377467707848264 0">
         <a-entity cursor="fuse: true; fuseTimeout: 500"
            position="0 0 -1.3"
            geometry="primitive: ring; radiusInner: 0.02; radiusOuter: 0.03"
            material="color: black; shader: flat">
        </a-entity>
      </a-entity>
 
  <a-text text="width:50;wrapCount:17.53;value:Use WASD keys to move, or click on the red box to move the statue closer.;align:center;color:#333333" position="-40 15.668 -30.946" rotation="10 25 0" wrap-count="20"></a-text>
  <a-entity move-box position="-10 1 3.761" material="color:red" rotation="0 40 0" geometry="" scale="4 4.5 1" shadow=""></a-entity>
</a-scene>

              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console