25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

122 lines
4.4 KiB

  1. import './marketingheader.scss';
  2. import '../../components/artwork/artwork.scss';
  3. import $ from 'jquery';
  4. import {createElement, createImage} from "../../_global/scripts/helpers";
  5. import {marketingHeaderData} from "./MarketingHeaderData";
  6. import {createArtwork} from "../../components/artwork/ArtworkComponent";
  7. import {createSearchInput} from "../../atoms/search-input/SearchInputComponent";
  8. import {createSearchButton} from "../../atoms/search-button/SearchButtonComponent";
  9. import IHKSearchTypeahead from "./marketingheader-typeahead";
  10. import {createProgressBar} from "../../atoms/progress-bar/ProgressBarComponent";
  11. import {createButton} from "../../atoms/button/ButtonComponent";
  12. export const createMarketingHeader =
  13. ({
  14. artworkStyle = 'artwork',
  15. headline1 = 'Willkommen bei Ihrer IHK.',
  16. headline2 = 'Wie können wir Ihnen helfen?',
  17. placeholder = 'Tippe "Taxischein" für Autocomplete',
  18. api = 'services/search/{SEARCHTERM}.json',
  19. tiles = marketingHeaderData,
  20. imageSrc = 'https://source.unsplash.com/2vCqH34PqWs/1080x648',
  21. kicker = 'Noch 7 Tage offen',
  22. headline = 'Jetzt und digital mitreden',
  23. copy = 'Mit der digitalen Beteiligung erhalten Mitgliedsunternehmen die Möglichkeit, sich einfach und schnell über laufende Verfahren und Abstimmungen zu informieren und sich aktiv daran zu beteiligen.',
  24. moreCta = {
  25. label: 'Mehr Infos',
  26. link: '#',
  27. target: '_self',
  28. },
  29. buttonCta = {
  30. label: 'Jetzt beteiligen',
  31. link: '#',
  32. target: '_self',
  33. },
  34. showProgress = true,
  35. progress = 60,
  36. backgroundImage = null,
  37. isFirstElement = false,
  38. }) => {
  39. const section = createElement('section', ['marketingheader'], null);
  40. const search = createElement('div', ['search'], null, section);
  41. const artwork = createArtwork({type: artworkStyle});
  42. search.appendChild(artwork);
  43. search.dataset.type = artworkStyle;
  44. const container = createElement('div', ['container', 'small'], null, search);
  45. const row = createElement('div', ['row'], null, container);
  46. const col = createElement('div', ['col'], null, row);
  47. createElement('h1', ['like-h2'], headline1 + '<br>' + headline2, col);
  48. const form = createElement('form', [], null, col);
  49. const label = createElement('label', ['visually-hidden'], 'IHK durchsuchen', form);
  50. label.for = 'search-term';
  51. form.appendChild(createSearchInput({api: api, placeholder: placeholder}));
  52. form.appendChild(createSearchButton({}));
  53. form.action = '#';
  54. const tilesContainer = createElement('div', ['tiles'], null, col);
  55. tiles.map((tile) => {
  56. const div = createElement('div', ['tile'], null, tilesContainer);
  57. const a = createElement('a', [], tile.title, div);
  58. a.href = tile.link;
  59. })
  60. if (api) {
  61. new IHKSearchTypeahead($(form).find('input.typeahead'));
  62. }
  63. const hasImage = imageSrc && imageSrc.length > 0;
  64. const stage = createElement('div', ['participation', 'participation-stage'], null, section);
  65. const container2 = createElement('div', ['container'], null, stage);
  66. const row2 = createElement('div', ['row'], null, container2);
  67. const col2 = createElement('div', ['col'], null, row2);
  68. const tb2 = createElement('div', ['text-box'], null, col2);
  69. if (backgroundImage && backgroundImage.length > 0) {
  70. //section.content('style=background: red;');
  71. stage.style = 'background-image: url(' + backgroundImage + ');';
  72. stage.classList.add('background-image');
  73. }
  74. if (isFirstElement) {
  75. stage.classList.add('first-element');
  76. }
  77. if (kicker && kicker.length > 0) {
  78. createElement('p', ['kicker'], kicker, tb2);
  79. }
  80. if (showProgress) {
  81. tb2.appendChild(createProgressBar({progress}));
  82. }
  83. createElement('h1', ['like-h2'], headline, tb2);
  84. createElement('p', [], copy, tb2);
  85. if (moreCta) {
  86. const more = createElement('a', [], moreCta.label, tb2);
  87. more.href = moreCta.link;
  88. more.target = moreCta.target;
  89. }
  90. if (buttonCta) {
  91. const button2 = createButton({
  92. elementType: 'a',
  93. link: buttonCta.link,
  94. color: 'white',
  95. label: buttonCta.label,
  96. iconPosition: 'icon-right',
  97. icon: 'small-arrow-right-simple',
  98. });
  99. tb2.appendChild(button2);
  100. }
  101. if (hasImage) {
  102. stage.classList.add('image-stage');
  103. const ib2 = createElement('div', ['image-box'], null, col2);
  104. createImage(imageSrc, 1080, 648, 'Beteiligung', [], ib2);
  105. }
  106. return section;
  107. }