JSFiddle - React, Tailwind, and code Playground
by the94air
HTML
<form action="contact.php" method="post" class="form">
<section class="form-grid">
<div class="name-section">
<input type="text" name="name" id="name" required autocomplete="name" placeholder=" ">
<label for="name" class="label-name">
<span class="content-name">Name</span>
</label>
</div>
<div class="email-section">
<input type="email" name="email" id="email" required placeholder=" " autocomplete="email">
<label for="email" class="label-name">
<span class="content-name">Email</span>
</label>
</div>
</section>
</form>
CSS
:root {
font-size: 16px;
font-family: 'IBM Plex Sans', sans-serif;
--text-primary: #b8b9b9;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
main {
margin-left: 5rem;
}
body::-webkit-scrollbar {
width: 0.25rem;
}
body::-webkit-scrollbar-track {
background: #8320F5;
}
body::-webkit-scrollbar-thumb {
background: #523275;
}
/* Nav */
.navbar {
position: fixed;
background: rgb(35, 27, 49);
transition: 300ms ease;
}
.navbar-nav {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.nav-item {
width: 100%;
}
.nav-item:last-child {
margin-top: auto;
}
.nav-link {
display: flex;
align-items: center;
height: 5rem;
color: var(--text-primary);
text-decoration: none;
filter: grayscale(100%) opacity(0.7);
transition: 500ms;
}
.nav-link:hover {
filter: grayscale(0%) opacity(1);
background: #1b0130;
}
.nav-link svg {
min-width: 3rem;
margin: 0 1rem;
}
.link-text {
display: none;
margin-left: 1rem;
font-size: 2rem;
}
.logo {
font-weight: bold;
text-transform: uppercase;
margin-bottom: 1rem;
letter-spacing: 0.2ch;
width: 100%;
}
.logo svg {
transform: rotate(0deg);
transition: transform 500ms;
}
.navbar:hover .logo svg {
transform: rotate(-180deg)
}
/* Small Screens */
@media only screen and (max-width: 600px) {
.navbar {
bottom: 0;
width: 100vw;
height: 5rem;
}
.logo {
display: none;
}
.navbar-nav {
flex-direction: row;
}
.nav-link {
justify-content: center;
}
main {
margin: 0;
}
}
/* Large Screens */
@media only screen and (min-width: 600px) {
.navbar {
top: 0;
width: 5rem;
height: 100vh;
}
.navbar:hover {
width: 16rem;
}
.navbar:hover .link-text {
display:...