Pen Settings



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


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


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.


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.


  <p>And Aubrey was her name<br />
    A not so very ordinary girl or name<br />
    But who's to blame?<br />
    For a love that wouldn't bloom<br />
    For the hearts that never played in tune<br />
    Like a lovely melody that everyone can sing<br />
    Take away the words that rhyme, it doesn't mean a thing</p>
  <p>And Aubrey was her name<br />
    We tripped the light and danced together to the moon<br />
    But where was June?<br />
    No, it never came around<br />
    If it did it never made a sound<br />
    Maybe I was absent or was listening too fast<br />
    Catching all the words but then the meaning going past</p>
  <p>But God I miss the girl<br />
    And I'd go a thousand times around the world just to be<br />
    Closer to her than to me</p>
  <p>And Aubrey was her name<br />
    I never knew her but I loved her just the same<br />
    I loved her name<br />
    Wish that I had found the way<br />
    And the reasons that would make her stay<br />
    I have learned to lead a life apart from all the rest<br />
    If I can't have the one I want, I'll do without the best</p>
  <p>But how I miss the girl<br />
    And I'd go a million times around the world just to say<br />
    She had been mine for a day</p>


                body {
  margin: 15px;
  font-family: Georgia, serif;

h2 {
  font-size: 168px;
  text-align: center;

p {
  font-size: 112px;
  text-align: center;

nav {
  background-color: #fefefe;
  border: 1px solid #999;
  position: fixed;
  top: 0;
  left: 0;
  padding: 20px 20px 10px;

nav a {
  display: block;
  margin: 4px 0;

.block {
  font-family: sans-serif;
  padding: 15px;
  background-color: seagreen;
  border: 0px solid #555;
  margin-bottom: 15px;
  height: calc(100vh - 60px);

.block-target {
  color: #eee;
  font-size: 30px;
  height: 200px;
  height: 50%;
  max-width: 50%;

.flex {
  display: flex;
  align-items: center;
  justify-content: center;

.flex-item {
  flex: 1;


                $(function() {
  var $document   = $(document);
  var $window     = $(window);
  var height      = $document.height() - $window.height();
  var timeline    = new TimelineMax();
  var scrolling   = false;
  // TimeScale value when Ctrl is pressed
  var ctrlSpeed = 3;
  // Set your speed constant here for how many pixels you want
  // it to scroll / second
  var scrollSpeed = 200;
  var totalTime   = height / scrollSpeed;
  var duration;
  var ratio;
  var timeScale; 
  var keyboard = {
    DOWN : 40,
    UP   : 38,
    CTRL : 17
  // ===========================================================================
  //  KEY DOWN
  // ===========================================================================
  $document.on("keydown", function(event) {
    // IF 'CTRL' is pressed, speed up the timeScale to the ctrlSpeed
    if (event.ctrlKey) {
    // DOWN KEY
    if (event.keyCode === keyboard.DOWN) {
      if (!scrolling) {
        ratio     = $window.scrollTop() / height;
        duration  = totalTime * (1 - ratio);
        scrolling = true;
        // IF the 'CTRL' key is pressed, change the timeScale to the ctrlSpeed
        // ELSE set the timeScale to 1
        timeScale = event.ctrlKey ? ctrlSpeed : 1;
          .to($window, duration, { scrollTo: "max", ease: Power0.easeNone })
    // UP KEY
    if (event.keyCode === keyboard.UP) {
      if (!scrolling) {
        ratio     = $window.scrollTop() / height;
        duration  = totalTime - (totalTime * (1 - ratio));        
        scrolling = true;        
        timeScale = event.ctrlKey ? ctrlSpeed : 1;
          .to($window, duration, { scrollTo: 0,  ease: Power0.easeNone })
  // ===========================================================================
  //  KEY UP
  // ===========================================================================
  $document.on("keyup", function(event) {
    // Set the timeScale back to 1 when 'CTRL' is released
    if (event.keyCode === keyboard.CTRL) {
    if (event.keyCode === keyboard.UP || event.keyCode === keyboard.DOWN) {
      scrolling = false;