JSFiddle - React, Tailwind, and code Playground
by Gwyn Milcote
HTML
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<div id='sidebar'>[links generated here]</div>
<div id='main'>
<div id='header'>
<h2>about...</h2>
<p>paragraph...</p>
</div>
<div id='content'>
<article>
<h1>Welcome</h1>
<p>A ocumentati</p>
<p><img src="http" alt="screenshot-2"></p>
<h2>Thanks</h2>
<p>Thanks to <a href="http">......</a> and <a href="https://gi">....</a>.</p>
<h2>License</h2>
<p>Licensed under ...</p>
</article>
</div>
<div id='footer'>
footer...
</div>
</div>
CSS
div, img, p, a, button, canvas, pre, code {
box-sizing: border-box;
}
:root {
--colourLight: #eee;
--colourMedium: linear-gradient(to top left, #FFFBC9, #F4D1B4);
--colourDark: #aaa;
}
html, body {
height: 100%;
width: 100%;
}
body {
color: rgba(0, 0, 0, 0.7);
background-color: #ffffff;
margin: 0 auto;
padding: 0;
font-family: 'Nunito', Helvetica, sans-serif;
font-size: 16px;
}
img {
max-width: 100%;
max-height: 400px;
width: auto;
height: auto;
}
a {
color: #000000;
}
a:hover {
color: grey;
}
h1, h2, h3, {
color: #000;
font-weight: bold;
margin: 0;
}
code {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
background: #f4f4f4;
padding: 1px 5px;
}
#main {
float: right;
width: calc(100% - 220px);
min-height: 100%;
position: relative;
}
#header {
background: var(--colourMedium);
padding: 30px 30px 10px 30px;
text-align: center;
}
#header h2 {
margin: 0;
}
#content {
display: block;
background-color: #fff;
padding: 0 0 100px 30px;
}
#sidebar {
float: left;
display: block;
width: 220px;
background: #fff;
overflow: auto;
position: fixed;
height: 100%;
}
#sidebar .title {
background: var(--colourMedium);
padding: 5px 10px;
font-size: 20px;
font-weight: bold;
}
#sidebar ul {
padding: 0;
margin: 10px 0;
list-style-type: none;
}
#sidebar ul a {
text-decoration: none;
display: block;
font-size: 14px;
}
#sidebar ul a:hover {
color: #000;
}
#sidebar ul li {
padding: 3px 0 3px 20px;
transition: 0.3s;
}
#sidebar ul li:hover {
background-color: #eee;
transition: 0.3s;
}
#footer {
background: var(--colourMedium);
text-align: center;
padding: 15px 30px;
width: 100%;
height: 80px;
position: absolute;
bottom: 0;
left: 0;
}
pre {
display: block;
font-size: 14px;
width: 95%;
max-height: 100px;
overflow: auto;
border: 1px solid #aaa;
}
pre code {
line-height:...
JavaScript
const navSections = [
{
title: "Welcome",
links: [
{title: "Index - About Griffin", url: ""},
{title: "Help me out?", url: "support"},
]
},{
title: "Introduction",
links: [
{title: "Frontend & Backend", url: "front-back"},
{title: "About PHP", url: "about-php"},
{title: "About Databases", url: "about-db"},
{title: "MVC Structure", url: "mvc"},
{title: "Extending Classes", url: "classes"},
{title: "GET vs POST", url: "get-post"},
{title: "Sessions", url: "sessions"}, {title: "Security", url: "security"},
{title: "Exceptions", url: "exceptions"}
]
},{
title: "Griffin Basics",
links: [
{title: "Installation Guide", url: "install"},
{title: "Upload to Web Host", url: "webhosting"},
{title: "Site Settings", url: "settings"},
{title: "Routing", url: "routing"},
{title: "Pagination", url: "pagination"},
{title: "Data Mapper", url: "data-mapper"},
{title: "AJAX Requests", url: "ajax"},
{title: "Validation", url: "validation"},
{title: "Guide: add new pages", url: "add-pages"}
]
},{
title: "Key Gameplay",
links: [
{title: "User Accounts", url: "accounts"},
{title: "Restricting Pages", url: "permissions"},
{title: "Admins & Moderation", url: "admin"},
{title: "Pets", url: "pets"},
{title: "Items & Inventory", url: "items"},
{title: "Item Functions", url: "item-functions"},
{title: "Private Messages", url: "messages"},
{title: "Forum", url: "forum"},
{title: "Displaying Pet Images", url: "images"},
]
},{
title: "More Gameplay",
links: [
{title: "Activity Log", url: "activity"},
...