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

              
                <h1>Shaped Fade Image & text Changer</h1>
<div class="main-wrapper">
  <div class="text-wrap">
    <div class="textbox">
      <h4>Tim Berners-Lee</h4>
      <p>In 1989, Tim Berners-Lee invented of the modern day world wide web, an Internet-based hypermedia initiative for global information sharing while at CERN, the European Particle Physics Laboratory. He wrote the first web client and server in 1990. His specifications of URIs, HTTP and HTML were refined as web technology spread.</p>
    </div>
    <div class="textbox">
      <h4>Modern Day Computing</h4>
      <p>Computers these days are light weight, portable with much more memory than the big bulky computers of the seventies, eighties and early nineties. Giving the modern day programmer much more computing power and a much cleaner look.</p>
    </div>
    <div class="textbox">
      <h4>Computing On The Go</h4>
      <p>As mentioned before the modern day computing is both light weight and portable meaning it is possible to work anywhere you like providing that you have connection to the internet or company server. While the invention of wi-fi has made home computing more flexible an mobile without trailing wires.</p>
    </div>
    <div class="textbox">
      <h4>Maximum Mobile Computing</h4>
      <p>The invention of the mobile phone has allowed computing to become even more mobile than the laptop and the Iphone has more memory than a lot of laptops. So with its large memory and being pocket sized the Iphone is the ideal tool to use when you are on the move.</p>
    </div>
  </div>
  <div class="overlay">
    <img src="https://drive.google.com/uc?id=17F09zegxBCHDgCo6CSxvGI_uV1jgGzTy" class="images" alt="Tim Berners-Lee inventor of the internet.">
    <img src="https://drive.google.com/uc?id=16tY6BLIgZzOAHwhqrNk8fuToE1hUy8BT" class="images" alt="computer desk.">
    <img src="https://drive.google.com/uc?id=11s_iHUq_GQWkYqX-kmwlLQHskZ1AWkdX" class="images" alt="outside computing.">
    <img src="https://drive.google.com/uc?id=18Q5xt2elEQM4UZzS_qk56BSffvMFXQDQ" class="images" alt="Woman on a mobile phone.">
  </div>
</div>
<div class="dotbox">
  <button class="dot" id="10" onclick="focusOnDot(this.id)">1</button>
  <button class="dot" id="11" onclick="focusOnDot(this.id)">2</button>
  <button class="dot" id="12" onclick="focusOnDot(this.id)">3</button>
  <button class="dot" id="13" onclick="focusOnDot(this.id)">4</button>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}
body {
  background-color: #f7f7f7;
}
h1 {
  width: 770px;
  padding: 5px;
  margin: 30px auto 0px auto;
  color: #ffffff;
  font-size: 48px;
  border-radius: 10px;
  box-shadow: 1px 1px 5px #00ff00, 2px 2px 10px #ff7777;
  text-shadow: 1px 1px 5px #00ff00, 2px 2px 10px #ff7777;
  text-align: center;
}
.main-wrapper {
  position: relative;
  top: 80px;
  left: 50%;
  transform: translatex(-50%);
  width: 750px;
  height: 300px;
  background-color: #ffffdd;
  border: 2px solid #aaaaaa;
  border-radius: 20px;
  box-shadow: 2px 2px 15px 3px #77ff77, 4px 4px 20px 6px #ff7777;
  overflow: hidden;
}
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 450px;
  height: 600px;
  margin: -150px 0 0 0;
  background-color: #ffffff;
  border-right: 2px solid #aaaaaa;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  box-shadow: 1px 0 5px #999999;
  overflow: hidden;
}
.images {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  width: 450px;
  height: 300px;
  margin-top: 150px;
  transition-duration: 3s;
}
.images:first-child {
  opacity: 1;
}
.text-wrap {
  position: relative;
  float: right;
  margin: 10px 10px 0 0;
  width: 275px;
  height: 275px;
  padding: 10px;
  border: 2px solid #aaaaaa;
  border-radius: 10px;
  box-shadow: inset 2px 2px 10px #777777;
  overflow: hidden;
  z-index: 1;
}
.textbox {
  position: absolute;
  top: 10px;
  left: 10px;
  opacity: 0;
  width: 255px;
  height: 255px;
  background-color: #ffffdd;
  transition-duration: 3s;
}
.textbox:first-child {
  opacity: 1;
}
h4,
p {
  text-align: center;
}

.dotbox {
  position: relative;
  top: 110px;
  left: calc(50% - 126px);
  width: 257px;
  background-color: #ffffdd;
  border: 1px solid #aaaaaa;
  border-radius: 10px;
  box-shadow: 1px 1px 5px #00ff00, 2px 2px 10px #ff7777;
}
.dot {
  width: 20px;
  height: 20px;
  margin: 20px;
  background-color: #ffdddd;
  border: 1px solid #cc0000;
  outline: 2px solid #cc0000;
  outline-offset: +4px;
  border-radius: 50%;
}
.dot:nth-child(1) {
  background-color: #77ff77;
  border: 1px solid #77cc77;
  outline: 2px solid #77cc77;
}
.dot:focus {
  background-color: #77ff77;
  border: 1px solid #77cc77;
  outline: 2px solid #77cc77;
}

              
            
!

JS

              
                var img = document.querySelectorAll(".images");
var box = document.querySelectorAll(".textbox");
var dot = document.querySelectorAll(".dot");
var i;

function focusOnDot(inc) {
  for (i = 0; i < img.length; i++) {
    img[i].style.opacity = 0;
    box[i].style.opacity = 0;
    dot[i].style.backgroundColor = "#ffcccc";
    dot[i].style.borderColor = "#cc0000";
    dot[i].style.outlineColor = "#cc0000";
  }
  inc = inc - 10;
  img[inc].style.opacity = 1;
  box[inc].style.opacity = 1;
  dot[inc].style.backgroundColor = "#77ff77";
  dot[inc].style.borderColor = "#77ff77";
  dot[inc].style.outlineColor = "#77ff77";
}

              
            
!
999px

Console