Skip to content

Commit bdc6014

Browse files
authored
Refactor layout and remove unused navigation functions
Updated layout and spacing for better mobile display. Removed navigation functions and adjusted related elements.
1 parent 78b619c commit bdc6014

1 file changed

Lines changed: 20 additions & 87 deletions

File tree

sichty.html

Lines changed: 20 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
5252
z-index: 1000;
5353
display: flex;
54-
justify-content: space-between; /* Upraveno pro zarovnání doleva */
54+
justify-content: flex-start; /* Upraveno pro zarovnání doleva */
5555
align-items: center;
5656
flex-wrap: wrap; /* Přidáno pro lepší mobilní zobrazení */
57-
gap: 10px; /* Přidáno pro lepší mezery mezi prvky */
57+
gap: 20px; /* Přidáno pro lepší mezery mezi prvky */
5858
}
5959

6060
.theme-toggle {
@@ -72,7 +72,7 @@
7272
}
7373

7474
.main-content {
75-
margin-top: 60px; /* Sníženo, protože top-controls je nižší */
75+
margin-top: 80px; /* Upraveno pro potenciálně vyšší lištu */
7676
}
7777

7878
.controls {
@@ -437,12 +437,13 @@
437437

438438
@media (max-width: 768px) {
439439
.main-content {
440-
margin-top: 80px; /* Upraveno zpět, pokud by top-controls bylo vyšší */
440+
margin-top: 140px; /* Zvětšeno pro vyšší horní lištu */
441441
}
442442

443443
.top-controls {
444444
height: auto; /* Automatická výška pro mobilní zobrazení */
445445
padding: 10px 5px; /* Menší padding na mobilech */
446+
justify-content: center; /* Zarovnání na střed na mobilu */
446447
}
447448

448449
.action-buttons {
@@ -492,19 +493,19 @@
492493
<button class="theme-toggle" onclick="toggleTheme()">
493494
<i class="fas fa-moon"></i>
494495
</button>
495-
<!-- Tlačítka akcí byla přesunuta níže -->
496-
</div>
497-
498-
<div class="main-content">
499-
<!-- <h1 style="text-align: center;">Progres směny</h1> Odstraněno dle požadavku -->
500-
501-
<!-- Volba směny - PŘESUNUTO SEM -->
502-
<div class="shift-select" style="justify-content: center; margin-bottom: 20px;">
496+
<!-- Volba směny PŘESUNUTA SEM -->
497+
<div class="shift-select">
503498
<button class="shift-btn active" data-shift="A">Směna A</button>
504499
<button class="shift-btn" data-shift="B">Směna B</button>
505500
<button class="shift-btn" data-shift="C">Směna C</button>
506501
<button class="shift-btn" data-shift="D">Směna D</button>
507502
</div>
503+
</div>
504+
505+
<div class="main-content">
506+
<!-- <h1 style="text-align: center;">Progres směny</h1> Odstraněno dle požadavku -->
507+
508+
<!-- Volba směny byla přesunuta nahoru -->
508509

509510
<div class="calendar" id="calendar"></div>
510511
<div class="year-view" id="yearView" style="display: none;">
@@ -513,12 +514,12 @@
513514

514515
<div class="controls">
515516
<!-- Ovládání roku -->
516-
<button class="nav-btn" onclick="previousYear()">«</button>
517+
<!-- <button class="nav-btn" onclick="previousYear()">«</button> Odstraněno -->
517518
<select id="yearSelect" class="month-select"></select>
518-
<button class="nav-btn" onclick="nextYear()">»</button>
519+
<!-- <button class="nav-btn" onclick="nextYear()">»</button> Odstraněno -->
519520

520521
<!-- Ovládání měsíce -->
521-
<button class="nav-btn" onclick="previousMonth()"></button>
522+
<!-- <button class="nav-btn" onclick="previousMonth()">←</button> Odstraněno -->
522523
<select id="monthSelect" class="month-select">
523524
<option value="0">Leden</option>
524525
<option value="1">Únor</option>
@@ -533,9 +534,7 @@
533534
<option value="10">Listopad</option>
534535
<option value="11">Prosinec</option>
535536
</select>
536-
<button class="nav-btn" onclick="nextMonth()"></button>
537-
538-
<!-- Volba směny byla přesunuta nahoru nad kalendář -->
537+
<!-- <button class="nav-btn" onclick="nextMonth()">→</button> Odstraněno -->
539538
</div>
540539

541540
<!-- Tlačítka akcí PŘESUNUTA SEM -->
@@ -1416,25 +1415,9 @@ <h3>Celkem přesčasů</h3>
14161415

14171416
}
14181417

1419-
// --- NOVÉ FUNKCE PRO NAVIGACI ---
1418+
// --- NAVIGAČNÍ FUNKCE UPRAVENY ---
14201419

1421-
function previousYear() {
1422-
const yearSelect = document.getElementById('yearSelect');
1423-
let newYear = parseInt(yearSelect.value) - 1;
1424-
if (newYear >= parseInt(yearSelect.options[0].value)) {
1425-
yearSelect.value = newYear;
1426-
changeYear();
1427-
}
1428-
}
1429-
1430-
function nextYear() {
1431-
const yearSelect = document.getElementById('yearSelect');
1432-
let newYear = parseInt(yearSelect.value) + 1;
1433-
if (newYear <= parseInt(yearSelect.options[yearSelect.options.length - 1].value)) {
1434-
yearSelect.value = newYear;
1435-
changeYear();
1436-
}
1437-
}
1420+
// Funkce previousYear, nextYear, previousMonth, nextMonth byly ODSTRANĚNY
14381421

14391422
function changeYear() {
14401423
currentYear = parseInt(document.getElementById('yearSelect').value);
@@ -1448,50 +1431,6 @@ <h3>Celkem přesčasů</h3>
14481431
}
14491432
}
14501433

1451-
function previousMonth() {
1452-
const yearSelect = document.getElementById('yearSelect');
1453-
if (currentMonth > 0) {
1454-
currentMonth--;
1455-
} else {
1456-
currentMonth = 11;
1457-
let newYear = currentYear - 1;
1458-
if (newYear >= parseInt(yearSelect.options[0].value)) {
1459-
currentYear = newYear;
1460-
yearSelect.value = currentYear;
1461-
HOLIDAYS = getHolidays(currentYear);
1462-
} else {
1463-
// Jsme na minimálním roce, dál nemůžeme
1464-
currentMonth = 0;
1465-
return;
1466-
}
1467-
}
1468-
document.getElementById('monthSelect').value = currentMonth;
1469-
const yearShifts = generateShifts(currentYear, currentShift);
1470-
createCalendar(yearShifts, currentMonth);
1471-
}
1472-
1473-
function nextMonth() {
1474-
const yearSelect = document.getElementById('yearSelect');
1475-
if (currentMonth < 11) {
1476-
currentMonth++;
1477-
} else {
1478-
currentMonth = 0;
1479-
let newYear = currentYear + 1;
1480-
if (newYear <= parseInt(yearSelect.options[yearSelect.options.length - 1].value)) {
1481-
currentYear = newYear;
1482-
yearSelect.value = currentYear;
1483-
HOLIDAYS = getHolidays(currentYear);
1484-
} else {
1485-
// Jsme na maximálním roce, dál nemůžeme
1486-
currentMonth = 11;
1487-
return;
1488-
}
1489-
}
1490-
document.getElementById('monthSelect').value = currentMonth;
1491-
const yearShifts = generateShifts(currentYear, currentShift);
1492-
createCalendar(yearShifts, currentMonth);
1493-
}
1494-
14951434
function changeMonth() {
14961435
currentMonth = parseInt(document.getElementById('monthSelect').value);
14971436
const yearShifts = generateShifts(currentYear, currentShift);
@@ -1662,13 +1601,7 @@ <h3>Celkem přesčasů</h3>
16621601
});
16631602
});
16641603

1665-
document.addEventListener('keydown', function(e) {
1666-
if (e.key === 'ArrowLeft') {
1667-
previousMonth();
1668-
} else if (e.key === 'ArrowRight') {
1669-
nextMonth();
1670-
}
1671-
});
1604+
// Event listener pro klávesnici (šipky) byl ODSTRANĚN
16721605

16731606
// Poznámky a nastavení budou existovat pouze v paměti během běhu aplikace
16741607
window.addEventListener('beforeunload', function() {

0 commit comments

Comments
 (0)