<!DOCTYPE html>
<html lang="it">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="css/main.css">      
        <script src="" type="module"></script>
        <title>Nel cielo di Fara</title>
    </head>
    <body>
        <header class="main-header bg1">
            <div class="container">
                <div class="columns text-gray" id="nav">
                    <div class="column col-7">
                        <img src="img/InnovaPatrimonio_logo_transparent_bg_150x98.png" alt="Logo InnovaPatrimonio" id="logo">
                    </div>
                    <div class="column col-5" id="links">
                        <a href="index.html" title="Torna alla home page">Home</a>
                        <a href="progetto.html" title="Vai alla descrizione del progetto">Il progetto</a>
                        <a href="itinerario.html" title="Vai all'itinerario">L'itinerario</a>
                        <a href="news.html" title="Leggi news ed eventi">News & Eventi</a>
                        <a href="credits.html" title="Credits del progetto">Credits</a>
                    </div>
                </div>
            </div>
            <div id="title" class="text-center">
                <h1 class="arvo">Nel cielo di Fara</h1>
                <button>Entra</button>
            </div>
        </header>
        <main></main>
        <footer class="roboto">
            <p id="copy">&copy; Avviso pubblico Beni Culturali e Turismo POR FESR Lazio 2014-2020</p>
            <p><img src="img/loghi_ispc_potlach.png" class="logos" alt="Loghi ISPC Potlach"></p>
            <p><img src="img/FESR_BARRA_BENEFICIARI_DEF.jpg" class="logos" alt="Loghi enti beneficiari"></p>
        </footer>
    </body>
    <!-- MOOOVE AWAAAAAYY -->
    <script type="text/javascript">
        window.addEventListener('load', () => {
            let navlinks = document.querySelector('#links').children;

            Array.from(navlinks).forEach(element => {
                let ref = element.href.substr(element.href.lastIndexOf('/'), element.href.length);
                
                if (window.location.href.includes(ref) || element.href.includes('index.html')) {
                    element.setAttribute('class', 'active');
                }
                /**
                 let homeRE = new RegExp(/https?:\S+\/$/);
                 if (homeRE.test(window.location.href)) {
                     navlinks[0].setAttribute('class', 'active');
                    }
                */
            });            
        });

        window.addEventListener('scroll', event => {
            let nav = document.querySelector('#nav');

            if (window.pageYOffset !== 0) {
                nav.classList.add('bg-white');
                nav.classList.remove('text-gray');
            }
            else {
                nav.classList.add('text-gray');
                nav.classList.remove('bg-white');
            }
        })
    </script>
</html>