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 class="options">
    <label class="option">
        <input type="radio" name="company" value="apple" checked>
        <div class="option-content">
            <h1 class="animated bounceIn"><i class="ion-social-apple-outline"></i></h1>
            <h4>APPLE</h4>
            <h4><i class="ion-android-radio-button-on"></i></h4>
        </div>
        <div class="on-checked"></div>
    </label>
    <label class="option">
        <input type="radio" name="company" value="facebook">
        <div class="option-content">
            <h1 class="animated bounceIn"><i class="ion-social-facebook-outline"></i></h1>
            <h4>FACEBOOK</h4>
            <h4><i class="ion-android-radio-button-on"></i></h4>
        </div>
        <div class="on-checked"></div>
    </label>
    <label class="option">
        <input type="checkbox" name="social" value="tumblr" checked>
        <div class="option-content">
            <h1 class="animated bounceIn"><i class="ion-social-tumblr-outline"></i></h1>
            <h4>TUMBLR</h4>
            <h4><i class="ion-android-checkbox-outline"></i></h4>
        </div>
        <div class="on-checked"></div>
    </label>
    <label class="option">
        <input type="checkbox" name="social" value="twitter">
        <div class="option-content">
            <h1 class="animated bounceIn"><i class="ion-social-twitter-outline"></i></h1>
            <h4>TWITTER</h4>
            <h4><i class="ion-android-checkbox-outline"></i></h4>
        </div>
        <div class="on-checked"></div>
    </label>
</div>

<a id="toggle-alert"><i class="ion-ios-chatboxes"></i><span>OFF Alert</span></a>
            
          
!
            
              // <START> demo code
body,
html {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    min-height: inherit;
    width: 100%;
    max-width: 100%;
    font-size: 1rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ff5f6d 20%, #ffc371 80%);
    color: #fff;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
}

* {
    padding: 0px;
    margin: 0px;
}

h1 {
    font-size: 6em;
    font-weight: 700!important;
    text-shadow: 1px 1px rgba(0, 0, 0, 0.02), 2px 2px rgba(0, 0, 0, 0.02), 3px 3px rgba(0, 0, 0, 0.02), 4px 4px rgba(0, 0, 0, 0.02), 0.125rem 0.125rem rgba(0, 0, 0, 0.02), 6px 6px rgba(0, 0, 0, 0.02), 7px 7px rgba(0, 0, 0, 0.02), 8px 8px rgba(0, 0, 0, 0.02), 9px 9px rgba(0, 0, 0, 0.02), 0.3125rem 0.3125rem rgba(0, 0, 0, 0.02), 11px 11px rgba(0, 0, 0, 0.02), 12px 12px rgba(0, 0, 0, 0.02), 13px 13px rgba(0, 0, 0, 0.02), 14px 14px rgba(0, 0, 0, 0.02), 0.625rem 0.625rem rgba(0, 0, 0, 0.02), 16px 16px rgba(0, 0, 0, 0.02), 17px 17px rgba(0, 0, 0, 0.02), 18px 18px rgba(0, 0, 0, 0.02), 19px 19px rgba(0, 0, 0, 0.02), 1.25rem 1.25rem rgba(0, 0, 0, 0.02);
}

h4,
h5 {
    margin-top: 1em;
    letter-spacing: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 100%;
    font-weight: normal;
}

p {
    font-size: 0.875em;
    margin-bottom: 1em;
    line-height: 160%;
}

#toggle-alert {
    position: fixed;
    z-index: 1000;
    right: 1.5em;
    top: 1.5em;
    display: block;
    border: 1px solid #fff;
    padding: 1em 1.8em;
    font-size: 0.6125em;
    border-radius: 100em;
    cursor: pointer;
    transition: .3s ease-out all;
    i {
      margin-right: 0.7em;
      line-height: 100%;
      opacity: .7;
      font-size: 1rem;
    }
    &:hover {
        border-color: #ffc371;
        color: #ffc371;
    }
}

// <START> option code

.options {
    display: table;
    border-collapse: collapse;
    width: 100%;
    height: inherit;
    table-layout: fixed; // equal .option width
    >.option {
        position: relative;
        overflow: hidden;
        display: table-cell;
        vertical-align: middle;
        transform: translate3d(0, 0, 0);
        transition-property: background;
        transition-timing-function: cubic-bezier(.19, 1, .22, 1);
        transition-duration: .3s;
        border: 1px solid rgba(255, 255, 255, .07);
        >input[type="radio"],
        >input[type="checkbox"] {
            position: absolute;
            display: none;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            &:hover,
            &:checked {
                cursor: pointer!important;
                &~.option-content {
                    width: 100%;
                    transform: scale(1.3, 1.3);
                }
            }
            &:checked {
                &~.on-checked {
                    opacity: 1;
                    box-shadow: inset 0px 0px 3em -1.2em rgba(0,0,0,.5);
                }
            }
            &:active {
                ~.option-content {
                    transform: scale(1.15, 1.15);
                }
            }
        }
        >.option-content {
            position: relative;
            z-index: 1;
            cursor: pointer!important;
            height: inherit;
            transform: translate3d(0, 0, 0);
            transition-property: transform, background, padding, transform;
            transition-timing-function: cubic-bezier(.19, 1, .22, 1);
            transition-duration: .3s;
        }
        >.on-checked {
            position: absolute;
            z-index: 0;
            left: 0;
            top: 0;
            height: 100%;
            width: 100%;
            opacity: 0;
            pointer-events: none;
            transition-property: opacity;
            transition-duration: .5s;
            background-color: rgba(0, 0, 0, .1);
        }
    }
}
            
          
!
            
              // CSS only !!

// The following JS is a easy way to get checked value with jQuery

var showAlert = true;

// for radio
$('input[type="radio"]').on('change', (event) => {
    const name = event.target.name;
    const value = event.target.value;
    if(!showAlert) return;
    // print
    swal({
        title: name,
        type: 'success',
        html: 'value: <strong>' + value + '</strong>',
        confirmButtonText: 'okay'
    })
});

// for checkbox
$('input[type="checkbox"]').on('change', (event) => {
    const name = event.target.name;
    const values = [];
    $('input[name="' + name + '"]:checked').each((index, input) => {
        values.push($(input).val());
    });
    if(!showAlert) return;
    // print
    if(values.length) {
      swal({
          title: event.target.name,
          type: 'success',
          html: 'value: <strong>' + JSON.stringify(values) + '</strong>',
          confirmButtonText: 'okay'
      })
    } else {
      swal({
          title: event.target.name,
          type: 'warning',
          html: 'Please choose a social',
          confirmButtonText: 'okay'
      })
    }
});

// enable / disabled alert
$('#toggle-alert').on('click', ()=> {
    if(showAlert) {
        $('#toggle-alert span').text('ON alert');
    } else {
        $('#toggle-alert span').text('OFF alert');
    }
    showAlert = showAlert ? false : true;
})
            
          
!
999px
Loading ..................

Console