Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <div id="gift"></div>
              
            
!

CSS

              
                /**
 * Variables
 */
$color__light_blue: #CAE4F2;
$color__dark_blue: #2A6FB0; /* 42, 111, 176 */
$color__dark_blue_alpha: rgba(42,111,176,0.3);
$color__dark_blue_dark_alpha: rgba(42,111,176,0.8);
$color__light_green: #65C0A5;
$color__dark_green: #0B8972; /* #35a66f
*/
$color__dark_green_alpha: #6DB8AA;
$color__light_red: #F17259;
$color__light_red_alpha: #F38E7A;
$color__dark_red: #9D1313;

$font_stack__body: 'Nunito', 'Quicksand', 'Valero Round', sans-serif;
$font_stack__headings: 'Sonsie One', cursive;

$section_height: 100vh;
$section_width: calc( 100vw + 17px );
$post_width: 600px;

* {
  position: relative;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-size: 16px;
  background: $color__light_blue;
  font-family: $font_stack__body;
  font-weight: 100;
  letter-spacing: -0.2px;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
  font-family: $font_stack__headings;
}

/**
 * Gift Component
 */
.day {
  height: 100vh;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0;
}
.bow {
    position: relative;
    width: 212px;
    height: 100px;
}
.bow:before,
.bow:after {
    content: "";
    position: absolute;
    top: -60px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-right: 25px solid $color__dark_green;
  border-bottom: 25px solid $color__light_green;
  border-top: 25px solid $color__light_green;
  border-left: 25px solid $color__dark_green;
    -moz-border-radius: 50px 150px 0 150px;
         border-radius: 50px 150px 0 150px;
    -webkit-transform: rotate(-35deg);
       -moz-transform: rotate(-35deg);
        -ms-transform: rotate(-35deg);
         -o-transform: rotate(-35deg);
            transform: rotate(-35deg);
}
.bow:after {
    left: 160px;
    right: 0;
    -moz-border-radius: 150px 50px 150px 0;
         border-radius: 150px 50px 150px 0;
    -webkit-transform: rotate(35deg);
       -moz-transform: rotate(35deg);
        -ms-transform: rotate(35deg);
         -o-transform: rotate(35deg);
            transform: rotate(35deg);
}
.present-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}
.present {
  width: 300px;
  height: 300px;
  background: $color__dark_red;
  border-radius: 10px;
  box-shadow: 2px 2px 5px $color__dark_blue;
  transform: scale(1); 
  transition: 0.1s ease-in all;
}
.present:hover {
  cursor: pointer;
  transform: scale(1.2);
}
/* horizontal green ribbon */
.present:before {
  box-sizing: border-box;
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 60px;
  background: $color__light_green;
  border-top: 15px solid $color__dark_green;
  border-bottom: 15px solid $color__dark_green;
  display: block;
}
/* vertical green ribbon */
.present:after {
  box-sizing: border-box;
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 100%;
  background: $color__light_green;
  border-left: 15px solid $color__dark_green;
  border-right: 15px solid $color__dark_green;
  display: block;
}
.present h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: $color__dark_green;
  text-align: center;
  font-size: 2.5em;
  line-height: 2.25em;
  letter-spacing: -2px;
  z-index: 5;
  background: white;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  padding: 5px;
  box-shadow: 2px 2px 5px rgba(60,60,60,1);
}
.present h1 span {
  margin-left: -2px;
  font-size: 0.25em;
}
.ribbon,
.present h1:before {
  content: "";
  display: block;
  position: absolute;
  z-index: 1;
  width: 50px;
  height: 50px;
  background: $color__light_green;
  border-radius: 50%;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
}
.present h1:before {
  top: -130px;
  z-index: 2;
  box-shadow: 1px 1px 3px $color__dark_green;
}
.ribbon:before,
.ribbon:after {
  content: '';
  display: block;
  position: absolute;
  height: 80px;
  width: 0px;
  // background: $color__dark_green;
  top: 20px;
  left: -30px;
  border-right: 15px solid $color__light_green;
  border-left: 15px solid $color__dark_green;
  border-top: 15px solid $color__light_green;
  border-bottom: 15px solid transparent;
    -webkit-transform: rotate(35deg);
       -moz-transform: rotate(35deg);
        -ms-transform: rotate(35deg);
         -o-transform: rotate(35deg);
            transform: rotate(35deg);
}
.ribbon:after {
  right: -30px;
  left: auto;
    -webkit-transform: rotate(-35deg);
       -moz-transform: rotate(-35deg);
        -ms-transform: rotate(-35deg);
         -o-transform: rotate(-35deg);
            transform: rotate(-35deg);
}

/**
 * CSS Styles for the Gift Tag
 */
.tag {
  display: block;
  border-right: 50px solid transparent;
  background: tan;
  height: 90px;
  width: 100px;
  max-width: 200px;
  font-family: "Satisfy";
  position: absolute;
  top: 25px;
  right: -60px;
  transform: rotate(30deg);
}
.tag:before {
  border-right: 45px solid tan;
  border-top: 45px solid transparent;
  border-left: 45px solid transparent;
  border-bottom: 45px solid transparent;
  position: absolute;
  top: 0;
  left: -90px;
  content: '';
  display: block;
}
.tag:after {
  border-right: 45px solid transparent;
    border-top: 45px solid tan;
    border-left: 45px solid tan;
    border-bottom: 45px solid tan;
    position: absolute;
    top: 0;
    right: -140px;
    content: '';
    display: block;
}
.tag p {
  position: absolute;
  border-top: 3px solid brown;
  border-bottom: 3px solid brown;
  height: 80px;
  width: 188px;
  left: -5px;
  top: 5px;
  padding: 1em 50px 1em 15px;
}
.tag input {
  background: transparent;
  font-family: Satisfy;
  font-size: 1.5em;
  width: 100px;
  outline: none;
  border: none;
}
.tag input:hover {
  background: rgba(0,0,0,0.1);
}
.tag button {
  position: absolute;
  top: 25px;
  left: -30px;
  font-size: 1.2em;
  background: transparent;
  outline: none;
  border: none;
}
.tag button:before {
  position: absolute;
  top: -5px;
  left: -90px;
  z-index: 1;
  display: block;
  content: '';
  border-radius: 50%;
  width: 110px;
  height: 110px;
  border-top: 3px solid gold;
  border-right: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 3px solid transparent;
}


.tag li:hover {
  cursor: pointer;
}

.tag li:hover .tag-front {
  -webkit-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  -ms-transform: rotateY(180deg);
  -o-transform: rotateY(180deg);
  transform: rotateY(180deg);
  -webkit-transform: perspective(1000) rotateY(180deg);
  -moz-transform: perspective(1000) rotateY(180deg);
  -ms-transform: perspective(1000) rotateY(180deg);
  -o-transform: perspective(1000) rotateY(180deg);
  transform: perspective(1000) rotateY(180deg);
}

.tag li:hover .tag-back {
  z-index: 950;
  -webkit-transform: rotateY(0deg);
  -moz-transform: rotateY(0deg);
  -ms-transform: rotateY(0deg);
  -o-transform: rotateY(0deg);
  transform: rotateY(0deg);
  -webkit-transform: perspective(1000) rotateY(0deg);
  -moz-transform: perspective(1000) rotateY(0deg);
  -ms-transform: perspective(1000) rotateY(0deg);
  -o-transform: perspective(1000) rotateY(0deg);
  transform: perspective(1000) rotateY(0deg);
}

.tag .tag-front,
.tag .tag-back {
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  -ms-backface-visibility: hidden;
  -o-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: -webkit-transform 0.6s;
  -moz-transition: -moz-transform 0.6s;
  -o-transition: -o-transform 0.6s;
  transition: transform 0.6s;
  display: block;
  // height: 100%;
  position: absolute;
  // width: 100%;
}

.tag .tag-front {
  -webkit-transform: perspective(1000) rotateY(0);
  -moz-transform: perspective(1000) rotateY(0);
  -ms-transform: perspective(1000) rotateY(0);
  -o-transform: perspective(1000) rotateY(0);
  transform: perspective(1000) rotateY(0);
  z-index: 900;
}

.tag .tag-back {
  -webkit-transform: rotateY(-180deg);
  -moz-transform: rotateY(-180deg);
  -ms-transform: rotateY(-180deg);
  -o-transform: rotateY(-180deg);
  transform: rotateY(-180deg);
  z-index: 800;
}
              
            
!

JS

              
                /*
 * Let it snow!
 */
$.fn.snow();

/**
 * Gift Component
 */
var Gift = React.createClass({
  render: function() {
    return (
      <section id="day1" className="day">
  <div className="present-wrap">
  <div className="present">
    <span className="bow"></span>
    <span className="ribbon"></span>
    <h1 className="present-title">1<span>st</span></h1>
    <div className="tag">
       <p className="tag-front">
        To: <input type="text" value="Aaron"/>
        <button>O</button>
       </p>
      <p className="tag-back">
        From: <input type="text" value="Santa" />
        <button>O</button>
       </p>
     </div>
  </div>
  </div>
</section>
    )
  }
});
ReactDOM.render(
  <Gift/>,
  document.querySelector("#gift")
);

var now = new Date();
var date = now.getDate();
var suffix = "th";

if( date == 1 || date == 21 ) { 
  suffix = "st"; 
} else if( date == 2 || date == 22 ) {
  suffix = "nd";
} else if ( date == 3 || date == 23 ) {
  suffix = "rd";
} 
$('.present-title').html(date + "<span>" + suffix + "</span>");


              
            
!
999px

Console