Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="callout-text">
	<h4>Testimonials</h4>
	<div class="testimonial-carousel">
		<!-- Circled Left 2 icon by Icons8 -->
		<div class="icon-container">
			<span class="lnr lnr-arrow-left-circle"></span>
		</div>
		<div class="testimonial-items">
			<div class="testimonial-item first">
				<blockquote>
					<p class="testimonial-quote">Thank you very much for the great job you made of my cooker. You made a horrible job look easy and I can't thank you enough. I hate cleaning oven racks and they sparkle now. Thanks again.</p>
					<p class="testimonial-author"><cite>— H Scott, Edinburgh</cite></p>
				</blockquote>
			</div>
			<div class="testimonial-item second">
				<blockquote>
					<p class="testimonial-quote">Just a wee note to say 'WOW!' and thank you to you, and colleagues. Our old flat is sparkling and looks absolutely fantastic, I still can't believe how clean the oven is! Thanks so much again for all your hard work yesterday.</p>
					<p class="testimonial-author"><cite>— Nicola, Leith, Edinburgh</cite></p>
				</blockquote>
			</div>
			<div class="testimonial-item third">
				<blockquote>
					<p class="testimonial-quote">As mentioned I was very satisfied with the quality of the cleaning. The lady was very cheerful and enthusiastic. I will definitely consider using Quality Cleaning Services again.</p>
					<p class="testimonial-author"><cite>— W S Khan, Lothian Road, Edinburgh</cite></p>
				</blockquote>
			</div>
		</div>
		<!-- End .testimonial-items -->
		<div class="icon-container">
			<span class="lnr lnr-arrow-right-circle"></span>
		</div>
	</div>
</div>

<!-- <div class="next-button-container"><button id="button">Next >></button></div> -->
            
          
!
            
              body {
	margin: 0;
	padding: 0;
}

h4 {
	font-family: 'Lato', sans-serif;
	font-size: 2em;
	@media (min-width: 768px) {
		font-size: 3em;
	}
}

.callout-text {
	text-align: center;
	max-width: 1140px;
	margin: 20px auto;
}

.testimonial-carousel {
	background-image: url("https://images.unsplash.com/photo-1489347215392-cee3b4f539aa?dpr=1&auto=compress,format&fit=crop&w=1199&h=799&q=80&cs=tinysrgb&crop=");
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	overflow: hidden;
	height: 500px;
	position: relative;
	padding: 20px 0px;
	display: flex;
	.icon-container {
		position: relative;
		padding: 0 5px;
		max-width: 20px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		z-index: 9999;
		@media (min-width: 768px) {
			max-width: 50px;
			padding: 0 10px;
		}
		span.lnr {
			color: #dadada;
			font-size: 1.6em;
			cursor: pointer;
			transition: color 0.3s linear;
			@media (min-width: 768px) {
				font-size: 2.6em;
			}
			&:hover {
				color: #fff;
			}
		}
	}
	p {
		font-family: 'Bad Script', cursive;
		font-size: 1em;
		@media (min-width: 768px) {
			font-size: 1.4em;
		}
	}
}

.testimonial-items {
	position: relative;
	flex: 1;
	overflow: hidden;
	color: #fff;
}

.testimonial-item {
	width: 100%;
	height: 100%;
	transition: transform 1s;
	position: absolute;
	display: flex;
	flex-direction: column;
	justify-content: center;
	p.testimonial-author {
		font-weight: bold;
		text-align: right;
	}
	&.first {
		left: 0;
	}
	&.second {
		left: 100%;
	}
	&.third {
		left: 200%;
	}
}
            
          
!
            
              (function () {
	'use strict';
	var slides = document.querySelectorAll('.testimonial-item'),
		 button = document.getElementById('button'),
		 arrows = document.querySelectorAll('.lnr'),
		 carouselCount = 0,
		 scrollInterval,
		 interval = 5000;

	arrows[0].addEventListener('click', function (e) {
		e = e || window.event;
		e.preventDefault();
		carouselCount -= 100;
		slider();
		if (e.type !== 'autoClick') {
			clearInterval(scrollInterval);
			scrollInterval = setInterval(autoScroll, interval);
		}
	});
	arrows[1].addEventListener('click', sliderEvent);
	arrows[1].addEventListener('autoClick', sliderEvent);
	
	function sliderEvent(e) {
		e = e || window.event;
		e.preventDefault();
		carouselCount += 100;
		slider();
		if (e.type !== "autoClick") {
			clearInterval(scrollInterval);
			scrollInterval = setInterval(autoScroll, interval);
		}
	}
	
	function slider() {
		switch (carouselCount) {
			case -100:
				carouselCount = 0;
				break;
			case 300:
				carouselCount = 0;
				break;
			default:
				break;
		}
		console.log(carouselCount);
		for (var i = 0; i < slides.length; i += 1) {
			slides[i].setAttribute('style', 'transform:translateX(-' + carouselCount + '%)');
		}
	}
	
	// create new Event to dispatch click for auto scroll
	var autoClick = new Event('autoClick');
	function autoScroll() {
		arrows[1].dispatchEvent(autoClick);
	}
	
	// set timing of dispatch click events
	scrollInterval = setInterval(autoScroll, interval);
	
})();
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console