Main content

add copy code to theses, have code affect the page when altered, probably use text input/ area

This is the link tag for box icons, or visit this link to get it https://boxicons.com/?query=

<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
 
<main>
    <div class="side-bar">
        <div class="top">
            <div class="logo">
                <span>Code Commerce</span>
            </div>
            <!-- Don't know how to use boxicons correctly 
                <i autofocus  id="sidebarbtn" tabindex="0" class="bx bx-menu"></i>
            
        </div>
        <div class="user">
            <img src="https://yt3.ggpht.com/VWBZ360UFEUxVD-Udx81wsl2QpcMwWIievwhz34vRdACTr7S_tVkflfCzV2tOoOo_Fy95URJmQ=s88-c-k-c0x00ffffff-no-rj" alt=""
            class="user-img">
            <div>
                <p class="bold">Clint C.</p>
                <p>Admin</p>
            </div>
        </div>
        <ul>
            <li>
                <a href="#">
                    <i class="bx bxs-grid-alt"></i>
                    <span class="nav-item">Dashboard</span>
                </a>
                <span class="tooltip">Dashboard</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-shopping-bag"></i>
                    <span class="nav-item">Products</span>
                </a>
                <span class="tooltip">Products</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-list-check"></i>
                    <span class="nav-item">Catagories</span>
                </a>
                <span class="tooltip">Catagories</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-food-menu"></i>
                    <span class="nav-item">Orders</span>
                </a>
                <span class="tooltip">Orders</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-body"></i>
                    <span class="nav-item">Customers</span>
                </a>
                <span class="tooltip">Customers</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-location-plus"></i>
                    <span class="nav-item">Shipping</span>
                </a>
                <span class="tooltip">Shipping</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-cog"></i>
                    <span class="nav-item">Settings</span>
                </a>
                <span class="tooltip">Settings</span>
            </li>
            <li>
                <a href="#">
                    <i class="bx bx-log-out"></i>
                    <span class="nav-item">Logout</span>
                </a>
                <span class="tooltip">Logout</span>
            </li>

        </ul>
    </div>
    <div class="main-content">
        
    </div>
    </main>
                
 
const btn = document.querySelector('#sidebarbtn')
const sideBar = document.querySelector('.side-bar')
btn.onclick = function(){
    sideBar.classList.toggle('active')
    console.log('lkjd')

}
btn.addEventListener('keydown', e => {
    let letter = e.key.toLowerCase()
    if(letter == 'enter'){
    sideBar.classList.toggle('active')
    console.log('enter')
    }
})
 
*{
    margin: 0;
    padding:0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body > header{
    /* position: relative; */
}
main{
    display: flex;
}
.user-img {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 100%;
    border: 1px solid #eee;
}
.side-bar {
    position: relative;
    border-right: 2px solid black;
    top: 0;
    left: 0;
    width: 80px;
    height: 100vh;
    background-color: #12171e;
    padding: .4rem .8rem;
    transition: all .4s ease;
}

.side-bar.active{
    width: 250px;
}
.side-bar #sidebarbtn {
    color: #eee;
    position: absolute;
    top: 0;
    left: 50%;
    /* margin-top: 25%; */
    border-radius: 5px;
    height: 49px !important;
    font-size: 1.2rem;
    display: flex;
    align-items: center ;
    line-height: 50px;
    transform: translateX(-50%);
    cursor: pointer;
}
.side-bar.active #sidebarbtn{
    left: 90%;
}
.side-bar .top {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgb(52, 68, 114);
    color: #eee;
    width: 100%;
}
.side-bar .top .logo{
    display: flex;
    align-items: center;
    height: 50px;
    width: 100%;
    opacity: 0;
}
.side-bar.active  .top .logo{
    opacity: 1;
}
.user {
    background-color: rgb(52, 68, 114);
    display: flex;
}
.user p{
    opacity: 1;
    margin-left: 1rem;
    color: #eee;
}
.user .bold {
    font-weight: 600;
}
.side-bar p{
    opacity: 0;
}
.side-bar.active p{
    opacity: 1;
}
.side-bar ul {
    /* background-color: rgb(52, 68, 114); */
}
.side-bar ul li {
    position: relative;
    list-style-type: none;
    height: 50px;
    /* width: 90%; */
    margin: 0.8rem auto;
    line-height: 50px;
}
.side-bar ul li a{
    color: #eee;
    text-decoration: none;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: 0.8rem;
    width: fit-content;
}

.side-bar ul li a:hover,
.side-bar ul li a:active,.side-bar ul li a:focus{
    background-color: #eee;
    color: black;
    /* color: ; */
    border: 0px solid black;
}
.side-bar ul li a i{
    min-width: 60px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    
}
.side-bar .nav-item{
    display: none;
}
.side-bar.active .nav-item{
    display: inline-flex;
}
.side-bar  .tooltip{
    opacity: 0;
}
.side-bar li a:active ~ .tooltip,.side-bar li a:hover ~ .tooltip{
    opacity: 1;
    position: absolute;
    color: black;
    left: 125px;
    top: 50%;
    transform: translate(-50%,-50%);
}
.side-bar.active .tooltip{
    opacity: 0
}
.hide {
    display: none;
}
// This page has really good letter focus cycle
if(letter == 'c' && !e.metaKey){
    if(!e.shiftKey){
        copyCodes[iCopyCodes].focus()
        iCopyCodes = (iCopyCodes + 1) % copyCodes.length

    } else{
        iCopyCodes = (iCopyCodes - 1 + copyCodes.length) % copyCodes.length
        
    }
    copyCodes[iCopyCodes].focus()
    console.log(iLetter)
}