From 7e3bfd8b9cf26fd5f749c4375cff9f2521c5117b Mon Sep 17 00:00:00 2001 From: PABLO VALENTIN Date: Tue, 22 Oct 2024 00:03:59 -0300 Subject: [PATCH] feat: creating the rooms section. --- Assets/CSS/Global.css | 11 -------- Assets/CSS/Menu.css | 11 ++++++++ Assets/CSS/Rooms.css | 62 +++++++++++++++++++++++++++++++++++++++++++ Assets/JS/Global.js | 16 +++++++++-- Assets/JS/Rooms.js | 45 +++++++++++++++++++++++++++++++ Pages/Login.html | 4 +-- Pages/Register.html | 6 ++--- Pages/Rooms.html | 42 +++++++++++++++++++++++++++++ 8 files changed, 179 insertions(+), 18 deletions(-) create mode 100644 Assets/CSS/Rooms.css create mode 100644 Assets/JS/Rooms.js create mode 100644 Pages/Rooms.html diff --git a/Assets/CSS/Global.css b/Assets/CSS/Global.css index 5365e19..8b24422 100644 --- a/Assets/CSS/Global.css +++ b/Assets/CSS/Global.css @@ -2,17 +2,6 @@ @import url("./Menu.css"); -/* Colors: */ - -*:root { - - --main-color: #B20000; - --page-color: #FFFFFF; - --neutral-color: #000000; - --contrast-color: #005C6D; - -} - /* Styles: */ * { diff --git a/Assets/CSS/Menu.css b/Assets/CSS/Menu.css index 7ed7683..2aaf245 100644 --- a/Assets/CSS/Menu.css +++ b/Assets/CSS/Menu.css @@ -2,6 +2,17 @@ @import url("https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css"); +/* Colors: */ + +*:root { + + --main-color: #B20000; + --page-color: #FFFFFF; + --neutral-color: #000000; + --contrast-color: #005C6D; + +} + /* Styles: */ #menu { diff --git a/Assets/CSS/Rooms.css b/Assets/CSS/Rooms.css new file mode 100644 index 0000000..9fa5527 --- /dev/null +++ b/Assets/CSS/Rooms.css @@ -0,0 +1,62 @@ +/* Resources: */ + +@import url("./Global.css"); + +/* Styles: */ + +#rooms { + + height: auto; + width: 100%; + min-height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + gap: 15px; + background-color: transparent; + padding: 80px 15px 15px 15px; + +} + +#rooms h1 { + + font-size: 35px; + font-weight: bolder; + text-transform: uppercase; + text-align: center; + color: var(--main-color); + margin-bottom: 25px; + +} + +#rooms .room { + + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + border: 1px solid var(--neutral-color); + border-radius: 10px; + text-decoration: none; + padding: 15px; + cursor: pointer; + +} + +#rooms .room h2 { + + font-size: 18px; + font-weight: bold; + color: var(--neutral-color); + text-align: center; + transition: 0.5s; + +} + +#rooms .room:hover h2 { + + color: var(--main-color); + +} \ No newline at end of file diff --git a/Assets/JS/Global.js b/Assets/JS/Global.js index 286cdf3..784347d 100644 --- a/Assets/JS/Global.js +++ b/Assets/JS/Global.js @@ -1,3 +1,14 @@ +/* + + Diferença entre Eventos ON e addEventListener: + + Eventos ON (onclick, onload, etc.): Só permite definir uma função para um determinado evento (Causa mau funcionamento se dois scripts + diferentes acessarem o evento de um mesmo elemento.). + + addEventListener (click, load, etc.): Permite definir várias funções para um mesmo evento de um elemento. + +*/ + // Constants and Variables: const assets_root_folder = (window.location.pathname.split("/").pop() === "Index.html") ? "./" : "../"; @@ -59,6 +70,7 @@ async function ADD_Menu() '' + @@ -75,7 +87,7 @@ async function ADD_Menu() // Events: -window.onload = async function() { +window.addEventListener("load", function() { ADD_Favicon(); @@ -102,4 +114,4 @@ window.onload = async function() { } -} \ No newline at end of file +}); \ No newline at end of file diff --git a/Assets/JS/Rooms.js b/Assets/JS/Rooms.js new file mode 100644 index 0000000..f25d850 --- /dev/null +++ b/Assets/JS/Rooms.js @@ -0,0 +1,45 @@ +// Constants and Variables: + +const rooms = [ + + {name: "Laboratório 04"}, + {name: "Laboratório 09"}, + {name: "Laboratório 02"}, + {name: "Laboratório 06"} + +]; + +// Functions: + +function ADD_Rooms() +{ + + const rooms_list = document.getElementById("rooms").innerHTML; + + let rooms_inserts = ""; + + rooms.forEach(room => { + + rooms_inserts = rooms_inserts.concat( + + '' + + + `

${room.name}

` + + + '
' + + ); + + }); + + document.getElementById("rooms").innerHTML = rooms_list.concat(rooms_inserts); + +} + +// Events: + +window.addEventListener("load", function() { + + ADD_Rooms(); + +}); \ No newline at end of file diff --git a/Pages/Login.html b/Pages/Login.html index 90abe5d..5a0d134 100644 --- a/Pages/Login.html +++ b/Pages/Login.html @@ -30,10 +30,10 @@
- + - +
diff --git a/Pages/Register.html b/Pages/Register.html index 015e71f..9763161 100644 --- a/Pages/Register.html +++ b/Pages/Register.html @@ -30,13 +30,13 @@
- + - + - +
diff --git a/Pages/Rooms.html b/Pages/Rooms.html new file mode 100644 index 0000000..734fbea --- /dev/null +++ b/Pages/Rooms.html @@ -0,0 +1,42 @@ + + + + + + + + + Salas | Agenda Fatec + + + + + + + + + + + + + + +
+ + + +
+ +
+ +

Salas da Fatec Jahu

+ +
+ + + +
+ + + + \ No newline at end of file