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

              
                <body>
  <div class="header">
  <h1 class="title"> Move your cursor over the blacked out areas of the cards | background colors are choosen at random each time </h1>
  </div>
<div class="container">
    <div class="card" id="change">
    <div class="face face1">
      <div class="content">
        <img src="">
        <h3>Education</h3>
      </div>
    </div>
    <div class="face face2">
      <div class="content">
        <p>descriptive text here</p>
        <a href="#">View Projects</a>
      </div>
    </div>
  </div>
  <div class="card">
    <div class="face face1">
      <div class="content">
        <img src="">
        <h3>Code</h3>
      </div>
    </div>
    <div class="face face2">
      <div class="content">
        <p>descriptive text here</p>
        <a href="#">View Projects</a>
      </div>
    </div>
  </div>
  <div class="card">
    <div class="face face1">
      <div class="content">
        <img src="">
        <h3>Design</h3>
      </div>
    </div>
    <div class="face face2">
      <div class="content">
        <p>descriptive text here</p>
        <a href="#">View Projects</a>
      </div>
    </div>
  </div>
  </div>
</body>

              
            
!

CSS

              
                body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: black;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-family: consolas;
}

.title {
  flex:1 0 100%;
  color:white;
  font-size: 1.5em;
}
.header {
  padding: 5%;
  margin: 10px;
}
.container {
  width: 1000px;
  position: relative;
  display: flex;
  justify-content: space-between;
}

.container .card {
  position: relative;
}

.container .card .face {
  width:300px;
  height:200px;
  transition: 0.5s; 
}

.container .card .face.face1 {
  position: relative;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

/* .container .card:hover .face.face1 {
  background: #A4C64E;
} */

.container .card .face.face1 .content{
  opacity:.02;
  transition:0.5s;
  
}

.container .card:hover .face.face1 .content{
  opacity:1;
}

.container .card .face.face1 .content img{
  max-width: 100px;
}

.container .card .face.face1 .content h3{
  margin: 10px 0 0;
  padding: 0;
  color: #fff;
  text-align: center;
  font-size: 1.5em
}

.container .card .face.face2 {
  position: relative;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rbga(0,0,0,0.8);

}

.container .card .face.face2 .content a{
  margin: 15px 0 0;
  display: inline-block;
  text-decoration: none;
  font-weight: 900;
  color: #333;
  padding: 5px;
  border: 1px solid #333
}
.container .card .face.face2 .content a:hover{
  background:#333;
  color:#fff;
}

/* ----- Responsive adjustments to smaller viewport */

@media screen and (max-width:925px){
  .container{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .card{
    margin: 20px;
  }
}
              
            
!

JS

              
                var colorChange = $('.container .card .face.face1');
var original = colorChange.css('background');
var colors = ['#AC4EC6', ' #A4C64E', '#C6704E', '#C6AC4E', '#C64E68','#C64EA4','#4B99C2'];

colorChange.hover(function () {
// defines location of new color in the colors array
    var hexLocation = Math.floor(Math.random() * colors.length);
    var newcolor = colors[hexLocation];
  
//replaces background property with new color when hovering
    $(this).css('background', newcolor);
}, function() {
 //replaces background property with original color when NOT hovering
    $(this).css('background', original);
});

              
            
!
999px

Console