Browse Source

3 instead of 1 image

master
FlorianEisenmenger 7 months ago
parent
commit
bae36afd78
5 changed files with 43 additions and 6 deletions
  1. +8
    -1
      gfi-ihk-2024/stories/sections/marketingheader/MarketingHeaderComponent.js
  2. +6
    -0
      gfi-ihk-2024/stories/sections/marketingheader/marketingheader.scss
  3. +12
    -3
      gfi-ihk-2024/stories/sections/participation-stage/ParticipationStageComponent.js
  4. +15
    -0
      gfi-ihk-2024/stories/sections/participation-stage/participation-stage.scss
  5. +2
    -2
      gfi-ihk-2024/stories/sections/slider/slider.scss

+ 8
- 1
gfi-ihk-2024/stories/sections/marketingheader/MarketingHeaderComponent.js View File

@@ -120,7 +120,14 @@ export const createMarketingHeader =


if (slideData.imageSrc && slideData.imageSrc.length > 0) { if (slideData.imageSrc && slideData.imageSrc.length > 0) {
const imageBox = createElement('div', ['image-box'], null, outer); const imageBox = createElement('div', ['image-box'], null, outer);
createImage(slideData.imageSrc, 900, 600, 'Slide ' + index, [], imageBox);
const picture = createElement('picture', [], null, imageBox);
const src1 = createElement('source', [], null, picture);
src1.setAttribute('media','(min-width: 1000px)');
src1.setAttribute('srcset',slideData.imageSrc);
const src2 = createElement('source', [], null, picture);
src2.setAttribute('media','(min-width: 901px)');
src2.setAttribute('srcset',slideData.imageSrc);
createImage(slideData.imageSrc, 900, 600, 'Slide ' + index, [], picture);
const copyright = createElement('span', ['copyright'], 'Copyright-Angabe', imageBox); const copyright = createElement('span', ['copyright'], 'Copyright-Angabe', imageBox);
copyright.setAttribute("aria-hidden", "true"); copyright.setAttribute("aria-hidden", "true");
createElement('span', ['sr-only'], 'Copyright-Angabe', imageBox); createElement('span', ['sr-only'], 'Copyright-Angabe', imageBox);


+ 6
- 0
gfi-ihk-2024/stories/sections/marketingheader/marketingheader.scss View File

@@ -592,6 +592,12 @@ section.marketingheader{
min-height: 427px; min-height: 427px;
height: 100%; height: 100%;
} }
picture {
@media(min-width: 1000px) {
min-height: 427px;
height: 100%;
}
}
img { img {
object-position: right; object-position: right;
//max-height:427px; //max-height:427px;


+ 12
- 3
gfi-ihk-2024/stories/sections/participation-stage/ParticipationStageComponent.js View File

@@ -32,8 +32,10 @@ export const createParticipationStage = ({
const tb = createElement('div', ['text-box'], null, col); const tb = createElement('div', ['text-box'], null, col);


if (backgroundImage && backgroundImage.length > 0) { if (backgroundImage && backgroundImage.length > 0) {
//section.content('style=background: red;');
section.style = 'background-image: url(' + backgroundImage + ');';
section.style = '--bg-mobile: url(' + backgroundImage + ');\n' +
' --bg-tablet: url(' + backgroundImage + ');\n' +
' --bg-desktop: url(' + backgroundImage + ');\n' +
' background-image: var(--bg-mobile);';
section.classList.add('background-image'); section.classList.add('background-image');
} }


@@ -69,7 +71,14 @@ export const createParticipationStage = ({
if (hasImage) { if (hasImage) {
section.classList.add('image-stage'); section.classList.add('image-stage');
const ib = createElement('div', ['image-box'], null, col); const ib = createElement('div', ['image-box'], null, col);
createImage(imageSrc, 1080, 648, 'Beteiligung', [], ib);
const picture = createElement('picture', [], null, ib);
const src1 = createElement('source', [], null, picture);
src1.setAttribute('media','(min-width: 1300px)');
src1.setAttribute('srcset',imageSrc);
const src2 = createElement('source', [], null, picture);
src2.setAttribute('media','(min-width: 1000px)');
src2.setAttribute('srcset',imageSrc);
createImage(imageSrc, 1080, 648, 'Beteiligung', [], picture);
const copy = createElement('span', ['copyright'], copyright, ib); const copy = createElement('span', ['copyright'], copyright, ib);
copy.setAttribute("aria-hidden", "true"); copy.setAttribute("aria-hidden", "true");
createElement('span', ['sr-only'], copyright, ib); createElement('span', ['sr-only'], copyright, ib);


+ 15
- 0
gfi-ihk-2024/stories/sections/participation-stage/participation-stage.scss View File

@@ -13,6 +13,16 @@
&.background-image { &.background-image {
background-size: cover; background-size: cover;
background-position: 50% 50%; background-position: 50% 50%;
@media (min-width: 560px) {
&[style*='--bg-tablet'] {
background-image: var(--bg-tablet) !important;
}
}
@media (min-width: 1000px) {
&[style*='--bg-desktop'] {
background-image: var(--bg-desktop) !important;
}
}
} }


&.first-element { &.first-element {
@@ -83,6 +93,11 @@
bottom: 0; bottom: 0;
z-index: -1; z-index: -1;


picture {
display: block;
width: 100%;
height: 100%;
}
img { img {
position: relative; position: relative;
display: block; display: block;


+ 2
- 2
gfi-ihk-2024/stories/sections/slider/slider.scss View File

@@ -155,7 +155,7 @@
padding-top: 66.66667%; padding-top: 66.66667%;
} }


> img, .gallery {
> picture, img, .gallery {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
@@ -169,7 +169,7 @@
flex: 1 1 66.66667%; flex: 1 1 66.66667%;
max-width: 66.66667%; max-width: 66.66667%;


> img, .gallery {
> picture, img, .gallery {
width: calc(100% - 20px); width: calc(100% - 20px);
left: 1px; left: 1px;
} }


Loading…
Cancel
Save