From 84be057ca86027ff8e8c1609f418e02bff4299c6 Mon Sep 17 00:00:00 2001 From: FlorianEisenmenger Date: Tue, 2 Dec 2025 23:27:04 +0100 Subject: [PATCH] css from develop --- .../stories/components/contact/contact.scss | 2 +- .../document-list/document-list.scss | 4 +-- .../components/search-form/search-form.js | 26 ++++++++++++++++++- .../components/teaser/TeaserComponent.js | 10 +++++++ .../stories/sections/events/events.scss | 3 ++- .../stories/sections/teasers/teasers.scss | 12 ++++----- 6 files changed, 46 insertions(+), 11 deletions(-) diff --git a/gfi-ihk-2024/stories/components/contact/contact.scss b/gfi-ihk-2024/stories/components/contact/contact.scss index e964858..222c4eb 100644 --- a/gfi-ihk-2024/stories/components/contact/contact.scss +++ b/gfi-ihk-2024/stories/components/contact/contact.scss @@ -14,7 +14,7 @@ margin-top: var(--section-headline-margin); } - h5, h6, .like-h6 { + h5, .like-h5, h6, .like-h6 { margin-top: -0.3em; font-size: var(--font-size-copy); font-family: var(--font-korb); diff --git a/gfi-ihk-2024/stories/components/document-list/document-list.scss b/gfi-ihk-2024/stories/components/document-list/document-list.scss index d065759..22ee421 100644 --- a/gfi-ihk-2024/stories/components/document-list/document-list.scss +++ b/gfi-ihk-2024/stories/components/document-list/document-list.scss @@ -116,7 +116,7 @@ } } - h6 { + h6, .like-h6 { font-size: 18px; margin-top: 4px; text-decoration: underline; @@ -126,7 +126,7 @@ } } - h5, .details { + h5, .like-h5, .details { font-weight: 600; } diff --git a/gfi-ihk-2024/stories/components/search-form/search-form.js b/gfi-ihk-2024/stories/components/search-form/search-form.js index 1f292a1..b97685f 100644 --- a/gfi-ihk-2024/stories/components/search-form/search-form.js +++ b/gfi-ihk-2024/stories/components/search-form/search-form.js @@ -31,7 +31,11 @@ export class IHKSearchTiles { this.allResultButton.classList.add("all-button-wrapper"); this.buttonString = '
Alle Suchergebnisse
'; this.allResultButton.innerHTML = this.buttonString; - this.allResultButton.addEventListener("click", () => { + this.allResultButton.addEventListener("click", (e) => { + if(this.allResultButton.classList.contains("no-results")) { + e.preventDefault(); + return; + } this.searchButton.click(); }); @@ -111,7 +115,27 @@ export class IHKSearchTiles { // find tile a and shorten the text if needed let itemTitles = tiles.getElementsByClassName('item-title'); self.shortenTileText(itemTitles); + + const hasHits = tiles.querySelectorAll('.tile').length > 0; + + // Zustand je nach Ergebnis setzen + if (!hasHits) { + self.allResultButton.innerHTML = '
Keine Inhalte gefunden
'; + self.allResultButton.classList.add('no-results'); + self.allResultButton.querySelector('.btn').setAttribute('disabled', 'true'); + + } else { + self.allResultButton.innerHTML = '
Alle Suchergebnisse
'; + self.allResultButton.classList.remove('no-results'); + self.allResultButton.querySelector('.btn').removeAttribute('disabled'); + } + // add the "all results" button + const searchWrapper = tiles.closest('.search'); + if (searchWrapper) { + searchWrapper.classList.add('has-button-wrapper'); + } + tiles.insertAdjacentElement("afterend", self.allResultButton); } } diff --git a/gfi-ihk-2024/stories/components/teaser/TeaserComponent.js b/gfi-ihk-2024/stories/components/teaser/TeaserComponent.js index cb32382..02dad94 100644 --- a/gfi-ihk-2024/stories/components/teaser/TeaserComponent.js +++ b/gfi-ihk-2024/stories/components/teaser/TeaserComponent.js @@ -70,6 +70,16 @@ export const createTeaser = ({ } } + else if (type === 'picto' || type === 'pictoHero') { + const imageBox = createElement('div', ['image-box', 'chart'], null, teaser); + const pictoBox = createElement('div', ['picto-box', ...(type === 'pictoHero' ? ['hero'] : [])], null, imageBox); + const iconBox = createElement('div', ['icon'], null, pictoBox); + iconBox.classList.add(picto); + if (pictoText) { + createElement('span', ['picto-title'], chartTitle, pictoBox); + } + } + const textBox = createElement('div', ['text-box'], '', teaser); createElement('div', ['title','like-h4'], headline, textBox); createElement('p', [], copy, textBox); diff --git a/gfi-ihk-2024/stories/sections/events/events.scss b/gfi-ihk-2024/stories/sections/events/events.scss index 1e7453b..c6fd872 100644 --- a/gfi-ihk-2024/stories/sections/events/events.scss +++ b/gfi-ihk-2024/stories/sections/events/events.scss @@ -11,6 +11,7 @@ padding-right: calc(var(--section-padding) / 2); } + .container > .like-h2, .container > h2 { margin-top: var(--section-headline-margin); } @@ -218,4 +219,4 @@ } } } -} \ No newline at end of file +} diff --git a/gfi-ihk-2024/stories/sections/teasers/teasers.scss b/gfi-ihk-2024/stories/sections/teasers/teasers.scss index 4d852f5..e07e400 100644 --- a/gfi-ihk-2024/stories/sections/teasers/teasers.scss +++ b/gfi-ihk-2024/stories/sections/teasers/teasers.scss @@ -154,7 +154,7 @@ margin-top: 0; } - h2 { + h2, .like-h2 { margin-top: 0 !important; } @@ -230,7 +230,7 @@ } &[data-type="hero"] .image-box + .text-box { - h3, h4, .like-h4 { + h3, .like-h3, h4, .like-h4 { position: relative; font-size: 20px; margin-top: 0; @@ -370,14 +370,14 @@ } a.teaser { - h3, h4, .like-h4 { + h3, .like-h3, h4, .like-h4 { text-decoration: underline; text-underline-offset: 0.09em; text-decoration-thickness: 0.08em; } } - h3, h4, .like-h4 { + h3, .like-h3, h4, .like-h4 { margin: 16px 0 14px; color: var(--theme-color-link); transition: 0.3s ease; @@ -617,7 +617,7 @@ height: 14px; } - h3, h4, .like-h4 { + h3, .like-h3, h4, .like-h4 { color: var(--theme-color-link-hover); } } @@ -638,7 +638,7 @@ } .magazine-article .teasers, .magazine-start .teasers, .teasers.magazine-style { - h2 { + h2, .like-h2 { text-transform: uppercase; font-size: var(--font-size-h4); margin-bottom: 1.2em;