From 21342eaa64f6d0c9fc3c0cbc0a342b831fd78612 Mon Sep 17 00:00:00 2001 From: Mirella Raposo Date: Fri, 30 Apr 2021 21:14:52 -0300 Subject: [PATCH] =?UTF-8?q?N=C3=A3o=20consegui,=20ver=20comentarios=20no?= =?UTF-8?q?=20classroom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Exerc\303\255cio de Casa/img/book.png" | Bin 0 -> 2385 bytes "Exerc\303\255cio de Casa/index.html" | 74 +++++++++++ "Exerc\303\255cio de Casa/script/books.js" | 56 ++++++++ "Exerc\303\255cio de Casa/script/script.js" | 95 ++++++-------- "Exerc\303\255cio de Casa/style/style.css" | 137 ++++++++++++++++++++ 5 files changed, 307 insertions(+), 55 deletions(-) create mode 100644 "Exerc\303\255cio de Casa/img/book.png" create mode 100644 "Exerc\303\255cio de Casa/script/books.js" diff --git "a/Exerc\303\255cio de Casa/img/book.png" "b/Exerc\303\255cio de Casa/img/book.png" new file mode 100644 index 0000000000000000000000000000000000000000..b5885dba4e8425078f2b6a4e458904e5be6a6b35 GIT binary patch literal 2385 zcmc&$c{J1u8=mZurLvUm4hA)rh%BRRFqyHNl9{om2}xvMCbAp5Avdmd{G`E zXnI#?&i!P3-FI^%6`*djI-RZ?&`4t(dPOC`z_iJh?+#ax!ubE5O!Zj4ELM#-!0*}_I&jB+n#f{4EVLrkj>d$hUX*OL& z+kNyq(37|2mnl&lg!NbyauAj)k0=xs7Hljjz6&SCtN$L{0U_l8cq$}Yo8~q`@@Ib` z^<78@W6f0D-1L`70afc~=71)zIsFKdHmel;b`bB$9i=*IHWwQ*6Sc8V-me;Fqfj7vfkXS^KaFW!(`t`(qapX?f!0}Cxmbjcjbh^i(?^`jxtOFCGJ@5#8p_$U(GArk@5#qY*{84_ zL<0HhG8^KYQa4d|Y zKkSN|&iY*N+uhuYYXf?>v^-|X1*-JYA_G^$tY@B{mvQMZ2KUC2j6%Z~FM1!JvJpAw z9!{p=S)Ie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ncS{1vQqDiR+41j z9AbL)Q??D>l^qPj`?8uBVvMY$557gg;sio!bzW>i)|^#bt>45^55Sqp#+lo)4@Be| zw@6_uDc1pC*S%_xVV0tHD3VdFtA_hYWR zcPK_kY>jEg*gG24BZRKsDl;Vp1CB2f;Rz}(;bi3`NGeey6_JQ%#5F0wE$0NZHg6Ll zQ^WCQ?u)3}wr+u!@9L_~JwBbMF&|H+U)xo?gx3agfqp>~B7TBrgbytnCE+;D*!$=V z`QWcp-SdNH`Pw-E<7mkqvt~mR(|C5(>qZolzYssU8;b@<3`=(TqB|LRFgc_qcI94* zfy~p(>7@>sjnI4*wdhA2Qd;KKgh%ZIgFKh6W?XDOFdmwJ?9ksmRNf@a>CHva<^Bc3 zKi2iE4jgBg0W0mj@vT34@w9J0QJimR0fVOmRZm8q*9R+K+$z_jAhHn2eV)q8GJasB zy{~ZFcVLP2#o6=9rF?5Oz9F5ZF+Dp$M5>ke2XqAooLT6%@6EXY!;E7Rvy + + + + + Document + + + + + + + + +
+ +
+ + +

Biblioteca

+ +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + +
+ +
TítuloAutorISBNData de PublicaçãoPáginasInserção na Biblioteca
+
+ +
+
+ + + + \ No newline at end of file diff --git "a/Exerc\303\255cio de Casa/script/books.js" "b/Exerc\303\255cio de Casa/script/books.js" new file mode 100644 index 0000000..fd9e9f6 --- /dev/null +++ "b/Exerc\303\255cio de Casa/script/books.js" @@ -0,0 +1,56 @@ +let books = [ + { + isbn: "9781593275846", + title: "Eloquent JavaScript, Second Edition", + subtitle: "A Modern Introduction to Programming", + author: "Marijn Haverbeke", + published: "2014-12-14T00:00:00.000Z", + }, + { + isbn: "9781449331818", + title: "Learning JavaScript Design Patterns", + subtitle: "A JavaScript and jQuery Developer's Guide", + author: "Addy Osmani", + published: "2012-07-01T00:00:00.000Z", + }, + { + isbn: "9781449365035", + title: "Speaking JavaScript", + subtitle: "An In-Depth Guide for Programmers", + author: "Axel Rauschmayer", + published: "2014-02-01T00:00:00.000Z", + }, + { + isbn: "9781491950296", + title: "Programming JavaScript Applications", + subtitle: "Robust Web Architecture with Node, HTML5, and Modern JS Libraries", + author: "Eric Elliott", + published: "2014-07-01T00:00:00.000Z", + }, + { + isbn: "9781593277574", + title: "Understanding ECMAScript 6", + subtitle: "The Definitive Guide for JavaScript Developers", + author: "Nicholas C. Zakas", + published: "2016-09-03T00:00:00.000Z", + }, + { + isbn: "9781491904244", + title: "You Don't Know JS", + author: "Kyle Simpson", + published: "2015-12-27T00:00:00.000Z", + }, + { + isbn: "9781449325862", + title: "Git Pocket Guide", + author: "Richard E. Silverman", + published: "2013-08-02T00:00:00.000Z", + }, + { + isbn: "9781449337711", + title: "Designing Evolvable Web APIs with ASP.NET", + author: "Glenn Block, et al.", + published: "2014-04-07T00:00:00.000Z", + } +] + diff --git "a/Exerc\303\255cio de Casa/script/script.js" "b/Exerc\303\255cio de Casa/script/script.js" index 68f1d0b..afd0660 100644 --- "a/Exerc\303\255cio de Casa/script/script.js" +++ "b/Exerc\303\255cio de Casa/script/script.js" @@ -1,55 +1,40 @@ -let books = [ - { - isbn: "9781593275846", - title: "Eloquent JavaScript, Second Edition", - subtitle: "A Modern Introduction to Programming", - author: "Marijn Haverbeke", - published: "2014-12-14T00:00:00.000Z", - }, - { - isbn: "9781449331818", - title: "Learning JavaScript Design Patterns", - subtitle: "A JavaScript and jQuery Developer's Guide", - author: "Addy Osmani", - published: "2012-07-01T00:00:00.000Z", - }, - { - isbn: "9781449365035", - title: "Speaking JavaScript", - subtitle: "An In-Depth Guide for Programmers", - author: "Axel Rauschmayer", - published: "2014-02-01T00:00:00.000Z", - }, - { - isbn: "9781491950296", - title: "Programming JavaScript Applications", - subtitle: "Robust Web Architecture with Node, HTML5, and Modern JS Libraries", - author: "Eric Elliott", - published: "2014-07-01T00:00:00.000Z", - }, - { - isbn: "9781593277574", - title: "Understanding ECMAScript 6", - subtitle: "The Definitive Guide for JavaScript Developers", - author: "Nicholas C. Zakas", - published: "2016-09-03T00:00:00.000Z", - }, - { - isbn: "9781491904244", - title: "You Don't Know JS", - author: "Kyle Simpson", - published: "2015-12-27T00:00:00.000Z", - }, - { - isbn: "9781449325862", - title: "Git Pocket Guide", - author: "Richard E. Silverman", - published: "2013-08-02T00:00:00.000Z", - }, - { - isbn: "9781449337711", - title: "Designing Evolvable Web APIs with ASP.NET", - author: "Glenn Block, et al.", - published: "2014-04-07T00:00:00.000Z", - } -] \ No newline at end of file +document.addEventListener("DOMContentLoaded", function(){ + document.querySelector("#botaoAdicionar").addEventListener("click", function livrosAdicionar(event) { + event.preventDefault(); + + let bancoLivros = { + isbn: document.getElementById("livroISBN"), + title: document.getElementById("livroTitulo"), + subtitle: document.getElementById("livroSubtitulo"), + author: document.getElementById("livroAutor"), + published: document.getElementById("livroData"), + } + + /* let livroTitulo = document.getElementById("livroTitulo").value; + let livroAutor = document.getElementById("livroAutor").value; + let livroISBN = document.getElementById("livroISBN").value; + let livroData = document.getElementById("livroData").value; + let livroPaginas = document.getElementById("livroPaginas").value; + let dataInsercao = new Date().toLocaleDateString("pt-br"); + let horaInsercao = new Date ().toLocaleTimeString("pt-br"); */ + + let exibeResposta = document.getElementById("resposta"); + let exibeLista = document.getElementById("addLivros"); + + + if (bancoLivros.isbn === "" || bancoLivros.title === "" || bancoLivros.author === "" || bancoLivros.published === "") { + exibeResposta.innerHTML = "Por favor, preencha todos os campos." + } else { + exibeResposta.innerHTML = (`O livro "${livroTitulo}" do autor ${livroAutor} foi adicionado à Biblioteca às ${horaInsercao} do dia ${dataInsercao}.`) + exibeLista.push("bancoLivros") = ` + ${livroTitulo} + ${livroAutor} + ${livroISBN} + ${livroData} + ${livroPaginas} + ${dataInsercao} às ${horaInsercao} + ` + + } + +})}) diff --git "a/Exerc\303\255cio de Casa/style/style.css" "b/Exerc\303\255cio de Casa/style/style.css" index e69de29..d633406 100644 --- "a/Exerc\303\255cio de Casa/style/style.css" +++ "b/Exerc\303\255cio de Casa/style/style.css" @@ -0,0 +1,137 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; + font-size: 10px; + font-family: 'Montserrat', sans-serif; +} + +body { + background-color: #EEFAFC; +} + +@media only screen and (min-width: 360px) { + +/* HEADER */ + +header { + box-sizing: border-box; + background-color: #2292A4; + padding: 2rem; + width: 100%; +} + +.headerCaixa { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.headerTitulo { + font-family: 'Orelega One', cursive; + font-size: 2.5rem; + color: white; + margin-left: 1rem; +} + +.headerImg { + object-fit: cover; + width: 25px; + height: 25px; +} + +/* FORMULARIO*/ + +.formCaixa { + box-sizing: border-box; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: 1rem; + padding: 1rem 0rem 3rem 0rem; + background-color: white; + text-align: center; + max-width: 100%; + border-radius: 1rem; +} + +label { + font-weight: bold; + font-size: 1.6rem; +} + +form > input { + margin-top: 1rem; + margin-bottom: 1rem; + width: 30rem; + padding: 1.4rem; + font-size: 1.4rem; + border-radius: 1rem; + border: #2292A4 solid 0.1rem; +} + +#botaoAdicionar { + background-color: #2292A4; + font-size: 1.6rem; + color: white; + width: 25rem; + padding: 1.4rem; + margin-top: 2rem; + text-decoration: none; + border:white; + border-radius: 1rem; +} + +#botaoAdicionar:hover { + font-weight: bolder; +} + +:placeholder-shown{ + text-align: center; +} + +.tabela { + box-sizing: border-box; + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: space-evenly; + margin: 1rem; + padding: 1rem 0rem 3rem 0rem; + background-color: white; + text-align: center; + max-width: 100%; + border-radius: 1rem; +} + +th { + font-weight: bold; + font-size: 1.2rem; +} + +} + +@media only screen and (min-width: 700px) { + form > input { + width: 50rem; + } + + th { + padding: 1rem; + border-radius: 0.5rem; + margin: 0 3rem 0 3rem; + border-style: solid; + border-width: 0.1rem; + border-color: white; + color: white; + background-color: #2292A4; + } + + .listaLivros { + display: flex; + flex-direction: row; + justify-content: space-evenly; + } +} \ No newline at end of file