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

              
                <div id="wrapper">
  <div id="container">
    
    <div class="information-column">
      <div class="content">
        <img class="logo" src="http://enwaara.se/codepen/spotify.svg"/>

        <h1>Choose a subscribtion and start the party</h1>
        <p>Find all your favorite tracks and create the best playlist ever</p>
      </div>
    </div>
    
    <div class="form-column">
      
      <div class="subscribtion free">
          <h2>Free</h2>
          <p>Unlimited music online</p>
      </div>

      <div class="subscribtion family">
          <h2>Family</h2>
          <p>Unlimited music for the whole family</p>
      </div>

      <div class="subscribtion premium">
          <h2>Premium</h2>
          <p>Unlimited music anywhere, anytime both online and offline</p>
      </div>
      
     <form class="form">
        
        <label>Email</label>
        <input type="email" placeholder="Your email here">
        
        <label>Password</label>
        <input type="password" placeholder="Your password here">
       
       <div class="free-button btn">Start litsening</div>
       
        <label class="payment free-form">Payment</label>
        <div class="klarna payment-btn btn free-form"><img src="https://cdn.klarna.com/1.0/shared/image/generic/logo/de_de/basic/logo_white.png"/></div>
        <div class="paypal payment-btn btn free-form"><img src="https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom-white.svg"/></div>
       <div class="card payment-btn btn free-form">Card</div>
       
       <div class="next free-form btn">Next<i class="fa fa-angle-right"></i></div>
        
      </form>
      
    </div>
    
  </div>
</div>
              
            
!

CSS

              
                @mixin border-radius($radius) {
  -webkit-border-radius: $radius;
  -moz-border-radius: $radius;
  -ms-border-radius: $radius;
  border-radius: $radius;
}

$primary-color: #f1f2f6;
$secondary-color: #ff6b81;
$decor-color: #2EBD59;
$font: "museo-sans", sans-serif;

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-transition: 0.2s ease-in-out;
  -moz-transition: 0.2s ease-in-out;
  -o-transition: 0.2s ease-in-out;
  transition: 0.2s ease-in-out;
  font-family: $font;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: $primary-color;
  &:focus{
    outline: none;
  }
}

body{
  background-color: #DEFFE7;
}

#wrapper{
   position: absolute;
   top: 50%;
   margin-top: -240px;
   left: 0;
   width: 100%;
}

#container{
  width: 720px;
  height: 480px;
  margin: 0 auto;
  box-shadow: 1px 1px 10px 2px rgba(0,0,0,0.2);
  @include border-radius(5px);
  overflow: hidden;
}

.information-column {
  width: 40%;
  height: 100%;
  overflow: hidden;
  float: left;
  position: relative;
  background-image: url('http://enwaara.se/codepen/music.jpeg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.content {
  width: 100%;
  height: 100%;
  padding: 30px;
  background: -moz-linear-gradient(-45deg, rgba(241,242,246,0.9) 0%, rgba(227,228,232,0.9) 45%, rgba(214,215,219,0.9) 100%);
  background: -webkit-linear-gradient(-45deg, rgba(241,242,246,0.9) 0%,rgba(227,228,232,0.9) 45%,rgba(214,215,219,0.9) 100%);
  background: linear-gradient(135deg, rgba(241,242,246,0.9) 0%,rgba(227,228,232,0.9) 45%,rgba(214,215,219,0.9) 100%);
  h1 {
    width: 100%;
    margin-top: 32px;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
    color: $decor-color;
    text-shadow: -1px 1px 2px $secondary-color;
  }
  p {
    width: 62%;
    font-size: 0.8em;
    letter-spacing: 1px;
    line-height: 1.6em;
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: #a4b0be;
  }
}

.logo {
  width: 40%;
  height: auto;
}

.form-column {
  width: 60%;
  height: 100%;
  padding: 50px;
  float: right;
  background: rgb(46,189,89);
  background: -moz-linear-gradient(45deg, rgba(46,189,89,1) 0%, rgba(50,201,93,1) 54%, rgba(57,229,97,1) 100%);
  background: -webkit-linear-gradient(45deg, rgba(46,189,89,1) 0%,rgba(50,201,93,1) 54%,rgba(57,229,97,1) 100%);
  background: linear-gradient(45deg, rgba(46,189,89,1) 0%,rgba(50,201,93,1) 54%,rgba(57,229,97,1) 100%);
}

.subscribtion {
  width: 100%;
  overflow: hidden;
  padding: 12px;
  margin-bottom: 24px;
  border: 2px solid $primary-color;
  @include border-radius (4px);
  cursor: pointer;
  &:nth-child(1) {
    margin-top: 24px;
  }
  h2 {
    width: 60%;
    font-weight: 700;
    font-size: 1.4em;
    letter-spacing: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid $primary-color;
    margin-bottom: 8px;
  }
  p {
    width: 80%;
    font-size: 0.8em;
    line-height: 1.4em;
  }
  &:hover {
    box-shadow: 0px 0px 10px 0px $secondary-color;
  }
  &.active {
    background-color: $primary-color;
    &:nth-child(1) {
      margin-top: 0px;
    }
    h2 {
      color: $decor-color;
      border-color: $decor-color;
    }
    p {
      color: $decor-color;
    }
  }
  &.hidden {
    height: 0;
    margin: 0;
    padding-bottom: 0;
    padding-top: 0;
    opacity: 0;
  }
}

.form {
  width: 100%;
  opacity: 0;
  &.active {
    opacity: 1;
  }
  label {
    display: block;
    width: 100%;
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  input {
    width: 100%;
    padding: 8px;
    border: none;
    background: none;
    border-bottom: 1px solid $primary-color;
    margin-bottom: 12px;
    font-size: 0.8em;
    color: $primary-color;
    letter-spacing: 1px;
    &::-webkit-input-placeholder {
      color: #009432;
      -webkit-transition: 0.2s ease-in-out;
      -moz-transition: 0.2s ease-in-out;
      -o-transition: 0.2s ease-in-out;
      transition: 0.2s ease-in-out;
    }
    &::-moz-placeholder {
      color: #009432;
      -webkit-transition: 0.2s ease-in-out;
      -moz-transition: 0.2s ease-in-out;
      -o-transition: 0.2s ease-in-out;
      transition: 0.2s ease-in-out;
    }
    &:-ms-input-placeholder {
      color: #009432;
      -webkit-transition: 0.2s ease-in-out;
      -moz-transition: 0.2s ease-in-out;
      -o-transition: 0.2s ease-in-out;
      transition: 0.2s ease-in-out;
    }
    &:-moz-placeholder {
      color: #009432;
      -webkit-transition: 0.2s ease-in-out;
      -moz-transition: 0.2s ease-in-out;
      -o-transition: 0.2s ease-in-out;
      transition: 0.2s ease-in-out;
    }
    &:focus {
      &::-webkit-input-placeholder {
        color: $primary-color;
      }
      &::-moz-placeholder {
        color: $primary-color;
      }
      &:-ms-input-placeholder {
        color: $primary-color;
      }
      &:-moz-placeholder {
        color: $primary-color;
      }
    }
  }
}

.payment {
  margin-top: 12px;
}

.payment-btn.active {
  
}

.btn {
  width: 30.33%;
  float: left;
  margin-right: 4%;
  margin-top: 12px;
  height: 40px;
  padding-top: 12px;
  text-align: center;
  background-color: $primary-color;
  color: $decor-color;
  font-weight: 700;
  font-size: 0.8em;
  letter-spacing: 2px;
  @include border-radius(4px);
  border: none;
  cursor: pointer;
  i {
    margin-left: 8px;
  }
}
.klarna {
  background-color: #fa82a0;
  img {
    width: 50%;
    height: auto;
    margin-top: 2px;
  }
  &:hover, &.active {
    background-color: #F9688D;
  }
}
.paypal {
  background-color: #009cde;
  img {
    width: 60%;
    height: auto;
  }
  &:hover, &.active {
    background-color: #008DCE;
  }
}
.card {
  margin-right: 0;
  &:hover, &.active{
    box-shadow: 0px 0px 10px 0px $secondary-color;
  }
}
.free-button {
  width: 100%;
  margin-right: 0;
  margin-top: 8px;
  display: none;
  &:hover {
    box-shadow: 0px 0px 10px 0px $secondary-color;
  }
  &.active {
    display: block;
  }
}

.next {
  width: 100%;
  margin-right: 0;
  margin-top: 12px;
  i {
    color: $decor-color;
    margin-left: 8px;
  }
  &:hover {
    i {
      margin-left: 12px;
    }
  }
}

.free-form.hidden {
  height: 0;
  opacity: 0;
  display: none;
}
              
            
!

JS

              
                $('.subscribtion').click(function(){
  
  if($(this).hasClass('active')) {
    
    $(this).removeClass('active');
    $('.form').removeClass('active');
    
    if($(this).hasClass('free')) {
      $('.family').removeClass('hidden');
      $('.premium').removeClass('hidden');
      $('.free-form').removeClass('hidden');
      $('.free-button').removeClass('active');
    }
    if($(this).hasClass('family')) {
      $('.free').removeClass('hidden');
      $('.premium').removeClass('hidden');
    }
    if($(this).hasClass('premium')) {
      $('.free').removeClass('hidden');
      $('.family').removeClass('hidden');
    }
    
  }
  else {
    $(this).addClass('active');
    
    if($(this).hasClass('free')) {
      $('.family').addClass('hidden');
      $('.premium').addClass('hidden');
      $('.free-form').addClass('hidden');
      $('.free-button').addClass('active');
    }
    if($(this).hasClass('family')) {
      $('.free').addClass('hidden');
      $('.premium').addClass('hidden');
    }
    if($(this).hasClass('premium')) {
      $('.free').addClass('hidden');
      $('.family').addClass('hidden');
    }
    
    $('.form').addClass('active');
  }
  
});

$('.payment-btn').click(function(){
  
  if( $(this).hasClass('active') ) {
    $(this).removeClass('active');
  }
  else {
    $('.payment-btn').removeClass('active');
    $(this).addClass('active');
  }
  
})
              
            
!
999px

Console