Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion exe-ghibli/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<img src="logo.png">
</div>

<script src="script-resolucao.js"></script>

<script src="./script.js"></script>

</body>

</html>
45 changes: 44 additions & 1 deletion exe-ghibli/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<obj.length; i++){
// console.log(obj[i].title + obj[i].description)
// }



2 changes: 1 addition & 1 deletion exe-ghibli/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ p {
}

.card:nth-child(2n) h1 {
background-image: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
background-image: linear-gradient(120deg, #fdfb5d 0%, #cb48ff 100%);
}

.card:nth-child(4n) h1 {
Expand Down