JSFiddle - React, Tailwind, and code Playground

by JokerMartini

HTML

<script src="https://code.jquery.com/jquery-1.7.2.js"></script>
	<body>
		<div class="page-wrapper">
			<div class="left-column">
				<div class="inner-content">
					<h2>Table of Contents</h2>
					<ul>
						<li><a href="#" class="nav-title" data-title="intro">Introduction</a>
							<ul>
								<li><a href="#" class="nav-title" data-title="what">What is ?</a></li>
								<li><a href="#" class="nav-title" data-title="why">Why ?</a></li>
							</ul>
						</li>
						<li>Installation
							<ul>
								<li>Overview</li>
								<li><a href="#" class="nav-title" data-title="test">Test</a></li>
							</ul>
						</li>				
					</ul>
				</div>
			</div>
			<div class="right-column">
				<div class="inner-content">
						<h1 class="section-title" data-title="intro">Introduction</h1>
						<hr>
						<h2 class="section-title" data-title="what">What is ?</h2>
						<p> is a standalone node based editor for constructing, managing, and manipulating 3D computer generated scenes.</p> 
						<p>The unique design of  allows users to work with massive scenes for any kind of project, both small and large.  removes repeating scene setup work with it’s dynamic tokening system and flexible framework. Artists can save, reuse, and share setups.</p>

						<h2 class="section-title" data-title="why">Why?</h2>

						<hr>
						<hr>
						<hr>




						<h2>Supported Software</h2>
						<hr>
						<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. in turpis pulvinar facilisis....

CSS

/* Globals
-------------------------------------------------------------------------------*/
html, body {
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}
 
.page-wrapper {
    height: 100%;
    position: relative;
}
 
.left-column {
    position:fixed;
    top:0;
    left:0;
    width:240px;
    height:100%;
  border-right: dotted 1px rgb(200,200,200);
}
 
.right-column {
    margin-left:240px;
    min-height:100%;
}
.inner-content {
  padding: 1em;
}

JavaScript

function scroll_to_element(element) {
    $('html, body').animate({scrollTop: $(element).offset().top}, 500);
}
 
$(window).ready(function() {
 
    $(".nav-title").click(function() {
        var target = $(this);
 
        // get data-filter text
        var title = target.data('title').toLowerCase();
 
        // collect section titles
        sections = $( ".section-title" );
 
        // loop through and scroll to valid section
        for (i = 0; i < sections.length; i++) { 
            var section = $(sections[i]);
            var section_title = section.data('title').toLowerCase();
             
            if (section_title === title) {
                scroll_to_element(section)
                // console.log(target);
            }
        }
    });
});