JSFiddle - React, Tailwind, and code Playground

by serhioses

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
  <body>

    <header class="header">
      <section class="block">
        <div class="container">
          <nav id="top-nav" class="top-nav">
            <div class="dropdown dropdown-root" data-level="1">
              <span class="trigger bars">
                            <i></i>
                            <i></i>
                            <i></i>
                        </span>
              <ul class="drop drop-menu">
                <li>
                  <a href="#">
                    <span>Главная</span>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <span>Портфолио</span>
                  </a>
                </li>
                <li class="dropdown" data-level="2">
                  <a href="#">
                    <span>Услуги</span>
                    <em class="trigger"></em>
                  </a>
                  <ul class="drop">
                    <li>
                      <a href="#"><span>Программирование</span></a>
                    </li>
                    <li>
                      <a href="#"><span>Вёрстка</span></a>
                    </li>
                    <li>
                      <a href="#"><span>Дизайн</span></a>
                    </li>
                    <li>
                      <a href="#"><span>SEO продвижение</span></a>
                    </li>
                  </ul>
                </li>
                <li>
                  <a href="#">
                    <span>Отзывы</span>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <span>Контакты</span>
                  </a>
                </li>
              </ul>
            </div>
          </nav>
        </div>
      </section>
    </header>
    <main class="main">
      <section class="block">
        <div...

CSS

/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}

*, *:before, *:after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

html, body {
    display: flex;
    flex-direction: column; 
}

body {
    flex: auto;
    line-height: 1.42857143;
    font-family: Arial;
    font-size: 100%;
}

a {
	text-decoration: none;
	position: relative;
}

h2 {
	margin-bottom: 10px;
	color: #222;
	line-height: 36px;
	font-size: 30px;
	text-transform: uppercase;
}

.header {
    display: flex;
    flex-direction: column;
    margin: 0 auto 10px;
    width: 100%;
    background-color: slateblue;
}

.header a {
	display: block;
	color: darkslategrey;
	white-space: nowrap;
}

.main {
    flex-grow: 1;
    margin: 0 auto;
    width: 100%;
    min-width: 320px;
    padding-top: 10px;
    padding-bottom: 20px;
}

.footer {
    margin: 0 auto;
    width: 100%;
}

.block {
    width: 100%;
}

.container {
	margin: 0 auto;
	min-width: 320px;
	padding: 15px;
}

.dropdown {
	position: relative;
}

.dropdown .drop {
	display: none;
}

.dropdown.opened > .drop {
	display: block;
}

.trigger {
	cursor: pointer;
}

.top-nav .bars {
	display: inline-block;
	width: 40px;
	height: 34px;
}

.top-nav .bars i...

JavaScript

;(function () {
    'use strict';
    
    var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;

    window.requestAnimationFrame = requestAnimationFrame;

    Element.prototype.siblings = function () {
        var siblings = [], parentChildren = this.parentNode.children, i;

        for (i = 0; i < parentChildren.length; i++) {
            if (parentChildren[i].nodeType === 1 && parentChildren[i] !== this) {
                siblings.push(parentChildren[i]);
            }
        }

        return siblings;
    };

    Element.prototype.css = function (obj) {
        var prop;

        for (prop in obj) {
            this.style[prop] = obj[prop];
        }

        return this;
    }

    function Dropdown (root, options) {
        var defaults = {
                hideSiblings: true,
                hideOnOtherDropsClick: true,
                hideOutside: true,
                hideNested: true,
                trigger: 'dropdown',
                effect: 'toggle',
                animationDuration: 300
            },
            effects = {
                toggle: function (current, hide) {
                    var triggerClassList = current.trigger.classList,
                        dropdownClassList = current.dropdown.classList;

                    if (hide) {
                        triggerClassList.remove('active');
                        dropdownClassList.remove('opened');
                        dropdownClassList.remove('pressed');
                    } else {
                        triggerClassList.toggle('active');
                        dropdownClassList.toggle('opened');
                        dropdownClassList.toggle('pressed');
                    }

                    return current;
                },
                slide: function (current, hide) {
                    var h, maxHeight, step,
                        triggerClassList...