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.
 
 
 
 

42 rivejä
2.1 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. export const createMagazineArticle = ({
  11. addArticleComponents = true,
  12. kicker = 'Titelthema',
  13. headline = '5 Beispiele, wie sich Unternehmen für ihr Umfeld engagieren',
  14. }) => {
  15. const article = createElement('article', ['col', 'magazine-article']);
  16. if (addArticleComponents) {
  17. createElement('p', ['kicker'], kicker, article);
  18. createElement('h1', [], headline, article);
  19. article.appendChild(createAnchorLinks({titles: ['Lorem ipsum dolor sit', 'Consectetur adipisicing elit']}))
  20. const richText = createElement('div', ['richtext'], null, article);
  21. createElement('p', ['initial'], lorem1, richText);
  22. createElement('p', [], lorem2, richText);
  23. createElement('h2', [], 'Lorem ipsum dolor sit', richText);
  24. createElement('p', [], lorem1, richText);
  25. article.appendChild(createGallery({galleryType: 'masonry'}));
  26. article.appendChild(createInfobox({content: lorem2}));
  27. const imageBox = createElement('figure', ['image-box', 'off-grid'], null, article);
  28. createImage('https://source.unsplash.com/TamMbr4okv4/420x280', 420, 280, 'Image off grid', [], imageBox);
  29. createElement('figcaption', [], 'Bildunterschrift lorem ipsum dolor sit amet ipsum', imageBox);
  30. createElement('p', [], lorem2 + ' ' + lorem1 + ' ' + lorem2, article);
  31. createElement('p', [], lorem2, article);
  32. createElement('h2', [], 'Consectetur adipisicing elit', article);
  33. createElement('p', [], lorem2, article);
  34. article.appendChild(createBlockquote({}));
  35. article.appendChild(createContact({}));
  36. article.appendChild(createPrintShare({}));
  37. }
  38. return article;
  39. }