<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Admin</title>

    <link rel="stylesheet" href="{{asset('/fonts/css/all.css')}}">
    <script src="{{asset('jquery.js')}}"></script>
    @vite(['resources/css/app.css', 'resources/js/app.js'])

</head>
<body class="antialiased bg-gray-800">
<div class="font-display h-full  flex items-start">
    @include('admin.layouts.sidebar')
    <div class="w-full flex flex-col">
        @include('admin.layouts.navbar')
        <main class="p-3 dark:bg-gray-800 bg-slate-100">
            @yield('main')

        </main>
        @include('admin.layouts.footer')


    </div>
</div>

<script>
    const sidebarTrigger=document.getElementById('sidebar-trigger')
    const sidebarMenu=document.getElementById('sidebar-menu')
    const sidebarHover=document.getElementById('sidebar-hover')
    sidebarTrigger.addEventListener('click',toggleSidebar)

    function toggleSidebar() {
        sidebarMenu.classList.toggle('md:w-[300px]')
        sidebarMenu.classList.toggle('w-[300px]')
        sidebarMenu.classList.toggle('-left-[300px]')
        sidebarMenu.classList.toggle('md:left-0')
        sidebarMenu.classList.toggle('md:w-0')
        sidebarHover.classList.toggle('hidden')
    }

    sidebarHover.addEventListener('click',function (){
        // if(sidebarMenu.classList.contains('w-[300px]')){
        //     sidebarMenu.classList.remove('w-[300px]')
        //     sidebarMenu.classList.add('-left-[300px]')
        //     sidebarMenu.classList.add('w-0')
        //     sidebarHover.classList.add('hidden')
        // }

        toggleSidebar()

    })

</script>
</body>
</html>
