ALL STORIES

ALL STORIES

Browse the latest news, business, finance, technology, sports and more from ABE NEWS.

Loading stories…


PAGE 1

#abe-all-stories {
width: 100%;
box-sizing: border-box;
}

.abe-stories-header {
margin-bottom: 25px;
border-bottom: 3px solid #ed1b2e;
padding-bottom: 12px;
}

.abe-stories-header h2 {
margin: 0 0 8px;
font-size: 28px;
font-weight: 800;
}

.abe-stories-header p {
margin: 0;
}

#abe-stories-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
}

.abe-story-card {
border: 1px solid #e1e5ea;
border-radius: 7px;
overflow: hidden;
background: #fff;
}

.abe-story-image {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
display: block;
}

.abe-story-content {
padding: 15px;
}

.abe-story-content h3 {
margin: 0 0 10px;
font-size: 18px;
line-height: 1.3;
}

.abe-story-content h3 a {
color: #0b1424;
text-decoration: none;
}

.abe-story-date {
margin: 0;
font-size: 13px;
color: #666;
}

#abe-story-pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 15px;
margin: 35px 0 10px;
}

#abe-story-pagination button {
display: inline-block !important;
visibility: visible !important;
opacity: 1;
min-width: 200px;
border: 1px solid #ed1b2e !important;
border-radius: 22px;
background: #ffffff !important;
color: #ed1b2e !important;
padding: 11px 18px;
font-size: 12px !important;
font-family: Arial, sans-serif !important;
font-weight: 700 !important;
line-height: 1.2 !important;
text-indent: 0 !important;
cursor: pointer;
}

#abe-story-pagination button:hover {
border-color: #ed1b2e;
color: #ed1b2e;
}

#abe-story-pagination button:disabled {
opacity: .35 !important;
color: #ed1b2e !important;
cursor: default;
}

#abe-page-number {
font-size: 12px;
font-weight: 700;
}

@media (max-width: 700px) {
#abe-stories-grid {
grid-template-columns: 1fr;
}

#abe-story-pagination {
flex-wrap: wrap;
}
}

(function () {
var postsPerPage = 10;
var currentPage = 1;

var grid = document.getElementById(“abe-stories-grid”);
var prev = document.getElementById(“abe-prev”);
var next = document.getElementById(“abe-next”);
var pageNumber = document.getElementById(“abe-page-number”);

function escapeHtml(value) {
var div = document.createElement(“div”);
div.textContent = value || “”;
return div.innerHTML;
}

function getPostLink(entry) {
for (var i = 0; i < entry.link.length; i++) {
if (entry.link[i].rel === "alternate") {
return entry.link[i].href;
}
}
return "#";
}

function getImage(entry) {
if (entry.media$thumbnail && entry.media$thumbnail.url) {
return entry.media$thumbnail.url
.replace(//s72-c//, "/s640/")
.replace(/=s72-c/, "=s640");
}

return "";
}

window.abeLoadStories = function (data) {
var entries = data.feed.entry || [];
var total = Number(data.feed.openSearch$totalResults.$t || 0);

grid.innerHTML = "";

if (!entries.length) {
grid.innerHTML = "

No more stories found.

“;
next.disabled = true;
return;
}

entries.forEach(function (entry) {
var title = entry.title.$t;
var url = getPostLink(entry);
var image = getImage(entry);
var date = new Date(entry.published.$t);

var card = document.createElement(“article”);
card.className = “abe-story-card”;

card.innerHTML =
(image
? ‘' + escapeHtml(title) + '‘
: “”) +
‘

‘ +
‘

‘ + escapeHtml(title) + ‘

‘ +
‘

‘ +
‘

‘;

grid.appendChild(card);
});

pageNumber.textContent = “PAGE ” + currentPage;
prev.disabled = currentPage === 1;
next.disabled = currentPage * postsPerPage >= total;
};

function loadPage(page) {
currentPage = page;

grid.innerHTML =
‘

Loading stories…

‘;

var oldScript = document.getElementById(“abe-feed-script”);
if (oldScript) {
oldScript.remove();
}

var startIndex = ((currentPage – 1) * postsPerPage) + 1;

var script = document.createElement(“script”);
script.id = “abe-feed-script”;
script.src =
“/feeds/posts/default?alt=json-in-script” +
“&start-index=” + startIndex +
“&max-results=” + postsPerPage +
“&callback=abeLoadStories”;

document.body.appendChild(script);

window.scrollTo({
top: document.getElementById(“abe-all-stories”).offsetTop – 20,
behavior: “smooth”
});
}

prev.addEventListener(“click”, function () {
if (currentPage > 1) {
loadPage(currentPage – 1);
}
});

next.addEventListener(“click”, function () {
loadPage(currentPage + 1);
});

loadPage(1);
})();