O hexa não foi dessa vez. Depois de um sentimento coletivo que mais parecia uma ressaca moral, cabe pensar nos efeitos que o ato de perder uma disputa opera em nós. Convenhamos que, fãs ou não de futebol, não tem como viver neste país sem ser impactado por uma mistura de curiosidade, patriotismo, esperança e…
Copa do mundo: sobre perder e seus efeitos
Créditos: Pexels
Mais Notícias
.fp-slider-wrap-all {
width: 100%;
position: relative;
display: none; /* Oculto até encontrar posts */
}
.fp-slider-all {
position: relative;
width: 100%;
height: 280px;
overflow: hidden;
border: 1px solid #E6E6E6;
border-radius: 15px;
}
.fp-slide-all {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.8s ease;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
border-radius: 15px;
}
.fp-slide-all.active {
opacity: 1;
}
(function() {
var base = 'https://folhapopular.info/wp-json/wp/v2';
function initSlider(containerId, posts) {
var container = document.getElementById(containerId);
var wrapper = document.getElementById('fp-slider-wrap-all');
if (!container) return;
container.innerHTML = '';
var slides = [];
var current = 0;
posts.forEach(function(p) {
var img = '';
if (
p._embedded &&
p._embedded['wp:featuredmedia'] &&
p._embedded['wp:featuredmedia'][0]
) {
img = p._embedded['wp:featuredmedia'][0].source_url;
}
if (!img) return;
var slide = document.createElement('div');
slide.className = 'fp-slide-all';
slide.style.backgroundImage = 'url(' + img + ')';
container.appendChild(slide);
slides.push(slide);
});
/* Se não houver slides, mantém oculto */
if (!slides.length) {
if (wrapper) wrapper.style.display = 'none';
return;
}
/* Exibe o slider somente se houver posts */
if (wrapper) wrapper.style.display = 'block';
slides[0].classList.add('active');
if (slides.length < 2) return;
setInterval(function() {
slides[current].classList.remove('active');
current = (current + 1) % slides.length;
slides[current].classList.add('active');
}, 4000);
}
function loadSlider(categoryId, containerId) {
fetch(base + '/posts?categories=' + categoryId + '&per_page=10&_embed=1')
.then(function(r) { return r.json(); })
.then(function(posts) {
/* Se não houver posts na categoria, oculta o bloco */
if (!posts || !posts.length) {
var wrapper = document.getElementById('fp-slider-wrap-all');
if (wrapper) wrapper.style.display = 'none';
return;
}
initSlider(containerId, posts);
})
.catch(function(e) {
console.log('Erro:', e);
var wrapper = document.getElementById('fp-slider-wrap-all');
if (wrapper) wrapper.style.display = 'none';
});
}
setTimeout(function() {
loadSlider(20860, 'fp-slider-all');
}, 2500);
})();

