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

View File

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

View File

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

View File

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

View File

@@ -41,7 +41,7 @@ class Util
static function parseJsonFromFile(string $filename): mixed
{
$content = self::readFileContent($filename);
if(!isset($content)) {
if (!isset($content)) {
return null;
}
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); ?>]">
<i class="fas fa-bars"></i>
</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()">
</div>
@@ -108,7 +109,8 @@ $topics = $subjectData->topics;
<a onclick="event.stopPropagation();"
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>
<?php echo($fileName); ?>
</a>

View File

@@ -61,58 +61,61 @@ if (!isset($topicData)) {
<!-- Main Content -->
<main class="main-content">
<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">
<h4>Verwandte Themen:</h4>
<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>
<div class="related-topics bg-gray-100 p-4 rounded-lg">
<h4>Verwandte Themen:</h4>
<ul class="flex flex-wrap gap-2">
<?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) {
foreach ($topicData->relatedTopics as $relatedTopicName) {
$relatedTopic = $subjectData->topics[$relatedTopicName];
if (!isset($relatedTopic)) {
continue;
}
?>
<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>
<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
}
?>
</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>
</main>
<footer class="sticky top-[100vh] lg:ms-[280px] w-full lg:w-auto bg-white/80 backdrop-blur-lg shadow-sm p-5">