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.

            
              <h1>Time Left in Dry January 2019</h1>
<p id="counter"></p>
<div class="card">
  <div class="card-bg"></div>
  <div class="card-content">
    <div class="card-header">
      <p class="card-headline">Old Fashioned</p>
      <ul>
        <li><span>2 oz. Bourbon</span></li>
        <li><span>3 Dashes of Bitters</span></li>
        <li><span>2 Luxardo Cherries*</span></li>
        <li><span>Orange Peel</span></li>
      </ul>
    </div>
    <div class="fine-print">
      <p>*3 to make it an "Old Chilcote"</p>
    </div>
  </div>
  <div class="hidden-text-container">
      <h2 id="hidden-text">Hang in there!</h2>
  </div>
</div>
<p>&uarr;&nbsp;Hover&nbsp;&uarr;</p>
<!-- <footer class="footer">
    <div class="socialLinks">
      <a href="https://github.com/letsbleachthis" target="_blank" class="iconSocial"><i class="fab fa-github"></i></a>
      <a href="https://dribbble.com/LaurenChilcote" target="_blank" class="iconSocial"><i class="fab fa-dribbble"></i></a>
      <a href="https://www.linkedin.com/in/laurenchilcote/" target="_blank" class="iconSocial"><i class="fab fa-linkedin"></i></a>
      <a href="https://twitter.com/LaurenChilcote" target="_blank" class="iconSocial"><i class="fab fa-twitter"></i></a>
    </div>
  </footer> -->

            
          
!
            
              html {
  --fontMono: 'Inconsolata', monospace;
  --fontSans: 'Montserrat', sans-serif;
  --fontAwesome: 'Font Awesome 5 Free';
  
  --primaryColorDark: #000;
  --primaryColorLight: #fff;
  --popColor: #FF1EAD;
}
*, *:before, *:after {
	box-sizing: border-box;
	outline: none;
}

//Mixins
@mixin h1Text {
  font-family: var(--fontSans);
  font-size: 1.5em;
  letter-spacing: 0.1em;
  line-height: 1.2em;
  font-weight: 500;
  margin: 0.25em 0;
  text-align: center;
  text-transform: uppercase;
}
@mixin cardHeadline {
  font-family: var(--fontSans);
  font-size: 2.5em;
  line-height: 1.1em;
  font-weight: 700;
  margin: 0.25em 0;
  text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.5);
}
@mixin h2Text {
  font-family: var(--fontSans);
  font-size: 1.5em;
  line-height: 1.75em;
  font-weight: 700;
  margin: 0.25em 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
@mixin unorderedList {
  list-style-type: none;
  padding-left: 0;
  
  li {
    font-family: var(--fontMono);
    font-size: 1.2em;
    line-height: 1.75em;
    font-weight: 500;
    margin: 0.25em 0;
    text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.5);
    
    span {
     background: var(--primaryColorDark);
     padding: 4px;
    }
  }
}
@mixin paragraphText {
  font-family: var(--fontSans);
  font-size: 0.85em;
  line-height: 1.5em;
  font-weight: 500;
  margin: 0.25em 0;
}

//General Styles
body {
  padding: 2em;
	position: relative;
	display: flex;
  flex-direction: column;
	align-items: center;
	justify-content: center;
  min-width: 400px;
	width: 100%;
	height: 100vh;
	background-color: var(--primaryColorLight);
}
h1 {
  @include h1Text;
  color: var(--popColor);
}
h2 {
  @include h2Text;
}
p {
  @include paragraphText;
  
  &.card-headline {
    @include cardHeadline;
  }
}
ul {
  @include unorderedList;
}
#counter {
  font-family: var(--fontMono);
  font-size: 1.25em;
  line-height: 1.2em;
}
.card {
  margin: 1em;
  position: relative;
  width: 50vw;
  min-width: 300px;
  max-width: 600px;
  height: 60vh;
  min-height: 300px;
  border-radius: 8px;
  box-shadow: 0 5px 70px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  color: var(--primaryColorLight);
  transition: all 0.5s ease;
  
  .card-content {
    padding: 0.75em 1.5em 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 1;
    opacity: 1;
  }
  &:before {
    content: '';
    position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
    transition: opacity 0.7s ease;
  }
  .hidden-text-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    #hidden-text {
      z-index: 2;
      opacity: 0;
      transition: opacity 1s ease;
    }
  }
  //on card hover...
  &:hover {
    &:before {
      background-color: var(--popColor);
      opacity: 0.7;
    }
    .card-content {
      opacity: 0;
    }
    #hidden-text {
      opacity: 1;
    }
  }
}
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("https://www.thecocktailproject.com/sites/default/files/styles/recipe-slider-img/public/knobcreek_oldfashioned_beauty_7832-4868-Edit.jpg?itok=cLs3oxvF") no-repeat;
  background-size: cover;
  background-position: left top;
}
.fine-print {
    background-color: var(--popColor);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35em 1.2em;
    border-radius: 3px 3px 0 0;
    color: var(--primaryColorLight);
    font-size: 0.85em;
    width: fit-content;
  }
//Footer
.footer {
  margin: 1em 0 0;
  
  .socialLinks {
    display: flex;
    flex-direction: row;
    justify-content: center;
    
    .iconSocial {
      margin: 0 0.5em;
      width: 41px;
      height: 41px;
      border-radius: 100%;
      background: var(--primaryColorDark);
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      transition: all 150ms ease-in;
      
      .fab {
        font-size: 19px;
        color: var(--primaryColorLight);
      }
      &:hover {
        background: var(--popColor); 
        
        .fab {
          color: var(--primaryColorLight);
        }
      }
    }
  }
}
            
          
!
            
              // Set the date we're counting down to
var countDownDate = new Date("Feb 1, 2019 01:00:00").getTime();

// Update the count down every 1 second
var x = setInterval(function() {

  // Get todays date and time
  var now = new Date().getTime();
    
  // Find the distance between now and the count down date
  var distance = countDownDate - now;
    
  // Time calculations for days, hours, minutes and seconds
  var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    
  // Output the result in an element with id="demo"
  document.getElementById("counter").innerHTML = days + "d " + hours + "h "
  + minutes + "m " + seconds + "s ";
  
  // If the count down is over, write some text 
  if (distance < 0) {
    clearInterval(x);
    document.getElementById("counter").innerHTML = "None! It's drinkin' time.";
    document.getElementById("hidden-text").innerHTML = "Cheers!";
  }
}, 1000);
            
          
!
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