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

              
                <link rel="stylesheet" href="https://unpkg.com/@auroratide/typewritten-text/lib/style.css" />
<script type="module" src="https://unpkg.com/@auroratide/typewritten-text/lib/define.js"></script>

<article>
  <section id="janet" style="--bubble: #ADCEDD;">
    <figure>
      <img src="https://i.imgur.com/W1l95nt.png" alt="A girl with brown hair and blue eyes." />
      <figcaption>Janet</figcaption>
    </figure>
    <blockquote><typewritten-text letter-interval="50">Hi! I'm <strong>Janet</strong>, the new gal on the team. What's your name?</typewritten-text></blockquote>
  </section>
  <section id="dinesh" class="flipped" style="--bubble: #CCB8B3;">
    <blockquote><typewritten-text letter-interval="50" paused>I'm <strong>Dinesh</strong>, the UI designer. The first thing you should know is our team lead is always <em>at least</em> five minutes late.</typewritten-text></blockquote>
    <figure>
      <img src="https://i.imgur.com/HVReWxe.png" alt="A boy with black hair and brown eyes." />
      <figcaption>Dinesh</figcaption>
    </figure>
  </section>
</article>
              
            
!

CSS

              
                :root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --color-bg: hsl(0, 0%, 93%);
    --color-fg: hsl(0, 0%, 100%);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin-top: 0;
}

body {
    font-family: var(--font);
    padding: 0.5em;
    background: var(--color-bg);
}

article {
  max-width: 50rem;
  margin: auto;
}

img {
  width: 100%;
  display: block;
}

blockquote {
  margin: 0;
}

figure {
  margin: 0 1rem;
}

section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%; 
  margin-bottom: 1em;
}

section figure {
  flex: 0 1 33%;
  max-width: 10rem;
  margin-bottom: 1em;
}

section figcaption {
  text-align: center;
}

section blockquote {
  font-size: 1.25rem;
  flex: 1;
  position: relative;
  background: var(--bubble);
  padding: 1em;
  border-radius: 0.5em;
  position: relative;
}

section blockquote::after {
  content: '';
  background: var(--bubble);
  position: absolute;
  width: 1em;
  height: 1em;
  left: 1.2em;
  top: -0.2em;
  transform: skew(-20deg, -20deg);
}

section.flipped figure {
  align-self: flex-end;
}

section.flipped img {
  transform: scaleX(-1);
}

section.flipped blockquote::after {
  top: auto;
  left: auto;
  right: 1.2em;
  bottom: -0.2em;
  transform: skew(-20deg, -20deg);
}

.typewritten-text_character::after, .typewritten-text_start::after {
  display: none;
}

@media screen and (min-width: 32rem) {
  section {
    flex-direction: row;
  }
  
  section blockquote::after {
    top: auto;
    right: auto;
    left: -0.2em;
    bottom: -0.2em;
    transform: skew(-20deg, -20deg);
  }
  
  section.flipped blockquote::after {
    top: auto;
    right: -0.2em;
    left: auto;
    bottom: -0.2em;
    transform: skew(20deg, 20deg);
  }
}
              
            
!

JS

              
                const janet = document.querySelector('#janet typewritten-text')
const dinesh = document.querySelector('#dinesh typewritten-text')

janet.addEventListener('typewritten-text:phrasetyped', () => {
  setTimeout(dinesh.start, dinesh.phraseInterval)
})
              
            
!
999px

Console