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

Auto Save

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

              
                <html>

<head>
  <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500" rel="stylesheet">
  <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>

<body>
  <!-- Top navigation -->
  <header>
    <span class="logo">Your Logo</span>
    <nav>
      <a href="#home">Home</a>
      <a href="#about">About</a>
      <a href="#product">Product</a>
    </nav>
  </header>
  <!-- Page sections | Home -->
  <section class="page-sections home vr-container" id="home">
    <div class="vr-overlay-content">
      <h1>Let's explore the virtual world.</h1>
    <button class="action"onclick="window.location.href = '#about';">Get Started</button>
    </div>
    <span class="attribution"><a title="By DXR (Own work) [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)], via Wikimedia Commons" href="https://commons.wikimedia.org/wiki/File%3ARheingauer_Dom%2C_Geisenheim%2C_360_Panorama_(Equirectangular_projection).jpg">By DXR (Own work) [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)], via Wikimedia Commons</a></span>
    <!-- This is where I want to place the a-frame embed code -->
    <a-scene class="vr-background" id="aframe-viewer">
      <a-entity rotation="0 0 0">
        <a-animation attribute="rotation" dur="150000" easing="linear" fill="forwards" to="0 360 0" repeat="indefinite"></a-animation>
        <a-sky src="https://upload.wikimedia.org/wikipedia/commons/1/18/Rheingauer_Dom%2C_Geisenheim%2C_360_Panorama_%28Equirectangular_projection%29.jpg"></a-sky>
      </a-entity>
    </a-scene>
  </section>
  <!-- Page sections | About -->
  <section class="page-sections about" id="about">
    <h2 class="section-title">About Us</h2>
    <p class="section-content">Lorem ipsum dolor sit amet, te tritani recusabo nec. Ius admodum fuisset ea, nam ut causae mentitum scribentur. Vix id wisi doctus aperiri, cu ius harum appareat. Pro iudico bonorum interesset ei. Mel sanctus scaevola consectetuer at, ne sea affert congue intellegat.</p>
    <p class="section-content">Ex facilisis intellegam inciderint nec. Detracto adipiscing et usu. In est dissentias definitionem, latine legimus mel et. Ut vim ferri dolore interpretaris, te sea dico mollis sensibus. Cu eos lorem maluisset, ex congue torquatos usu.</p>
  </section>
  <!-- Page sections | Product -->
  <section class="page-sections product" id="product">
    <h2 class="section-title">Product</h2>
    <p class="section-content">Lorem ipsum dolor sit amet, te tritani recusabo nec. Ius admodum fuisset ea, nam ut causae mentitum scribentur. Vix id wisi doctus aperiri, cu ius harum appareat. Pro iudico bonorum interesset ei. Mel sanctus scaevola consectetuer at, ne sea affert congue intellegat.</p>
    <p class="section-content">Ex facilisis intellegam inciderint nec. Detracto adipiscing et usu. In est dissentias definitionem, latine legimus mel et. Ut vim ferri dolore interpretaris, te sea dico mollis sensibus. Cu eos lorem maluisset, ex congue torquatos usu.</p>
  </section>
</body>
<!-- Page Footer -->
<footer>
  <span class="post">Footer message</span>
  <nav>
    <a href="#home">Home</a>
    <a href="#about">About</a>
    <a href="#product">Product</a>
  </nav>
</footer>

</html>
              
            
!

CSS

              
                //
// -- Styles for the VR Embed

// Without these next 2 rules, a-frame will hide the rest of the page and disable scrolling
body.a-body {
  height: auto;
  overflow: auto;
}
html.a-html {
  height: auto;
  overflow: auto;
  position: static;
}

// make the viewer fill the background behind the elements instead of over it
.vr-background {
  overflow: hidden;
}

// for the html element inside which you are adding the a-frame embed code
.vr-container {
  height: 100vh; // I want the embed to be full-height. You can give any value you want here.
  .vr-overlay-content {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 100%;
    height: 200px;
    pointer-events: none; // this is important as it enables your interactions on the overlay to be detected by a-frame
  }
  .action {
    pointer-events: initial; // enables click on the button
  }
}

//
// -- Styles for the template - can be ignored for the VR part
header {
  position: fixed;
  z-index: 12;
  left: 0;
  top: 0;
  width: 100%;
  background: #2B3A42;
  color: #FFFFFF;
  .logo, nav {
    float: left;
    width: 50%;
    line-height: 1.5rem;
  }
  nav {
    text-align: right;
    a {
      color: inherit;
      text-decoration: none;
      padding: 10px 20px;
      display: inline-block;
      text-transform: uppercase;
      font-size: 0.875rem;
      font-weight: 400;
      vertical-align: bottom;
      &:hover {
        color: #FF530D;
      }
    }
  }
  .logo {
    padding: 10px 20px;
    display: inline-block;
    font-weight: 500;
    font-size: 1.25rem;
  }
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}
section.home {
  display: block;
  max-width: 100%;
  text-align: center;
  color: #FFFFFF;
  padding: 0;
  h1 {
    font-size: 2.5rem;
    font-weight: 400;
  }
  .action {
    color: #FFFFFF;
    background: #FF530D;
    border: 0;
    height: 50px;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    padding: 0 20px;
    border-radius: 6px;
  }
  .attribution {
    position: absolute;
    display: block;
    z-index: 12;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.5;
    a {
      color: inherit;
      text-decoration: none;
    }
  }
}
section.about {
  background: #EFF9F9;
}
section.product {
  background: #FFFFFF;
}
.page-sections {
  padding: 20px 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 11;
}
.section-title, .section-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.section-title {
  font-size: 2rem;
  color: #3F5765;
  font-weight: 400;
}
footer {
  background: #2B3A42;
  color: #FFFFFF;
  span, nav {
    float: left;
  }
  span {
    display: block;
    width: 50%;
    padding: 20px;
  }
  nav {
    text-align: right;
    width: 50%;
    a {
      font-size: 0.875rem;
      color: inherit;
      text-decoration: none;
      text-transform: uppercase;
      font-weight: 400;
      display: inline-block;
      padding: 20px;
      &:hover {
        color: #FF530D;
      }
    }
  }
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}
* {
  box-sizing: border-box;
}
body {
  font-size: 16px;
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-weight: 300;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  letter-spacing: 0.5px;
  color: #2B3A42;
}
              
            
!

JS

              
                
              
            
!
999px

Console