105 lines
3.9 KiB
HTML
105 lines
3.9 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Modellauto - Startseite</title>
|
||
<link rel="stylesheet" href="./Styles/startseite/startseite.css">
|
||
<link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet">
|
||
<link rel="stylesheet" href="./Styles/header_footer/header.css">
|
||
<link rel="stylesheet" href="./Styles/header_footer/footer.css">
|
||
</head>
|
||
<body>
|
||
<div class="wrapper">
|
||
<!-- Header -->
|
||
<div id="header-placeholder"></div>
|
||
<script>
|
||
fetch(href="/header")
|
||
.then(response => response.text())
|
||
.then(data => {
|
||
document.getElementById('header-placeholder').innerHTML = data;
|
||
})
|
||
.catch(error => console.error('Fehler beim Laden des Headers:', error));
|
||
</script>
|
||
|
||
<!-- Infobereich -->
|
||
<section style="padding: 40px 20px; text-align: center; background: #fff;">
|
||
<h2>Willkommen bei deinem Modellauto-Shop</h2>
|
||
<p>Bei uns findest du hochwertige Modellautos – ob Oldtimer, Sportwagen oder Nutzfahrzeuge.
|
||
Perfekt für Sammler, Bastler und Fans.
|
||
</p>
|
||
</section>
|
||
|
||
<!-- Hauptinhalt -->
|
||
</br>
|
||
<h1>Unsere Neusten Produkte</h1>
|
||
<section class="card-grid" id="latest-products">
|
||
<!-- Dynamische Produkte (5 aktuelle Produkte) -->
|
||
</section>
|
||
|
||
<script>
|
||
fetch('/api/products/new')
|
||
.then(res => res.json())
|
||
.then(products => {
|
||
const container = document.getElementById('latest-products');
|
||
container.innerHTML = ''; // sicherheitshalber leeren
|
||
|
||
products.forEach(product => {
|
||
const card = document.createElement('div');
|
||
card.classList.add('card');
|
||
card.innerHTML = `
|
||
<img src="${product.image_url}" alt="${product.name}">
|
||
<h3>${product.name}</h3>
|
||
<p>Preis: ${product.price}€</p>
|
||
<p>${product.description}</p>
|
||
<button class="add-to-cart" data-id="${product.id}">Zum Warenkorb hinzufügen</button>
|
||
`;
|
||
container.appendChild(card);
|
||
});
|
||
})
|
||
.catch(err => {
|
||
console.error('Fehler beim Laden der neuesten Produkte:', err);
|
||
});
|
||
</script>
|
||
|
||
|
||
<!-- Info-Sektion -->
|
||
<section style="background: #ffffff; padding: 40px 20px; display: flex; flex-wrap: wrap; justify-content: space-around; gap: 30px; text-align: center;">
|
||
<div style="flex: 1 1 250px;">
|
||
<i class='bx bx-package' style="font-size: 40px; color: #ff6600;"></i>
|
||
<h3>Versandkostenfrei ab 50 €</h3>
|
||
<p>Schneller & sicherer Versand mit Sendungsverfolgung.</p>
|
||
</div>
|
||
<div style="flex: 1 1 250px;">
|
||
<i class='bx bx-credit-card' style="font-size: 40px; color: #ff6600;"></i>
|
||
<h3>Flexible Zahlungsmethoden</h3>
|
||
<p>PayPal, Kreditkarte, Klarna, Vorkasse – du hast die Wahl.</p>
|
||
</div>
|
||
<div style="flex: 1 1 250px;">
|
||
<i class='bx bx-undo' style="font-size: 40px; color: #ff6600;"></i>
|
||
<h3>14 Tage Rückgaberecht</h3>
|
||
<p>Unzufrieden? Kein Problem – Rückgabe einfach & unkompliziert.</p>
|
||
</div>
|
||
<div style="flex: 1 1 250px;">
|
||
<i class='bx bx-star' style="font-size: 40px; color: #ff6600;"></i>
|
||
<h3>Top-Bewertungen</h3>
|
||
<p>Unsere Kunden lieben uns – überzeug dich selbst!</p>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Fußzeiele -->
|
||
<div id="footer"></div>
|
||
|
||
<script>
|
||
fetch('/footer')
|
||
.then(response => response.text())
|
||
.then(data => {
|
||
document.getElementById('footer').innerHTML = data;
|
||
});
|
||
</script>
|
||
|
||
</div>
|
||
|
||
</body>
|
||
</html>
|