Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d86976d6f |
@@ -1,9 +0,0 @@
|
|||||||
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
|
|
||||||
+5
-37
@@ -14,11 +14,6 @@
|
|||||||
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;
|
||||||
}
|
}
|
||||||
@@ -32,7 +27,7 @@ body {
|
|||||||
.schedule {
|
.schedule {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
||||||
/* Hora = 35px | cada dia = 58px */
|
/* Hora = 42px | cada dia = 58px */
|
||||||
grid-template-columns: 42px repeat(5, 58px);
|
grid-template-columns: 42px repeat(5, 58px);
|
||||||
|
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
@@ -42,7 +37,7 @@ body {
|
|||||||
/* CÉLULAS */
|
/* CÉLULAS */
|
||||||
|
|
||||||
.cell {
|
.cell {
|
||||||
height: 26px;
|
height: 30px;
|
||||||
padding: 2px 3px;
|
padding: 2px 3px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -164,7 +159,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:20","17:10"],
|
["16:10","17:10"],
|
||||||
["17:30","18:20"]
|
["17:30","18:20"]
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -369,60 +364,33 @@ 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>`;
|
||||||
@@ -506,4 +474,4 @@ setInterval(updateHighlight, 30000);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user