JSFiddle - React, Tailwind, and code Playground

by waqasahmad724

HTML

<ul class="anchor-nav">
			<li><a href="#section1" class="anchor-active">section1</a></li>
			<li><a href="#section2">section2</a></li>
			<li><a href="#section3">section3</a></li>
			<li><a href="#section4">section4</a></li>
			<li><a href="#section5">section5</a></li>
		</ul>
		<ul class="side-nav">
			<li><a href="#section1" class="anchor-active">section1</a></li>
			<li><a href="#section2">section2</a></li>
			<li><a href="#section3">section3</a></li>
			<li><a href="#section4">section4</a></li>
			<li><a href="#section5">section5</a></li>
		</ul>
		<section id="section1" class="section-active">
			<h1>section1</h1>
			<p>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
			<p>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non...

CSS

body, body * {
	max-height: 1000000px;
}
body {
	margin:0;
	color:#000;
	font:12px Arial, Helvetica, sans-serif;
	background:#fff;
	-webkit-text-size-adjust:100%;
	-ms-text-size-adjust: none;
	min-width:320px;
}
img {border-style:none;}
a {
	color:#00f;
	text-decoration:underline;
}
a:hover {text-decoration:none;}
input,
textarea,
select {
	font:100% Arial, Helvetica, sans-serif;
	vertical-align:middle;
	color:#000;
}
form,
fieldset {
	margin:0;
	padding:0;
	border-style:none;
}
q {quotes:none;}
q:before {content:''}
q:after {content:''}
header, footer, article, section, nav, figure, aside, main { display: block; }
figure { margin:0; padding:0; }
input[type="search"]{
	-webkit-appearance: none;
	-moz-box-sizing:content-box;
	-webkit-box-sizing:content-box;
	box-sizing: content-box;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration{display:none;}
::-webkit-input-placeholder {color: #babfc3;}
:-moz-placeholder {color: #babfc3;}
::-moz-placeholder {
	color: #babfc3;
	opacity:1
}
:-ms-input-placeholder {color: #babfc3;}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="submit"],
textarea{
	-webkit-appearance:none;
	border-radius:0;
	-moz-border-radius:0;
	-webkit-border-radius:0;
}
textarea{overflow:auto;}
[type="submit"]{cursor:pointer;}
button::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
	padding:0;
	border:0;
}
#wrapper {
	width:960px;
	margin:0 auto;
	overflow:hidden;
	padding:65px 0 0;
}
.anchor-nav{
	padding:0;
	margin:0;
	list-style:none;
	display:table;
	table-layout:fixed;
	width:100%;
	position:fixed;
	left:0;
	right:0;
	top:0;
	background:#fff;
}
.extra-anchor-nav {
	position: fixed;
	top: 100px;
	left: 0;
}
.extra-anchor-nav .anchor-nav .active {
	font-weight: bold;
}
.anchor-nav li{
	border:1px solid...

JavaScript

// page init
jQuery(function() {
	initAnchors();
});

// smooth anchor links
function initAnchors() {
	/* global SmoothScroll */

	// simple case:
	new SmoothScroll({
		anchorLinks: 'a.back-to-top',
    animDuration: 800
	});

	// common case:
	new SmoothScroll({
		extraOffset: $('.anchor-nav').height() || 0,
		anchorLinks: '.anchor-nav a, .side-nav a',
		activeClasses: 'link',
		wheelBehavior: 'ignore',
		animDuration: 800
	});

	// custom case:
	new SmoothScroll({
		anchorLinks: '.inner-links a',
		container: '.inner-container',
		activeClasses: 'parent'
	});
}

/*!
 * SmoothScroll module
 */
;(function($, exports) {
	// private variables
	var page,
		win = $(window),
		activeBlock, activeWheelHandler,
		wheelEvents = ('onwheel' in document || document.documentMode >= 9 ? 'wheel' : 'mousewheel DOMMouseScroll');

	// animation handlers
	function scrollTo(offset, options, callback) {
		// initialize variables
		var scrollBlock;
		if (document.body) {
			if (typeof options === 'number') {
				options = { duration: options };
			} else {
				options = options || {};
			}
			page = page || $('html, body');
			scrollBlock = options.container || page;
		} else {
			return;
		}

		// treat single number as scrollTop
		if (typeof offset === 'number') {
			offset = { top: offset };
		}

		// handle mousewheel/trackpad while animation is active
		if (activeBlock && activeWheelHandler) {
			activeBlock.off(wheelEvents, activeWheelHandler);
		}
		if (options.wheelBehavior && options.wheelBehavior !== 'none') {
			activeWheelHandler = function(e) {
				if (options.wheelBehavior === 'stop') {
					scrollBlock.off(wheelEvents, activeWheelHandler);
					scrollBlock.stop();
				} else if (options.wheelBehavior === 'ignore') {
					e.preventDefault();
				}
			};
			activeBlock = scrollBlock.on(wheelEvents, activeWheelHandler);
		}

		// start scrolling animation
		scrollBlock.stop().animate({
			scrollLeft: offset.left,
			scrollTop: offset.top
		}, options.duration, function()...