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

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Icon -->
    <link rel="icon" href="images/cloud-sun-solid.svg">

    <!-- Font -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
    <link rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@forevolve/bootstrap-dark@1.0.0/dist/css/bootstrap-dark.min.css" />
    <link rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@forevolve/bootstrap-dark@1.0.0/dist/css/toggle-bootstrap.min.css" />
    <link rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@forevolve/bootstrap-dark@1.0.0/dist/css/toggle-bootstrap-dark.min.css" />
    <link rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@forevolve/bootstrap-dark@1.0.0/dist/css/toggle-bootstrap-print.min.css" />

    <!-- Swiper -->
    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css" /> -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css" />

    <!-- Style -->
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/login.css">

    <title>Meteo</title>
</head>

<body class="bootstrap">

    <header>
        <!-- Navbar -->
        <div class="container-fluid">
            <nav class="navbar navbar-expand-lg navbar bg-light fixed-top" id="topNavBar">
                <div class="container-fluid">
                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                            <li class="nav-item">
                                <div class="container-fluid">
                                    <a class="navbar-brand" href="/">
                                        <img src="images/cloud-sun-solid.svg" alt="logo"
                                            class="d-inline-block align-text-top">
                                        Meteo
                                    </a>
                                </div>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link active" aria-current="page" href="/">Home</a>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
                                    aria-expanded="false">
                                    Aree
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a class="dropdown-item" href="/aree?nomeArea=europe">Europa</a></li>
                                    <li><a class="dropdown-item" href="/aree?nomeArea=asia">Asia</a></li>
                                    <li><a class="dropdown-item" href="/aree?nomeArea=americas">America</a></li>
                                    <li><a class="dropdown-item" href="/aree?nomeArea=africa">Africa</a></li>
                                    <li><a class="dropdown-item" href="/aree?nomeArea=oceania">Oceania</a></li>
                                </ul>
                            </li>
                            <% if(!autentication){%>
                                <li class="nav-item dropdown">
                                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                        data-bs-toggle="dropdown" aria-expanded="false">
                                        Autenticazione
                                    </a>
                                    <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                        <li><a class="dropdown-item" href="/login">Login</a></li>
                                        <li><a class="dropdown-item" href="/registrazione">Registrazione</a></li>
                                    </ul>
                                </li>
                                <%} else{%>
                                    <li class="nav-item dropdown">
                                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                            data-bs-toggle="dropdown" aria-expanded="false">
                                            <%= user%>
                                        </a>
                                        <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                            <li><a class="dropdown-item" href="/areaPersonale">Area Personale</a></li>
                                            <li><a class="dropdown-item" href="/logout">Logout</a></li>
                                        </ul>
                                    </li>
                                    <%}%>
                                        <!-- Toggle dark mode-->
                                        <li class="nav-item">
                                            <div class="nav-link">
                                                <div class="toggle">
                                                    <input type="checkbox" id="darkModeToggle">
                                                    <label for="darkModeToggle"></label>
                                                </div>
                                            </div>
                                        </li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
    </header>

    <main>

        <!-- Section 2 -->
        <section class="section-2 marginTop">
            <div class="container text-left">
                <h4 id="nomeArea">Capitali dell'area: <%= nomeArea%>
                </h4>
                <div class="swiper mySwiper">

                    <div class="swiper-wrapper">
                        <% for(let i=0; i < capitali.length; i++){%>
                            <div class="swiper-slide">
                                <img id="imgSlider<%= i%>">
                                <div class="slide-info">
                                    <h3 id="cit<%= i%>">
                                        <%= capitali[i]%>
                                    </h3>
                                    <ul class="list-unstyled">
                                        <li id="cit<%= i%>Temp"></li>
                                        <li id="cit<%= i%>TempPerc"></li>
                                        <li id="cit<%= i%>Humid"></li>
                                        <li id="cit<%= i%>Weather"></li>
                                    </ul>
                                </div>
                            </div>
                            <%}%>
                    </div>
                    <div class="swiper-pagination"></div>
                </div>
                <div class="swiper-button-next"></div>
                <div class="swiper-button-prev"></div>
            </div>
        </section>


        </section>

    </main>

    <hr class="section-divider">

    <!-- Footer -->
    <footer class="position-relative z-index-10 d-print-none">
        <div class="py-6 bg-gray-200 text-muted">
            <div class="container">
                <div class="row">
                    <div class="col-lg-4 mb-5 mb-lg-0">
                        <div class="fw-bold text-uppercase text-dark mb-3">Meteo</div>
                        <p>Previsioni in tempo reale e in tutto il mondo</p>
                    </div>
                    <div class="col-lg-2 col-md-6 mb-5 mb-lg-0">
                        <h6 class="text-uppercase text-dark mb-3">Aree</h6>
                        <ul class="list-unstyled">
                            <li><a class="text-muted" href="/aree?nomeArea=europe">Europa</a></li>
                            <li><a class="text-muted" href="/aree?nomeArea=asia">Asia</a></li>
                            <li><a class="text-muted" href="/aree?nomeArea=americas">America</a></li>
                            <li><a class="text-muted" href="/aree?nomeArea=africa">Africa</a></li>
                            <li><a class="text-muted" href="/aree?nomeArea=oceania">Oceania</a></li>
                        </ul>
                    </div>
                    <div class="col-lg-2 col-md-6 mb-5 mb-lg-0">
                        <h6 class="text-uppercase text-dark mb-3">Autenticazione</h6>
                        <ul class="list-unstyled">
                            <li><a class="text-muted" href="/login">Accedi </a></li>
                            <li><a class="text-muted" href="/registrazione">Registrati</a></li>
                        </ul>
                    </div>
                    <div class="col-lg-4">
                        <h6 class="text-uppercase text-dark mb-3">Rimani aggiornato</h6>
                        <p class="mb-3"> Accedi o iscriviti se non sei gi√† registrato per rimanere aggiornato!
                        </p>
                        <form action="/registrazione" id="newsletter-form">
                            <div class="input-group mb-3">
                                <input class="form-control bg-transparent border-dark border-end-0" type="email"
                                    placeholder="Inserisci la tua mail" aria-label="Your Email Address">
                                <button class="btn btn-outline-dark border-start-0" type="submit"> <i
                                        class="fa fa-paper-plane text-lg"></i></button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </footer>

    <!-- Script -->

    <!-- Bootstrap -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa"
        crossorigin="anonymous"></script>

    <!-- Swiper -->
    <!-- <script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script> -->
    <script src="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.js"></script>

    <!-- Javascript -->
    <script src="js/meteo.js"></script>
    <script src="js/area.js"></script>
    <script src="js/darkMode.js"></script>


</body>

</html>