The number of intubated patients treated in hospital ICUs for acute Covid-19 symptoms reached nearly 700 on Wednesday (699), while related deaths from the virus reached 67 over the past 24 hours.New confirmed instances of Covid-19 were 3,062, with the total since the advent of the pandemic now exceeding 245,000. The death toll from the pandemic reached 7,649, with the average age of the victims being 79. Of the victims, 95.7 percent suffered from an underlying condition or were above the age of 70. The average age of the intubated patients was 68, with 81.5 percent suffering from an underlying condition or above the age of 70. The average age of new infections fell to 44.
');
}
},
error: function() {
// Fallback to admin-ajax if REST API fails
$.ajax({
url: 'https://www.xtesini.gr/wp-admin/admin-ajax.php',
type: 'POST',
data: {
action: 'get_recommendations_carousel',
limit: limit,
nonce: '7718261a35'
},
success: function(response) {
if (response.success && response.data.html) {
container.html(response.data.html);
initializeCarousel($('#carousel_6853d58ce32b1'));
} else {
container.html('
');
}
}
});
}
});
// Carousel initialization function
function initializeCarousel($wrapper) {
var $container = $wrapper.find(".carousel-container");
var $carousel = $wrapper.find(".related-articles-carousel");
var $items = $wrapper.find(".carousel-item");
var $prevBtn = $wrapper.find(".prev-arrow");
var $nextBtn = $wrapper.find(".next-arrow");
if ($items.length === 0) return;
var itemWidth = $items.first().outerWidth(true);
var visibleItems = Math.floor($container.parent().width() / itemWidth);
var position = 0;
var maxPosition = Math.max(0, $items.length - visibleItems);
// Touch handling variables
var isDragging = false;
var startX = 0;
var startY = 0;
var currentX = 0;
var currentTranslate = 0;
var startTranslate = 0;
var threshold = 10;
var isScrolling = null;
// Hide prev button initially
$prevBtn.css("opacity", "0.5");
// Navigation
$nextBtn.click(function() {
if (position < maxPosition) {
position++;
updatePosition();
}
});
$prevBtn.click(function() {
if (position > 0) {
position--;
updatePosition();
}
});
// Touch support
$carousel.on("touchstart", function(e) {
var touch = e.originalEvent.touches[0];
startX = touch.clientX;
startY = touch.clientY;
isDragging = true;
isScrolling = null;
var transform = $container.css("transform");
var matrix = transform.replace(/[^0-9,.\-]/g, "").split(",");
startTranslate = currentTranslate = matrix[4] ? parseInt(matrix[4]) : 0;
$container.css("transition", "none");
});
$carousel.on("touchmove", function(e) {
if (!isDragging) return;
var touch = e.originalEvent.touches[0];
var deltaX = touch.clientX - startX;
var deltaY = touch.clientY - startY;
if (isScrolling === null) {
if (Math.abs(deltaX) > threshold || Math.abs(deltaY) > threshold) {
isScrolling = Math.abs(deltaY) > Math.abs(deltaX) * 0.7;
}
}
if (isScrolling === true) {
isDragging = false;
$container.css("transition", "transform 0.3s ease");
return;
}
if (isScrolling === false) {
e.preventDefault();
currentX = deltaX;
var newTranslate = startTranslate + deltaX;
var minTranslate = -maxPosition * itemWidth;
var maxTranslate = 0;
if (newTranslate > maxTranslate) {
newTranslate = maxTranslate + (newTranslate - maxTranslate) * 0.3;
} else if (newTranslate < minTranslate) {
newTranslate = minTranslate + (newTranslate - minTranslate) * 0.3;
}
$container.css("transform", "translateX(" + newTranslate + "px)");
}
});
$carousel.on("touchend", function(e) {
if (!isDragging || isScrolling === true) return;
isDragging = false;
$container.css("transition", "transform 0.3s ease");
var prevPosition = position;
if (Math.abs(currentX) > itemWidth * 0.25) {
if (currentX > 0 && position > 0) {
position--;
} else if (currentX < 0 && position < maxPosition) {
position++;
}
}
if (position !== prevPosition && window.RecommendationTracker) {
var action = position > prevPosition ? 'next' : 'prev';
window.RecommendationTracker.trackCarouselInteraction(action);
}
updatePosition();
isScrolling = null;
currentX = 0;
});
function updatePosition() {
var translateX = -position * itemWidth;
currentTranslate = translateX;
$container.css({
"transition": "transform 0.3s ease",
"transform": "translateX(" + translateX + "px)"
});
$prevBtn.css("opacity", position <= 0 ? "0.5" : "1");
$nextBtn.css("opacity", position >= maxPosition ? "0.5" : "1");
}
// Responsive
$(window).on("resize", function() {
itemWidth = $items.first().outerWidth(true);
visibleItems = Math.floor($container.parent().width() / itemWidth);
maxPosition = Math.max(0, $items.length - visibleItems);
if (position > maxPosition) {
position = maxPosition;
}
updatePosition();
});
updatePosition();
}
});