JSFiddle - React, Tailwind, and code Playground

by Vivekk Upadhyay

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="image-wrapper">
  <a href="home.html">
    <img src="http://japesfawcett.com/testsh/images/landing_logo2.png" />
  </a>

  
</div>

<div id="test" class="fancy_title">
      <canvas width=640 height=100></canvas>
  </div>

CSS

body {
		background-color: #000;
	}
	
@font-face {
    font-family: segoe;
    src: url(fonts/segoesc.ttf);
}

div.image-wrapper {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
}

.image-wrapper img {
  display: block;
}

#test { position:absolute; left:0; top:70%; right:0; height:100px; margin: 0 auto; text-align:center;
  width: 100%;
}

#test p {
  width: 100%;
  font-family: 'Loved by the King';
  font-size: 30px;
  text-align: center;
  color: #FAEDE8;
  margin-top: -40px;
    -webkit-animation: fadeInLeft 5s; /* Safari, Chrome and Opera > 12.1 */
       -moz-animation: fadeInLeft 5s; /* Firefox < 16 */
        -ms-animation: fadeInLeft 5s; /* Internet Explorer */
         -o-animation: fadeInLeft 5s; /* Opera < 12.1 */
            animation: fadeInLeft 5s;
}

#test canvas { margin:0 auto; text-align:center;    font-family: 'Loved by the King'; }
@keyframes fadeInLeft {
    0% { 
        opacity: 0; 
        -webkit-transform: translateX(-15px); 
    } 
    100% { 
        opacity: 1; 
        -webkit-transform: translateX(0); 
    } 
}

/* Firefox < 16 */
@-moz-keyframes fadeInLeft {
    0% { 
        opacity: 0; 
        -webkit-transform: translateX(-15px); 
    } 
    100% { 
        opacity: 1; 
        -webkit-transform: translateX(0); 
    } 
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadeInLeft {
    0% { 
        opacity: 0; 
        -webkit-transform: translateX(-15px); 
    } 
    100% { 
        opacity: 1; 
        -webkit-transform: translateX(0); 
    } 
}

/* Internet Explorer */
@-ms-keyframes fadeInLeft {
   0% { 
        opacity: 0; 
        -webkit-transform: translateX(-15px); 
    } 
    100% { 
        opacity: 1; 
        -webkit-transform: translateX(0); 
    } 
}

/* Opera < 12.1 */
@-o-keyframes fadeInLeft {
   0% { 
...

JavaScript

WebFontConfig = {
    google: { families: [ 'Loved+by+the+King::latin' ] }
  };
  (function() {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
      '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
  })(); 


 //$(".fancy_title p").lettering();

// get 2D context
	var ctx = document.querySelector("canvas").getContext("2d"),
	
	    // dash-length for off-range
        dashLen = 220,
		
		// we'll update this, initialize
        dashOffset = dashLen,
		
		// some arbitrary speed
        speed = 5,
		
		// the text we will draw
        txt = "enter the sunshine state",
		
		// start position for x and iterator
		x = 30, i = 0;

// Comic Sans?? Let's make it useful for something ;) w/ fallbacks
    ctx.font = "50px Loved by the King"; 
	
	// thickness of the line
    ctx.lineWidth = 1; 
	
	// to avoid spikes we can join each line with a round joint
	//ctx.lineJoin = "round";
	
	// increase realism letting background (f.ex. paper) show through
	ctx.globalAlpha = 2/3;
	
	// some color, lets use a black pencil
    ctx.strokeStyle = ctx.fillStyle = "#FFF";


(function loop() {
      // clear canvas for each frame
      ctx.clearRect(x, 0, 60, 150);
      
      // calculate and set current line-dash for this char
      ctx.setLineDash([dashLen - dashOffset, dashOffset - speed]);
      
      // reduce length of off-dash
      dashOffset -= speed;
      
      // draw char to canvas with current dash-length
      ctx.strokeText(txt[i], x, 90);

      // char done? no, the loop
      if (dashOffset > 0) requestAnimationFrame(loop);
      else {
      
        // ok, outline done, lets fill its interior before next
        ctx.fillText(txt[i], x, 90);
        
        // reset line-dash length
        dashOffset = dashLen;
        
        //...