diff --git a/exe-ghibli/index.html b/exe-ghibli/index.html index 2d3aa63..e0c3381 100644 --- a/exe-ghibli/index.html +++ b/exe-ghibli/index.html @@ -18,7 +18,9 @@ - + + + \ No newline at end of file diff --git a/exe-ghibli/script.js b/exe-ghibli/script.js index a586ec0..25a9305 100644 --- a/exe-ghibli/script.js +++ b/exe-ghibli/script.js @@ -18,7 +18,50 @@ const obj = [ { "title": "Only Yesterday", "description": "It’s 1982, and Taeko is 27 years old, unmarried, and has lived her whole life in Tokyo. She decides to visit her family in the countryside, and as the train travels through the night, memories flood back of her younger years: the first immature stirrings of romance, the onset of puberty, and the frustrations of math and boys. At the station she is met by young farmer Toshio, and the encounters with him begin to reconnect her to forgotten longings. In lyrical switches between the present and the past, Taeko contemplates the arc of her life, and wonders if she has been true to the dreams of her childhood self." + }, + { + "title": "Howl's Moving Castle", + "description": "The story is set in a fictional kingdom where both magic and early 20th-century technology are prevalent, against the backdrop of a war with another kingdom. The film tells the story of a young hatter named Sophie after she is turned into an old woman by a witch's curse. She encounters a wizard named Howl, and gets caught up in his resistance to fighting for the king." } ] - // COMEÇA O EXERCÍCIO + + //Aqui começa o exercicio + + const app = document.getElementById("root"); + const container = document.createElement("div"); + //Atribuindo uma class dentro da div chamada container + container.setAttribute("class", "container"); + + app.appendChild(container); + + //Fazer com que o servidor leia a array de filmes e imprima isso no console + //usando forEach + obj.forEach(filme => { + console.log(filme.title) + console.log(filme.description) + + //Criando os Cards para cada item do array + let card = document.createElement("div"); + card.setAttribute("class", "card"); + //o espaço container vai adotar as variaveis criadas, cards + container.appendChild(card); + + //Criando o elemento de um titulo + let titulo = document.createElement("h1"); + titulo.innerHTML = filme.title + card.appendChild(titulo); + + //Criando o elemento da descrição + let descricao = document.createElement("p"); + descricao.textContent = filme.description + card.appendChild(descricao); + }); + + //usando for + // for(let i=0; i