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

              
                <html>
	<head>
		<link href="https://fonts.googleapis.com/css?family=Lato:300,400&display=swap" rel="stylesheet">
	</head>
	<body>
		<div class="container">
			<div class="card-stack">
				<a class="buttons prev" href="#"><</a>
				<ul class="card-list">
					<li class="card" style="background: #c31432;  /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #240b36, #c31432);  /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #240b36, #c31432); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
">
						<img src="https://svgshare.com/i/E90.svg" alt="Sun" class="card-list__image">
						
						<h3 class="card-list__text">Watch your way toward success as you excel above your competitors.  </h3>
					</li>
					<li class="card" style="background: #00416A;
background: -webkit-linear-gradient(to right, #FFE000, #799F0C, #00416A);
background: linear-gradient(to right, #FFE000, #799F0C, #00416A);
">
						<img src="https://svgshare.com/i/E9H.svg" alt="Sun" class="card-list__image">
						
						<h3 class="card-list__text">Relax and chill, we've got you covered :) </h3>
					</li>
					<li class="card" style="background: #1e3c72;
background: -webkit-linear-gradient(to right, #2a5298, #1e3c72);
background: linear-gradient(to right, #2a5298, #1e3c72);
">
						<img src="https://svgshare.com/i/E86.svg" alt="Sun" class="card-list__image">
						
						<h3 class="card-list__text">	Boost your social networking presence</h3>
					</li>					
					
							<li class="card" style="background: #2C3E50;
background: -webkit-linear-gradient(to right, #FD746C, #2C3E50);
background: linear-gradient(to right, #FD746C, #2C3E50);
">
								<img src="https://svgshare.com/i/E8Y.svg" alt="Sun" class="card-list__image">
						
						<h3 class="card-list__text">	Be at the top of your competitors</h3>
								
					</li>
					<li class="card" style="background: #373B44;
background: -webkit-linear-gradient(to right, #4286f4, #373B44);
background: linear-gradient(to right, #4286f4, #373B44);
">
						<img src="https://svgshare.com/i/E9z.svg" alt="Sun" class="card-list__image">
						
						<h3 class="card-list__text">	Create contents for your online courses</h3>
					</li>
			</ul>	
			<a class="buttons next" href="#">></a>
		</div>
		</div>
	</body>
</html>
              
            
!

CSS

              
                @default-diff:  12px;
@default-width: 100%;
@default-min: 10%;

html {
	font-family: 'Lato', sans-serif;
}
.container {
    width: 100%;
    height: 900px;
    background-color: #fff;
    padding: 50px 80px;
    
    .card-stack {
        width: 500px;
        height: 250px;
        position: absolute;
        margin: 20px auto;

        .buttons {
            display: none;
            position: absolute;
            background: rgba(0, 0, 0, 0.46);
            border: 2px solid rgba(255, 255, 255, 0.7);
            border-radius: 50%;
            width: 35px;
            height: 35px;
            left: 0;
            top: 55%;
            color: rgba(255, 255, 255, 0.7);
            text-align: center;
            line-height: 35px;
            text-decoration: none;
            font-size: 22px;
            z-index: 100;
            outline: none;
            transition:all 0.2s ease;
            &:hover{
                transform: scale(1.3,1.3);
            }
        }

        .prev {
            left: 15px;
            right: auto;
        }

        .next {
            left: auto;
            right: 15px;
        }

        .carousel .buttons:hover {
            color: #C01313 ;
            background: #fff;
        }
        
        .card-list {
            width: 300px;
					
					&__image {
						height: 200px;
					}
					
					&__text {
						color: #fff;
						font-weight: 300;
					}
            li {
							display: flex;
							align-items: center;
							justify-content: center;
                transition: all 100ms ease-in-out;
                border-radius: 10px;
                position: absolute;
                list-style: none;
                height: 300px;  
                left: 0;
                right: 0;
                margin: 0 auto;
                padding-top: 20px;
                text-align: center;
                       -webkit-box-shadow: 0 2px 15px 1px rgba(225, 225, 225, 0.5);
                box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.5);    
                &:nth-child(1) {
                    top: (@default-diff * 2);
                    width: @default-width - @default-min * 4;
                    /* animation: scaleCard 100ms; */
                }
                &:nth-child(2) {
                    top: (@default-diff * 3);
                    width: @default-width - @default-min * 3;
                }
                &:nth-child(3) {
                    top: (@default-diff * 4);
                    width: @default-width - @default-min * 2;
                }
                &:nth-child(4) {
                    top: (@default-diff * 5);
                    width: @default-width - @default-min * 1;
                }
                &:nth-child(5) {
                    top: (@default-diff * 6);
                    width: @default-width - @default-min * 0;
                }
            }

        }
			
				&:hover {
				> .buttons.prev {
					display: block;
					animation: bounceInLeft 200ms; 
				}

				> .buttons.next {
					display: block;
					animation: bounceInRight 200ms; 
				}
			}
    }
}

.transformThis {
    animation: scaleDown 500ms;
}

.transformPrev {
    animation: scaleUp 100ms;
		display: none;
}

@keyframes scaleUp {
    0% {transform: scale(1.2) translateY(50px); opacity: 0; }
    20% {transform: scale(1.15) translateY(40px); opacity: 0.10;}
    40% {transform: scale(1.10) translateY(30px); opacity: 0.20;}
    60% {transform: scale(1.05) translateY(20px); opacity: 0.40;}
    80% {transform: scale(1.01) translateY(10px); opacity: 0.80;}
    100% {transform: scale(1) translateY(0); opacity: 1;}
}

@keyframes scaleDown {
    0% {transform: scale(1) translateY(0); opacity: 1; }
    20% {transform: scale(1.01) translateY(20px); opacity: 0.80;}
    40% {transform: scale(1.05) translateY(40px); opacity: 0.40;}
    60% {transform: scale(1.10) translateY(60px); opacity: 0.20;}
    80% {transform: scale(1.15) translateY(80px); opacity: 0.10;}
    100% {transform: scale(1.2) translateY(100px); opacity: 0;}
}

@keyframes scaleCard {
    0%   {top:5px;}
    100% {top:24px;}    
}

@keyframes bounceInLeft {
  0% { opacity: 0; transform: translateX(40px); } 
  // 60% { opacity: 1; transform: translateX(20px); } 
  // 80% { transform: translateX(20px); } 
  100% { transform: translateX(0); } 
}

@keyframes bounceInRight {
  0% { opacity: 0; transform: translateX(-40px); } 
  // 60% { opacity: 1; transform: translateX(-20px); } 
  // 80% { transform: translateX(20px); } 
  100% { transform: translateX(0); } 
}

              
            
!

JS

              
                var $card = $('.card');
var lastCard = $(".card-list .card").length - 1;

$('.next').click(function(){ 
	var prependList = function() {
		if( $('.card').hasClass('activeNow') ) {
			var $slicedCard = $('.card').slice(lastCard).removeClass('transformThis activeNow');
			$('ul').prepend($slicedCard);
		}
	}
	$('li').last().removeClass('transformPrev').addClass('transformThis').prev().addClass('activeNow');
	setTimeout(function(){prependList(); }, 150);
});

$('.prev').click(function() {
	var appendToList = function() {
		if( $('.card').hasClass('activeNow') ) {
			var $slicedCard = $('.card').slice(0, 1).addClass('transformPrev');
			$('.card-list').append($slicedCard);
		}}
	
			$('li').removeClass('transformPrev').last().addClass('activeNow').prevAll().removeClass('activeNow');
	setTimeout(function(){appendToList();}, 150);
});

              
            
!
999px

Console