Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 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.

HTML

              
                <base href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/">
<div id="container">
<img src="gear2.svg" alt id="leftgear">
<img src="gear2.svg" alt id="rightgear">
<main>
  <h1>Metropolis</h1>
<p>Metropolis, the mother city, city of mothers, mother of all cities.   The city, the film… they too are machines.
<p>Flywheels, a crankshaft, an eccentric disk.
<p>A machine without Workers, devoid of function, pure movement… rotating, thrusting… a machine of desire. 
<p>Round shapes and jerking movements become one within the image of two clocks. One-hour and one-hour clock. Day shift and night shift, hours each, mark the Metropolis working day.
<p>Two groups of Workers, uniformed, in rows of six, march in unison, the exhausted half as fast as the fresh.
<p>The Workers' theme - a funeral march. The night shift enters a cage… the grate is raised, the cage sinks, and with it the camera.           <p>A title picks up the movement. The title's movement is carried through to the movement of the picture.
<p>The Workers: Now just a painted silhouette rising in the background, the design of the Underground Workers' City.
<p>Elevators transport the Workers up and down between the machine halls and their living quarters.  A new musical theme: The Theme of the City of the Workers.
<p>The main square of the Workers' City. Simply a transit area for the Workers returning to their quarters.  In the centre a gong,             again a kind of alarm clock.
<p>The downward scroll of the title is answered by a rising, equilateral triangle pointing skywards.
<p>The Sports stadium, the contrast is stark between its openness under sweeping skies and the cramped City of the Workers - just as stark as the contrast between the liberated and carefree movements  of the youths, dressed in white, and the dull lethargy  of the darkly clothed Workers - and the self-determined horizontal  movement versus the downward ride of the Workers in the lift.
</main>

</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Roboto+Slab:100);
@font-face { 
font-family: Metropolis;
  src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/Metropolis_1920.otf);
}
* { 
  box-sizing: border-box;
}
html { 
  background: linear-gradient(rgba(0,0,0,0.3),#000), url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/coal-mine-beringen.jpg); 
  color: #fff; 
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
}
body { 
  margin: 2rem; 
  font-family: Roboto Slab, sans-serif;
  line-height: 2;
}
h1 { 
  font-family: Metropolis, sans-serif; 
  text-align: center;
  font-size: 8rem;
  margin-top: 2rem;
}
div > img { 
  position: fixed;
  width: 15vw;
  height: auto; 
}
#rightgear { right: 2rem; }
main { 
  max-width: 800px;
  width : 60%;
  margin: 0 auto;
  font-size: 2rem; 
}
@media all and (max-width: 1000px) {
  h1 { font-size: 10vw; }
}
@media all and (max-width: 800px) {
  main { font-size: 1.6rem;  }
}
@media all and (max-width: 500px) {
 h1 { font-size: 12vw; }
 img { display: none; }
 main { width: 100%; }
}
              
            
!

JS

              
                ;(function() {
    var throttle = function(type, name, obj) {
        var obj = obj || window;
        var running = false;
        var func = function() {
            if (running) { return; }
            running = true;
            requestAnimationFrame(function() {
                obj.dispatchEvent(new CustomEvent(name));
                running = false;
            });
        };
        obj.addEventListener(type, func);
    };
    throttle ("scroll", "optimizedScroll");
})();

var leftgear = document.getElementById("leftgear"),
rightgear = document.getElementById("rightgear");
    
// to use the script *without* anti-jank, set the event to "scroll" and remove the anonymous function.

window.addEventListener("optimizedScroll", function() {
    leftgear.style.transform = "rotate("+window.pageYOffset+"deg)";
    rightgear.style.transform = "rotate(-"+window.pageYOffset+"deg)";
});

              
            
!
999px

Console