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

              
                <link rel="stylesheet" href="https://unpkg.com/akar-icons-fonts/src/css/akar-icons.css">

<nav class="Navbar">
    <a href="#" id="toggle" class="Toggle Navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse"><span></span></a>

    <div id="navbarCollapse" class="Navbar-menu">
        <ul class="Navbar-menu-major">
            <li><a href="#"><i class="ai-person"></i> My Account</a></li>
            <li><a href="#"><i class="ai-bell"></i> My Notifications</a></li>
            <li><a href="#"><i class="ai-chat-question"></i> My Support Requests</a></li>
            <li>
                <details>
                    <summary>
                        <i class="ai-airplay-audio"></i>
                        What are you looking for?
                        <i class="ai-chevron-vertical" style="font-size:smaller"></i>
                    </summary>

                    <p class="Navbar-meta">Tell us what you are looking for, so we can tailor the website to your needs.</p>
                    <p>
                        <select id="personaSelector" class="Navbar-persona-selector">
                            <option value="1">I need help with JavaScript</option>
                            <option value="2">I need help with PHP</option>
                            <option value="3">I need help with MySQL</option>
                            <option value="4">I need something else</option>
                        </select>
                    </p>
                </details>
            </li>
        </ul>

        <div class="Navbar-menu-minor">
            <ul>
                <li><a href="#"><i class="ai-shield"></i> Sample Page #1</a></li>
                <li><a href="#"><i class="ai-shield"></i> Sample Page #2</a></li>
            </ul>
        </div>
    </div>

    <ul class="Navbar-quickLinks">
        <li>
            <a href="#link" id="toggle-mini">
                <div class="sh">
                    <svg class="Navbar-shimmer">
                        <text dy="1em">What are you looking for?</text>
                    </svg>
                </div>
            </a>
        </li>
    </ul>
</nav>

<svg class="svg-def">
    <defs>
        <linearGradient id="svg-dark-shimmer" fy="0">
            <stop offset="0" stop-color="#999999" />
            <stop offset="0.3" stop-color="#999999" />
            <stop offset="0.6" stop-color="#ffffff" />
            <stop offset="0.7" stop-color="#999999" />
            <stop offset="1" stop-color="#999999" />
            <animateTransform attributeName="gradientTransform"
                            attributeType="XML"
                            type="translate"
                            from="-1.5 0"
                            to="1.5 0"
                            dur="2s"
                            repeatCount="indefinite"/>
        </linearGradient>
    </defs>
</svg>

              
            
!

CSS

              
                :root {
    --drawer-width: 300px;
}

* {
    box-sizing: border-box;
    font-family: "Bricolage Grotesque", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

html {
    height: 100%;
    background: url(https://images.unsplash.com/photo-1652116119697-3e0fc957032f?q=80&w=1932&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D) no-repeat center center / cover;
}

/* Essential styles for the Navbar and its components */
.Navbar-shimmer {
    height: 14px;
}

.sh {
    background: transparent;
    border: 0;
    padding: 0;
}

svg.svg-def {
    width: 0;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

.sh text { 
    fill: url(#svg-dark-shimmer); 
    width: 100%;  
}

.Navbar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.Toggle {
    position: relative;
    display: inline-block;
    width: 5rem;
    height: 5rem;
    padding-top: 3rem;
    border-radius: 100%;
    background-color: transparent;
}

.Toggle span {
    margin: -0.1rem auto 0;
    vertical-align: top;
    transition-duration: 0s;
    transition-delay: 0.2s;
    text-indent: 100%;
    line-height: 0;
    white-space: nowrap;
    overflow: hidden;
}

.Toggle span, 
.Toggle span:before, 
.Toggle span:after {
    display: block;
    width: 2.1rem;
    height: 0.2rem;
    background-color: #fff;
}

.Toggle span:before, 
.Toggle span:after {
    content: "";
    position: absolute;
    transition-property: margin, transform;
    transition-duration: 0.2s;
    transition-delay: 0.2s, 0s;
}

.Toggle span:before {
    margin-top: -0.7rem;
}

.Toggle span:after {
    margin-top: 0.7rem;
}

.Toggle:hover span:before {
    transform: translateY(-1px);
}

.Toggle:hover span:after {
    transform: translateY(1px);
}

.Toggle.is-active span {
    background-color: rgba(255, 255, 255, 0);
    transition-delay: 0.2s;
}

.Toggle.is-active span:before, 
.Toggle.is-active span:after {
    margin-top: 0;
    transition-delay: 0s, 0.2s;
}

.Toggle.is-active span:before {
    transform: rotate(45deg);
}

.Toggle.is-active span:after {
    transform: rotate(-45deg);
}

.Navbar {
    perspective: 800px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.8rem;
    position: fixed;
    z-index: 128;
    backface-visibility: hidden;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5rem;
    background-color: #000;
}

.Navbar a:not(.Navbar-toggle) {
    color: inherit;
    text-decoration: none;
}

.Navbar-menu a,
.Navbar-quickLinks a {
    display: block;
}

.Navbar a i,
.Navbar details summary i {
    margin-right: 6px;
    opacity: 0.6;
}

.Navbar-quickLinks {
    width: 100vh;
    white-space: nowrap;
    position: absolute;
    bottom: 0;
    display: block;
    padding-left: 1.6rem !important;
    transform: rotate(-90deg) translateX(-6rem);
    transform-origin: 0 0;
}

.Navbar-quickLinks a {
    padding: 1.6rem 1.4rem;
}

.Navbar-quickLinks li {
    display: inline-block;
    width: 100%;
}

.Navbar-menu {
    line-height: 1.6rem;
    position: fixed;
    top: 0;
    left: 5rem;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 26rem;
    transform: translateX(-100%);
    overflow-y: auto;
    visibility: hidden;
    padding: 2.4rem 0;
    padding-top: 5.2rem;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: saturate(0);
    opacity: 0;
    transition-property: opacity, visibility, transform;
    transition-duration: 0.35s, 0.25s, 0.25s;
    transition-delay: 0.1s;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.Navbar-menu .Navbar-menu-major {
    flex-grow: 1;
}

.Navbar-menu.is-active {
    opacity: 1;
    visibility: visible;
    width: 26rem;
    transform: translateX(0);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transition-duration: 0.15s, 0.25s, 0.25s;
}

.Navbar-menu-major a,
.Navbar-menu-minor a,
.Navbar-menu-major details {
    padding: 1.6rem 10%;
}

.Navbar-menu-major details > summary {
    white-space: nowrap;
    list-style: none;
    cursor: pointer;
}

.Navbar-menu-major details > summary::-webkit-details-marker {
    display: none;
}

.Navbar-menu-major {
    font-size: 18px;
}

.Navbar-menu-major a:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.Navbar-menu-minor {
    color: #999999;
    margin-top: 1.4rem;
}

.Navbar-menu-minor a {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.Navbar-menu-minor a:hover {
    color: #fff;
}

.Navbar select {
    font-family: inherit;
    width: 100%;
    padding: 12px;
    background-color: black;
    color: white;
    border-radius: 3px;
    border: 1px solid rgb(255 255 255 / 0.4);
}

.Navbar select:hover {
    border: 1px solid rgb(255 255 255 / 0.6);
}

.Navbar .Navbar-meta {
    color: #999999;
    font-size: 14px;
    font-weight: 400;
}

.Navbar #toggle-mini {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 700;
    color: #999999;
    background: linear-gradient(to right, #4d4d4d 0, #fff 10%, #4d4d4d 20%);
    background-position: 0;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s infinite linear;
    animation-fill-mode: forwards;
    -webkit-text-size-adjust: none;
}

@keyframes shine {
    0% {
        background-position: 0;
    }
    60% {
        background-position: 100%;
    }
    100% {
        background-position: 100%;
    }
}

.Navbar-toggle {
    transform: scale(.8);
    position: absolute;
    top: 0;
}

              
            
!

JS

              
                document.getElementById("toggle").addEventListener("click", function() {
    this.classList.toggle("is-active");
    document.getElementById("navbarCollapse").classList.toggle("is-active");
});
document.getElementById("toggle-mini").addEventListener("click", function() {
    document.getElementById("toggle").classList.toggle("is-active");
    document.getElementById("navbarCollapse").classList.toggle("is-active");
});

              
            
!
999px

Console