Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

39 righe
1.4 KiB

  1. import './magazine-header.scss';
  2. import $ from "jquery";
  3. import {createElement, createImage} from "../../_global/scripts/helpers";
  4. import IHKMagazineHeader from "./magazine-header";
  5. export const createMagazineHeader =
  6. ({
  7. size = 'regular',
  8. logo = './logos/wirtschaftsdialoge.svg',
  9. title = 'Wirtschaftsdialoge',
  10. imgtext = 'regular',
  11. smalltext = '',
  12. backgroundColor = '',
  13. inlineStyles = 'background: ' + backgroundColor + ';',
  14. }) => {
  15. const header = createElement('section', ['magazine-header', size], null, null);
  16. header.setAttribute('aria-label', 'Kopfbereich');
  17. createElement('span', ['gradient'], null, header, inlineStyles);
  18. if (logo && logo.length > 0 && smalltext.length > 0) {
  19. imgtext = 'image-and-text';
  20. }
  21. const a = createElement('a', ['title', imgtext], null, header);
  22. a.href = '#';
  23. a.tabIndex = -1;
  24. if (logo && logo.length > 0 && smalltext.length === 0) {
  25. createImage(logo, 400, 100, 'Wirtschaftsdialoge Logo', [], a);
  26. } else if (logo && logo.length > 0 && smalltext.length > 0) {
  27. createImage(logo, 100, 100, '', [], a);
  28. const div = createElement('div', ['text'], null, a);
  29. createElement('span', ['title-text'], title, div);
  30. createElement('span', ['small-text'], smalltext, div);
  31. } else {
  32. a.innerText = title;
  33. }
  34. new IHKMagazineHeader($(header));
  35. return header;
  36. }