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.

            
              <div id="container">
  <h1>Web design panel</h1>
  <h2>Choose your flavor</h2>
  <div class="panel">
    <div class="input-mask">
      <label class="label label-good"><input type="radio" name="good" id="good"/> Good</label>
    </div>

    <div class="input-mask">
      <label class="label label-cheap"><input type="radio" name="cheap" id="cheap"/>Cheap</label>
    </div>

    <div class="input-mask">
      <label class="label label-fast"><input type="radio" name="fast" id="fast"/>Fast</label>
    </div>
    
  </div>  
  
</div>
            
          
!
            
              body 
  background #e4ecf0
  font-family 'Raleway'
  
#container 
  width 400px 
  max-width 90%
  padding-top 30px
  position absolute
  top 50%
  left 50%
  transform translate(-50%, -50%)
  background-color rgba(255,255,255,0.6)
  box-shadow -1px 1px 6px rgba(0,0,0,0.15)
  border-radius 8px
h1 
  font-size 36px
  font-weight 300
  text-align center
  margin-bottom 0.5em
  color #444f54
h2 
  font-weight 700
  font-size 14px
  text-align center
  margin-bottom 2em
  color #839fd6
.panel 
  padding 30px 30px 20px
  border-top 1px solid rgba(80,80,80,0.1)
 
.label
  position relative
  display inline-block
  font-size 30px
  line-height 1em
  margin-top 0.5em
  margin-bottom 1em
  padding-left 100px
  cursor pointer
  font-weight 600
  &:before,
  &:after
    content ''
    display block
    position absolute
    transform translateY(-50%)
    top 50%
    transition all 0.7s ease
  &:before
    width 60px
    height 18px 
    border-radius 9px
    background-color #aaa
    left 0
  &:after 
    width 30px
    height 30px
    background-color #ccc
    border-radius 50%
    left -5px
input[type=radio]
  opacity 0
  //visibility none
  display none

.label.active
  &:after
    left 35px
  
.label-good.active
  &:before
    background-color #79a16d
  &:after
    background-color #6dbe56
    
.label-cheap.active
  &:before
    background-color #6d7ea1
  &:after 
    background-color #5574bd
    
.label-fast.active
  &:before
    background-color #a26d74 
  &:after  
    background-color #bd5562
            
          
!
            
              //console.clear();

var uncheck = function (el){
  console.log(el);
  $(el).prop('checked', false);
  $(el).parent().removeClass('active');
};

var checkOptions = function(optionTry){
  var good = $('#good')[0].checked;
  var cheap = $('#cheap')[0].checked;
  var fast = $('#fast')[0].checked;
  var option = optionTry;
  
  if (good && option == 'cheap') {
      uncheck('#fast');
    
  } else if (cheap && option == 'fast') {
      uncheck('#good');
          
  } else if (fast && option == "good") {
    uncheck('#cheap');     
  }
  //console.log(optionTry);
  //console.log(good, cheap, fast);
}

$(function(){
  $(':radio').on('change', function(){
    var id = $(this)[0].id;
    $(this).parent().addClass('active');
    checkOptions(id);
  });
});
            
          
!
999px
Loading ..................

Console