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

              
                <div id="alertHolder">
  <div id="top">
    <div id="innerTop">
      <div id="mainText" class="hiddenText">NerdOrDie</div>
      <div class="outline">NerdOrDie</div>
      <div class="solid">NerdOrDie</div>
    </div>
  </div>
  <div id="bot">
    <div id="line"></div>
    <div id="botLeft">
      <div id="innerLeft">
        <div id="subText" class="hiddenText">8 Month Resub</div>
        <div id="botLeftTextHolder">
          <div class="outline">8 Month Resub</div>
          <div class="solid">8 Month Resub</div>
        </div>
      </div>
    </div>
    <div id="botRight">
      <div id="box">
        <div id="boxBackground"></div>
        <div id="boxText" class="hiddenText">감사합니다</div>
        <div id="botRightTextHolder">
          <div class="outline">감사합니다</div>
          <div class="solid">감사합니다</div>
        </div>
      </div>
    </div>
  </div>
  <div id="messageHolder">
    <div id="alert-user-message">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est quas, quaerat temporibus dicta omnis dolor eos maiores, quisquam voluptatem fuga, nisi labore placeat facere odio nesciunt nihil minus ex officia</div>
  </div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Montserrat:400,800,900&display=swap');
@import url('https://fonts.googleapis.com/css?family=Black+Han+Sans&display=swap');

:root {
  --fontFamily: 'Montserrat', sans-serif;
  --boxFont: 'Black Han Sans', sans-serif;
  
  --accentColor: #ff005c;
  
  --topColor: #FFF;
  --topSize: 54px;
  --topWeight: 900;
  
  --botColor: #FFF;
  --botSize: 28px;
  --botWeight: 900;
  
  --boxColor: #FFF;
  --boxWeight: 400;
  
  --textTransform: uppercase;
  
  --lineHeight: 4px;
}

html, body {
  padding: 0;
  margin: 0;
  font-family: var(--fontFamily);
  text-transform: var(--textTransform);
  overflow: hidden;
  background: #000;
}

#alertHolder {
  display: inline-block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  opacity: 1;
}

#top {
  color: var(--topColor);
  font-size: var(--topSize);
  font-weight: var(--topWeight);
  line-height: var(--topSize);
  position: relative;
  padding-bottom: calc(4px + var(--lineHeight));
  overflow: hidden;
  min-width: 350px;
}

#bot {
  color: var(--botColor);
  font-size: var(--botSize);
  font-weight: var(--botWeight);
  line-height: var(--botSize);
  padding: 10px 0;
  position: relative;
}

#line {
  height: var(--lineHeight);
  width: 100%;
  background: var(--accentColor);
  position: absolute;
  top: 0;
  left: 0;
}

#botLeft, #botRight {
  display: inline-block;
  position: absolute;
  top: 0;
}

#botLeft {
  width: 60%;
  left: 0;
  padding: calc(10px + var(--lineHeight)) 0 10px;
  overflow: hidden;
}

#botRight {
  text-align: center;
  width: 40%;
  right: 0;
  font-family: var(--boxFont) !important;
}

#box {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 10px 0;
  font-weight: var(--boxWeight);
}

#boxText {
  position: relative;
  text-align: center;
  z-index: 999;
}

#boxBackground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accentColor);
}

.outline, .solid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#botLeftTextHolder {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform-origin: left top;
}

#botRightTextHolder {
  position: absolute;
  width: 100%;
  height: 100%;
  right: 0;
  top: 0;
  transform-origin: center center;
}

#botLeft .outline, #botLeft .solid {
  top: 50%;
  left: 0;
  transform: translate(0%, -50%);
  transform-origin: left center;
}

#top .outline {
  color: rgba(0,0,0,0);
  -webkit-text-stroke: .5px var(--topColor);
}

#botLeft .outline {
  color: rgba(0,0,0,0);
  -webkit-text-stroke: .5px var(--botColor);
}

#box .outline {
  color: rgba(0,0,0,0);
  -webkit-text-stroke: .5px var(--boxColor);
}

.solid {
  opacity: 0;
  -webkit-text-stroke: 1px rgba(0,0,0,0);
}

#box .solid {
  opacity: 1;
}

#box .outline {
  opacity: 0;
}

.hiddenText {
  color: rgba(0,0,0,0) !important;
}


#messageHolder {
  position: relative;
}

#alert-user-message {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 600px;
  transform: translateX(-50%);
  text-align: center;
  white-space: normal;
}

#alert-user-message img {
    vertical-align: middle;
    height: 1em;
}
              
            
!

JS

              
                (function () {
  
  const yAmount = "+=1920",
        xAmount = "+=0"

console.clear;
  
const scriptUrls = [
  "https://ext-assets.streamlabs.com/users/140067/gsap2-1-2.js",
  "https://ext-assets.streamlabs.com/users/140067/SplitText-2-1-2.min.js"
];
  
  
function loadMedia (media) {
  return new Promise((resolve, reject) => {

  media.oncanplay = resolve
  media.onerror = reject
})}

function loadScript (url) {
  return new Promise(function (resolve, reject) {
    const script = document.createElement('script')
    script.onload = resolve
    script.onerror = reject

    script.src = url

    document.head.appendChild(script)
  })
}
  
if (!window.jQuery) {
  scriptUrls.push("https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js");
}
Promise.all([
  ...scriptUrls.map(src => loadScript(src)),
  // ...mediaElements.map(media => loadMedia(media))
])
.then(() => animate())

function wrapText(wrapSelector){
  var splitText = new SplitText(wrapSelector, {type: 'chars'});
  return splitText.chars;
}
  
function wrapLines(wrapSelector){
  var splitText = new SplitText(wrapSelector, {type: 'lines'});
  return splitText.lines;
}

function checkTextWidth(element, measure, width, padding){
  
    let elementWidth = $(measure).width();

    if(elementWidth > width){
      let transformAmount = (width - padding)/elementWidth;
      $(element).css('transform', 'scale(' + transformAmount + ')');
    }
} 
  
let animate = function() { 
    
  let messageLines = wrapLines("#alert-user-message");
  
  checkTextWidth("#botLeftTextHolder", "#botLeftTextHolder .solid", $("#botLeft").outerWidth(), 20);
  checkTextWidth("#botRightTextHolder", "#botRightTextHolder .solid", $("#botRight").outerWidth(), 20);
  
  // checkTextWidth("#mainTextHolder span", $("#mainTextHolder").innerWidth());
  
  function blinkBox() {
    TweenMax.to("#boxBackground", 0.01, {opacity: 0, yoyo: true, repeatDelay: .1, repeat: 5})
    TweenMax.to("#box .solid", 0.01, {opacity: 0, yoyo: true, repeatDelay: .1, repeat: 5})
    TweenMax.to("#box .outline", 0.01, {opacity: 1, yoyo: true, repeatDelay: .1, repeat: 5})
  }
  
  function blinkTop() {
    TweenMax.set("#top .outline", {opacity: 1});
    TweenMax.set("#top .solid", {opacity: 0});
    TweenMax.to("#top .outline", 0.02, {opacity: 1});
    TweenMax.to("#top .solid", 0.02, {opacity: 1, yoyo: true, repeatDelay: .1, repeat: 2, onComplete: hideTopOut});
    function hideTopOut(){
      TweenMax.set("#top .outline", {opacity: 0});
    }
  }
  
  function blinkBot() {
    TweenMax.set("#botLeft .outline", {opacity: 1});
    TweenMax.set("#botLeft .solid", {opacity: 0});
    TweenMax.to("#botLeft .outline", {opacity: 1});
    TweenMax.to("#botLeft .solid", 0.05, {delay: .5, opacity: 1, yoyo: true, repeatDelay: .1, repeat: 2, onComplete: hideBotOut});
    function hideBotOut(){
      TweenMax.to("#botLeft .outline", 0.05, {opacity: 0});
    }
  }

  tl = new TimelineMax();
  tl.set("#alertHolder", {autoAlpha: 1, delay: .2})
  
    .from("#boxBackground", .5, {y: yAmount, x: xAmount, ease: Power4.easeOut})
    .from("#botRightTextHolder .solid", .2, {opacity: 0}, "-=.3")
    .to("#botRightTextHolder .solid", .1, {delay: .2})
  
    .add( function(){
      blinkBox();
    })
  
    .from("#botRight", .4, {left: "50%", x: "-50%", delay: 1.2, ease: Power2.easeOut})
    
    .from("#line", .4, {scaleX: 0, ease: Power2.easeOut}, "-=.4")
    .add( function(){
      blinkBot();
    })
    .add( function(){
      blinkTop();
    })
    .from("#innerLeft", .4, {x: "110%", ease: Power1.easeOut}, "-=.2")
    .from("#innerTop", .3, {y: "110%", ease: Power1.easeOut}, "-=.2")
    
    .to("#innerTop", 0, {delay: .8})
  
    .staggerFrom(messageLines, 0.4, {
      y: 3,
      autoAlpha:0,
      stagger: {
        ease: Power4.easeNone,
        amount: 0.3
      }
    }, null)
    .add( function(){
      blinkTop();
    })
  
    .to("#innerLeft", 0, {delay: .5})
    .add( function(){
      blinkBot();
    })

  
} // end of animate

}());  // end of function wrapper
              
            
!
999px

Console