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

              
                <section class="spinner-container">
  <div class="spinner"></div>
</section>
<p><i>Copia/Pega o c&oacute;digo xerado</i><span>&#9759</span></p>
<form action="https://codepen.io/IPardelo/pen/GRjyjxX">
  <input type="text" id="input-text" placeholder="Escribe aqu&iacute; o texto..." />
  <button type="submit">XERAR</button>
</form>
<section class="spinner-container" id="code">
  <h3>HTML</h3>
  <small class="html"></small>
  <h3>CSS</h3>
  <small class="css"></small>
</section>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Ubuntu&display=swap");
body {
  font-family: "Ubuntu", sans-serif;
  background-color: #ececec;
}

p {
  color: #555;
  text-align: center;
  position: relative;
}
p span {
  display: block;
  position: absolute;
  left: 50%;
  top: 30px;
  font-size: 2.8rem;
  transform: translateX(-50%);
}

a {
  text-decoration: none;
  color: #555;
}
a:hover, a:visited {
  color: teal;
}

form {
  position: fixed;
  right: 25px;
  top: 20px;
}
form input {
  padding: 10px;
  width: 200px;
}
form button {
  padding: 10px;
  cursor: pointer;
  transition: color, background-color 0.3s ease;
}
form button:hover {
  background-color: #333;
  color: #fafafa;
  border-color: #333;
}

/* The necessary styles below*/
.spinner-container {
  margin: 100px auto;
  text-align: center;
}
.spinner-container .spinner {
  font-size: 2em;
}
.spinner-container .spinner__leter {
  font-weight: light;
  position: relative;
  color: rgba(188, 188, 188, 0.25);
  text-transform: uppercase;
}
.spinner-container .spinner__leter:before {
  content: attr(letter);
  position: absolute;
  top: 0;
  left: 0;
  color: #333;
  animation: load-animation 2.8s infinite;
  animation-fill-mode: backwards;
  text-transform: uppercase;
}
.spinner-container .spinner__leter:nth-child(2):before {
  animation-delay: 0.4s;
}
.spinner-container .spinner__leter:nth-child(3):before {
  animation-delay: 0.8s;
}
.spinner-container .spinner__leter:nth-child(4):before {
  animation-delay: 1.2s;
}
.spinner-container .spinner__leter:nth-child(5):before {
  animation-delay: 1.6s;
}
.spinner-container .spinner__leter:nth-child(6):before {
  animation-delay: 2s;
}
.spinner-container .spinner__leter:nth-child(7):before {
  animation-delay: 2.4s;
}
.spinner-container .spinner__leter:nth-child(8):before {
  animation-delay: 2.8s;
}
.spinner-container .spinner__leter:nth-child(9):before {
  animation-delay: 3.2s;
}
.spinner-container .spinner__leter:nth-child(10):before {
  animation-delay: 3.6s;
}
.spinner-container .spinner__leter:nth-child(11):before {
  animation-delay: 4s;
}
.spinner-container .spinner__leter:nth-child(12):before {
  animation-delay: 4.4s;
}
.spinner-container .spinner__leter:nth-child(13):before {
  animation-delay: 4.8s;
}

@keyframes load-animation {
  0%, 80%, to {
    transform: rotateY(-90deg);
    opacity: 0;
  }
  5% {
    opacity: 0.5;
  }
  20%, 50% {
    transform: rotateY(0);
    opacity: 1;
  }
}
#code {
  width: 90%;
  max-width: 800px;
  background: white;
  padding: 40px;
}
              
            
!

JS

              
                const inputText = document.getElementById('input-text');
const goForm = document.querySelector('form');
const spinner = document.querySelector('.spinner');
const loading = ['C','a','r','g','a','n','d','o'];
let loaderText;
let htmlWriter = '';

const reWrite = (e) => {
  e.preventDefault();
  loaderText = inputText.value.split('');
  if (loaderText.length > 0) {
    pushText(loaderText);
  } else {
    pushText(loading);
  }
  loaderText.lenght > 0 ? getText : loading;
}

const pushText = (text) => {
  text.forEach((e)=>{
    htmlWriter += `<span class="spinner__leter" letter="${e}">${e}</span>`;
  });
  spinner.innerHTML = htmlWriter;
  inputText.value = '';
  outPut();
}

goForm.addEventListener('submit', reWrite);
window.addEventListener('DOMContentLoaded', reWrite);

//Output Code to copy and paste
function outPut() {
  const outPutCSS = '.spinner-container{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);}.spinner-container .spinner{font-size:2em}.spinner-container .spinner__leter{font-weight:light;position:relative;color:rgba(188,188,188,.25);text-transform:uppercase}.spinner-container .spinner__leter:before{content:attr(letter);position:absolute;top:0;left:0;color:#333;animation:load-animation 2.8s infinite;animation-fill-mode:backwards;text-transform:uppercase}.spinner-container .spinner__leter:nth-child(2):before{animation-delay:.4s}.spinner-container .spinner__leter:nth-child(3):before{animation-delay:.8s}.spinner-container .spinner__leter:nth-child(4):before{animation-delay:1.2s}.spinner-container .spinner__leter:nth-child(5):before{animation-delay:1.6s}.spinner-container .spinner__leter:nth-child(6):before{animation-delay:2s}.spinner-container .spinner__leter:nth-child(7):before{animation-delay:2.4s}.spinner-container .spinner__leter:nth-child(8):before{animation-delay:2.8s}.spinner-container .spinner__leter:nth-child(9):before{animation-delay:3.2s}.spinner-container .spinner__leter:nth-child(10):before{animation-delay:3.6s}@keyframes load-animation{0%,80%,to{transform:rotateY(-90deg);opacity:0}5%{opacity:.5}20%,50%{transform:rotateY(0);opacity:1}}';
  let outPutHtml = `<section class="spinner-container"><div class="spinner">${htmlWriter}</div></section>`;
  document.querySelector('.html').innerText = outPutHtml;
  document.querySelector('.css').innerText = outPutCSS;
  htmlWriter = '';
}
              
            
!
999px

Console