<!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">
    <title>Pokedéx</title>
</head>
<body>
    <%- include('./partials/header.ejs') %>
    <% if (message != "") { %>
        <section id="message">
            <p>Pokémon cadastrado com sucesso!</p> <span id="close">&times;</span>
        </section>
    <% } %>
    <main>
        <section id="pokemons">            
        <% pokedex.forEach((element) => { %>
            <a href="/detalhes/<%= element.id %>">
                <article class="card">
                    <div class="card_image">
                        <img src="<%=element.imagem%>" alt="Foto do Pokemon">
                    </div>                
                    <div class="info">
                        <div><%= element.nome %></div>
                        <div><%= element.tipo %></div>
                    </div>
                </article>
            </a>
        <% }) %>
        </section>

    </main>
    
    <%- include('./partials/footer.ejs') %>
    <script src="/script.js"></script>
</body>
</html>