JSFiddle - React, Tailwind, and code Playground
by humanzing
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.js"></script>
<div class="dashboard">
<div>
<label>
<a>Menu</a>
<input type="checkbox">
<span>
<h4>UDF Panel</h4>
<ul>
<li>Exchange</li>
<li>Refresh</li>
<li>Listes</li>
<li>Add</li>
</ul>
<!-- <ul>
<li>Les règles</li>
<li>Impulsive 12345</li>
<li>Corrective ABC</li>
<li>Triangle D'Eliott ABCDE</li>
<li>Triple Combo WXYXZ</li>
<li>Double Combo WXY</li>
</ul>-->
<ul>
<li>Admin</li>
<li>Change PW</li>
<li>Logout</li>
</ul>
</span>
</label>
</div>
<div>
</div>
</div>
CSS
html, body {
height: 100%;
font-family: 'Lato', sans-serif;
overflow: hidden;
}
body {
background: linear-gradient(135deg, rgba(65,131,155,1) 0%,rgba(51,98,123,1) 100%);
padding:0;
margin:0;
}
*:focus {
outline: none;
}
* {
box-sizing: border-box;
}
.dashboard {
width: 80%;
height: 80vh;
background: #202b33;
margin: 60px auto;
border-radius: 4px;
overflow: hidden;
min-height:350px;
display: grid;
grid-template-columns: 20% 80%;
position:relative;
}
.dashboard > div{
padding: 30px;
}
.dashboard > div:nth-child(2){
padding: 30px;
position:relative;
overflow-y: auto;
}
.dashboard > div > label > a{
color:#fff;
display:none;
}
.dashboard > div > label > a:hover{
color:#ddd;
cursor:pointer;
}
.dashboard > div > label > input[type="checkbox"]{
display:none;
}
.dashboard > div > label > span {
margin-top:15px;
}
.dashboard > div > label > span > h4{
text-align:center;
margin: 10px 0;
font-size: 13px;
font-weight: 200;
letter-spacing: 1px;
text-transform: uppercase;
margin: 0;
color:white;
}
.dashboard > div > label > span > ul{
text-align:center;
list-style:none;
padding:0;
margin:0;
text-align:left;
padding-left:5px;
padding-right:5px;
margin: 24px 0;
}
.dashboard > div > label > span > ul > li{
text-align:center;
text-align:left;
cursor:pointer;
overflow: hidden;
//text-overflow: ellipsis;
white-space: nowrap;
}
.dashboard > div > label > span > ul > li > a{
background: rgba(255,255,255,0.2);
border-radius:5px;
padding:3px 7px;
margin: 0 15px;
color:white;
}
.dashboard > div > label > span > ul > li:first-child {
height: 35px;
line-height: 35px;
font-size: 16px;
font-weight: 400;
color: #fff;
cursor: default;
}
.dashboard > div > label > span > ul > li:hover:first-child {
}
.dashboard > div > label > span > ul > li:hover {
color:white;
}
.dashboard > div > label > span > ul > li {
...
JavaScript
function filterFunction() {
var input, filter, ul, li, a, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
div = document.getElementById("myDropdown");
a = div.getElementsByTagName("a");
for (i = 0; i < a.length; i++) {
if (a[i].innerHTML.toUpperCase().indexOf(filter) > -1) {
a[i].style.display = "";
} else {
a[i].style.display = "none";
}
}
}
function f(t)
{
document.getElementById("myInput").value = t.innerText;
}
function a(t)
{
document.getElementById("myInput").value = t.innerText;
}