You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 line
2.4 KiB

  1. import './magazine-article.scss';
  2. import {createElement, createImage} from "../../_global/scripts/helpers";
  3. import {lorem1, lorem2} from "../../_global/scripts/lorem";
  4. import {createGallery} from "../gallery/GalleryComponent";
  5. import {createAnchorLinks} from "../anchor-links/AnchorLinksComponent";
  6. import {createBlockquote} from "../../atoms/blockquote/BlockquoteComponent";
  7. import {createContact} from "../contact/ContactComponent";
  8. import {createPrintShare} from "../print-share/PrintShareComponent";
  9. import {createInfobox} from "../infobox/InfoboxComponent";
  10. import {createEventsSection} from "../../sections/events/EventsComponent";
  11. import {createCardSlider} from "../../sections/card-slider/CardSliderComponent";
  12. export const createMagazineArticle = ({
  13. addArticleComponents = true,
  14. kicker = 'Titelthema',
  15. headline = '5 Beispiele, wie sich Unternehmen für ihr Umfeld engagieren',
  16. }) => {
  17. const article = createElement('article', ['col', 'magazine-article']);
  18. if (addArticleComponents) {
  19. createElement('p', ['kicker'], kicker, article);
  20. createElement('h1', [], headline, article);
  21. createElement('p', ['author-date'], 'von Martina Mustermann | 15.02.2025', article);
  22. article.appendChild(createAnchorLinks({titles: ['Lorem ipsum dolor sit', 'Consectetur adipisicing elit']}))
  23. const richText = createElement('div', ['richtext'], null, article);
  24. createElement('p', ['initial'], lorem1, richText);
  25. createElement('p', [], lorem2, richText);
  26. createElement('h2', [], 'Lorem ipsum dolor sit', richText);
  27. createElement('p', [], lorem1, richText);
  28. article.appendChild(createCardSlider({}));
  29. article.appendChild(createGallery({galleryType: 'masonry'}));
  30. article.appendChild(createInfobox({content: lorem2}));
  31. const imageBox = createElement('figure', ['image-box', 'off-grid'], null, article);
  32. createImage('./dummy/placeholder-3-2.svg', 420, 280, 'Image off grid', [], imageBox);
  33. createElement('figcaption', [], 'Bildunterschrift lorem ipsum dolor sit amet ipsum', imageBox);
  34. createElement('p', [], lorem2 + ' ' + lorem1 + ' ' + lorem2, article);
  35. createElement('p', [], lorem2, article);
  36. createElement('h2', [], 'Consectetur adipisicing elit', article);
  37. createElement('p', [], lorem2, article);
  38. article.appendChild(createEventsSection({}));
  39. article.appendChild(createBlockquote({}));
  40. article.appendChild(createContact({}));
  41. article.appendChild(createPrintShare({}));
  42. }
  43. return article;
  44. }