JSFiddle - React, Tailwind, and code Playground

by Glynne Turner

HTML

<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
 
 
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
  <style>
   
  </style> 
  <header>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="#">Local Magazine Company</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav ml-auto">
        <li class="nav-item">
          <a class="nav-link" href="#">Home</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#about-us">About Us</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#featured-articles">Featured Articles</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#subscribe">Subscribe</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#contact-us">Contact Us</a>
        </li>
      </ul>
    </div>
  </nav>
  <div class="jumbotron jumbotron-fluid d-flex align-items-center animate">
      <div class="container text-center">
        <h1 class="display-4 animate fadeInDown">Local Magazine Company</h1>
        <p class="lead animate fadeInUp">Bringing you the best in local news, arts, culture, and more.</p>
        <a href="#subscribe" class="btn btn-primary btn-lg...

CSS

.jumbotron {
      background-image: url("https://mlmuuous6dwe.i.optimole.com/DfwWcdQ-wlJcJ3sX/w:1024/h:647/q:auto/https://technation.io/wp-content/uploads/2019/08/digital-northampton.png?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80");
      background-size: cover;
      color: white;
      min-height:100vh;
      text-shadow: 1px 1px 3px black;
    }
    .jumbotron h1 {
      font-size: 4rem;
    }
    .jumbotron p {
      font-size: 1.5rem;
    }
    
   /* ANIMATIONS */
@charset...

JavaScript

var doAnimations = function() {
     
    // Calc current offset and get all animatables
    var offset = $(window).scrollTop() + $(window).height(),
        $animatables = $('.animate');
    
    // Unbind scroll handler if we have no animatables
    
    
    // Check all animatables and animate them if necessary
		$animatables.each(function(i) {
       var $animatable = $(this);
			if (($animatable.offset().top + $animatable.height() -300 ) < offset) {
        $animatable.removeClass('animate').addClass('animated');
			} else{
        $animatable.removeClass('animated').addClass('animate');}
    });

	};
  
  // Hook doAnimations on scroll, and trigger a scroll
	$(window).on('scroll', doAnimations);
    $(window).trigger('scroll');
    $(document).ready(function(){
  // we call the function 
  doAnimations();
});