jQuery(document).ready(function($) {
function updateWeeklyPlanner() {
$.post('https://krupapiotr.pl/wp-admin/admin-ajax.php', { action: 'get_krupa_status' }, function(d) {
var turbo = Number(0) || 0;
var custom_footer_text = "";
var d_real = Number(d.real_procent) || 0;
var dzis_procent = Math.max(0, Math.min(100, d_real + turbo));
if (d.pracujemy) {
if (dzis_procent <= 40) {
custom_footer_text = "
Przyjmujemy zgłoszenia";
} else if (dzis_procent <= 80) {
custom_footer_text = "
Ostatnie terminy";
} else {
custom_footer_text = "
Tylko dalsze terminy";
}
} else {
custom_footer_text = "
Poza godzinami pracy";
}
var todayIdx = 0;
if (d.dni_tygodnia_profile && d.dni_tygodnia_profile.length > 0) {
for (var i = 0; i 0) {
d.dni_tygodnia_profile.forEach(function(dzien, index) {
var raw_pct = Number(dzien.procent) || 0;
var pct_dnia = Math.max(0, Math.min(100, raw_pct + turbo));
var kolor_paska = '#10b981';
if (pct_dnia > 40 && pct_dnia 80) kolor_paska = '#ef4444';
if (!d.pracujemy && dzien.czy_dzis) {
kolor_paska = d.kolor || '#94a3b8';
}
var diffDays = index - todayIdx;
var targetDate = new Date();
targetDate.setDate(targetDate.getDate() + diffDays);
var dayString = ('0' + targetDate.getDate()).slice(-2);
var monthString = ('0' + (targetDate.getMonth() + 1)).slice(-2);
var dataFormatowana = dayString + '.' + monthString;
var klasa_dzis = dzien.czy_dzis ? 'k-day-row k-is-today' : 'k-day-row';
var marker_dzis = dzien.czy_dzis ? '
Dziś' : '';
html_dni += '
' +
'
' +
'
' +
'' + dzien.label + '' +
'' + dataFormatowana + '' +
'
' +
marker_dzis +
'
' +
'
' +
'
' +
'' + pct_dnia + '%' +
'
' +
'
';
});
}
$('#box_k_bar_6a3f424784f7f').html(
'
' + html_dni + '
' +
''
);
setTimeout(function() {
$('#box_k_bar_6a3f424784f7f .k-day-fill-mini').each(function() {
var w = $(this)[0].style.width;
$(this).css('width', '0').animate({width: w}, 600);
});
}, 50);
});
}
updateWeeklyPlanner();
});
.k-v56-weekly-container {
width: 100%;
margin: 15px 0;
font-family: system-ui, -apple-system, sans-serif;
background: #ffffff;
border: 1px solid #f1f5f9;
border-radius: 12px;
padding: 10px 12px;
box-sizing: border-box;
box-shadow: 0 4px 20px -4px rgba(0,0,0,0.03);
}
.k-weekly-list {
display: flex;
flex-direction: column;
gap: 4px; /* Zmniejszony odstęp między wierszami z 8px na 4px */
}
.k-day-row {
display: flex;
align-items: center;
padding: 2px 0; /* Znacznie zredukowany padding pionowy */
gap: 12px;
border-radius: 8px;
transition: background 0.2s;
}
.k-day-row.k-is-today {
background: #f8fafc;
padding: 3px 10px; /* Delikatniejszy padding dla dnia dzisiejszego */
margin: 0 -10px;
}
.k-day-name-zone {
display: flex;
align-items: center;
gap: 6px;
width: 70px;
flex-shrink: 0;
}
.k-day-label-group {
display: flex;
flex-direction: column;
line-height: 1.0; /* CIAŚNIEJSZA INTERLINIA */
}
.k-day-label {
font-size: 11px;
font-weight: 600;
color: #334155;
text-transform: capitalize;
}
.k-day-row.k-is-today .k-day-label { color: #0f172a; }
.k-day-date {
font-size: 9px;
color: #94a3b8;
font-weight: 500;
letter-spacing: 0.3px;
}
.k-day-rail-mini {
flex-grow: 1;
height: 6px;
background: #f1f5f9;
border-radius: 6px;
overflow: hidden;
}
.k-day-fill-mini {
height: 100%;
border-radius: 6px;
transition: background-color 0.3s ease;
}
.k-day-pct-zone {
width: 32px;
text-align: right;
flex-shrink: 0;
}
.k-day-pct-val {
font-size: 11px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.k-today-badge {
font-size: 8px;
background: #e2e8f0;
color: #475569;
padding: 2px 5px;
border-radius: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.k-day-row.k-is-today .k-today-badge {
background: #10b981;
color: #fff;
}
/* PRZEBUDOWANA STOPKA */
.k-weekly-footer {
display: flex;
flex-direction: column; /* Ułożenie elementów jeden pod drugim */
justify-content: center;
align-items: center; /* Wyśrodkowanie całości */
margin-top: 10px; /* Mniejszy odstęp z góry */
padding-top: 10px;
border-top: 1px solid #f1f5f9;
width: 100%;
gap: 3px; /* Minimalny odstęp między statusem a wersją */
}
.k-weekly-desc {
display: flex;
align-items: center;
justify-content: center; /* Wyśrodkowanie tekstu z kropką */
width: 100%;
gap: 6px;
font-size: 12px;
color: #475569;
font-weight: 600; /* Minimalnie pogrubione, by tekst na całą szerokość był czytelny */
text-transform: uppercase; /* Bardziej oficjalny charakter "OSTATNIE TERMINY" */
letter-spacing: 0.5px;
}
.k-status-dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
}
.k-dot-green { background-color: #10b981; box-shadow: 0 0 0 2px #d1fae5; }
.k-dot-yellow { background-color: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.k-dot-red { background-color: #ef4444; box-shadow: 0 0 0 2px #fee2e2; }
.k-dot-gray { background-color: #94a3b8; }
.k-weekly-brand {
width: 100%;
text-align: center; /* Wyśrodkowanie wersji pod statusem */
font-size: 9px;
color: #cbd5e1;
font-weight: 500;
}
.k-v55-bar-loading {
font-size: 12px;
color: #94a3b8;
text-align: center;
padding: 20px 0;
}