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

              
                header.parallax
  div.parallax-fg
    h1 This is a test of that no-JS parallax effect <br><small>(without using background-images)</small>
  div.parallax-bg
    h3 this should be in the background
    p Some random text to put behind the main content, showing this method works for arbitrary HTML.
section
  h2 Some second heading
  p This code was adapted from <a href="https://www.youtube.com/watch?v=6CQ7DYni7Bg" target="_blank" rel="noopener">Codegrid's excellent little Youtube video</a> from last year. You should check it out. I only made this as a test of a mobile code-sketching setup. Codepen works great on phones! So I just propped mine up in a cupholder on my bus to New York, hooked it up to a bluetooth keyboard, and sketched this and two other little things up. So fun, highly recommend it for young ones looking to get into this. You do not need a bunch of fancy stuff to learn web development.
section.parallax
  div.parallax-fg
    h3 You can actually right click and open this image in a new tab
  div.parallax-bg
    img(src="https://franknoirot.github.io/assets/img/furniture/6.jpg")
section
  h2 Now this is a story
  p All about how my life got flipped, turned upside down, and I'd like to take a minute - just sit right there - tell ya how I became the prince of a town called "Bel Air."
section.parallax
  div.parallax-fg
    h3 How is the weather?
  div.parallax-bg
    img(src="https://franknoirot.github.io/assets/img/furniture/1.jpg")
              
            
!

CSS

              
                :root {
  font-family: 'Roboto', sans-serif;
}

h1,h2,h3,h4,h5,h6 {
  font-family: "Roboto Slab", serif;
  color: hsl(128deg, 70%, 20%);
  filter: ;
  --h-size-min: 1.4em;
  --h-w-min: 21;
  --h-w-max: 35;
  --h-w-diff: calc(var(--h-w-max) - var(--h-w-min));
  --h-size-w-min: calc(var(--h-w-min) * 1em);
  --h-factor: 1;
  
  font-size: calc(var(--h-size-min) * var(--h-factor) + .1 * (100vw - var(--h-size-w-min)) / var(--h-w-diff));
}

h1 { --h-factor: 2.25; }
h2 { --h-factor: 2; }
h3 { --h-factor: 1.75; }
h4 { --h-factor: 1.5; }
h5 { --h-factor: 1.25; }

p {
  --p-line-height-min: 1.3em;
  --p-w-max: 35;
  --p-w-min: 21;
  --p-w-diff: calc(var(--p-w-max)-var(--p-w-min));
  --p-line-height-w-min: calc(var(--p-w-min) * 1em);
  
  line-height: calc(var(--p-line-height-min) + .75 * (100vw - var(--p-line-height-w-min)) / var(--p-w-diff));
}

html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: white;
  margin: 0;
  padding: 0;
  height: 100%;
  transform-style: preserve-3d;
  perspective: 1px;
  overflow-y: scroll;
  overflow-x: hidden;
}

section {
  background: white;
  box-sizing: border-box;
  padding: 5vmin 5vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.parallax {
  min-height: 100vh;
}

.parallax,
.parallax-fg {
  width: 100vw;
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vw;
  transform-style: inherit;
  box-sizing: border-box;
  overflow: hidden;
}

.parallax,
.parallax-fg,
.parallax-bg {
  background: 50% 50% / cover;
}

.parallax-bg {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: block;
  background-size: cover;
  transform-origin: 50% 50% 0;
  transform: translateZ(-1px)  scale(2);
  z-index: -1;
  min-height: 100vh;
  background-color: #44884d;
}

.parallax-bg img {
  mix-blend-mode: screen;
}
              
            
!

JS

              
                // 🤖 These are not the droids you're looking for. 🤖
              
            
!
999px

Console