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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <div class="timer" id="timer"></div>
<div class="container">
  <div class="quote-display" id="quoteDisplay"></div>
  <textarea id="quoteInput" class="quote-input" autofocus></textarea>

<!-- Side Links Only -->
<div class="side-links">
  <a href="" target="_blank" class="side-link side-link-youtube">
    <i class="fab fa-youtube-square side-link-icon"></i>
    <span class="side-link-text">View Tutorial</span>
  <a href="" target="_blank" class="side-link side-link-github side-link-icon">
    <i class="fab fa-github-square"></i>
    <span class="side-link-text">View GitHub</span>
  <a href="" target="_blank" class="side-link side-link-twitter">
    <i class="fab fa-twitter-square side-link-icon"></i>
    <span class="side-link-text">View Twitter</span>


                * {
  box-sizing: border-box;

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: #1E0555;

body, .quote-input {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;

.container {
  background-color: #F0DB4F;
  padding: 1rem;
  border-radius: .5rem;
  width: 700px;
  max-width: 90%;

.timer {
  position: absolute;
  top: 2rem;
  font-size: 3rem;
  color: #F0DB4F;
  font-weight: bold;

.quote-display {
  margin-bottom: 1rem;
  margin-left: calc(1rem + 2px);
  margin-right: calc(1rem + 2px);

.quote-input {
  background-color: transparent;
  border: 2px solid #A1922E;
  outline: none;
  width: 100%;
  height: 8rem;
  margin: auto;
  resize: none;
  padding: .5rem 1rem;
  font-size: 1rem;
  border-radius: .5rem;

.quote-input:focus {
  border-color: black;

.correct {
  color: green;

.incorrect {
  color: red;
  text-decoration: underline;

/* Background Styles Only */

@import url('');

* {
    font-family: Raleway;

.side-links {
  position: absolute;
  top: 15px;
  right: 15px;

.side-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: 10px;
  color: white;
  width: 180px;
  padding: 10px 0;
  border-radius: 10px;

.side-link-youtube {
  background-color: red;

.side-link-twitter {
  background-color: #1DA1F2;

.side-link-github {
  background-color: #6e5494;

.side-link-text {
  margin-left: 10px;
  font-size: 18px;

.side-link-icon {
  color: white;
  font-size: 30px;


                const RANDOM_QUOTE_API_URL = ''
const quoteDisplayElement = document.getElementById('quoteDisplay')
const quoteInputElement = document.getElementById('quoteInput')
const timerElement = document.getElementById('timer')

quoteInputElement.addEventListener('input', () => {
  const arrayQuote = quoteDisplayElement.querySelectorAll('span')
  const arrayValue = quoteInputElement.value.split('')

  let correct = true
  arrayQuote.forEach((characterSpan, index) => {
    const character = arrayValue[index]
    if (character == null) {
      correct = false
    } else if (character === characterSpan.innerText) {
    } else {
      correct = false

  if (correct) renderNewQuote()

function getRandomQuote() {
  return fetch(RANDOM_QUOTE_API_URL)
    .then(response => response.json())
    .then(data => data.content)

async function renderNewQuote() {
  const quote = await getRandomQuote()
  quoteDisplayElement.innerHTML = ''
  quote.split('').forEach(character => {
    const characterSpan = document.createElement('span')
    characterSpan.innerText = character
  quoteInputElement.value = null

let startTime
function startTimer() {
  timerElement.innerText = 0
  startTime = new Date()
  setInterval(() => {
    timer.innerText = getTimerTime()
  }, 1000)

function getTimerTime() {
  return Math.floor((new Date() - startTime) / 1000)