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

              
                <section class="a-tabs mod--bg--blue-dark">
    <div class="a-tabs__inner mod--inner">
        <dl class="a-tabs__frame js-a-tab">
            <dt class="a-tabs__title active js-a-tab-link">
                <button class="a-tabs__link button--basic js-a-tab-button">First One</button>
            </dt>
            <dd class="a-tabs__text">
                <div class="a-tabs__blurb">
                    <h3>Lorem</h3>
                    <p>Lorem 1 ipsum dolor sit amet consectetur adipiscing elit natoque, porttitor purus euismod porta risus penatibus volutpat cursus, augue vestibulum laoreet vivamus hac.</p>
                </div>
                <div class="a-tabs__image">
                    <img src="https://source.unsplash.com/830x500/?mountains" width="830" height="500" alt="mountains" />
                </div>
            </dd>
            <dt class="a-tabs__title js-a-tab-link">
                <button class="a-tabs__link button--basic js-a-tab-button">The Second</button>
            </dt>
            <dd class="a-tabs__text">
                <div class="a-tabs__blurb">
                    <h3>Ipsum</h3>
                    <p>Lorem 2 ipsum dolor sit amet consectetur adipiscing elit natoque, porttitor purus euismod porta risus penatibus volutpat cursus, augue vestibulum laoreet vivamus.</p>
                </div>
                <div class="a-tabs__image">
                    <img src="https://source.unsplash.com/830x500/?hills" width="830" height="500" alt="hills" />
                </div>
            </dd>
            <dt class="a-tabs__title js-a-tab-link">
                <button class="a-tabs__link button--basic js-a-tab-button">Number Three</button>
            </dt>
            <dd class="a-tabs__text">
                <div class="a-tabs__blurb">
                    <h3>Dolar</h3>
                    <p>Lorem 3 ipsum dolor sit amet consectetur adipiscing elit natoque, porttitor purus euismod porta risus penatibus volutpat cursus, augue vestibulum laoreet vivamus hac pharetra facilisi. Aliquam malesuada aptent ac curae hendrerit nam viverra.</p>
                </div>
                <div class="a-tabs__image">
                    <img src="https://source.unsplash.com/830x500/?lake" width="830" height="500" alt="lake" />
                </div>
            </dd>
            <dt class="a-tabs__title js-a-tab-link">
                <button class="a-tabs__link button--basic js-a-tab-button">Last One</button>
            </dt>
            <dd class="a-tabs__text">
                <div class="a-tabs__blurb">
                    <h3>Sit</h3>
                    <p>Lorem 4 ipsum dolor sit amet consectetur adipiscing elit natoque, porttitor purus euismod porta risus penatibus volutpat cursus, augue vestibulum.</p>
                </div>
                <div class="a-tabs__image">
                    <img src="https://source.unsplash.com/830x500/?jungle" width="830" height="500" alt="jungle" />
                </div>
            </dd>
        </dl>
    </div>
</section>

              
            
!

CSS

              
                // Variables
$font-size: 18;
$color-2: teal;
$color-2--dark: darken($color-2, 15%);
$color-2--light: aquamarine;
$color-drab--light: #eaebec;
$color-1: aquamarine;
$color-light: white;
$color-dark: black;
$gap: 25/$font-size * 1em;
$gap--big: $gap*4;
$gap--baby: $gap*2; 
$fam-2: 'Arial Black', sans-serif;
$ease-1: cubic-bezier(0, 0.16, 0, 1.74);

// Styling
.a-tabs {
    $a-tabs__count: 4;
    position: relative;
    width: 100%;
    @media (min-width: 801px){
        &[class] { // for specificity
            background-color: transparent;
        }
        &:after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: -1;
            bottom: 10em;
        }
        &.mod--bg--blue-dark:after {
            background-color: $color-2--dark;
        }
        &.mod--bg--drab:after {
            background-color: $color-drab--light;
        }
        &.mod--bg--red:after {
            background-color: $color-1;
        }
    }
    &__inner.mod--inner {
        display: flex;
        flex-wrap: wrap;
        max-width: 1440px;
        padding: $gap;
        @media (min-width: 801px){
            padding: $gap--baby $gap 0;
        }
    }
    &__frame {
        position: relative;
        overflow: hidden;
        font-size: 0;
        @media (min-width: 801px){
            white-space: nowrap;
        }
    }
    &__title {
        font-size: 1rem; // reset from parent's 0
        position: absolute;
        left: $gap;
        top: 0;
        z-index: 50;
        height: 4em;
        opacity: .5;
        transform: scale(.97);
        transform-origin: 50%;
        transition: transform 600ms, filter 600ms, opacity 600ms;
        @for $i from 1 through $a-tabs__count { // must update if add more
            &:nth-of-type(#{$i}) {
                margin-top: 7% * ($i - 1);
            }
        }
        &:first-of-type {
            transform-origin: 50% 100%;
        }
        &:last-of-type {
            transform-origin: 50% 0;
        }
        @media (max-width: 800px){
            &[class] { // for specificity
                position: relative;
                left: 0;
                width: 100%;
                margin-top: 0;
                padding-left: 1.5em;
            }
            &:before,
            &:after {
                content: "";
                position: absolute;
                top: 1.5em;
                left: 0;
                width: 1.4em;
                height: .5em;
                background: currentcolor;
            }
            &:before {
                transform: rotate(90deg);
                width: 1.4em;
            }
            &.active {
                &:before,
                &:after {
                    background: $color-1;
                    width: 1em;
                }
                &:before {
                    transform: none;
                }
            }
	    }
    }
    &__link {
        font-size: 2.8em;
        font-family: $fam-2;
        cursor: pointer;
        transition: color 300ms, transform 300ms;
        color: $color-light;
        @media (min-width: 801px) and (max-width: 900px){
            font-size: 2.25em;
        }
        &:focus {
            outline: 0;
        }
    }
    &__text {
        font-size: 1rem; // reset from parent's 0
        position: relative;
        display: inline-block;
        vertical-align: top;
        width: 100%;
        margin: 0;
        padding-left: 50%;
        overflow: hidden;
        transition: transform 1ms 301ms;
        & > * {
            position: relative;
            transition: transform 1ms 301ms;
            transform: translateY(1em) scale(0.95);
            opacity: 0;
            .active + & {
                transition: all 300ms;
                transform: translateY(0);
                opacity: 1;
            }
        }
	    @media (min-width: 801px){
            white-space: normal;
            @for $i from 1 through $a-tabs__count { // must update if add more
                &:nth-of-type(#{$i}) {
                    transform: translateX(percentage((($i - 1)*100/100) * -1));
                }
            }
            .active + & {
                z-index: 10;
                transition: transform 300ms 301ms;
                opacity: 1;
            }
	    }
        @media (max-width: 800px){
            max-height: 0;
            padding: 0;
            transition: max-height 300ms, opacity 300ms, transform 1ms 301ms;
            .active + & {
                transition: max-height 600ms 150ms ease-in, opacity 300ms 301ms;
                max-height: 100em;
                opacity: 1;
                & > * {
                    transition-delay: 300ms;
                }
            }
	    }
    }
    &__blurb {
        max-width: 33em;
    }
    &__image {
        padding-top: 1em;
        @media (max-width: 800px){
		    display: none;
	    }
        img {
            display: block;
        }
    }
    // javascript overrides
    &__title {
        // mobile
        @media (max-width: 800px){
            filter: none !important;
            transform: none !important;
            &.active {
                opacity: 1 !important;
            }
        }
    }
}

// Base (and already-in-theme styles)
body,
html {
    height: 100%;
}
*, *:before, *:after {
    box-sizing: border-box;
}
body {
    display: flex;
    align-items: center;
    background-color: $color-2;
    background-image: linear-gradient(
        -45deg,
        $color-2,
        $color-2--light
    );
    font-size: $font-size * 1px;
	line-height: 1.4;
	color: $color-2--dark;
    font-family: 'Roboto', sans-serif;
	@media (max-width: 800px){
		font-size: $font-size * 1px - 1px;
	}
	@media (max-width: 500px){
		font-size: $font-size * 1px - 2px;
	}
}
img {
    max-width: 100%;
    height: auto;
}
p {
    margin-top: 0;
}
h1, h2, h3, h4, h5, h6 {
    font-family: $fam-2;
    margin-bottom: .5em;
}
.mod--bg--blue-dark,
.mod--bg--red{
    color: $color-light;
    background-color: $color-2--dark;
}
.mod--inner {
    margin: auto;
    max-width: 1440px;
}
.mod--pad-sides {
    padding: 0 $gap;
}
.button--basic {
    -webkit-appearance: none;
    border: 0;
    background-color: transparent;
}
.a-tabs {
    margin-top: 2em;
    img {
        border-radius: 1em;
        box-shadow: 0 .15em .25em rgba($color-dark, .25);
        margin-bottom: 1em;
        border: 2px solid $color-light;
    }
    &:after {
        background-image: linear-gradient(
            -45deg,
            $color-2--dark,
            lighten($color-2--dark, 7%)
        );
        box-shadow: 0 .15em .25em rgba($color-dark, .25);
    }
    &__link {
        text-shadow: 0 .05em .1em rgba($color-dark,.75);
        transition: text-shadow 300ms;
        &:hover {
            text-shadow: 0 .15em .25em rgba($color-dark,.5);
        }
    }
}

              
            
!

JS

              
                console.clear();
jQuery( function( $ ) {
    $( '.js-a-tab' ).each( function() {
        var $aTabs = $( this );
        var $buttons = $aTabs.find( '.js-a-tab-button' );
        var $parents = $();
        $buttons
            .each( function() {
                var $this = $( this );
                var $parent = $this.parent();
                $this.data( 'parent', $parent );
                $parents = $parents.add( $parent );
            } );
        $buttons
            .on( 'click.aquaATab', function() {
                $parents.removeClass( 'active' );
                $( this ).data( 'parent' ).addClass( 'active' );
            } )
            .on( 'mouseout.aquaATab blur.aquaATab', function() {
                $parents
                    .css( {
                        transform: '',
                        filter: '',
                        opacity: 0.8,
                    } );
            } )
            .on( 'mouseover.aquaATab focus.aquaATab', function() {
                var $this = $( this );
                var thisIndex = $buttons.index( $this );
                $buttons.each( function( index ) {
                    var diff = 0;
                    if ( index < thisIndex ) {
                        var diff = 1 - ( thisIndex - index ) / 10;
                    } else if ( index > thisIndex ) {
                        var diff = 1 - ( index - thisIndex ) / 10;
                    }
                    $( this ).data( 'parent' )
                        .css( {
                            transform: 'scale(' + diff + ')',
                            opacity: diff - 0.5,
                            filter: 'blur(' + ( 1 - diff * 1.1 ) + 'em)',
                        } );
                } );
                $this.data( 'parent' )
                    .css( {
                        transform: 'scale(1)',
                        opacity: 1,
                        filter: 'blur(0)',
                    } );
            } );
    } );
} );
              
            
!
999px

Console