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

              
                // Author: Jouan Marcel
// Author URI: https://jouanmarcel.com

.t3xts.t3xt-1 NO!
.t3xts.t3xt-2 THIS IS
.t3xts.t3xt-3 PATRICK!

a(href="https://jouanmarcel.com" target="_blank").ref 🔗 Jouan Marcel
              
            
!

CSS

              
                *
  margin: 0px
  padding: 0px
  box-sizing: border-box

body
  font-family: "Roboto Mono"
  font-size: 50px
  padding: 50px 0 0 100px
  display: flex
  align-items: stretch
  flex-direction: column
  font-weight: 700
  color: #fff
  background-image: radial-gradient(#e85e3c, #7c1717)
  background-repeat: no-repeat
  height: 100vh

.t3xts
  line-height: 1
  position: relative
  perspective: 1000px
  text-transform: uppercase
.t3xt
  transform-style: preserve-3d
  position: absolute
  top: 0
  text-transform: uppercase
.t3xt-out
  animation: text-out .5s ease
.t3xt-in
  animation: text-in .5s ease

@keyframes text-out
  to
    transform: rotateX(90deg)
    opacity: 0
@keyframes text-in
  from
    opacity: 0
    transform: rotateX(-90deg)
  to
    transform: rotateX(0deg)
    opacity: 1
	
.ref
  background-color: #000
  border-radius: 3px
  padding: 5px 8px
  position: absolute
  font-size: 16px
  bottom: 10px
  right: 10px
  color: #fff
  font-weight: 300
  font-family: sans-serif
  text-decoration: none
  &::first-letter
    font-size: 12px
    
              
            
!

JS

              
                
function n3xt(text, element) {
  let sample = document.querySelector(element)
  if(sample.dataset.animating === 'true') return
  let sampleH = 50 // will keep it fixed, otherwise sample.offsetHeight
  let sampleT = sample.textContent // old text
  let sampleNT = text // new text
  sample.dataset.animating = 'true'
  sample.style.height = sampleH + 'px'

  // original text element
  let samO = document.createElement('div')
  samO.style.transformOrigin = '0 ' + (sampleH/2) + 'px -' + (sampleH/2) + 'px'
  samO.classList.add('t3xt')
  samO.textContent = sampleT

  // new text element
  let samN = samO.cloneNode()
  samN.textContent = sampleNT
  sample.textContent = ''
  sample.appendChild(samO)
  sample.appendChild(samN)

  samO.classList.add('t3xt-out')
  samN.classList.add('t3xt-in')
  
  samN.addEventListener('animationend', function(event){
    sample.removeChild(samO)
    sample.removeChild(samN)
    sample.textContent = sampleNT
    sample.dataset.animating = 'false'
  })
}


let phraseIndex = 1
let wordIndex = 0
let t3xts = [
  ["No!", "This is", "Patrick!"],
  ["I can't", "see my", "forehead"],
  ["Is mayonnaise", "an instrument?"],
  ["F stands", "for Fun", "🎶"],
  ["I wumbo", "you wumbo", "he/she/me wumbo"],
  ["It may be", "stupid, but", "it's also dumb"],
  ["Moss always", "points to", "civilization"]
]

// start it off
setTimeout(changetext, 200)

function changetext(){
  if(wordIndex > 2) {
    wordIndex = 0
    phraseIndex++
  }
  if(phraseIndex >= t3xts.length) {
    phraseIndex = 0
  }
  let term = t3xts[phraseIndex][wordIndex]
  n3xt(term, '.t3xt-' + (++wordIndex) )
  
  if(wordIndex == 3) {
    setTimeout(changetext, 2000)
  } else {
    setTimeout(changetext, 150)
  }
}

              
            
!
999px

Console