Einrückungen und Zeilenumbrüche vereinheitlicht

This commit is contained in:
Matthias Grief
2024-11-19 22:24:37 +01:00
parent 62d1e820a6
commit cc389eb179
7 changed files with 61 additions and 52 deletions

View File

@@ -209,7 +209,7 @@ body {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 0.5rem; gap: 0.5rem;
transform: translateY(0); /* Set initial transform state */ transform: translateY(0); /* Set initial transform state */
} }
.download-btn:hover { .download-btn:hover {
@@ -240,6 +240,7 @@ body {
.search-container { .search-container {
width: 100%; width: 100%;
} }
.menu-toggle { .menu-toggle {
display: flex !important; display: flex !important;
} }
@@ -298,8 +299,12 @@ body {
/* Add floating animation for icons */ /* Add floating animation for icons */
@keyframes float { @keyframes float {
0%, 100% { transform: translateY(0); } 0%, 100% {
50% { transform: translateY(-10px); } transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
} }
.theme-toggle:hover { .theme-toggle:hover {

View File

@@ -1,4 +1,3 @@
/* Corporate Design Colors */ /* Corporate Design Colors */
:root { :root {
--primary-color: #5265A0; /* HSGG Blau */ --primary-color: #5265A0; /* HSGG Blau */

View File

@@ -84,7 +84,7 @@ class SubjectData
$subjectDirectory = "config/subjects/$subjectId"; $subjectDirectory = "config/subjects/$subjectId";
$filename = "$subjectDirectory/properties.json"; $filename = "$subjectDirectory/properties.json";
$data = Util::parseJsonFromFile($filename); $data = Util::parseJsonFromFile($filename);
if(!isset($data)) { if (!isset($data)) {
return null; return null;
} }

View File

@@ -90,7 +90,7 @@ class TopicData
$topicsDirectory = "config/subjects/$subjectId/topics"; $topicsDirectory = "config/subjects/$subjectId/topics";
$topicDataDirectory = "$topicsDirectory/$topicId"; $topicDataDirectory = "$topicsDirectory/$topicId";
$data = Util::parseJsonFromFile("$topicDataDirectory/properties.json"); $data = Util::parseJsonFromFile("$topicDataDirectory/properties.json");
if(!isset($data)) { if (!isset($data)) {
return null; return null;
} }

View File

@@ -41,7 +41,7 @@ class Util
static function parseJsonFromFile(string $filename): mixed static function parseJsonFromFile(string $filename): mixed
{ {
$content = self::readFileContent($filename); $content = self::readFileContent($filename);
if(!isset($content)) { if (!isset($content)) {
return null; return null;
} }
return json_decode($content); return json_decode($content);

View File

@@ -51,7 +51,8 @@ $topics = $subjectData->topics;
<button class="menu-toggle h-12 w-12 border-2 p-1 hover:border-[<?php echo($subjectData->color); ?>]"> <button class="menu-toggle h-12 w-12 border-2 p-1 hover:border-[<?php echo($subjectData->color); ?>]">
<i class="fas fa-bars"></i> <i class="fas fa-bars"></i>
</button> </button>
<input type="text" class="search-box p-3 border-2 w-full focus:border-[<?php echo($subjectData->color); ?>]" id="searchInput" placeholder="Suche nach Themen, Übungen oder Hilfe..." <input type="text" class="search-box p-3 border-2 w-full focus:border-[<?php echo($subjectData->color); ?>]"
id="searchInput" placeholder="Suche nach Themen, Übungen oder Hilfe..."
oninput="handleSearch()"> oninput="handleSearch()">
</div> </div>
@@ -108,7 +109,8 @@ $topics = $subjectData->topics;
<a onclick="event.stopPropagation();" <a onclick="event.stopPropagation();"
href="<?php echo("config/subjects/$subjectData->id/topics/$topicData->id/$fileName") ?>" href="<?php echo("config/subjects/$subjectData->id/topics/$topicData->id/$fileName") ?>"
target="_blank" download class="download-btn border-2 border-[<?php echo($subjectData->color); ?>]"> target="_blank" download
class="download-btn border-2 border-[<?php echo($subjectData->color); ?>]">
<i class="fas fa-file-pdf"></i> <i class="fas fa-file-pdf"></i>
<?php echo($fileName); ?> <?php echo($fileName); ?>
</a> </a>

View File

@@ -61,58 +61,61 @@ if (!isset($topicData)) {
<!-- Main Content --> <!-- Main Content -->
<main class="main-content"> <main class="main-content">
<div class="max-w-7xl mt-5"> <div class="max-w-7xl mt-5">
<div class="mt-16"></div> <div class="mt-16"></div>
<div class="related-topics bg-gray-100 p-4 rounded-lg"> <div class="related-topics bg-gray-100 p-4 rounded-lg">
<h4>Verwandte Themen:</h4> <h4>Verwandte Themen:</h4>
<ul class="flex flex-wrap gap-2"> <ul class="flex flex-wrap gap-2">
<?php
foreach ($topicData->relatedTopics as $relatedTopicName) {
$relatedTopic = $subjectData->topics[$relatedTopicName];
if (!isset($relatedTopic)) {
continue;
}
?>
<li onclick="event.stopPropagation();" class="border-[<?php echo($subjectData->color); ?>] border-2">
<a href='<?php echo("topic.php?subject=$subjectData->id&topic=$relatedTopic->id") ?>' class="block">
<?php echo($relatedTopic->displayName); ?>
</a>
</li>
<?php <?php
} foreach ($topicData->relatedTopics as $relatedTopicName) {
?> $relatedTopic = $subjectData->topics[$relatedTopicName];
</ul> if (!isset($relatedTopic)) {
</div> continue;
}
<div class="content-card mt-[8px]">
<h1 class="content-title"><?php echo($topicData->displayName); ?></h1>
<p class="content-text">
<?php echo($topicData->description); ?>
</p>
<p class="content-text article-section">
<?php echo($topicData->article); ?>
</p>
<div class="exercise-section bg-gray-100">
<h3 style="margin-bottom: 1rem;" class="text-[var(--primary-color)]">Übungen herunterladen:</h3>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
<?php
foreach ($topicData->files as $fileName) {
?> ?>
<li onclick="event.stopPropagation();"
<a href='<?php echo("config/subjects/$subjectData->id/topics/$topicData->id/$fileName") ?>' class="border-[<?php echo($subjectData->color); ?>] border-2">
target="_blank" download class="download-btn border-[<?php echo($subjectData->color); ?>] border-2"> <a href='<?php echo("topic.php?subject=$subjectData->id&topic=$relatedTopic->id") ?>'
<i class="fas fa-file-pdf"></i> class="block">
<?php echo($fileName); ?> <?php echo($relatedTopic->displayName); ?>
</a> </a>
</li>
<?php <?php
} }
?> ?>
</ul>
</div>
<div class="content-card mt-[8px]">
<h1 class="content-title"><?php echo($topicData->displayName); ?></h1>
<p class="content-text">
<?php echo($topicData->description); ?>
</p>
<p class="content-text article-section">
<?php echo($topicData->article); ?>
</p>
<div class="exercise-section bg-gray-100">
<h3 style="margin-bottom: 1rem;" class="text-[var(--primary-color)]">Übungen herunterladen:</h3>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
<?php
foreach ($topicData->files as $fileName) {
?>
<a href='<?php echo("config/subjects/$subjectData->id/topics/$topicData->id/$fileName") ?>'
target="_blank" download
class="download-btn border-[<?php echo($subjectData->color); ?>] border-2">
<i class="fas fa-file-pdf"></i>
<?php echo($fileName); ?>
</a>
<?php
}
?>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
</main> </main>
<footer class="sticky top-[100vh] lg:ms-[280px] w-full lg:w-auto bg-white/80 backdrop-blur-lg shadow-sm p-5"> <footer class="sticky top-[100vh] lg:ms-[280px] w-full lg:w-auto bg-white/80 backdrop-blur-lg shadow-sm p-5">