From 31af1460467389d63f2f4f780bfc7e9b0a509228 Mon Sep 17 00:00:00 2001 From: Eric Blommel Date: Mon, 18 Nov 2024 23:24:21 +0100 Subject: [PATCH] update styling of topic page --- webseite/assets/css/subject.css | 20 +- webseite/assets/css/topic.css | 208 ++++++++++++++++ webseite/subject.php | 13 +- webseite/topic.php | 420 +++++++++----------------------- 4 files changed, 328 insertions(+), 333 deletions(-) create mode 100644 webseite/assets/css/topic.css diff --git a/webseite/assets/css/subject.css b/webseite/assets/css/subject.css index 6a8374c..fb9b0fe 100644 --- a/webseite/assets/css/subject.css +++ b/webseite/assets/css/subject.css @@ -7,7 +7,6 @@ } body { - background-color: var(--bg-color); min-height: 100vh; display: flex; overflow-x: hidden; @@ -47,6 +46,13 @@ body { transition: all 0.2s ease; } +/* Active nav link style */ +.nav-link.active { + background: rgba(255, 255, 255, 0.15); + color: white; + font-weight: 600; +} + .nav-link:hover { background: rgba(255, 255, 255, 0.1); color: white; @@ -63,7 +69,6 @@ body { top: 0; right: 0; padding: 1rem; - background: var(--card-bg); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); z-index: 40; display: flex; @@ -81,7 +86,6 @@ body { outline: none; font-size: 1rem; transition: all 0.2s ease; - background: var(--bg-color); } .main-content { @@ -102,7 +106,6 @@ body { } .topic-card { - background: var(--card-bg); border-radius: 20px; padding: 2rem; position: relative; @@ -284,7 +287,6 @@ body { display: none; align-items: center; justify-content: center; - color: var(--text-primary); transition: all 0.3s ease; } @@ -363,7 +365,6 @@ body { } .related-topics li { - background: white; padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; @@ -390,10 +391,3 @@ body { transform: translateY(-5px) scale(1.01); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); } - -/* Active nav link style */ -.nav-link.active { - background: rgba(255, 255, 255, 0.15); - color: white; - font-weight: 600; -} \ No newline at end of file diff --git a/webseite/assets/css/topic.css b/webseite/assets/css/topic.css new file mode 100644 index 0000000..5437597 --- /dev/null +++ b/webseite/assets/css/topic.css @@ -0,0 +1,208 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; +} + +body { + min-height: 100vh; + display: flex; + overflow-x: hidden; +} + +/* Left Sidebar Styles */ +.sidebar { + width: 280px; + height: 100vh; + padding: 2rem; + position: fixed; + left: 0; + top: 0; + transition: transform 0.3s ease; + z-index: 50; +} + +.sidebar-header { + color: white; + margin-bottom: 2rem; + display: flex; + align-items: center; + gap: 1rem; +} + +.sidebar-header i { + font-size: 2rem; +} + +.nav-link { + display: flex; + align-items: center; + padding: 1rem; + color: rgba(255, 255, 255, 0.8); + text-decoration: none; + border-radius: 12px; + margin-bottom: 0.5rem; + transition: all 0.2s ease; +} + +.nav-link:hover { + background: rgba(255, 255, 255, 0.1); + color: white; + transform: translateX(5px); +} + +.nav-link i { + margin-right: 1rem; + font-size: 1.25rem; +} + +/* Main Content Styles */ +.main-content { + margin-left: 280px; + padding: 2rem; + flex: 1; +} + + +/* Content Card Styles */ +.content-card { + border-radius: 20px; + padding: 2rem; + margin-bottom: 2rem; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); + transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); +} + + +.content-title { + font-size: 2rem; + margin-bottom: 1rem; +} + +.content-text { + line-height: 1.7; + margin-bottom: 1.5rem; +} + +/* Add these styles for the related-topics section */ +.related-topics { + padding: 1.25rem; + border-radius: 12px; +} + +.related-topics h4 { + color: var(--primary-color); + margin-bottom: 1rem; + font-size: 1rem; +} + +.related-topics ul { + list-style: none; + display: flex; + flex-wrap: wrap; + gap: 0.5rem; +} + +.related-topics li { + padding: 0.5rem 1rem; + border-radius: 20px; + font-size: 0.9rem; + transition: all 0.2s ease; + cursor: pointer; +} + +.related-topics li:hover { + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); +} + +.related-topics a { + color: inherit; + text-decoration: none; +} + +/* Exercise Section Styles */ +.exercise-section { + padding: 1.5rem; + border-radius: 12px; + color: white; + margin-top: 2rem; + position: relative; + overflow: hidden; +} + +.exercise-section::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1)); + pointer-events: none; +} + +.download-btn { + display: inline-flex; + align-items: center; + gap: 0.5rem; + background: rgba(255, 255, 255, 0.1); + color: white; + padding: 0.75rem 1.25rem; + border-radius: 10px; + text-decoration: none; + margin: 0.5rem; + backdrop-filter: blur(5px); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); +} + +.download-btn:hover { + background: rgba(255, 255, 255, 0.2); + transform: translateY(-3px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +@media (max-width: 768px) { + .sidebar { + transform: translateX(-100%); + } + + .sidebar.active { + transform: translateX(0); + } + + .main-content { + margin-left: 0; + } +} + +/* Active nav link style */ +.nav-link.active { + background: rgba(255, 255, 255, 0.15); + color: white; + font-weight: 600; +} + +/* List style improvement */ +.content-text li { + position: relative; + padding-left: 1.5rem; + margin-bottom: 0.5rem; +} + +.content-text li::before { + content: '•'; + position: absolute; + left: 0; + font-weight: bold; +} + +.menu-toggle { + padding: 0.75rem; + border-radius: 10px; + cursor: pointer; + align-items: center; + justify-content: center; + transition: all 0.3s ease; +} \ No newline at end of file diff --git a/webseite/subject.php b/webseite/subject.php index 26746d4..edc6cef 100644 --- a/webseite/subject.php +++ b/webseite/subject.php @@ -38,7 +38,7 @@ $topics = $subjectData->topics; Startseite - + displayName); ?> Übersicht @@ -126,8 +126,6 @@ $topics = $subjectData->topics; document.addEventListener('DOMContentLoaded', () => { const menuToggle = document.querySelector('.menu-toggle'); const sidebar = document.querySelector('.sidebar'); - const searchContainer = document.querySelector('.search-container'); - const mainContent = document.querySelector('.main-content'); // Function to handle sidebar toggle function toggleSidebar() { @@ -194,14 +192,6 @@ $topics = $subjectData->topics; } }, 250); }); - - // Handle escape key to close sidebar - document.addEventListener('keydown', (e) => { - if (e.key === 'Escape' && sidebar.classList.contains('active')) { - sidebar.classList.remove('active'); - removeOverlay(); - } - }); }); // Add this right after your existing toggleSidebar function @@ -215,7 +205,6 @@ $topics = $subjectData->topics; } // Add event listeners - window.addEventListener('load', updateMenuVisibility); window.addEventListener('resize', updateMenuVisibility); // Update search function with fallback animation diff --git a/webseite/topic.php b/webseite/topic.php index 922dda5..46e7f80 100644 --- a/webseite/topic.php +++ b/webseite/topic.php @@ -1,21 +1,21 @@ <?php echo($topicData->displayName); ?> - <?php echo($subjectData->displayName); ?> + + - + -