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

<head>
    <!-- Basic -->
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- Mobile Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <!-- Site Metas -->
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <!-- Site favicon -->
    <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('img/logo-no-background') }}" />
    <link rel="icon" type="image/png" href="{{ asset('img/logo-no-background.png') }}" />
    <link rel="icon" type="image/png" href="{{ asset('img/logo-no-background.png') }}" />

    <title>SIPEX | {{ $title }}</title>


    <!-- bootstrap core css -->
    <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}" />

    <!-- Swiper CSS -->
    <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css" />

    <!-- font awesome style -->
    <link href="{{ asset('css/font-awesome.min.css') }}" rel="stylesheet" />

    <!-- Custom styles for this template -->
    <link href="{{ asset('css/style.css') }}" rel="stylesheet" />

    <!-- responsive style -->
    <link href="{{ asset('css/responsive.css') }}" rel="stylesheet" />
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">

</head>

<body>
    <!-- header section strats -->
    <header class="header_section">
        <div class="container-fluid">
            <nav class="navbar navbar-expand-lg custom_nav-container ">
                <a class="navbar-brand" href="/home"></a>

                <button class="navbar-toggler" type="button" data-toggle="collapse"
                    data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                    aria-label="Toggle navigation">
                    <span class=""> </span>
                </button>

                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav">
                        <li class="nav-item">
                            <a class="nav-link {{ $title === 'Home' ? 'active' : '' }}"
                               href="/home">Home</span></a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {{ $title === 'Ekstrakurikuler' ? 'active' : '' }}"
                                href="/data-ekstrakurikuler">Ekstrakurikuler</a>
                        </li>
                    </ul>
                    <div class="quote_btn-container">
                        <a href="{{ route('login') }}" class="quote_btn">
                            Login
                        </a>
                    </div>
                </div>

            </nav>
        </div>
    </header>
    <!-- end header section -->

    <!-- ekstrakurikuler section -->
    <section id="ekstrakurikuler" class="service_section layout_padding">
        <div class="container">
            <div class="heading_container">
                <h2>
                    Ekstrakurikuler
                </h2>
                <p>
                    Kegiatan Ekstrakurikuler Siswa di MAN 3 Banyuwangi
                </p>
            </div>
            <div id="ekstrakurikulerCarousel" class="carousel slide" data-ride="carousel">
                <div class="carousel-inner">
                    @php
                        $ekstrakurikulers = \App\Models\Extracuricullar::all();
                        $totalCards = 4;
                    @endphp

                    @for ($i = 0; $i < count($ekstrakurikulers); $i += $totalCards)
                        <div class="carousel-item {{ $i === 0 ? 'active' : '' }}">
                            <div class="row">
                                @for ($j = $i; $j < $i + $totalCards && $j < count($ekstrakurikulers); $j++)
                                    <div class="col-md-6 col-lg-3">
                                        <div class="box" style="width: 17rem;">
                                            @php
                                                $kategori = strtolower($ekstrakurikulers[$j]->kategori);
                                                $iconClass = ($kategori === 'olahraga') ? 'fas fa-walking' : (($kategori === 'seni') ? 'fas fa-music' : 'fas fa-brush');
                                            @endphp
                                            <i class="{{ $iconClass }} fa-5x"></i>
                                            <div class="card-body">
                                                <div class="detail-box">
                                                    <h5>
                                                        {{ $ekstrakurikulers[$j]->nama }}
                                                    </h5>
                                                    <p>
                                                       Bidang {{ $ekstrakurikulers[$j]->kategori }}
                                                    </p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                @endfor
                            </div>
                        </div>
                    @endfor
                </div>
                <div class="carousel-indicators mt-20">
                    @for ($i = 0; $i < ceil(count($ekstrakurikulers) / $totalCards); $i++)
                        <span data-target="#ekstrakurikulerCarousel" data-slide-to="{{ $i }}"
                            class="{{ $i === 0 ? 'active' : '' }}" onclick="goToSlide({{ $i }})"></span>
                    @endfor
                </div>
                <script>
                    function goToSlide(index) {
                        $('#ekstrakurikulerCarousel').carousel(index);
                    }
                </script>
            </div>
        </div>
    </section>


    <div class="footer_container">
        <!-- info section -->

        <section class="info_section ">
            <div class="container">
                <div class="row">
                    <div class="col-md-4">
                        <div class="info_detail">
                            <h4>
                                Sistem Pendukung Keputusan Pemilihan Ekstrakurikuler Siswa di MAN 3 Banyuwangi
                            </h4>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="info_link_box">
                            <h4>Links</h4>
                            <div class="info_links">
                                <a class="" href="/home">
                                    <i class="fa fa-home" aria-hidden="true"></i>
                                    <span style="margin-left: 5px;">Home</span>
                                </a>
                                <a class="" href="/data-ekstrakurikuler">
                                    <i class="fas fa-file" aria-hidden="true"></i>
                                    <span style="margin-left: 5px;">Ekstrakurikuler</span>
                                </a>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="info_contact">
                            <h4>Address</h4>
                            <div class="contact_link_box">
                                <a href="https://maps.app.goo.gl/ibCGWyfsxw8pbR6i9">
                                    <i class="fa fa-map-marker" aria-hidden="true"></i>
                                    <span>
                                        Location
                                    </span>
                                </a>
                                <a href="mailto:man3banyuwangi@gmail.com">
                                    <i class="fa fa-envelope" aria-hidden="true"></i>
                                    <span>
                                        Email
                                    </span>
                                </a>
                                <a href="tel:+62333397173">
                                    <i class="fa fa-phone" aria-hidden="true"></i>
                                    <span>
                                        Telepon
                                    </span>
                                </a>
                                <a href="https://www.instagram.com/osimman3banyuwangi" target="_blank">
                                    <i class="fab fa-instagram" aria-hidden="true"></i>
                                    <span>
                                        Instagram
                                    </span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>


        <!-- end info section -->

        <!-- footer section -->
        <footer class="footer_section">
            <div class="container">
                <p>
                    &copy; <span id="displayYear"></span> All Rights Reserved By
                    <a href="home">SIPEX</a>
                </p>
            </div>
        </footer>
        <!-- footer section -->
    </div>

    <!-- jQery -->
    <script src="js/jquery-3.4.1.min.js"></script>
    <!-- popper js -->
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
        integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous">
    </script>
    <!-- bootstrap js -->
    <script src="js/bootstrap.js"></script>
    <script src="js/custom.js"></script>
    <!-- Google Map -->
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCh39n5U-4IoWpsVGUHWdqB6puEkhRLdmI&callback=myMap">
    </script>
    <!-- End Google Map -->
    <!-- Swiper JS -->
    <script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>

</body>

</html>
