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 class="overlay"></div>

<!-- begin nav -->
    <div class="nav">
        <ul class="tabs">
            <li class="tabs_item tab tab__bookmark tab__is-active"> 
                <div class="tab_circle"></div>
                <i class="fa fa-bookmark tab_icon"></i>
                <span class="tab_name"> Bookmark</span>
            </li>

            <li class="tabs_item tab tab__bell"> 
                <div class="tab_circle"></div>
                <i class="fa fa-bell tab_icon"></i>
                <span class="tab_name"> Bell</span>
            </li>

            <li class="tabs_item tab tab__burn"> 
                <div class="tab_circle"></div>
                <i class="fa fa-cloud-upload tab_icon"></i>
                <span class="tab_name"> Upload</span>
            </li>

            <li class="tabs_item tab tab__clipboard"> 
                <div class="tab_circle"></div>
                <i class="fa fa-clipboard tab_icon"></i>
                <span class="tab_name"> Clipboard</span>
            </li>

            <li class="tabs_item tab tab__comment"> 
                <div class="tab_circle"></div>
                <i class="fa fa-comment tab_icon"></i>
                <span class="tab_name"> Comment</span>
            </li>
        </ul>
    </div>
    <!-- end nav -->
              
            
!

CSS

              
                
@import url('https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700&subset=cyrillic');
body{
    // background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    transition: 0.5s;
    overflow: hidden;
}

.overlay{
    height: 200vw;
    width: 200vw;
    border-radius: 50%;
    background: #000;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    // transition: 0.3s ease;
}

.nav{
    background: white;
    padding: 22px 45px;
    border-radius: 15px;
    box-shadow: 3px 3px 15px rgba(179, 179, 179, 0.185);
    position: relative;
    z-index: 1000;
}

.tabs{
    display: flex;
    width: 390px;
    justify-content: space-around;
    list-style-type: none;
}

.tab{
    padding: 13px 23px;
    background: #e0efff;
    color: #58a6ff;
    margin-right: 15px;
    border-radius: 55px;
    text-align: center;
    white-space: nowrap;
    transition: 0.3s ease;
    overflow: hidden;
    max-width: 0px;
    cursor: pointer;
    position: relative;
    flex-basis: 120px;
    &__is-active{
        max-width: 100px;
        box-shadow: 7px 7px 15px rgba(124, 124, 124, 0.096);
        .tab_name{
            opacity: 1;
        }
    }

    &_circle{
        position: absolute;
        height: 20px;
        width: 20px;
        border-radius: 50%;
        border: 2px solid #58a6ff;
        z-index: 10;
        opacity: 0;
        left: 30px;
        pointer-events: none;
    }

    &_icon{
        margin-right: 1px;
        font-size: 16px;
        vertical-align: middle;
        position: relative;
        right: 6.7px;
        top: -1px;
    }

    &_name{
        font-family: 'Ubuntu', sans-serif;
        font-size: 15px;
        font-weight: 500;
        position: relative;
        transition: 0.3s ease;
        top: 1px;
        opacity: 0;
    }

    &__bookmark{
        background: #cffcff;
        color: #00a8b5;
    }
    &__burn{
        background: #f1ddff;
        color: #774898;
    }
    &__clipboard{
        background: #ffddeb;
        color: #de4383;
    }
    &__comment{
        background: #ffeed5;
        color: #f3ae4b;
    }
}

              
            
!

JS

              
                let tabs = document.querySelectorAll('.tab')
let overlay = document.querySelector('.overlay')


let firstActive = document.querySelector(".tab__is-active")
let activeColor = getComputedStyle(firstActive).color; 
overlay.style.background = activeColor;
document.body.style.background = activeColor;


tabs.forEach(tab => {
    tab.addEventListener('click', function () {
        let tl = new TimelineLite();

        let accentColor = getComputedStyle(this).color;
        document.body.style.background = accentColor;
        this.children[0].style.borderColor = accentColor;

        

        if(!this.classList.contains('tab__is-active')){
            tl.fromTo(this.children[0], 0.4, {scale: 0, opacity: 1}, {scale: 3, opacity: 0}, "0")
            overlay.style.background = accentColor;
            tl.fromTo(overlay, 1, {scale: 0, opacity: 0},{scale: 1, opacity: 1}, "0");
        }
        tabs.forEach(tab => tab.classList.remove("tab__is-active"));
        this.classList.add("tab__is-active");
    })
})
              
            
!
999px

Console