123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!-- A-Frame 0.7.1 -->
<script src="//aframe.io/releases/0.7.1/aframe.min.js"></script>

<!-- A-Frame 0.8.0 -->
<!-- <script src="//aframe.io/releases/0.8.0/aframe.min.js"></script> -->

<!-- A-Frame Extras -->
<script src="//unpkg.com/aframe-extras@3.13.1/dist/aframe-extras.min.js"></script>

<!-- A-Frame Animation -->
<script src="//unpkg.com/aframe-animation-component@4.1.*/dist/aframe-animation-component.min.js"></script>

<!-- Scene -->
<a-scene stats="false" background="color: black;" fog="color: #633; near: 0; far: 15;">
  
  <a-assets>
    <img id="crate-texture" src="https://aframe.io/sample-assets/assets/images/wood/crate.gif" crossorigin="anonymous">
    <!-- Audio assets are not to be freely distributed. -->
    <audio id="ambience" src="https://ucarecdn.com/e01a0015-866a-4b21-9cdf-85383e4f06f6/" crossorigin="anonymous"></audio>
    <audio id="alarm" src="https://ucarecdn.com/ae148d93-8c89-4c02-bf7f-e4f3d80554e8/" crossorigin="anonymous"></audio>
    <a-mixin id="wall" geometry="primitive: box; depth: 1; height: 10; width: 10;" material="color: gray; roughness: 1; metalness: 0;" shadow="receive: true; cast: false;" static-body></a-mixin>
    <a-mixin id="wall-wide" geometry="primitive: box; depth: 1; height: 10; width: 20;"></a-mixin>
    <a-mixin id="floor" geometry="primitive: box; height: 1; depth: 10; width: 20;" material="color: #333;" shadow="receive: true;" static-body></a-mixin>
    <a-mixin id="duct" geometry="primitive: box; height: 1; width: 20; depth: 1;" material="color: silver; metalness: 0.7; roughness: 0.3;"></a-mixin>
    <a-mixin id="duct-seam" geometry="primitive: box; height: 1.1; width: 0.1; depth: 1.1;" material="color: silver; metalness: 0.7; roughness: 0;"></a-mixin>
    <a-mixin id="pole" geometry="primitive: cylinder; height: 10; radius: 0.2;" material="color: white; metalness: 1;" shadow static-body position="0 5 0"></a-mixin>
    <a-mixin id="crate" geometry="primitive: box;" material="src: #crate-texture; roughness: 1; metalness: 0;" shadow="cast: true; receive: true;"></a-mixin>
    <a-mixin id="spotlight" light="type: spot; color: red; intensity: 20; distance: 7.5; castShadow: true; penumbra: 0.5;"></a-mixin>
  </a-assets>
  
  <!-- Camera 0.8.0 -->
<!--   <a-camera look-controls="pointerLockEnabled: true;" position=" 0 1.6 3" sound="src: #ambience; autoplay: true; loop: true; positional: false; volume: 0.2;"></a-camera> -->
  
  <!-- Camera 0.7.1 -->
  <a-entity camera="userHeight: 1.6;" jump-ability kinematic-body universal-controls position=" 0 1.6 4" sound="src: #ambience; autoplay: true; loop: true; positional: false; volume: 0.2;">
  </a-entity>
  
  <!-- Static Crates -->
  <a-entity mixin="crate" static-body position="0 2.5 -4.5"></a-entity>
  
  <a-entity mixin="crate" static-body position="-0.75 1.5 -4.5"></a-entity>
  <a-entity mixin="crate" static-body position="0.75 1.5 -4.5" rotation="0 0 90"></a-entity>
  
  <a-entity mixin="crate" static-body position="-1.5 0.5 -4.5"></a-entity>
  <a-entity mixin="crate" static-body position="0 0.5 -4.5" rotation="0 0 90"></a-entity>
  <a-entity mixin="crate" static-body position="1.5 0.5 -4.5"></a-entity>
  
  <!-- Dynamic Crates -->
  <a-entity mixin="crate" dynamic-body rotation="0 45 90" position="4 0.5 0"></a-entity>
  <a-entity mixin="crate" dynamic-body position="4 1.5 0.1"></a-entity>
  
  <a-entity mixin="crate" dynamic-body rotation="0 45 90" position="-4 0.5 0"></a-entity>
  <a-entity mixin="crate" dynamic-body position="-4 0.5 1.2"></a-entity>
  
  <!-- Alarm Wall -->
  <a-entity mixin="wall wall-wide" position="0 5 -5.5">
    <!-- Alarm Light -->
    <a-entity geometry="primitive: cylinder; radius: 0.2; height: 0.25" material="metalness: 1; roughness: 0.2; color: red; opacity: 0.9; shader: standard; emissive: red; emissiveIntensity: 10; fog: true;" rotation="90 0 0" position="0 0 0.65" sound="src: #alarm; autoplay: true; loop: true;">
      <!-- Container for rotation -->
      <a-entity rotation="90 0 0">
        <!-- Inner bulb -->
        <a-entity geometry="primitive: cylinder; radius: 0.1; height: 0.2;" material="color: red; shader: standard; emissive: white; emissiveIntensity: 10; fog: true;" position="0 0 0" animation="property: rotation.z; to: 360; dur: 1500; loop: true; autoplay: true; easing: linear;">
          <!-- Spotlights -->
          <a-entity mixin="spotlight" rotation="90 0 0"></a-entity>
          <a-entity mixin="spotlight" rotation="-90 0 0"></a-entity>
        </a-entity><!-- /Bulb -->
      </a-entity><!-- /Container -->
   </a-entity><!-- /Alarm Light -->
  </a-entity><!-- /Wall -->
  
  <!-- Other Walls -->
  <a-entity mixin="wall wall-wide" position="0 5 5.5"></a-entity>
  <a-entity mixin="wall" position="-10.5 5 0" rotation="0 90 0"></a-entity>
  <a-entity mixin="wall" position="10.5 5 0" rotation="0 90 0"></a-entity>
  
  <!-- Ambient Light -->
  <a-light type="ambient" intensity="0.3" color="#f66"></a-light>
  
  <!-- Ceiling -->
  <a-entity mixin="floor" position="0 10.5 0">
    
    <!-- Ducts -->
    <a-entity mixin="duct" position="0 -2 -3">
      <a-entity mixin="duct-seam"></a-entity>
      <a-entity mixin="duct-seam" position="-5 0 0"></a-entity>
      <a-entity mixin="duct-seam" position="5 0 0"></a-entity>
    </a-entity>
    
     <a-entity mixin="duct" position="0 -2 3">
      <a-entity mixin="duct-seam"></a-entity>
      <a-entity mixin="duct-seam" position="-5 0 0"></a-entity>
      <a-entity mixin="duct-seam" position="5 0 0"></a-entity>
    </a-entity>
    
  </a-entity><!-- /Ceiling -->
  
  <!-- Poles -->
  <a-entity mixin="pole" position="-5 5 0"></a-entity>
  <a-entity mixin="pole" position="5 5 0"></a-entity>
  
  <!-- Floor -->
  <a-entity mixin="floor" position="0 -0.5 0"></a-entity>
  
</a-scene>
            
          
!
            
              body {
  background: black;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console