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

              
                <nav class="tabbar">
    <ul>
        <li>
            <em></em>
        </li>
        <li>
            <em></em>
        </li>
        <li>
            <a>
                <div>
                    <div>
                        <label>
                            <input type="radio" name="type" value="play">
                            <span>
                                <svg>
                                    <use xlink:href="#play">
                                </svg>
                            </span>
                            <div></div>
                        </label>
                        <label>
                            <input type="radio" name="type" value="camera" checked>
                            <span>
                                <svg>
                                    <use xlink:href="#camera">
                                </svg>
                            </span>
                            <div></div>
                        </label>
                    </div>
                </div>
            </a>
        </li>
        <li>
            <em></em>
        </li>
        <li>
            <em></em>
        </li>
    </ul>
</nav>
    
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
    <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="camera">
        <path d="M6,0 L18,0 C21.3137085,-6.08718376e-16 24,2.6862915 24,6 L24,18 C24,21.3137085 21.3137085,24 18,24 L6,24 C2.6862915,24 4.05812251e-16,21.3137085 0,18 L0,6 C-4.05812251e-16,2.6862915 2.6862915,6.08718376e-16 6,0 Z M12,18 C15.3137085,18 18,15.3137085 18,12 C18,8.6862915 15.3137085,6 12,6 C8.6862915,6 6,8.6862915 6,12 C6,15.3137085 8.6862915,18 12,18 Z M12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 Z" stroke="none"></path>
    </symbol>
    <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="play">
        <path d="M6,0 L18,0 C21.3137085,-6.08718376e-16 24,2.6862915 24,6 L24,18 C24,21.3137085 21.3137085,24 18,24 L6,24 C2.6862915,24 4.05812251e-16,21.3137085 0,18 L0,6 C-4.05812251e-16,2.6862915 2.6862915,6.08718376e-16 6,0 Z M9,7.2604122 L9,16.7395878 C9,16.9605017 9.1790861,17.1395878 9.4,17.1395878 C9.48091742,17.1395878 9.55993218,17.1150466 9.62661153,17.0692046 L16.2808361,12.4944252 C16.5538996,12.306694 16.6230751,11.9331462 16.435344,11.6600827 C16.3937326,11.5995571 16.3413617,11.5471862 16.2808361,11.5055748 L9.62661153,6.93079543 C9.44456921,6.80564133 9.19553732,6.85175835 9.07038323,7.03380067 C9.02454118,7.10048002 9,7.17949477 9,7.2604122 Z" stroke="none"></path>
    </symbol>
</svg>

<!-- dribbble -->
<a class="dribbble" href="https://dribbble.com/shots/5499032-Tab-bar-video-photo-switch" target="_blank"><img src="https://cdn.dribbble.com/assets/dribbble-ball-mark-2bd45f09c2fb58dbbfb44766d5d1d07c5a12972d602ef8b32204d28fa3dda554.svg" alt=""></a>
              
            
!

CSS

              
                $width: 270px;
$primary: #5628EE;
$primaryLight: #8C6FF0;
$activeIcon: rgba(#fff, .5);
$inactiveIcon: rgba(#C2DBFF, .36);
$inactiveIconHover: rgba(#C2DBFF, .5);

.tabbar {
    border-radius: 6px;
    width: $width;
    ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
        position: relative;
        z-index: 1;
        li {
            position: relative;
            flex-grow: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            em {
                width: 32px;
                height: 32px;
                display: block;
                border-radius: 50%;
                background: #1C212E;
            }
            a {
                cursor: pointer;
                display: table;
                position: relative;
                display: flex;
                z-index: 1;
                justify-content: center;
                align-items: center;
                -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
                & > div {
                    width: 44px;
                    height: 44px;
                    position: relative;
                    & > div {
                        position: absolute;
                        width: 44px;
                        height: 88px;
                        overflow: hidden;
                        border-radius: 22px;
                        left: 0;
                        bottom: 0;
                        // Safari fix
                        -webkit-mask-image: -webkit-radial-gradient(white, black);
                        label {
                            cursor: pointer;
                            input {
                                display: none;
                                & + span {
                                    width: 44px;
                                    height: 44px;
                                    display: flex;
                                    justify-content: center;
                                    align-items: center;
                                    position: absolute;
                                    top: 0;
                                    z-index: 1;
                                    &:before {
                                        content: '';
                                        position: absolute;
                                        left: 0;
                                        top: 0;
                                        right: 0;
                                        bottom: 0;
                                        border-radius: 50%;
                                        display: block;
                                        opacity: 0;
                                        transition: opacity .3s ease;
                                        background-image: linear-gradient($primaryLight, $primary);
                                    }
                                    svg {
                                        fill: $inactiveIcon;
                                        width: 16px;
                                        height: 16px;
                                        display: block;
                                        position: relative;
                                        transition: fill .3s ease;
                                    }
                                    &:hover {
                                        svg {
                                            fill: $inactiveIconHover;
                                        }
                                    }
                                    & + div {
                                        left: 0;
                                        top: 50%;
                                        position: absolute;
                                        width: 44px;
                                        height: 88px;
                                        border-radius: 22px;
                                        background-image: linear-gradient($primaryLight, $primary);
                                    }
                                }
                                &:checked {
                                    & + span {
                                        animation: icon .3s linear forwards .3s;
                                        &:before {
                                            opacity: 1;
                                            transition: opacity .3s ease .6s;
                                        }
                                        svg {
                                            fill: $activeIcon;
                                            transition: fill .3s ease .15s;
                                        }
                                        & + div {
                                            background: none;
                                        }
                                    }
                                }
                                &:not(:checked) {
                                    & + span {
                                        transform: translateY(100%);
                                        animation: iconRemove .3s linear forwards .3s;
                                        & + div {
                                            animation: background .6s linear forwards;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

@keyframes background {
    40%,
    60% {
        transform: translateY(-50%);
    }
}

@keyframes backgroundBefore {
    40%,
    60% {
        transform: translateY(-50%);
    }
}

@keyframes icon {
    100% {
        transform: translateY(100%);
    }
}

@keyframes iconRemove {
    0% {
        transform: translateY(100%);
        opacity: 1;
    }
    40%,
    50% {
        transform: translateY(200%);
        opacity: 1;
    }
    51% {
        opacity: 0;
        z-index: 0;
        transform: translateY(0%);
    }
    52%,
    99% {
        opacity: 1;
        z-index: 0;
        transform: translateY(0%);
    }
    100% {
        opacity: 1;
        z-index: 2;
        transform: translateY(0%);
    }
}

html {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: inherit;
    &:before,
    &:after {
        box-sizing: inherit;
    }
}

// Center & dribbble
body {
    min-height: 100vh;
    font-family: Roboto, Arial;
    color: #ADAFB6;
    background: #121621;
    display: flex;
    justify-content: center;
    align-items: center;
    .switch {
        position: absolute;
        bottom: 10%;
        left: 50%;
        user-select: none;
        transform: translate(-50%, 0);
    }
    .dribbble {
        position: fixed;
        display: block;
        right: 20px;
        bottom: 20px;
        img {
            display: block;
            height: 28px;
        }
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console