<!DOCTYPE html>
<html lang="pt-br">
    <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">
        <link rel="stylesheet" href="/css/style.css">
        <link href="/img/site.ico" rel="icon" type="image/x-icon" />
        <title>Movies</title>
    </head>

    <body>
        <nav>
            <img src="/img/movie.png" class="img" alt="site Logo">
            <ul>
                <li>
                    <a href="/">Home</a>
                </li>
                <li>
                    <a href="/new">New Movie</a>
                </li>
                <li>
                    <a href="/about">About</a>
                </li>
            </ul>
        </nav>

        <% if(message != "") {  %>
            <section class="message">
                <p><%= message %></p> <span id="close">&times;</span>
            </section>
        <% }  %>

        <main class="index">
            <% filmes.forEach(movies => { %>
                <a href="/details/<%= movies.id %>">
                    <section class="wrapper">
                            <article class="card_content">
                                <img class="img" src="<%= movies.imagem %>">
                                <p class="name"> <%= movies.nome %></p>
                            </article>
                    </section>
                </a>
            <% }) %>
        </main>
            
        <script src="/js/script.js"></script>
    </body>
</html>