1 Commits

Author SHA1 Message Date
kl3z00 c4a3da8694 Horário 2026-10-26 15:45:36 +00:00
2 changed files with 46 additions and 5 deletions
+9
View File
@@ -0,0 +1,9 @@
services:
horario-escolar:
image: nginx:alpine
container_name: horario-escolar
restart: unless-stopped
ports:
- "2090:80"
volumes:
- ./horario-escolar.html:/usr/share/nginx/html/index.html:ro
+36 -4
View File
@@ -14,6 +14,11 @@
html, body { html, body {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: fit-content;
height: fit-content;
min-width: 0;
min-height: 0;
overflow: hidden;
background: transparent; background: transparent;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
@@ -27,7 +32,7 @@ body {
.schedule { .schedule {
display: grid; display: grid;
/* Hora = 42px | cada dia = 58px */ /* Hora = 35px | cada dia = 58px */
grid-template-columns: 42px repeat(5, 58px); grid-template-columns: 42px repeat(5, 58px);
gap: 2px; gap: 2px;
@@ -37,7 +42,7 @@ body {
/* CÉLULAS */ /* CÉLULAS */
.cell { .cell {
height: 30px; height: 26px;
padding: 2px 3px; padding: 2px 3px;
display: flex; display: flex;
@@ -159,7 +164,7 @@ const periods = [
["13:30","14:20"], ["13:30","14:20"],
["14:20","15:10"], ["14:20","15:10"],
["15:20","16:10"], ["15:20","16:10"],
["16:10","17:10"], ["16:20","17:10"],
["17:30","18:20"] ["17:30","18:20"]
]; ];
@@ -364,33 +369,60 @@ function findClass(day, start) {
} }
/* CONSTRUIR HORÁRIO */
function buildSchedule() { function buildSchedule() {
const container = document.getElementById("schedule"); const container = document.getElementById("schedule");
/* Cabeçalho */
const hourHeader = document.createElement("div"); const hourHeader = document.createElement("div");
hourHeader.className = "cell header-cell"; hourHeader.className = "cell header-cell";
hourHeader.textContent = "Hora"; hourHeader.textContent = "Hora";
container.appendChild(hourHeader); container.appendChild(hourHeader);
days.forEach((name, index) => { days.forEach((name, index) => {
const cell = document.createElement("div"); const cell = document.createElement("div");
cell.className = "cell header-cell"; cell.className = "cell header-cell";
cell.dataset.day = index + 1; cell.dataset.day = index + 1;
cell.textContent = name; cell.textContent = name;
container.appendChild(cell);});
container.appendChild(cell);
});
/* Aulas */
periods.forEach(period => { periods.forEach(period => {
const time = document.createElement("div"); const time = document.createElement("div");
time.className = "cell time"; time.className = "cell time";
time.innerHTML = `${period[0]}<br>${period[1]}`; time.innerHTML = `${period[0]}<br>${period[1]}`;
container.appendChild(time); container.appendChild(time);
for (let day = 1; day <= 5; day++) { for (let day = 1; day <= 5; day++) {
const lesson = findClass(day, period[0]); const lesson = findClass(day, period[0]);
const cell = document.createElement("div"); const cell = document.createElement("div");
cell.className = "cell"; cell.className = "cell";
cell.dataset.day = day; cell.dataset.day = day;
if (lesson) { if (lesson) {
cell.classList.add("class", lesson.color); cell.classList.add("class", lesson.color);
cell.dataset.start = lesson.start; cell.dataset.start = lesson.start;
cell.dataset.end = lesson.end; cell.dataset.end = lesson.end;
cell.innerHTML = cell.innerHTML =
`<span>${lesson.subject}</span> `<span>${lesson.subject}</span>
<span class="room">${lesson.room}</span>`; <span class="room">${lesson.room}</span>`;