Seitenleiste mit Filteroptionen
This commit is contained in:
+80
-37
@@ -2,49 +2,92 @@
|
|||||||
Seite: Suchergebnisse
|
Seite: Suchergebnisse
|
||||||
Inhalt: Zeigt die Ergebnisse einer Suche an
|
Inhalt: Zeigt die Ergebnisse einer Suche an
|
||||||
-->
|
-->
|
||||||
<div class="s-res-container">
|
<div class="s-res-layout-grid">
|
||||||
|
|
||||||
<!-- Kopfzeile der Suche -->
|
<!-- Links: Seitenleiste für Filter und Suche -->
|
||||||
<div class="s-res-header">
|
<aside class="s-res-sidebar">
|
||||||
<h1 class="s-res-main-title">Suchergebnisse</h1>
|
|
||||||
<p class="s-res-meta">3 Treffer für Ihre Suchanfrage</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Ergebnisliste (nach Titel sortiert) -->
|
<!-- Suchleiste Box -->
|
||||||
<div class="s-res-list">
|
<div class="s-res-sidebar-box">
|
||||||
|
<h3 class="s-res-sidebar-title">Suche anpassen</h3>
|
||||||
<!-- Beitrag A -->
|
<form action="#" method="GET" class="s-res-search-form">
|
||||||
<div class="s-res-item">
|
<!-- Deine Suchleiste -->
|
||||||
<div class="s-res-content">
|
<input type="search" id="site-search" name="q" placeholder="Suchen..." class="nav__search">
|
||||||
<h2 class="s-res-item-title">
|
<button type="submit" class="nav__search-button">Suchen</button>
|
||||||
<a href="#" class="s-res-link">Anleitung zur Webentwicklung</a>
|
</form>
|
||||||
</h2>
|
|
||||||
<p class="s-res-author">Von: <span class="s-res-author-name">Max Mustermann</span></p>
|
|
||||||
</div>
|
|
||||||
<div class="s-res-arrow">→</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Beitrag B -->
|
<!-- Filteroptionen Box -->
|
||||||
<div class="s-res-item">
|
<div class="s-res-sidebar-box">
|
||||||
<div class="s-res-content">
|
<h3 class="s-res-sidebar-title">Sortierung</h3>
|
||||||
<h2 class="s-res-item-title">
|
<div class="s-res-filter-group">
|
||||||
<a href="#" class="s-res-link">CSS Flexbox verständlich erklärt</a>
|
<label class="s-res-filter-option">
|
||||||
</h2>
|
<input type="radio" name="sort" value="alphabet" checked>
|
||||||
<p class="s-res-author">Von: <span class="s-res-author-name">Anna Schmidt</span></p>
|
<span>Alphabetisch</span>
|
||||||
|
</label>
|
||||||
|
<label class="s-res-filter-option">
|
||||||
|
<input type="radio" name="sort" value="likes">
|
||||||
|
<span>Beliebtheit (Likes)</span>
|
||||||
|
</label>
|
||||||
|
<label class="s-res-filter-option">
|
||||||
|
<input type="radio" name="sort" value="newest">
|
||||||
|
<span>Neueste Beiträge</span>
|
||||||
|
</label>
|
||||||
|
<label class="s-res-filter-option">
|
||||||
|
<input type="radio" name="sort" value="oldest">
|
||||||
|
<span>Älteste Beiträge</span>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="s-res-arrow">→</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Beitrag C -->
|
</aside>
|
||||||
<div class="s-res-item">
|
|
||||||
<div class="s-res-content">
|
<!-- Rechts: Hauptinhalt mit Ergebnissen -->
|
||||||
<h2 class="s-res-item-title">
|
<main class="s-res-main-content">
|
||||||
<a href="#" class="s-res-link">HTML5-Grundlagen für Einsteiger</a>
|
|
||||||
</h2>
|
<!-- Kopfzeile der Suche -->
|
||||||
<p class="s-res-author">Von: <span class="s-res-author-name">Lisa Meier</span></p>
|
<div class="s-res-header">
|
||||||
</div>
|
<h1 class="s-res-main-title">Suchergebnisse</h1>
|
||||||
<div class="s-res-arrow">→</div>
|
<p class="s-res-meta">3 Treffer für Ihre Suchanfrage</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<!-- Ergebnisliste -->
|
||||||
</div>
|
<div class="s-res-list">
|
||||||
|
|
||||||
|
<!-- Beitrag A -->
|
||||||
|
<div class="s-res-item">
|
||||||
|
<div class="s-res-content">
|
||||||
|
<h2 class="s-res-item-title">
|
||||||
|
<a href="#" class="s-res-link">Anleitung zur Webentwicklung</a>
|
||||||
|
</h2>
|
||||||
|
<p class="s-res-author">Von: <span class="s-res-author-name">Max Mustermann</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="s-res-arrow">→</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Beitrag B -->
|
||||||
|
<div class="s-res-item">
|
||||||
|
<div class="s-res-content">
|
||||||
|
<h2 class="s-res-item-title">
|
||||||
|
<a href="#" class="s-res-link">CSS Flexbox verständlich erklärt</a>
|
||||||
|
</h2>
|
||||||
|
<p class="s-res-author">Von: <span class="s-res-author-name">Anna Schmidt</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="s-res-arrow">→</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Beitrag C -->
|
||||||
|
<div class="s-res-item">
|
||||||
|
<div class="s-res-content">
|
||||||
|
<h2 class="s-res-item-title">
|
||||||
|
<a href="#" class="s-res-link">HTML5-Grundlagen für Einsteiger</a>
|
||||||
|
</h2>
|
||||||
|
<p class="s-res-author">Von: <span class="s-res-author-name">Lisa Meier</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="s-res-arrow">→</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</div>
|
||||||
+101
-8
@@ -1,20 +1,109 @@
|
|||||||
/*
|
/*
|
||||||
CSS für die Suchergebnis-Seite
|
CSS für die Suchergebnis-Seite
|
||||||
*/
|
*/
|
||||||
.s-res-container {
|
/* Container und Layout-Schutz vor globalen Styles */
|
||||||
|
.s-res-layout-grid {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
max-width: 800px;
|
max-width: 1200px;
|
||||||
margin: 2rem auto;
|
margin: 2rem auto;
|
||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
color: #212529;
|
color: #212529;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
|
||||||
|
/* Grid für die Zweispaltigkeit */
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 280px 1fr;
|
||||||
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.s-res-container * {
|
.s-res-layout-grid * {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- SEITENLEISTE (FILTER & SUCHE) --- */
|
||||||
|
.s-res-sidebar {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s-res-sidebar-box {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s-res-sidebar-title {
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1a202c;
|
||||||
|
margin: 0 0 1rem 0;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Formular & deine Suchleisten-Klassen */
|
||||||
|
.s-res-search-form {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav__search {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.4rem 0.6rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
border: 1px solid #cbd5e1;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav__search-button {
|
||||||
|
display: inline-block;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cbd5e1;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0.4rem 0.6rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-left: 4px;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav__search-button:hover {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Filter Radio-Buttons */
|
||||||
|
.s-res-filter-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s-res-filter-option {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
color: #4a5568;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s-res-filter-option input[type="radio"] {
|
||||||
|
margin: 0;
|
||||||
|
accent-color: #3182ce; /* Moderne Färbung des Radio-Buttons */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- HAUPTINHALT (ERGEBNISSE) --- */
|
||||||
|
.s-res-main-content {
|
||||||
|
min-width: 0; /* Verhindert das Ausbrechen von Flex-Elementen */
|
||||||
|
}
|
||||||
|
|
||||||
.s-res-header {
|
.s-res-header {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
border-bottom: 2px solid #dee2e6;
|
border-bottom: 2px solid #dee2e6;
|
||||||
@@ -34,7 +123,6 @@ CSS für die Suchergebnis-Seite
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ergebnisliste */
|
|
||||||
.s-res-list {
|
.s-res-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -59,7 +147,6 @@ CSS für die Suchergebnis-Seite
|
|||||||
border-color: #cbd5e1;
|
border-color: #cbd5e1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inhalt des Beitrags */
|
|
||||||
.s-res-content {
|
.s-res-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
@@ -70,7 +157,6 @@ CSS für die Suchergebnis-Seite
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Links */
|
|
||||||
.s-res-link {
|
.s-res-link {
|
||||||
color: #3182ce;
|
color: #3182ce;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -82,7 +168,6 @@ CSS für die Suchergebnis-Seite
|
|||||||
color: #2b6cb0;
|
color: #2b6cb0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Autorenzeile */
|
|
||||||
.s-res-author {
|
.s-res-author {
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
color: #4a5568;
|
color: #4a5568;
|
||||||
@@ -94,7 +179,6 @@ CSS für die Suchergebnis-Seite
|
|||||||
color: #2d3748;
|
color: #2d3748;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interaktions-Pfeil */
|
|
||||||
.s-res-arrow {
|
.s-res-arrow {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
color: #a0aec0;
|
color: #a0aec0;
|
||||||
@@ -106,3 +190,12 @@ CSS für die Suchergebnis-Seite
|
|||||||
color: #3182ce;
|
color: #3182ce;
|
||||||
transform: translateX(3px);
|
transform: translateX(3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- RESPONSIVE DESIGN (MOBILGERÄTE) --- */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.s-res-layout-grid {
|
||||||
|
grid-template-columns: 1fr; /* Stapelt Seitenleiste und Inhalt untereinander */
|
||||||
|
gap: 1.5rem;
|
||||||
|
margin: 1rem auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user