PR2-Pruefungsvorleistung2-M.../target/classes/templates/index.html

199 lines
3.6 KiB
HTML

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>PR2 Blog</title>
<style>
/* Grundstil für den gesamten Körper */
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f9;
display: flex;
flex-direction: column;
min-height: 100vh;
}
/* Header / Navigation */
.top {
background-color: #1f2937;
color: white;
padding: 20px 0;
text-align: center;
}
.top a {
color: white;
text-decoration: none;
margin: 0 15px;
font-size: 18px;
transition: color 0.3s;
}
.top a:hover {
color: #ff5520;
}
/* Inhalt */
.content {
padding: 40px 20px;
flex-grow: 1;
}
/* Titel */
.title {
text-align: center;
margin-bottom: 30px;
}
.title h1 {
font-size: 3rem;
color: #333;
}
.subtitle {
font-size: 1.2rem;
color: #555;
}
/* Blog Posts */
.card {
background-color: white;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: hidden;
margin: 20px auto;
width: 80%;
max-width: 800px;
transition: transform 0.3s ease;
}
.card:hover {
transform: translateY(-10px);
}
.card-body {
padding: 20px;
}
.card-title {
font-size: 1.8rem;
color: #333;
margin-bottom: 10px;
transition: color 0.3s;
}
.card-title:hover {
color: #ff5520;
}
.card-subtitle {
color: #777;
font-size: 1rem;
}
.card-text {
font-size: 1rem;
color: #555;
margin-top: 10px;
}
.card-img {
width: 100%;
height: 250px;
object-fit: cover;
}
/* Footer */
footer {
background-color: #2d2d2d;
color: white;
text-align: center;
padding: 20px;
font-size: 1rem;
}
/* Create Post Button */
.create-post-btn {
position: fixed;
bottom: 30px;
right: 30px;
background-color: #ff5520;
color: white;
padding: 15px 30px;
border-radius: 50px;
font-size: 1.2rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
transition: background-color 0.3s, box-shadow 0.3s;
border: none;
cursor: pointer;
text-decoration: none;
}
.create-post-btn:hover {
background-color: #e44b1f;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
/* Responsiveness */
@media screen and (max-width: 768px) {
.top a {
display: block;
margin: 10px 0;
}
.card {
width: 90%;
}
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="top" id="mainNav">
<a href="#" th:href="@{/}">Home</a>
<a href="#" th:href="@{/about}">About</a>
</nav>
<div class="content">
<header class="title">
<div th:if="${errorMessage == null}" >
<h1>PR2 Blog</h1>
<span class="subtitle">A Blog for PR2 Prüfungsvorleistung</span>
</div>
<div th:if="${errorMessage != null}" class="error">
<h1 th:text="'Fehler: ' + ${errorMessage}">Ein Fehler ist aufgetreten</h1>
</div>
</header>
<!-- Post preview -->
<div th:each="entry : ${PostMap}" class="card">
<div class="card-body">
<a th:href="@{/posts/{id}(id=${entry.key})}">
<h2 class="card-title" th:text="${entry.value.title}">></h2>
</a>
<h3 class="card-subtitle" th:text="${entry.value.subtitle}"></h3>
<p class="card-text">
Posted by <span style="font-weight: bold;" th:text="${entry.value.author}"></span>
on <span th:text="${entry.value.date}"></span>
</p>
</div>
</div>
</div>
<!-- Create New Post Button
<a href="#" class="create-post-btn" th:href="@{/new-post}">Create New Post</a>
-->
<!-- Footer -->
<footer>
<p>Made with ♥️ in Mannheim.</p>
</footer>
</body>
</html>