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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="app-cover">
  <div id="app">
    <div id="label-1">Batman Vs Superman</div>
    <div id="label-2">Choose your side</div>
    <div class="option selected batman" id="option-1">
      <div class="circle"></div>
      <div class="option-text">Batman</div>
    </div>
    <div class="option superman" id="option-2">
      <div class="circle"></div>
      <div class="option-text">Superman</div>
    </div>
    <div id="bg"></div>
  </div>
</div>
              
            
!

CSS

              
                *
{
    user-select: none;
}

body, html
{
    height: 100%;
    min-height: 100%;
}

body
{
    margin: 0;
    font-family: 'Encode Sans Expanded', sans-serif;
    background-color: #8898ff;
}

#app-cover
{
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    width: 380px;
    height: 200px;
    margin: -100px auto;
}

#app
{
    position: relative;
    height: 140px;
    padding: 30px;
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
}

#label-1
{
    color: #5f6065;
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 8px;
}

#label-2
{
    color: #aba9a9;
    font-size: 14px;
    margin-bottom: 25px;
}

.option
{
    position: relative;
    font-size: 16px;
    margin-bottom: 14px;
    cursor: pointer;
    z-index: 0;
}

.circle
{
    left: 0;
    width: 20px;
    background-color: #eaecff;
}

.circle:before
{
    content: '';
    width: 60px;
    left: -90px;
    background-color:  #8898ff;
    transition: 0.3s ease all;
}

.circle, .circle:before
{
    position: absolute;
    top: 0;
    height: 20px;
    border-radius: 100px;
}

.option.selected .circle:before, .option .circle.move-right:before, .option .circle.width-exact:before
{
    left: 0;
    width: 20px;
}

.option.selected .circle.increase-width:before, .option .circle.move-right:before
{
    left: -40px;
    width: 60px;
}

.option.selected .circle.width-zero:before
{
    width: 0;
}

.option-text
{
    color: #5f6065;
    padding-left: 34px;
}

#bg
{
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 130px;
    height: 150px;
    background-size: 130px;
    background-repeat: no-repeat;
    background-position: 100%;
    background-image: url(http://k003.kiwi6.com/hotlink/o0t7mldy36/batman.png);
    opacity: 1;
    transform: scale(1);
    transition: 0.6s cubic-bezier(0.18, 0.89, 0.29, 1.05) all;
    z-index: 1;

}

#bg.superman
{
    background-image: url(http://k003.kiwi6.com/hotlink/12adunj55b/superman.png);
}

#bg.op
{
    opacity: 0;
}

#bg.nobg
{
    background-image: none;
}

#bg.big
{
    transform: scale(3);
}
              
            
!

JS

              
                $(function()
{
    var option = $('.option'), _this, bg = $('#bg');

    function switchChoice()
    {
        _this = $(this);

        if( _this.hasClass('selected') )
            return false;
        else
        {
            $('.option.selected').find('.circle').addClass('increase-width');
            setTimeout(function()
            {
                $('.option.selected').find('.circle').addClass('width-zero');
            },300);

            setTimeout(function()
            {
                _this.find('.circle').addClass('move-right');
                bg.toggleClass('op');
            },150);

            setTimeout(function()
            {
                _this.find('.circle').addClass('width-exact');
                bg.toggleClass('big nobg');
            },600);

            setTimeout(function()
            {
                $('.option.selected').removeClass('selected');
                _this.addClass('selected');

                bg.toggleClass('op nobg big');

                if( $('.option.selected').hasClass('superman') )
                    bg.addClass('superman');
                else
                    bg.removeClass('superman');

                $('.circle').removeClass('increase-width width-zero move-right width-exact');
            },800);
        }
    }

    option.on('click',switchChoice);
});
              
            
!
999px

Console