JSFiddle - React, Tailwind, and code Playground
by bulbous
HTML
<div class="ihp-header" >
<!--
<div id="menuToggle" style="align-content: flex-start">
<input type="checkbox">
<span>
</span>
<span>
</span>
<span>
</span>
<ul id="menu" style="align-content: flex-start">
<li>
<a href="https://linklantern.xyz">Link Lantern</a>
</li>
<li>
<a href="https://hub.ihpacademy.com">Hub</a>
</li>
<li>
<a href="https://forum.ihpacademy.com">Forum</a>
</li>
</ul>
</div>
-->
<div id="burger" class="ihp-header-menu"><span></span><span></span><span></span></div>
<input id="burger-select" type="checkbox"></input>
<div class="ihp-logo center"><img class="noresize" src="https://linklantern.xyz/assets/img/ihp-logo-candidate.png?h=e755ac91f4fbde91787ad04ab57ad727"> </div>
</div>
CSS
:root {
--ihp-primary: #2b70e4;
--ihp-secondary: #209d5c;
}
.ihp-header {
position: relative;
}
.ihp-logo {
padding: 0 40px;
max-width: 300px;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
}
#burger {
position: absolute;
left: 0.35rem;
top: 55%;
transform: translateY(-50%);
}
#burger-select {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 2.5rem;
height: 2.5rem;
opacity: 0.2;
z-index: 2;
cursor: pointer;
}
#burger span {
display: block;
width: 2.25rem;
height: 0.25rem;
margin-bottom: 5px;
background: var(--ihp-primary);
border-radius: 3px;
z-index: 3;
opacity: 1;
}
#menuToggle {
position: relative;
top: 0px;
left: 0px;
z-index: 1;
-webkit-user-select: none;
user-select: none;
}
#menuToggle a {
text-decoration: none;
color: var(--ihp-primary);
transition: color 0.3s ease;
}
#menuToggle a:hover {
color: var(--ihp-secondary);
}
#menuToggle span:first-child {
transform-origin: 0% 0%;
}
#menuToggle span:nth-last-child(2) {
transform-origin: 0% 100%;
}
#menuToggle span {
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;
background: var(--ihp-primary);
border: solid;
border-radius: 3px;
z-index: 1;
transform-origin: 4px 0px;
transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0), background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0), opacity 0.55s ease;
}
/* * Transform all the slices of hamburger
* into a crossmark. */
#menuToggle input:checked~span {
opacity: 1;
transform: rotate(45deg) translate(-2px, -1px);
background: var(--ihp-secondary);
}
/* * But let's hide the middle one. */
#menuToggle input:checked~span:nth-last-child(3) {
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}
/* * Ohyeah and the last one should go the other direction */
#menuToggle input:checked~span:nth-last-child(2) {
transform: rotate(-45deg) translate(0,...