cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <!-- 
Made with love by Mark Ostrander
https://meostrander.com
-->

<p id="title">css 
</p>
<p id="subtitle">Overlays</p>
<div class="container">

  <!--  slide up  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/wrzf9P70YWLJK/giphy.gif">
    <div id="overlay">
      <h2 class="img-title">slide up</h2>
      <p class="fa fa-arrow-circle-up fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  slide down  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/fLK0eUlYZoB6E/giphy.gif">
    <div id="overlay2">
      <h2 class="img-title">slide down</h2>
      <p class="fa fa-arrow-circle-down fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  slide left  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/ci0uDcGQtBh0k/giphy.gif">
    <div id="overlay3">
      <h2 class="img-title">slide left</h2>
      <p class="fa fa-arrow-circle-left fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  slide right  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/MLi42SVDV49kQ/giphy.gif">
    <div id="overlay4">
      <h2 class="img-title">slide right</h2>
      <p class="fa fa-arrow-circle-right fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  fade in  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/a0Lgc1JvbfS4o/giphy.gif">
    <div id="overlay5">
      <h2 class="img-title">fade in</h2>
      <p class="fa fa-plus-square-o fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  rotate Y  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/3o8doU16qbBTKwXYTm/giphy.gif">
    <div id="overlay6">
      <h2 class="img-title">rotate y</h2>
      <p class="fa fa-rotate-left fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  rotate X  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/XXvnnrJJnOVl6/giphy.gif">
    <div id="overlay7">
      <h2 class="img-title">rotate x</h2>
      <p class="fa fa-rotate-right fa-4x img-icon"></p>
    </div>
  </div>

  <p class="fa fa-angle-down fa-2x"></p>

  <!--  scale out  -->
  <div class="resource">
    <img src="https://media.giphy.com/media/XreQmk7ETCak0/giphy.gif">
    <div id="overlay8">
      <h2 class="img-title">scale out</h2>
      <p class="fa fa-arrows-alt fa-4x img-icon"></p>
    </div>
  </div>
</div>
            
          
!
            
              // Variables
$background: #DDDDDD;
$main: #16a085;
$overlay: #000000;

// General
body {
  background: $background;
  color: $main;
  font-family: 'Oxygen', Arial;
  text-align: center;
}

#title,
#subtitle {
  font-size: 2.5em;
  letter-spacing: .3em;
  color: $main;
  margin: 0;
  text-transform: uppercase;
  font-family: 'Bungee', Arial;
}

.container {
  margin: 20px auto;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.resource {
  margin: 2px;
  width: 400px;
  height: 250px;
  position: relative;
  color: white;
  overflow: hidden;
  box-shadow: 5px 5px 10px grey;
  img {
    width: 100%;
    height: 100%;
  }
}

.img-title {
  font-weight: 300;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.img-title,
.img-icon {
  margin: 0;
}

// slide up
#overlay {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

// slide down
#overlay2 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

// slide left
#overlay3 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

// slide right
#overlay4 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

// fade in
#overlay5 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

// ratote Y
#overlay6 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  transform: rotateY(90deg);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

// ratote X
#overlay7 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  transform: rotateX(90deg);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

// scale out
#overlay8 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba($overlay, .85);
  width: 100%;
  height: 100%;
  position: absolute;
  top: auto;
  bottom: 0;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.resource:hover {
  img {
    transform: scale(2);
    transition: transform 0.5s;
  }
  #overlay5 {
    opacity: 1;
  }
  #overlay,
  #overlay2 {
    opacity: 1;
    transform: translateY(0px);
  }
  #overlay3,
  #overlay4 {
    opacity: 1;
    transform: translateX(0px);
  }
  #overlay6,
  #overlay7 {
    opacity: 1;
    transform: rotateY(0deg);
  }
  #overlay8 {
    opacity: 1;
    transform: scale(1);
  }
}
            
          
!
999px
Loading ..................

Console