<!DOCTYPE html>
<html lang="id">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    @if (Request::segment(1) == '')
        <meta property="og:title" content="SMAN 2 majujaya" />
        <meta name="description" content="Sekolah cinta Lingkungan" />
        <meta property="og:url" content="https://sman2majujaya.sch.id" />
        <meta property="og:description" content="SMAN 2 majujaya">
        <meta property="og:image" content="{{ asset('assets/images/logo-smanda.png') }}" />
        <meta property="og:type" content="article" />
        <title>SMAN 2 majujaya</title>
    @elseif (Request::segment(1) == 'detail')
        <meta property="og:title" content="{{ $artikel->judul }}" />
        <meta name="description" content="{{ $artikel->judul }}" />
        <meta property="og:url" content="https://sman2majujaya.sch.id/{{ $artikel->slug }}" />
        <meta property="og:description" content="{{ $artikel->judul }}" />
        @if ($artikel->image)
            <meta property="og:image" content="{{ asset('storage/artikel/' . $artikel->image) }}" />
        @else
            <meta property="og:image" content="{{ asset('assets/images/logo-smanda.png') }}" />
        @endif
        <meta property="og:type" content="article" />

        <title>SMAN 2 Majujaya | {{ $artikel->title }}</title>
    @endif
    <link rel="shortcut icon" href="{{ asset('assets/logo-smanda.ico') }}">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">

    {{-- AOS --}}
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    {{-- Magnific --}}
    <link rel="stylesheet" href="{{ asset('assets/css/magnific.css') }}">

    {{-- Summernote CSS --}}
    {{-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-bs5.min.css" /> --}}
    <!-- Summernote CSS -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.css" rel="stylesheet">


    <script src="https://cdn.jsdeliver.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://stackpacth.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>

    {{-- <link rel="stylesheet" href="{{ asset('assets/css/style.css') }}"> --}}

    <link rel="stylesheet" href="{{ asset('assets/css/style.css') }}">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
</head>

<body>

    <div class="admin-wrapper">

        {{-- SIDEBAR --}}
        <aside class="sidebar" id="sidebar">
            <h4 class="sidebar-title">ADMIN</h4>

            <ul class="sidebar-menu">
                <li>
                    <a href="{{ route('dashboard') }}" class="{{ request()->is('admin/dashboard') ? 'active' : '' }}">
                        <i class="bi bi-speedometer2"></i> Dashboard
                    </a>
                </li>

                <li>
                    <a href="{{ route('hero.index') }}">
                        <i class="bi bi-image"></i> Hero
                    </a>
                </li>

                <li>
                    <a href="{{ route('admin.ekskul.index') }}">
                        <i class="bi-people-fill"></i> Ekskul
                    </a>
                </li>

                <li>
                    <a href="{{ route('blog') }}">
                        <i class="bi bi-newspaper"></i> Berita
                    </a>
                </li>

                <li>
                    <a href="{{ route('photo') }}">
                        <i class="bi bi-images"></i> Foto
                    </a>
                </li>

                <li>
                    <a href="{{ route('video') }}">
                        <i class="bi bi-camera-video"></i> Video
                    </a>
                </li>

                <li>
                    <a href="{{ route('prestasi.admin') }}">
                        <i class="bi bi-trophy"></i> Prestasi
                    </a>
                </li>

                <li>
                    <a href="{{ route('admin.profil') }}">
                        <i class="bi bi-building"></i> Profil Sekolah
                    </a>
                </li>

                <li>
                    <a href="{{ route('admin.akun') }}">
                        <i class="bi-person-gear"></i> Profil Admin
                    </a>
                </li>

                <li class="mt-3">
                    <form action="/logout" method="POST">
                        @csrf
                        <button class="btn btn-danger w-100">
                            <i class="bi bi-box-arrow-right"></i> Logout
                        </button>
                    </form>
                </li>
            </ul>
        </aside>

        {{-- CONTENT --}}
        <main class="content d-flex flex-column min-vh-100">

            {{-- HEADER TOGGLE (MOBILE) --}}
            <div class="d-flex justify-content-end mb-3 d-lg-none">
                <button class="btn btn-primary" onclick="toggleSidebar()">
                    <i class="bi bi-list"></i>
                </button>
            </div>

            {{-- ISI HALAMAN --}}
            <div class="flex-grow-1">
                @yield('content')
            </div>

            {{-- FOOTER ADMIN --}}
            <footer class="admin-footer text-center mt-4 py-3">
                <small>
                    © {{ date('Y') }} <strong>toponeteach</strong>. All rights reserved.
                </small>
            </footer>

        </main>

    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous">
    </script>
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>

    <!-- jQuery (Required for Summernote) -->
    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

    <!-- Summernote -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.js"></script>

    <!-- Magnific Popup JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>

    <script>
        $(document).ready(function() {
            $('#summernote').summernote({
                height: 200
            });
        });
    </script>


    <script>
        // membuat teks navbar ketika discroll ke bawah berbuah bg putih teks putih
        const navbar = document.querySelector(".fixed-top");
        window.onscroll = () => {
            if (window.scrollY > 100) {
                navbar.classList.add("scroll-nav-active");
                navbar.classList.add("text-nav-active");
                // navbar.classList.remove("navbar-dark");
            } else {
                navbar.classList.remove("scroll-nav-active");
                // navbar.classList.add("navbar-dark");
            }
        };

        // Animasi Aos
        AOS.init();

        // Magnific
        $(document).ready(function() {
            $('.image-link').magnificPopup({
                type: 'image',
                retina: {
                    ration: 1,
                    replaceSrc: function(item, ratio) {
                        return item.src.replace(/\.\w+$/, function(m) {
                            return '@2x' + m;
                        });
                    }
                }
            });
        });
    </script>

    {{-- responsive toggle --}}
    <script>
        function toggleSidebar() {
            document.getElementById('sidebar').classList.toggle('active');
        }
    </script>



</body>

</html>
