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 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

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

              
                <!--
Credit to https://codepen.io/pedro-castro
-->
<section class="cd-slider">
  <ul>
    <li data-color="#FF384B">
      <div class="content" >
        <blockquote>
          <p>GET $100 BILL CREDIT, TODAY</p>
          <span>When you sign up to Origin Maximiser - that's $50 for electricity and $50 for natural gas. On a 12 month plan with a great discount. Online only.</span><br><br><br>
<button class="c-button c-button--purple" type="button">
  <div class="c-ripple js-ripple">
    <span class="c-ripple__circle"></span>
  </div>
  SWITCH TODAY
</button>
        </blockquote>

      </div>
    </li>
    <li data-color="#FF9C00">
      <div class="content" style="background-image:url()">
        <blockquote>
          <p>MOVING HOUSE?</p>
          <span>Let's make it quick, so your power is sorted in minutes.

</span><br><span>
<button class="btn eff focus">SWITCH TODAY</button></span>

        </blockquote>
      </div>
    </li>
    <li data-color="#002AFF">
      <div class="content" style="background-image:url()">
        <blockquote>
          <p>Fixed Energy Bill</p>
          <span>Pay the same amount for your electricity or natural gas for 12 months - 
no price hikes, no nasty surprises.

</span><br>
<button class="btn eff focus">SWITCH TODAY</button>

        </blockquote>
      </div>
    </li>
  </ul>
  <nav>
    <div><a class="prev" href="#"></a></div>
    <div><a class="next" href="#"></a></div>
  </nav>
</section>
  
 
              
            
!

CSS

              
                info {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 9999999;
  margin: 1.5rem;
}
@import url(https://fonts.googleapis.com/css?family=Montserrat:700);
*, *::before, *::after {
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	border: 0;
}
html {
	font-size: 10px;
	font-size: calc(5px + 0.4vw);
}
body {
	font-family: 'Montserrat', sans-serif;
  font-weight: 700;
	font-size: 1rem;
	color: #fff;
}
a {
  text-decoration: none;
  color: rgba(225, 255, 255, .8);
}
/* Slider style */
.cd-slider {
	position: relative;
	width: 100%;
	height: 100vh;
	overflow: hidden;
}
.cd-slider.ie9 nav div span {
	display: none;
}
.cd-slider ul li {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	visibility: hidden;
	-webkit-transition: visibility 0s .6s;
	transition: visibility 0s .6s;
}
.cd-slider ul li::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	border-radius: 100%;
	width: 135vh;
	height: 135vh;
	border: solid rgba(0,0,0,0.2);
	border-width: 0;
	-webkit-transform: translate(-50%, -50%);
	        transform: translate(-50%, -50%);
	pointer-events: none;
	-webkit-transition: border-width .4s .6s;
	transition: border-width .4s .6s;
}
.content {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-position: 50% 100%;
	background-size: auto 100%;
	background-repeat: no-repeat;
	mix-blend-mode: lighten;
	opacity: 0;
	-webkit-transform: scale(1.2);
	        transform: scale(1.2);
	-webkit-transition: opacity .4s .6s, -webkit-transform .4s .6s;
	transition: opacity .4s .6s, -webkit-transform .4s .6s;
	transition: opacity .4s .6s, transform .4s .6s;
	transition: opacity .4s .6s, transform .4s .6s, -webkit-transform .4s .6s;
}
.content blockquote {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 10%;
	left: 17%;
	z-index: 2;
	max-width: 45%;
}
blockquote p {
	font-size: 8rem;
	margin-bottom: 2rem;
}
blockquote span {
	font-size: 2.4rem;
}
/* current slide
---------------------------------*/
.cd-slider li.current_slide {
	visibility: visible;
}
.cd-slider li.current_slide::before {
	border-width: 16rem;
}
.cd-slider li.current_slide .content {
	opacity: 1;
	-webkit-transform: scale(1);
	        transform: scale(1);
}
/* nav
---------------------------------*/
nav div {
	position: absolute;
	top: 50%;
	left: 4%;
	width: 5rem;
	height: 5rem;
	margin-top: -2.5rem;
	list-style: none;
}
nav div:last-of-type {
	left: auto;
	right: 4%;
}
.prev, .next {
	position: relative;
	z-index: 100;
	width: 100%;
	height: 100%;
	display: block;
	border-radius: 100%;
	-webkit-transition: box-shadow .3s;
	transition: box-shadow .3s;
}
.prev::before, .prev::after, .next::before, .next::after {
	content: '';
	position: absolute;
	left: 43%;
	background: #fff;
	width: .4rem;
	min-width: 3px;
	border-radius: 3px;
	height: 34%;
}
.prev::before {
	-webkit-transform: rotate(45deg);
	        transform: rotate(45deg);
	top: 24%;
}
.prev::after {
	-webkit-transform: rotate(-45deg);
	        transform: rotate(-45deg);
	bottom: 24%;
}
.next::before, .next::after {
	left: auto;
	right: 43%;
}
.next::before {
	-webkit-transform: rotate(-45deg);
	        transform: rotate(-45deg);
	top: 24%;
}
.next::after {
	-webkit-transform: rotate(45deg);
	        transform: rotate(45deg);
	bottom: 24%;
}
.prev:hover, .next:hover {
	box-shadow: 0 0 0 1rem rgba(0, 0, 0, 0.15);
}
nav > div > span {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 100%;
	z-index: 5;
	pointer-events: none;
	will-change: width, height;
	-webkit-transform: translate(-50%, -50%);
	        transform: translate(-50%, -50%);
	-webkit-transition: width .6s, height .6s;
	transition: width .6s, height .6s;
}






@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300);
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300);


* {
  box-sizing: border-box;
}



.btn {
  background: #E53935;
  border-radius: 3px;
  border: 0;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  margin: 10px;
  padding: 12px 35px;
  text-decoration: none;
  transition: all 0.3s ease;
}
.btn.btn-link {
  background: transparent;
  box-shadow: none;
  color: #222;
}
.btn.btn-link circle {
  fill: rgba(0, 0, 0, 0.08);
}
.btn.btn-link:hover, .btn.btn-link:active {
  background: transparent;
}
.btn.btn-link:focus:before {
  background: rgba(0, 0, 0, 0.1);
}
.btn.focus, .btn:focus {
  outline: none;
}
.btn.focus:before, .btn:focus:before {
  transition: all 0.7s ease;
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  z-index: 99;
  left: 15%;
  right: 15%;
  top: -50%;
  bottom: -50%;
  border-radius: 200%;
  -webkit-animation: pulse ease 1.4s infinite;
}
.btn:active, .btn:hover {
  background: #F44336;
}
.btn:active:before, .btn:hover:before {
  opacity: 0;
  left: -10%;
  right: -10%;
}

.eff {
  position: relative;
  overflow: hidden;
}
.eff svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.eff circle {
  fill: rgba(255, 255, 255, 0);
}

@-webkit-keyframes pulse {
  from {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  to {
    transform: scale(1);
  }
}






/**
 * Component: Button
 * --------------------------------------------------
 */
.c-button {
  -webkit-appearance: none;
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  margin: 0;
  vertical-align: middle;
  overflow: visible;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  text-align: center;
  letter-spacing: 1px;
  background: transparent;
  border: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  box-shadow: 2px 2px 0 0 #383e46;
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
}
.c-button:hover, .c-button:focus {
  outline: 0;
  text-decoration: none;
}
.c-button:not(:disabled) {
  cursor: pointer;
}

/**
 * Mixin: Button Modifier
 * --------------------------------------------------
 */
/**
 * Component: Button
 * Modifier: Purple
 * --------------------------------------------------
 */
.c-button--purple {
  background: gray;
  text-shadow: 2px 2px 0 #7652d1;
}
.c-button--purple:hover {
  background: #8666d7;
}

/**
 * Component: Button
 * Modifier: Blue
 * --------------------------------------------------
 */
.c-button--blue {
  background: #4A89DC;
  text-shadow: 2px 2px 0 #276ecc;
}
.c-button--blue:hover {
  background: #357bd8;
}

/**
 * Component: Button
 * Modifier: Red
 * --------------------------------------------------
 */
.c-button--red {
  background: #E9573F;
  text-shadow: 2px 2px 0 #dc3519;
}
.c-button--red:hover {
  background: #e64328;
}

/**
 * Utility: Ripple
 * --------------------------------------------------
 */
.c-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.c-ripple__circle {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  opacity: 0;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.c-ripple.is-active .c-ripple__circle {
  -webkit-animation: a-ripple .4s ease-in;
          animation: a-ripple .4s ease-in;
}

/**
 * Animation: Ripple
 * --------------------------------------------------
 */
@-webkit-keyframes a-ripple {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    width: 200%;
    padding-bottom: 200%;
    opacity: 0;
  }
}
@keyframes a-ripple {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    width: 200%;
    padding-bottom: 200%;
    opacity: 0;
  }
}



              
            
!

JS

              
                (function() {
	var cdSlider = document.querySelector('.cd-slider'),
		item = cdSlider.querySelectorAll("li"),
		nav = cdSlider.querySelector("nav");

	item[0].className = "current_slide";

	for (var i = 0, len = item.length; i < len; i++) {
		var color = item[i].getAttribute("data-color");
		item[i].style.backgroundColor=color;
	}

	// Detect IE
	// hide ripple effect on IE9
	var ua = window.navigator.userAgent;
		var msie = ua.indexOf("MSIE");
		if ( msie > 0 ) {
			var version = parseInt(ua.substring(msie+ 5, ua.indexOf(".", msie)));
			if (version === 9) { cdSlider.className = "cd-slider ie9";}
	}

	if (item.length <= 1) {
		nav.style.display = "none";
	}

	function prevSlide() {
		var currentSlide = cdSlider.querySelector("li.current_slide"),
			prevElement = currentSlide.previousElementSibling,
			prevSlide = ( prevElement !== null) ? prevElement : item[item.length-1],
			prevColor = prevSlide.getAttribute("data-color"),
			el = document.createElement('span');

		currentSlide.className = "";
		prevSlide.className = "current_slide";

		nav.children[0].appendChild(el);

		var size = ( cdSlider.clientWidth >= cdSlider.clientHeight ) ? cdSlider.clientWidth*2 : cdSlider.clientHeight*2,
		    ripple = nav.children[0].querySelector("span");

		ripple.style.height = size + 'px';
		ripple.style.width = size + 'px';
		ripple.style.backgroundColor = prevColor;

		ripple.addEventListener("webkitTransitionEnd", function() {
			if (this.parentNode) {
				this.parentNode.removeChild(this);
			}
		});

		ripple.addEventListener("transitionend", function() {
			if (this.parentNode) {
				this.parentNode.removeChild(this);
			}
		});

	}

	function nextSlide() {
		var currentSlide = cdSlider.querySelector("li.current_slide"),
			nextElement = currentSlide.nextElementSibling,
			nextSlide = ( nextElement !== null ) ? nextElement : item[0],
			nextColor = nextSlide.getAttribute("data-color"),
			el = document.createElement('span');

		currentSlide.className = "";
		nextSlide.className = "current_slide";

		nav.children[1].appendChild(el);

		var size = ( cdSlider.clientWidth >= cdSlider.clientHeight ) ? cdSlider.clientWidth*2 : cdSlider.clientHeight*2,
			  ripple = nav.children[1].querySelector("span");

		ripple.style.height = size + 'px';
		ripple.style.width = size + 'px';
		ripple.style.backgroundColor = nextColor;

		ripple.addEventListener("webkitTransitionEnd", function() {
			if (this.parentNode) {
				this.parentNode.removeChild(this);
			}
		});

		ripple.addEventListener("transitionend", function() {
			if (this.parentNode) {
				this.parentNode.removeChild(this);
			}
		});

	}

	updateNavColor();

	function updateNavColor () {
		var currentSlide = cdSlider.querySelector("li.current_slide");

		var nextColor = ( currentSlide.nextElementSibling !== null ) ? currentSlide.nextElementSibling.getAttribute("data-color") : item[0].getAttribute("data-color");
		var	prevColor = ( currentSlide.previousElementSibling !== null ) ? currentSlide.previousElementSibling.getAttribute("data-color") : item[item.length-1].getAttribute("data-color");

		if (item.length > 2) {
			nav.querySelector(".prev").style.backgroundColor = prevColor;
			nav.querySelector(".next").style.backgroundColor = nextColor;
		}
	}

	nav.querySelector(".next").addEventListener('click', function(event) {
		event.preventDefault();
		nextSlide();
		updateNavColor();
	});

	nav.querySelector(".prev").addEventListener("click", function(event) {
		event.preventDefault();
		prevSlide();
		updateNavColor();
	});

})();
              
            
!
999px

Console