css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Droid+Serif" rel="stylesheet">


<div class="container">
  
  <div class="intro">
    <h1 class="intro__title">Badassery</h1>
    <p class="intro__sentence">A collection of individuals who have done neat things in life.</p>
    <div class="intro__divider"></div>
  </div>
  
   <div class="filter">
      <ul class="filter__list">
        <li class="filter__title font--secondary">
          Filter
        </li>
        <li class="filter__tag"><a class="filter__taglink" href="">Activists</a></li>
        <li class="filter__tag"><a class="filter__taglink" href="">Authors</a></li>
        <li class="filter__tag"><a class="filter__taglink" href="">Cooks</a></li>
        <li class="filter__tag"><a class="filter__taglink" href="">Scientists</a></li>
      </ul>
    </div>
  
  <div class="items__wrapper">
    <div class="item animated fadeInUp">
      <img class="item__img"         
           src="http://maggiebignell.com/space/misc/tuyouyou.png"
           alt="Illustration of Tu YouYou where she is holding a flask">
      <div class="item__caption">
        <p class="item__bio">Tu YouYou (屠呦呦) is a chemist who discovered artemisinin, which is used to treat malaria and has saved millions of lives. In 2015, she became the first Chinese Nobel laureate in physiology or medicine, and the first Chinese woman to receive a Nobel prize.</p>
      </div><!-- end caption-->
      <div class="item__tags">
         <a href="" class="item__tags--tag">Scientist</a>
      </div> <!--end tags-->
    </div><!-- end item-->
    
    <div class="item animated fadeInUp delay1">
      <img class="item__img"
           src="https://scontent-sea1-1.cdninstagram.com/t51.2885-15/e35/14717459_1803548519902936_8121883061970272256_n.jpg"
           alt="Illustration of Sylvia Beach in front of Shakespeare and Company">
      <div class="item__caption">
        <p class="item__bio">One of my favorite spots in the world is Shakespeare and Company, a little English bookstore in Paris that is filled to the brim with books in every nook and cranny, with cozy spots to curl up and a piano upstairs. Well, apparently, this isn’t the first Shakespeare and Company of Paris, but the second—the first was started by Sylvia Beach in 1919, publishing the likes of Ezra Pound, Hemingway, and James Joyce (who used it as his office!). It closed during the German occupation of France in 1941.</p>
      </div><!-- end caption-->
       <div class="item__tags">
          <a href="" class="item__tags--tag">               Entrepreneur
          </a>
        </div> <!--end tags-->
    </div><!-- end item-->
    
    <div class="item animated fadeInUp delay2">
      <img class="item__img"
           src="https://scontent-sea1-1.cdninstagram.com/t51.2885-15/e35/14582510_1505045592861458_1951758638246789120_n.jpg"
           alt="Illustration of Mary Shelley sitting on a chair with Frankstein walking in front of her">
      <div class="item__caption">
        <p class="item__bio">In 1818, Frankenstein was published under an anonymous author, later revealed to be a woman named Mary Shelley. It is heralded as an early example of science fiction, if not the first true science fiction story. (Her mother, also a writer, wrote a book called “A Vindication of the Rights of Woman” in 1792. Women’s rights! 1792!)</p>
      </div><!-- end caption-->
        <div class="item__tags">
          <a href="" class="item__tags--tag">Author</a>
        </div> <!--end tags-->
    </div><!-- end item-->
    
         <div class="item animated fadeInUp delay1">
      <img class="item__img"
           src="https://scontent-sea1-1.cdninstagram.com/t51.2885-15/e35/15276768_169079870234085_6260523516685189120_n.jpg"
           alt="Illustration of Julia Child mixing a pot, surrounded by kitchen items and a shark fin">
      <div class="item__caption">
        <p class="item__bio">After being rejected from the Women’s Army Corps for being too tall (girl, I getchu), this woman ended up in the Secret Intelligence division where she was asked to solve the problem of too many underwater explosives being set off by curious sharks. She concocted various recipes to add to the water and repel sharks, and her creation is still in use today. It was her first foray into cooking—though you probably know her better for her eventual cookbook, Mastering the Art of French Cooking. Her name was Julia Child.</p>
      </div><!-- end caption-->
       <div class="item__tags">
          <a href="" class="item__tags--tag">Scientist</a>
          <a href="" class="item__tags--tag">Cook</a>
        </div> <!--end tags-->
    </div><!-- end item-->
    
         <div class="item animated fadeInUp delay1">
      <img class="item__img"
           src="https://scontent-sea1-1.cdninstagram.com/t51.2885-15/e35/15337291_200273690431841_7802327238765969408_n.jpg"
           alt="Illustration of Chimamanda Ngozi Adichie sitting on a sofa chair in front of a bookshelf">
      <div class="item__caption">
        <p class="item__bio">Chimamanda Ngozi Adichie was 26 when her first novel, Purple Hibiscus, received critical acclaim, and her TEDx talk “We should all be feminists” (which is also now a book, that you should read, or watch, whatever floats your boat) was sampled in Beyoncé’s Flawless.</p>
      </div><!-- end caption-->
       <div class="item__tags">
          <a href="" class="item__tags--tag">Author</a>
          <a href="" class="item__tags--tag">Activist</a>
        </div> <!--end tags-->
    </div><!-- end item-->
    
         <div class="item animated fadeInUp delay1">
      <img class="item__img"
           src="https://scontent-sea1-1.cdninstagram.com/t51.2885-15/e35/15258877_204756309980803_4551728103176536064_n.jpg"
           alt="Illustration of Ada Lovelace at a desk in front of the Analytical Engine">
      <div class="item__caption">
        <p class="item__bio">In the 1840s, Ada Lovelace wrote the first algorithm intended to be carried out on a machine—the Analytical Engine she worked on with Charles Babbage—as such, she is regarded as the first. computer. programmer.</p>
      </div><!-- end caption-->
       <div class="item__tags">
          <a href="" class="item__tags--tag">Programmer</a>
          <a href="" class="item__tags--tag">Inventor</a>
        </div> <!--end tags-->
    </div><!-- end item-->
  </div>
</div>
            
          
!
            
              //Type
$font-size--small: 13px;
$font-size--medium: 16px;
$font-size--large--less400: 42px;
$font-size--large--less800: 48px;
$font-size--large--greater800: 72px;
$line-height--base : 24px;

// Font stacks
$font-family--primary: 'Droid Serif', Helvetica, Arial, sans-serif;
$font-family--secondary: 'Roboto Mono', Georgia, serif;

// Colors
$black: #222222;
$white: #ffffff;
$grey: #999999;
$grey--light: #f8f8f8;
$teal: #5CC3D6;
$cyan: #ca0000;
$red: #FE0642;
$orange: #ffaa05;
$purple: #3B3DE5;
$purple--dark: #2C04A3;
$purple--light: #d6dcff;

$color--primary: $purple;
$color--secondary: $white;
$color--tertiary: $purple--dark;
$color--accent: $orange;
$color--bg: $purple;

//useful shortcuts
$border-radius--primary: 4px;

* {
  box-sizing: border-box;
}

body {
  background: $color--bg;
  font-family: $font-family--primary;
  font-size: $font-size--medium;
  line-height: $line-height--base;
}

.font--secondary {
  text-transform: uppercase;
  font-family: $font-family--secondary;
  letter-spacing:0.12em;
  font-weight:bold;
  font-size: $font-size--small;
}

.container {
  width:92%;
  max-width:1400px;
  margin: 4% auto;
}

.intro {
  margin-bottom:4%;
  position:fixed;
  z-index:-1;
  width:92%;
  max-width:1400px;
}
.intro__title {
  @extend .font--secondary;
  color: $color--accent;
  letter-spacing:0.23em;
  font-size: $font-size--medium;
  margin-bottom: 20px;
}
.intro__sentence {
  font-size: $font-size--large--less400;
  line-height: 1.1;
  color: $color--secondary;
}
.intro__divider {
  height:2px;
  width:60px;
  background: $white;
  margin-top:34px;
}

.filter {
  padding-top:310px;
  width:100%;
}
.filter--fixed {
  padding-top: 0px !important;
  margin-top: 0 !important;
  position:fixed;
  width:100%;
  z-index:6000;
  top:0px;
  left:0px;
}
.filter__list {
  border-radius: $border-radius--primary;
  background: $white;
}
.filter__title {
  width:100%;
  padding:8px 24px;
  height:44px;
  margin-bottom:10px;
  border-radius:
    $border-radius--primary;
  background: $color--tertiary;
  font-size: $font-size--small;
  color: $purple--light;
}
.filter__title::after {
  content: "▾";
}
.filter__tag {
  display: none;
}
.filter__taglink {
  @extend .font--secondary;
  padding:8px 24px 8px 24px; 
  text-decoration:none;
  color: $color--tertiary;
}
.filter__taglink:hover {
   background: $purple--light;
}

.items__wrapper {
  display:flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-top:30px;
  width:100%;
}
.item {
  -webkit-box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.44);
    -moz-box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.44);
    box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.44);
   margin-bottom:4%;
   width:100%;
   position: relative;
   border-radius: 
     20px 20px
     $border-radius--primary
     $border-radius--primary;
   background: $white;
}
.item__img {
  width:100%;
  height:width;
  background: $orange;
  border-radius: 
    $border-radius--primary               
    $border-radius--primary 
    0px 0px;
}
.item__caption {
  padding: 16px 22px;
      padding-bottom:64px;
}
.item__tags {
  margin-top:20px;
  background: $color--tertiary;
  position:absolute;
  bottom:0;
  width:100%;
  padding:8px 19px 9px 19px;
  border-radius: 0px 0px
    $border-radius--primary
    $border-radius--primary;
}
.item__tags--tag {
   @extend .font--secondary;
  right:0;
  margin-right:8px;
  text-decoration:none;
  line-height:1;
  color: $color--tertiary;
  font-size: $font-size--small;
  background: $purple--light;
  display:inline-block;
  padding:5px 14px 5px 12px;
  border-radius: $border-radius--primary;
}
.item__tags--tag:hover {
  color: $purple;
  background: $white;
}

@media screen and (min-width:400px) {
  .intro__sentence {
    font-size: $font-size--large--less800;
  }
}

@media screen and (min-width:720px) {
  .filter {
    padding-top:280px;
  }
  .filter--fixed {
    background: $color--tertiary;
  }
  .filter__tag {
    display:inline-block;
  }
  .filter__tag--fixed {
     padding-top:16px;
  }
  .filter__taglink {
    background: $white;
    border-radius: $border-radius--primary;
    height:44px;
    margin-right:10px;
  }
  .filter__list {
     background: none;
  }
  .filter__title {
    width:auto;
    height:auto;
    display:inline-block;
    margin-right:10px;
  }
  .filter__title--fixed {
    margin-left:4%;
  }
  .filter__title::after {
     content:"";
  }
  .items__wrapper {
    flex-wrap:wrap;
  }
  .item {
    width:48%;
  }
}

@media screen and (min-width:760px) {
  .filter {
    padding-top:230px;
  }
}

@media screen and (min-width:1160px) {
  .intro__sentence {
    font-size: $font-size--large--greater800;
  }
  .filter {
    display: block;
    padding-top:300px;
    width:210px;
    float:left;
    padding-right:30px;
  }
  .filter--fixed {
    margin-top: 0 !important;
    position:fixed;
    top:38px;
    width:210px;
    padding-top:auto;
    left:auto;
    background-color: transparent;
  }
  .filter__tag--fixed {
    padding-top:0px;
  }
  .filter__title--fixed {
    padding-top:8px;
    margin-left:0%;
  }
  .filter__list {
    padding-bottom:10px;
    border-radius: $border-radius--primary;
    width:100%;
    background: $white;
  }
  .filter__title {
      width:100%;
      padding:8px 24px;
      margin-bottom:10px;
      border-radius:
        $border-radius--primary
        $border-radius--primary
        0px 0px;
      background: $color--tertiary;
    }
  .filter__tag {
     display:block;
  }
  .filter__taglink {
    padding:8px 24px 8px 24px; 
    display:block;
    margin-right:0;
  }
  .filter__taglink:hover {
    content:"‣";
    padding-right:10px;
  }
  .items__wrapper {
    flex-wrap:wrap;
    padding-top:300px;
    float:right;
    width:calc(100% - 240px);
  }
}

/*!
not entirely sure how to write this in BEM.
gosh dan is lovely ->
Animate.css - https://daneden.me/animate
Licensed under the MIT license - https://opensource.org/licenses/MIT

Copyright (c) 2014 Daniel Eden
*/

.animated {
  -webkit-animation-duration: 1s;
          animation-duration: 1s;
  -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
}

@-webkit-keyframes fadeInUp {
  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, 200px, 0);
            transform: translate3d(0, 200px, 0);
  }

  100% {
    opacity: 1;
    -webkit-transform: none;
            transform: none;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, 200px, 0);
            transform: translate3d(0, 200px, 0);
  }

  100% {
    opacity: 1;
    -webkit-transform: none;
            transform: none;
  }
}

.fadeInUp {
  -webkit-animation-name: fadeInUp;
          animation-name: fadeInUp;
}

.delay1 {
      -webkit-animation-delay: 0.2s; /* Safari 4.0 - 8.0 */
    animation-delay: 0.2s;
}
.delay2 {
      -webkit-animation-delay: 0.4s; /* Safari 4.0 - 8.0 */
    animation-delay: 0.4s;
}
            
          
!
            
              var filter = $('.filter');
var filtersTop = filter.css('padding-top');
var filtersTopNumber = parseInt(filtersTop, 10) + 12;

$(document).on("scroll", function() {
		var pixels = $(document).scrollTop();

  if (pixels > 80) {
			var opacity = 1-((pixels-80)*0.01);
		$(".intro").css("opacity",opacity);
		} else {
			$(".intro").css("opacity","1");
		}
  
  if (pixels > filtersTopNumber) {
    $(".filter").addClass("filter--fixed");
    $(".filter__tag").addClass("filter__tag--fixed");
    $(".filter__title").addClass("filter__title--fixed");
  } else {
    $(".filter").removeClass("filter--fixed");
    $(".filter__tag").removeClass("filter__tag--fixed");
    $(".filter__title").removeClass("filter__title--fixed");
  }
  
});
            
          
!
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.
Loading ..................

Console