css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <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>
            
          
!
            
              $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;
        }
    }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console