mirror of
https://github.com/TheErrorExe/blockattack
synced 2025-09-05 21:11:00 +02:00
Update index.html
This commit is contained in:
parent
51ebe112a6
commit
86336a9d4a
12
index.html
12
index.html
@ -62,15 +62,13 @@ This Website was developed by TheErrorExe for Blockattack. TheErrorExe is and wi
|
||||
<p><em>Jetzt die neuesten Features wie das Claimen von Gebieten ausprobieren!</em></p>
|
||||
</section>
|
||||
<script>
|
||||
async function loadNews() {
|
||||
async function loadNews() {
|
||||
try {
|
||||
const response = await fetch('https://api.errexe.xyz/blockattack-api/news/get');
|
||||
const data = await response.json();
|
||||
|
||||
const newsContainer = document.getElementById('news-container');
|
||||
newsContainer.innerHTML = '';
|
||||
|
||||
|
||||
const latestNews = data.slice(0, 2);
|
||||
|
||||
if (latestNews.length === 0) {
|
||||
@ -78,7 +76,11 @@ This Website was developed by TheErrorExe for Blockattack. TheErrorExe is and wi
|
||||
} else {
|
||||
latestNews.forEach(newsItem => {
|
||||
const newsElement = document.createElement('div');
|
||||
newsElement.innerHTML = `<h3>${newsItem.title}</h3><p>${newsItem.content}</p>`;
|
||||
newsElement.classList.add('news-item');
|
||||
newsElement.innerHTML = `
|
||||
<h3>${newsItem.title}</h3>
|
||||
<p>${newsItem.content}</p>
|
||||
`;
|
||||
newsContainer.appendChild(newsElement);
|
||||
});
|
||||
}
|
||||
@ -88,6 +90,8 @@ This Website was developed by TheErrorExe for Blockattack. TheErrorExe is and wi
|
||||
}
|
||||
}
|
||||
|
||||
loadNews();
|
||||
|
||||
</script>
|
||||
<section id="news-section" style="margin-bottom: 50px; border-bottom: 2px solid #ccc; padding-bottom: 20px;">
|
||||
<main style="padding: 20px;">
|
||||
|
Loading…
x
Reference in New Issue
Block a user