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="panels">
	<div class="panel">
		<div class="panel-body">
			<div class="spinner1"></div>
			<div class="navigation">
				<a href="#" data-target="right" class="nav-right"><i class="fa fa-arrow-right"></i></a>
			</div>
		</div>
	</div>
	<div class="panel">
		<div class="panel-body">
			<div class="spinner2"></div>
			<div class="navigation">
				<a href="#" data-target="left" class="nav-left"><i class="fa fa-arrow-left"></i></a>
				<a href="#" data-target="right" class="nav-right"><i class="fa fa-arrow-right"></i></a>
			</div>
		</div>
	</div>
	<div class="panel">
		<div class="panel-body">
			<div class="spinner3"></div>
			<div class="navigation">
				<a href="#" data-target="left" class="nav-left"><i class="fa fa-arrow-left"></i></a>
				<a href="#" data-target="right" class="nav-right"><i class="fa fa-arrow-right"></i></a>
			</div>
		</div>
	</div>
	<div class="panel">
		<div class="panel-body">
			<div class="spinner4"></div>
			<div class="navigation">
				<a href="#" data-target="left" class="nav-left"><i class="fa fa-arrow-left"></i></a>
				<a href="#" data-target="right" class="nav-right"><i class="fa fa-arrow-right"></i></a>
			</div>
		</div>
	</div>
	<div class="panel">
		<div class="panel-body">
			<div class="b-container">
				<span class="ball"></span>
				<span class="ball"></span>
				<span class="ball"></span>
			</div>
			<div class="navigation">
				<a href="#" data-target="left" class="nav-left"><i class="fa fa-arrow-left"></i></a>
				<a href="#" data-target="right" class="nav-right"><i class="fa fa-arrow-right"></i></a>
			</div>
		</div>
	</div>
	<div class="panel">
		<div class="panel-body">
			<div class="bars-container">
				<span class="bar"></span>
				<span class="bar"></span>
				<span class="bar"></span>
			</div>
			<div class="navigation">
				<a href="#" data-target="left" class="nav-left"><i class="fa fa-arrow-left"></i></a>
			</div>
		</div>
	</div>
</div>
              
            
!

CSS

              
                /* Spinners */
/* Spinner 1 */
.spinner1 {
    width: 50px;
    height: 50px;
    border-width: 3px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    border-radius: 50%;
    animation: spinner1 1s linear infinite;
}

@keyframes spinner1 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Spinner 2 */
.spinner2 {
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-color: #fff transparent #fff transparent;
    border-radius: 50%;
    animation: spinner2 1s linear infinite;
}

@keyframes spinner2 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Spinner 3 */
.spinner3 {
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-color: #fff transparent #fff transparent;
    border-radius: 50%;
    animation: spinner3 1s linear infinite;
}

@keyframes spinner3 {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(.5);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Spinner 4 */
.spinner4 {
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-color: #fff transparent #fff transparent;
    border-radius: 50%;
    animation: spinner4 1s linear infinite;
}

@keyframes spinner4 {
    0% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(150deg);
    }
    80% {
        transform: rotate(210deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Jumping ball */
.b-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 60px;
	flex-direction: row;
}
.b-container .ball{
	background-color: #fff;
	border-radius: 50%;
	display: block;
	width: 15px;
	height: 15px;
	animation: jump .7s ease-in-out infinite;
}

.b-container .ball:nth-child(2) {
	animation-delay: .15s;
}

.b-container .ball:nth-child(3) {
	animation-delay: .3s;
}

@keyframes jump {
	0%, 100% {
		transform: translateY(0);
	}
	
	50% {
		transform: translateY(-20px);
	}
}

/* Bars style */
.bars-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 40px;
	flex-direction: row;
}

.bar {
	background-color: #fff;
	height: 50px;
	width: 10px;
	display: block;
	animation: increase 1s ease-in-out infinite;
}

.bar:nth-child(2) {
	animation-delay: .25s;
}

.bar:nth-child(3) {
	animation-delay: .5s;
}

@keyframes increase {
	0%, 100% {
		transform: scaleY(1);
	}
	
	50% {
		transform: scaleY(0.6);
	}
}

/* Body and panels style */
body {
	margin: 0;
	position: relative;
    height: 100vh;
}

.panel {
	background-image: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
	position: absolute;
	top: 0;
	left: 0;
	width: 100vw;

	transform: translateX(100vw);
    transition: transform .7s ease-in-out;
}

.panel-body {
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
}

.panel:first-of-type {
	transform: translateX(0);
}

/* Navigation */
.navigation a{
    color: white;
    font-size: 30px;
    position: fixed;
    top: 50%;

    transform: translateY(-50%);
}

.navigation a:hover {
    text-decoration: none;
}

.navigation a.nav-left {
    left: 10px;
    right: auto;
}

.navigation a.nav-right {
    left: auto;
    right: 10px;
}

              
            
!

JS

              
                let panel_navigation = document.querySelectorAll('.navigation');

panel_navigation.forEach((pn, idx) => {
    for(let i=0; i<pn.children.length; i++) {
        pn.children[i].addEventListener('click', function() {
            // get parent panel
            let parent_panel = this.parentNode.parentNode.parentNode;

            // add active class to corresponding panel
            if(this.dataset.target === 'left') {
                parent_panel.previousElementSibling.style.transform = 'translateX(0)';
                parent_panel.style.transform = 'translateX(100vw)';
            } else if(this.dataset.target === 'right') {
                parent_panel.nextElementSibling.style.transform = 'translateX(0)';
                parent_panel.style.transform = 'translateX(-100vw)';
            }
        });
    }
});

              
            
!
999px

Console