kcc-gem-theme-original 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +142 -0
  4. data/_data/navigation.yml +154 -0
  5. data/_includes/accordion.html +36 -0
  6. data/_includes/accordion_path-sorting.html +29 -0
  7. data/_includes/body.html +5 -0
  8. data/_includes/breadcrumbs.html +44 -0
  9. data/_includes/card-section.html +26 -0
  10. data/_includes/chat-now.html +8 -0
  11. data/_includes/contacts-tan.html +94 -0
  12. data/_includes/contacts.html +96 -0
  13. data/_includes/document-head.html +25 -0
  14. data/_includes/emergency-alerts.html +29 -0
  15. data/_includes/foot.html +3 -0
  16. data/_includes/footer.html +193 -0
  17. data/_includes/hash/theme_hash.yml +1 -0
  18. data/_includes/hero-slider.html +36 -0
  19. data/_includes/nav-global.html +40 -0
  20. data/_includes/nav-local.html +34 -0
  21. data/_includes/nav-sub.html +19 -0
  22. data/_includes/preconnect.html +16 -0
  23. data/_includes/scripts/custom.html +4 -0
  24. data/_includes/scripts/google-api.html +2 -0
  25. data/_includes/scripts/google-noscript.html +9 -0
  26. data/_includes/scripts/google-tag.html +23 -0
  27. data/_includes/scripts/kcc-alerts.html +2 -0
  28. data/_includes/scripts/kcc-mega-nav.html +2 -0
  29. data/_includes/scripts/kcc-nav.html +2 -0
  30. data/_includes/scripts/kcc-theme-landing.html +2 -0
  31. data/_includes/scripts/kcc-theme.html +2 -0
  32. data/_includes/scripts/table-cdn.html +6 -0
  33. data/_includes/scripts/translate.html +11 -0
  34. data/_includes/scripts/vendor.html +8 -0
  35. data/_includes/styles/fonts.html +4 -0
  36. data/_includes/styles/main.html +6 -0
  37. data/_includes/styles/vendor.html +8 -0
  38. data/_includes/svg/check.html +11 -0
  39. data/_includes/svg/check_circle-24px.html +13 -0
  40. data/_includes/svg/email-24px.html +13 -0
  41. data/_includes/svg/goals.html +21 -0
  42. data/_includes/svg/kcc-copy.html +62 -0
  43. data/_includes/svg/kcc.html +65 -0
  44. data/_includes/svg/kcc.svg +59 -0
  45. data/_includes/svg/love.html +13 -0
  46. data/_includes/svg/place-24px.html +13 -0
  47. data/_includes/svg/save-money.html +26 -0
  48. data/_includes/tabbed-content.html +27 -0
  49. data/_includes/translate.html +3 -0
  50. data/_layouts/default.html +31 -0
  51. data/_layouts/markdown.html +13 -0
  52. data/_layouts/page.html +8 -0
  53. data/_layouts/sub-nav.html +6 -0
  54. data/assets/css/content.css +1 -0
  55. data/assets/css/main.css +1 -0
  56. data/assets/img/alert.svg +1 -0
  57. data/assets/img/arrow-right.svg +1 -0
  58. data/assets/img/arrow_right_alt.svg +1 -0
  59. data/assets/img/blank-contact.svg +1 -0
  60. data/assets/img/blue-next.svg +1 -0
  61. data/assets/img/blue-prev.svg +1 -0
  62. data/assets/img/dbl-next.svg +1 -0
  63. data/assets/img/dbl-next_mobile.svg +1 -0
  64. data/assets/img/dbl-prev.svg +1 -0
  65. data/assets/img/dbl-prev_mobile.svg +1 -0
  66. data/assets/img/facebook-f_white.svg +1 -0
  67. data/assets/img/facebook.svg +1 -0
  68. data/assets/img/heading-bg-underline-tan.png +0 -0
  69. data/assets/img/heading-bg-underline-transparent.png +0 -0
  70. data/assets/img/heading-bg-underline.png +0 -0
  71. data/assets/img/home.svg +8 -0
  72. data/assets/img/iccmc-logo_blue-transparent.png +0 -0
  73. data/assets/img/instagram-white.svg +1 -0
  74. data/assets/img/instagram.svg +1 -0
  75. data/assets/img/itransfer.png +0 -0
  76. data/assets/img/kankakee-community-college-blue.svg +1 -0
  77. data/assets/img/kankakee-community-college-word-logo.svg +1 -0
  78. data/assets/img/kcc-logo-inverse.svg +1 -0
  79. data/assets/img/kcc-logo-white.svg +1 -0
  80. data/assets/img/kcc-logo.svg +1 -0
  81. data/assets/img/kcc-placeholder-square.png +0 -0
  82. data/assets/img/kcc-placeholder.png +0 -0
  83. data/assets/img/kcc-text-logo-white.svg +1 -0
  84. data/assets/img/kcc-text-logo.svg +1 -0
  85. data/assets/img/keyboard_arrow_right.svg +1 -0
  86. data/assets/img/linkedin-white.svg +1 -0
  87. data/assets/img/linkedin.svg +1 -0
  88. data/assets/img/pause.svg +1 -0
  89. data/assets/img/pause_mobile.svg +1 -0
  90. data/assets/img/pinterest-p_white.svg +1 -0
  91. data/assets/img/pinterest.svg +1 -0
  92. data/assets/img/placeholder_16to9.jpg +0 -0
  93. data/assets/img/placeholder_4by3.jpg +0 -0
  94. data/assets/img/placeholder_square-1by1.jpg +0 -0
  95. data/assets/img/placeholder_square.jpg +0 -0
  96. data/assets/img/play.svg +1 -0
  97. data/assets/img/play_mobile.svg +1 -0
  98. data/assets/img/search.svg +1 -0
  99. data/assets/img/social-icon.svg +1 -0
  100. data/assets/img/twitter.svg +1 -0
  101. data/assets/img/video.svg +1 -0
  102. data/assets/img/volleyball.svg +1 -0
  103. data/assets/img/x-logo.svg +11 -0
  104. data/assets/img/x.svg +1 -0
  105. data/assets/img/xitter.svg +1 -0
  106. data/assets/img/youtube-white.svg +1 -0
  107. data/assets/img/youtube.svg +1 -0
  108. data/assets/img/yt-loading.png +0 -0
  109. data/assets/js/dist/102.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  110. data/assets/js/dist/13.197fcdd9ea9a90f7ba8e.bundle.js +2 -0
  111. data/assets/js/dist/13.197fcdd9ea9a90f7ba8e.bundle.js.LICENSE.txt +5 -0
  112. data/assets/js/dist/143.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  113. data/assets/js/dist/183.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  114. data/assets/js/dist/3.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  115. data/assets/js/dist/3.197fcdd9ea9a90f7ba8e.css +1 -0
  116. data/assets/js/dist/303.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  117. data/assets/js/dist/384.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  118. data/assets/js/dist/453.197fcdd9ea9a90f7ba8e.bundle.js +2 -0
  119. data/assets/js/dist/453.197fcdd9ea9a90f7ba8e.bundle.js.LICENSE.txt +5 -0
  120. data/assets/js/dist/635.197fcdd9ea9a90f7ba8e.bundle.js +2 -0
  121. data/assets/js/dist/635.197fcdd9ea9a90f7ba8e.bundle.js.LICENSE.txt +29 -0
  122. data/assets/js/dist/723.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  123. data/assets/js/dist/873.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  124. data/assets/js/dist/965.197fcdd9ea9a90f7ba8e.bundle.js +1 -0
  125. data/assets/js/dist/bootstrap.197fcdd9ea9a90f7ba8e.bundle.js +0 -0
  126. data/assets/js/dist/bootstrap.197fcdd9ea9a90f7ba8e.css +1 -0
  127. data/assets/js/dist/theme.197fcdd9ea9a90f7ba8e.bundle.js +2 -0
  128. data/assets/js/dist/theme.197fcdd9ea9a90f7ba8e.bundle.js.LICENSE.txt +47 -0
  129. data/assets/js/dist/theme.197fcdd9ea9a90f7ba8e.css +1 -0
  130. data/assets/js/nav/closeNavOnClick.js +22 -0
  131. data/assets/js/nav/highlightCurrentNav.js +44 -0
  132. data/assets/js/nav/moveSearchIcon.js +94 -0
  133. data/assets/js/nav/nav.js +13 -0
  134. data/assets/js/nav/searchToggleNav.js +46 -0
  135. data/assets/js/nav/toggleNavSearchDropdownOnWindowResize.js +52 -0
  136. data/assets/js/src/alerts.js +24 -0
  137. data/assets/js/src/all.js +83 -0
  138. data/assets/js/src/bootstrap.js +4 -0
  139. data/assets/js/src/cacheResponse.js +22 -0
  140. data/assets/js/src/campusAlertsSheetsAPI.js +53 -0
  141. data/assets/js/src/checkForPrefersReducedMotion.js +17 -0
  142. data/assets/js/src/contentHashLink.js +102 -0
  143. data/assets/js/src/createAlertsHtml.js +46 -0
  144. data/assets/js/src/footerDate.js +13 -0
  145. data/assets/js/src/getCachedResponse.js +37 -0
  146. data/assets/js/src/lazyLoad.js +13 -0
  147. data/assets/js/src/parseMarkdownToHTML.js +85 -0
  148. data/assets/js/src/sliders.js +81 -0
  149. data/assets/js/src/translate.js +62 -0
  150. data/assets/js/src/walkText.js +31 -0
  151. data/assets/js/src/wrapPowerText.js +11 -0
  152. data/assets/js/src/ytEmbed.js +30 -0
  153. data/assets/scss/0-tools/_bootstrap-overrides.scss +72 -0
  154. data/assets/scss/0-tools/_cloudcannon.scss +16 -0
  155. data/assets/scss/0-tools/_google-translate-overrides.scss +127 -0
  156. data/assets/scss/0-tools/_gsc-overrides.scss +144 -0
  157. data/assets/scss/0-tools/_vars.scss +72 -0
  158. data/assets/scss/1-base/_background.scss +5 -0
  159. data/assets/scss/1-base/_buttons.scss +121 -0
  160. data/assets/scss/1-base/_html.scss +4 -0
  161. data/assets/scss/1-base/_img.scss +12 -0
  162. data/assets/scss/1-base/_links.scss +126 -0
  163. data/assets/scss/1-base/_svg.scss +82 -0
  164. data/assets/scss/1-base/_typography.scss +640 -0
  165. data/assets/scss/2-modules/_accordion.scss +43 -0
  166. data/assets/scss/2-modules/_benefits.scss +371 -0
  167. data/assets/scss/2-modules/_breadcrumbs.scss +32 -0
  168. data/assets/scss/2-modules/_campus-alerts.scss +3 -0
  169. data/assets/scss/2-modules/_card-section.scss +9 -0
  170. data/assets/scss/2-modules/_contacts.scss +46 -0
  171. data/assets/scss/2-modules/_error.scss +10 -0
  172. data/assets/scss/2-modules/_footer.scss +122 -0
  173. data/assets/scss/2-modules/_header.scss +21 -0
  174. data/assets/scss/2-modules/_hero-slider.scss +331 -0
  175. data/assets/scss/2-modules/_img-hover.scss +70 -0
  176. data/assets/scss/2-modules/_loader.scss +9 -0
  177. data/assets/scss/2-modules/_nav-global.scss +315 -0
  178. data/assets/scss/2-modules/_nav-landing.scss +203 -0
  179. data/assets/scss/2-modules/_nav-local.scss +45 -0
  180. data/assets/scss/2-modules/_social-icons.scss +36 -0
  181. data/assets/scss/2-modules/_sub-nav.scss +32 -0
  182. data/assets/scss/2-modules/_yt-embed.scss +14 -0
  183. data/assets/scss/3-layout/_background.scss +3 -0
  184. data/assets/scss/3-layout/_content.scss +37 -0
  185. data/assets/scss/3-layout/_margins.scss +22 -0
  186. data/assets/scss/3-layout/_padding.scss +19 -0
  187. data/assets/scss/3-layout/_positioning.scss +343 -0
  188. data/assets/scss/3-layout/_section.scss +22 -0
  189. data/assets/scss/3-layout/_tables.scss +8 -0
  190. data/assets/scss/3-layout/_thank-you.scss +5 -0
  191. data/assets/scss/4-pages/index/_home.scss +15 -0
  192. data/assets/scss/bootstrap.scss +98 -0
  193. data/assets/scss/kcc-theme.scss +50 -0
  194. data/assets/scss/translate.scss +5 -0
  195. metadata +278 -0
@@ -0,0 +1,37 @@
1
+ /*
2
+ // Custom JS | written by https://github.com/wdzajicek
3
+ // © 2020 Kankakee Community College
4
+ // =================================================== */
5
+ // Module to retrieve our cached Google Sheet response from sessionStorage
6
+ // 1. Create an object that replicates an API response where `response.result.values`
7
+ // is an array containing an array representing each row in the sheet.
8
+ // 2. Then we pass our mock-sheet response object to the `createAlertsHtml` module to
9
+ // build and inject the alert into the DOM.
10
+ import createAlertsHtml from './createAlertsHtml.js';
11
+ import contentHashLink from './contentHashLink.js';
12
+ const cache = window.sessionStorage;
13
+
14
+ function createCachedResponseObject(Collapse) {
15
+ let cachedResponse = { // Reconstructing our own Google Sheet-like response from the sessionStorage items
16
+ result: {
17
+ values: [
18
+ 0, // First two rows aren't used by the `createAlertsHtml()` function
19
+ 0,
20
+ [ cache.Visible, cache.getItem('All-Pages'), cache.getItem('Alert-Content'), cache.getItem('Alert-Expiration'), cache.Start, cache.End ]
21
+ ]
22
+ }
23
+ }
24
+ createAlertsHtml(cachedResponse, Collapse);
25
+ contentHashLink(Collapse);
26
+ }
27
+
28
+ function getCachedResponse(Collapse) {
29
+ try {
30
+ createCachedResponseObject(Collapse);
31
+ } catch (error) {
32
+ contentHashLink(Collapse);
33
+ console.error(`Error retrieving cached response in sessionStorage:\nName: ${error.name}\nMessage: ${error.message}\n${error}`);
34
+ }
35
+ }
36
+
37
+ export default getCachedResponse;
@@ -0,0 +1,13 @@
1
+ // Lazy load images
2
+ // ex. <img src="/path/to/small-placeholder_image.png" data-src="/path/to/actual_image.jpg" alt="You better not leave it blank">
3
+ function lazyLoad() {
4
+ const lazyLoadImages = document.querySelectorAll('img[data-src]');
5
+
6
+ [...lazyLoadImages].forEach(img => {
7
+ img.setAttribute('src', img.getAttribute('data-src'));
8
+ img.onload = function() {
9
+ img.removeAttribute('data-src');
10
+ };
11
+ });
12
+ }
13
+ export default lazyLoad;
@@ -0,0 +1,85 @@
1
+ const inlineMarkdownElementsObject = {
2
+ 'strong': /\*\*([^\*]*)\*\*/g,
3
+ 'em': /_([^_]*)_/g
4
+ }
5
+
6
+ function replaceRegex(string, regex, replacement) {
7
+ const newString = string.replace(regex, replacement);
8
+ return newString;
9
+ }
10
+
11
+ function escapeCharacters(string, escapeOption) {
12
+ const escapedCharactersObject = {
13
+ '\\*': '__asterisk__',
14
+ '\\_': '__underscore__',
15
+ '\\[': '__openBracket__',
16
+ '\\]': '__closeBracket__',
17
+ '\\(': '__openParenthesis__',
18
+ '\\)': '__closeParenthesis__'
19
+ }
20
+
21
+ for (let char in escapedCharactersObject) {
22
+ if (escapedCharactersObject.hasOwnProperty(char)) {
23
+ escapeOption === true ? string = replaceRegex(string, char, escapedCharactersObject[char])
24
+ : escapeOption === false ? string = replaceRegex(string, escapedCharactersObject[char], char.replace(/^\\/g, ''))
25
+ : null;
26
+ }
27
+ }
28
+ return string;
29
+ }
30
+
31
+ function createAnchorElements(string) {
32
+ return string = string.replace(/\[(?<linkText>[^\]]*)\]\((?<linkHref>[^\)]*)\)/g, '<a href="$<linkHref>" target="_blank" rel="noopener noreferrer">$<linkText></a>');
33
+ }
34
+
35
+ function replacer(match, p1) {
36
+ if ( p1 === '' ) { // Filters out the '__' (double underscore) matches.
37
+ return match;
38
+ } else {
39
+ for (var el in inlineMarkdownElementsObject) {
40
+ if (inlineMarkdownElementsObject.hasOwnProperty(el)) {
41
+ match = match.replace(inlineMarkdownElementsObject[el], '<' + el + '>$1</' + el + '>' );
42
+ }
43
+ }
44
+ return match;
45
+ }
46
+ }
47
+
48
+ function createInlineElements(string) {
49
+ for (var el in inlineMarkdownElementsObject) {
50
+ if (inlineMarkdownElementsObject.hasOwnProperty(el)) {
51
+ string = string.replace(inlineMarkdownElementsObject[el], replacer);
52
+ }
53
+ }
54
+ return string;
55
+ }
56
+
57
+ function paragraphReplacer(match, p1) {
58
+ if ( p1 === '' ) { // Filters out blank lines
59
+ return match;
60
+ } else {
61
+ return match.replace(/^(.*)$/gm, '<p class="typography__alert">$1</p>');
62
+ }
63
+ }
64
+
65
+ function createParagraphElements(string) {
66
+ return string = string.replace(/^(.*)$/gm, paragraphReplacer);
67
+ }
68
+
69
+ function parseMarkdownToHTML(string) {
70
+ const escapedString = escapeCharacters(string, true);
71
+ const stringWithInlineElements = createInlineElements(escapedString);
72
+ const stringWithAnchorElements = createAnchorElements(stringWithInlineElements);
73
+ const stringWithParagraphElements = createParagraphElements(stringWithAnchorElements);
74
+ const unescapedString = escapeCharacters(stringWithParagraphElements, false);
75
+ //console.log(unescapedString);
76
+ return unescapedString;
77
+ }
78
+
79
+ //
80
+ // USAGE:
81
+ // import parseMarkdownToHTML from './parseMarkdownToHTML.js';
82
+ //
83
+ // parseMarkdownToHTML(stringContainingSimplifiedMarkdown);
84
+
85
+ export default parseMarkdownToHTML;
@@ -0,0 +1,81 @@
1
+ // Custom JS to initialize slick slider (https://github.com/kenwheeler/slick) and then build a play/pause toggle button
2
+ // Uses slick-specific methods & slick events. See slick events at: https://github.com/kenwheeler/slick/#events
3
+ const heroSliderClassName = '.hero-slider__slider'; // Our classname for the hero-slider's DOM parent
4
+ const SLICK_PLAY = 'slickPlay'; // Methods unique to slick
5
+ const SLICK_PAUSE = 'slickPause'; // Methods unique to slick
6
+ const SLICK_NEXT_SLIDE = 'slickNext'; // Methods unique to slick
7
+ const play = 'Play';
8
+ const pause = 'Pause';
9
+ // =============================================================================================== //
10
+ // TODO: //
11
+ // //
12
+ // Rewrite below prevArrow & nextArrow as <button> elements (like slick's default arrows). //
13
+ // //
14
+ // =============================================================================================== //
15
+
16
+ function initSlick() {
17
+ $(heroSliderClassName).slick({
18
+ dots: true,
19
+ slidesToShow: 1,
20
+ slidesToScroll: 1,
21
+ autoplay: true,
22
+ autoplaySpeed: 4000,
23
+ prevArrow:'<button type="button" data-role="none" class="prev slick-prev" aria-label="Previous" role="button" style="display: block;">Previous</button>', // TODO: change to <button> el
24
+ nextArrow:'<button type="button" data-role="none" class="next slick-next" aria-label="Next" role="button" style="display: block;">Next</button>' // TODO: change to <button> el
25
+ });
26
+ }
27
+
28
+ function setAttributeOnEl(el, attr, value) {
29
+ return el.setAttribute(attr, value);
30
+ }
31
+
32
+ function toggleSlickPlayState(el, slickState, newButtonText) {
33
+ const newButtonTextIsPause = newButtonText === pause;
34
+
35
+ $(heroSliderClassName).slick(slickState);
36
+ setAttributeOnEl(el, 'aria-label', newButtonText);
37
+ el.classList.toggle('hero-slider__button--play');
38
+ el.innerHTML = newButtonText;
39
+
40
+ newButtonTextIsPause ? $(heroSliderClassName).slick(SLICK_NEXT_SLIDE) : null;
41
+ }
42
+
43
+ function watchForElementClicks(el) {
44
+ el.addEventListener('click', function(e) {
45
+ let buttonTextIsPause = el.innerHTML === 'Pause';
46
+
47
+ buttonTextIsPause ? toggleSlickPlayState(el, SLICK_PAUSE, play) : toggleSlickPlayState(el, SLICK_PLAY, pause);
48
+ });
49
+ }
50
+
51
+ function createButton() {
52
+ const slickParent = document.querySelector(heroSliderClassName);
53
+ const button = document.createElement('button');
54
+ const initialButtonText = 'Pause';
55
+
56
+ setAttributeOnEl(button, 'role', 'button');
57
+ setAttributeOnEl(button, 'type', 'button');
58
+ setAttributeOnEl(button, 'aria-label', 'Pause');
59
+ setAttributeOnEl(button, 'style', 'display: block;');
60
+ button.innerHTML = initialButtonText;
61
+ button.classList.add('hero-slider__button--toggle');
62
+ slickParent.appendChild(button);
63
+ watchForElementClicks(button);
64
+ }
65
+
66
+ function watchForSlickInit(initFunction) {
67
+ // slick's on 'init' function (See events in slick docs):
68
+ $(heroSliderClassName).on('init', function(event, slick){ // According to slick doc's; you have to call a $(slick).on('init', function(){ //... }); before you initialize slick
69
+ createButton();
70
+ });
71
+ initFunction(); // Initializing slick after the above `.on('init', function() {})`
72
+ }
73
+
74
+ function initSliders() {
75
+ if ( ! document.querySelector(heroSliderClassName) )
76
+ return;
77
+
78
+ watchForSlickInit(initSlick);
79
+ }
80
+
81
+ export default initSliders;
@@ -0,0 +1,62 @@
1
+ const googleTranslateElement = document.getElementById('google_translate_element');
2
+ const styleConfigurationObject = { // Setting all the selectors & the styles they should get.
3
+ 'div.VIpgJd-ZVi9od-vH1Gmf *': 'color: #544F4B; font-family: "Roboto", sans-serif; width: 100%;', // Change font fam and color!
4
+ 'span.indicator': 'display: none;', // Change menu's padding
5
+ 'div.VIpgJd-ZVi9od-vH1Gmf': 'overflow-y: scroll; padding: 0px;', // Change menu's padding
6
+ 'div.VIpgJd-ZVi9od-vH1Gmf a div': 'padding: 20px; width: 100%;', // Change the padding of the languages
7
+ '.goog-te-menu2-item': 'width: 100%;', // Change the width of the languages
8
+ 'td': 'width: 100%; display: block;', // Change the width of the languages
9
+ 'td.VIpgJd-ZVi9od-vH1Gmf-KrhPNb': 'display: none;',
10
+ '.goog-te-menu2-colpad': 'display: none;', // Change the width of the languages
11
+ 'div.VIpgJd-ZVi9od-vH1Gmf': 'border: none;', // Change Google's default blue border
12
+ 'body': 'background-color: #fff; box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.3);',
13
+ };
14
+
15
+ function styleIFrameElement(iframe, iframeStyles) {
16
+ const combinedStyles = iframe.style.cssText + iframeStyles;
17
+
18
+ iframe.style = combinedStyles;
19
+ }
20
+
21
+ function setStyles(selector, styles, iframeMenuElement) {
22
+ const content = iframeMenuElement.contentWindow;
23
+ const itemsToStyle = content.document.querySelectorAll(selector);
24
+
25
+ [...itemsToStyle].forEach(item => item.style = styles);
26
+ }
27
+
28
+ function translate() {
29
+ const iframeStyles = ' height: 100%; width: 100%; top: 0px; box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.3);';
30
+
31
+ googleTranslateElement.addEventListener('click', _e => {
32
+ const iframeMenuElement = document.querySelector('iframe[title="Language Translate Widget"]');
33
+
34
+ // Use this log to find translate menu elements:
35
+ // console.log(iframeMenuElement.contentWindow.document.body);
36
+
37
+ // Target the anchor elements in the translate menu (language options)
38
+ const anchors = iframeMenuElement.contentWindow.document.body.querySelectorAll('.VIpgJd-ZVi9od-vH1Gmf a');
39
+ // Color the menu text white when an element is hovered:
40
+ [...anchors].forEach(a => {
41
+ a.addEventListener('mouseenter', () => {
42
+ if (a.querySelector('span.text').innerHTML !== 'Select Language') {
43
+ a.querySelector('span.text').style = 'color: #fff;';
44
+ }
45
+ })
46
+ a.addEventListener('mouseleave', () => {
47
+ if (a.querySelector('span.text').innerHTML !== 'Select Language') {
48
+ a.querySelector('span.text').style = 'color: #544F4B;';
49
+ }
50
+ })
51
+ });
52
+
53
+ styleIFrameElement(iframeMenuElement, iframeStyles);
54
+
55
+ Object.keys(styleConfigurationObject).forEach(selector => {
56
+ setStyles(selector, styleConfigurationObject[selector], iframeMenuElement);
57
+ });
58
+
59
+ }, false);
60
+ }
61
+
62
+ export default translate;
@@ -0,0 +1,31 @@
1
+ // Replace all occurences of "--" (double-hyphens,) within the page's text-nodes, with em-dashes.
2
+ // Use a replacer function to omit any occurences of triple-hyphens which appear in our documentation.
3
+ // For example, YAML Front - matter's opening and closing triple-hyphens
4
+ // Without the replacer funciton, triple-hyphens get replaced with an em-dash and a hyphen.
5
+ const emDashOrTripleHyphensRegex = /\\?---?/g;
6
+ const tripleHyphenRegex = /---/;
7
+ const emDash = '—' // This is an em-dash, however, it looks like a hyphen in monospace text editor font!
8
+
9
+ // Without the replacer function, triple-hyphens get replaced with an em-dash and a hyphen.
10
+ function replacerFunction(match) {
11
+ return match.search(tripleHyphenRegex) === -1 ? emDash : match;
12
+ }
13
+
14
+ function walkText(root) {
15
+ let currentNode;
16
+ const nodeIterator = document.createNodeIterator(
17
+ root,
18
+ NodeFilter.SHOW_TEXT,
19
+ (node) => (node.nodeValue.search(emDashOrTripleHyphensRegex) !== -1) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
20
+ );
21
+
22
+ while (currentNode = nodeIterator.nextNode()) {
23
+ currentNode.data = currentNode.data.replace(emDashOrTripleHyphensRegex, replacerFunction);
24
+ }
25
+ }
26
+ // Note on usage: You don't need to necessarily traverse the entire document.body.
27
+ // Usage:
28
+ //
29
+ // walkText(document.body);
30
+ //
31
+ export default walkText;
@@ -0,0 +1,11 @@
1
+ const slideHeadingList = document.querySelectorAll('.hero-slider__slider--slide-heading'); // Element from HTML
2
+ const regEx = /\*\*(\S+)\*\*/g;
3
+ const replacement = '<span class="typography__power-text">$1</span>';
4
+
5
+ function wrapPowerText() {
6
+ [...slideHeadingList].forEach(heading => {
7
+ heading.innerHTML = heading.innerHTML.replace(regEx, replacement);
8
+ })
9
+ }
10
+
11
+ export default wrapPowerText;
@@ -0,0 +1,30 @@
1
+ const ytEmbedParent = document.getElementById('yt-embed');
2
+ const videoId = ytEmbedParent.dataset.video;
3
+ //<iframe width="560" height="315" src="https://www.youtube.com/embed/LUCrx9chw-c" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
4
+
5
+ function setAttributes(el, arg, argVal) {
6
+ const argumentIsString = typeof arg == 'string';
7
+
8
+ if ( argumentIsString ) {
9
+ el.setAttribute(arg, argVal)
10
+ } else {
11
+ for (let i = 0, len = arg.length; i < len; i++) {
12
+ el.setAttribute(arg[i], argVal[i])
13
+ }
14
+ }
15
+ return el;
16
+ }
17
+
18
+ function ytEmbed() {
19
+ const iframe = document.createElement('iframe');
20
+
21
+ setAttributes(iframe, ['width', 'height', 'frameborder', 'allow', 'allowfullscreen'], ['560', '315', '0', 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture', '']);
22
+ ytEmbedParent.appendChild(iframe);
23
+ setAttributes(iframe, 'src', 'https://www.youtube.com/embed/' + videoId + '?showinfo=0&rel=0');
24
+ iframe.onload = () => {
25
+ ytEmbedParent.removeChild(ytEmbedParent.querySelector('.yt-embed'));
26
+ }
27
+
28
+ }
29
+
30
+ export default ytEmbed;
@@ -0,0 +1,72 @@
1
+ // Overrides AND additions/extensions to Bootstrap 4's styling
2
+
3
+ .nav-tabs {
4
+ border-bottom: 1px solid $grey-5;
5
+ }
6
+
7
+ .nav-tabs .nav-link {
8
+ background-color: $grey-4;
9
+ border-left-color: $grey-2;
10
+ border-left-style: solid;
11
+ border-left-width: 1px;
12
+ border-right-color: $grey-2;
13
+ border-right-style: solid;
14
+ border-right-width: 1px;
15
+ border-top-color: $grey-2;
16
+ border-top-style: solid;
17
+ border-top-width: 1px;
18
+ border-bottom-color: $grey-5;
19
+ }
20
+
21
+ .nav-tabs .nav-link.active {
22
+ border-color: $grey-5 $grey-5 $white;
23
+ }
24
+
25
+ .navbar-brand {
26
+ margin-right: 0;
27
+ }
28
+
29
+ @media screen and (min-width: 768px) {
30
+ .navbar-brand {
31
+ margin-right: 1rem;
32
+ }
33
+ }
34
+
35
+ .btn {
36
+ vertical-align: baseline; // Needed so Google Translate's injected <font> tags don't mess with font's alignment in the page
37
+ }
38
+
39
+ .modal-open .gsc-search-button {
40
+ margin-right: 15px;
41
+ }
42
+
43
+ // Modify the Bootstrap 4 dropdown menu's carot to give it an animated/interactice effect using pure CSS
44
+ // ======================================
45
+ // .dropdown-toggle::after controls the BS4 dropdown-menu carot symbol's display
46
+ @media screen and (max-width: 992px) {
47
+ .dropdown-toggle::after { // Set starting position & transition Fx
48
+ transform: rotate(0deg);
49
+ transition: transform 0.3s ease-in-out;
50
+ }
51
+
52
+ .nav-item.dropdown.show .dropdown-toggle::after { // Selectors that are only present when a dropdown is toggled to the open state.
53
+ transform: rotate(-180deg);
54
+ }
55
+ }
56
+
57
+ .dropdown-toggle.btn::after { // Set starting position & transition Fx
58
+ transform: rotate(0deg);
59
+ transition: transform 0.3s ease-in-out;
60
+ }
61
+
62
+ .nav-item.dropdown.show .dropdown-toggle.btn::after { // Selectors that are only present when a dropdown is toggled to the open state.
63
+ transform: rotate(-180deg);
64
+ }
65
+
66
+ @media screen and (min-width: 992px) {
67
+ .dropdown-toggle:not(.btn)::after { // Set starting position & transition Fx
68
+ display: none;
69
+ }
70
+ }
71
+
72
+ // End BS4 dropdown-menu carot modifications.
@@ -0,0 +1,16 @@
1
+ // Specific classes for the CloudCannon editor/interface.
2
+ .editor-link {
3
+ display: none;
4
+ }
5
+
6
+ .cms-editor-active .editor-link {
7
+ display: block;
8
+ }
9
+
10
+ .editor-button {
11
+ display: none;
12
+ }
13
+
14
+ .cms-editor-active .editor-button {
15
+ display: inline-block;
16
+ }
@@ -0,0 +1,127 @@
1
+ // Custom styling for Google Translate
2
+ // ====================================================== //
3
+
4
+ // Top-most element of the Google Translate menu
5
+ #google_translate_element {
6
+ position: fixed;
7
+ bottom: .25rem;
8
+ right: .25rem!important;
9
+ z-index: 99999;
10
+ }
11
+
12
+ // First child of translate element
13
+ .goog-te-gadget {
14
+ font-family: Roboto, 'Open Sans', sans-serif!important;
15
+ text-transform: uppercase;
16
+ font-weight: 500;
17
+ &:hover {
18
+ color: $white;
19
+ }
20
+ }
21
+
22
+ // Second child of translate element
23
+ .goog-te-gadget-simple {
24
+ background-color: rgba(255,255,255,0.85)!important;
25
+ border: 1px solid rgba(0,0,0,0.95) !important;
26
+ border-radius: 4px!important;
27
+ cursor: pointer;
28
+ display: inline-block;
29
+ font-size: 1rem!important;
30
+ height: 100%;
31
+ line-height:2rem!important;
32
+ margin-right: 5px;
33
+ padding: 8px!important;
34
+ transition: background-color .2s;
35
+ white-space: nowrap;
36
+ zoom: 1;
37
+ &:hover { // Adds a hover effect
38
+ background-color: rgba(0, 123, 255, 0.85)!important;
39
+ }
40
+ &:focus {
41
+ background-color: rgba(0, 123, 255, 0.85)!important;
42
+ }
43
+ }
44
+
45
+ // Adds a hover effect
46
+ .goog-te-gadget-simple:hover .VIpgJd-ZVi9od-xl07Ob-lTBxed {
47
+ color: $white !important;
48
+ }
49
+
50
+ // Adds a nice icon from "Material Icons" icons
51
+ .VIpgJd-ZVi9od-xl07Ob-lTBxed {
52
+ color: #000 !important;
53
+ text-decoration: none !important;
54
+ &:before {
55
+ font-family: 'Material Icons'; // <https://fonts.google.com/icons?selected=Material+Icons>
56
+ content: "\E927"; // G translate icon <https://fonts.google.com/icons?selected=Material+Icons&icon.query=translate>
57
+ margin-right: 16px;
58
+ font-size: 2rem;
59
+ vertical-align: -10px;
60
+ // width:32px!important;
61
+ }
62
+ }
63
+
64
+ // Hide span that messes up layout
65
+ .VIpgJd-ZVi9od-xl07Ob-lTBxed span:nth-child(5) {
66
+ display:none;
67
+ }
68
+
69
+ // Use a nicer looking dropdown arrow/carrot than the default
70
+ .VIpgJd-ZVi9od-xl07Ob-lTBxed span:nth-child(3) {
71
+ border:none!important;
72
+ font-family: 'Material Icons';
73
+ &:after {
74
+ font-family: 'Material Icons';
75
+ content: "\E5C5"; // <https://fonts.google.com/icons?selected=Material+Icons&icon.query=arrow>
76
+ font-size: 1.5rem;
77
+ vertical-align: -6px;
78
+ }
79
+ }
80
+
81
+ .goog-te-gadget-icon {
82
+ background-image: url(https://placehold.it/32)!important;
83
+ background-position: 0px 0px;
84
+ height: 32px!important;
85
+ width: 32px!important;
86
+ margin-right: 8px!important;
87
+ // OR
88
+ display: none;
89
+ }
90
+
91
+ // ============ HIDE TOP BAR ============
92
+ .VIpgJd-ZVi9od-ORHb-OEVmcd.skiptranslate {display: none!important;}
93
+ body {top: 0px!important;}
94
+
95
+ /* ================================== *\
96
+ Mediaqueries
97
+ \* ================================== */
98
+ @media (max-width: 667px) {
99
+ #google_translate_element {
100
+ bottom: .25rem;
101
+ left: 16px!important;
102
+ width: 100%!important;
103
+ .goog-te-gadget {
104
+ width:100%!important;
105
+ }
106
+ .skiptranslate {
107
+ width:100%!important;
108
+ }
109
+ .goog-te-gadget-simple {
110
+ width: calc(100% - 32px)!important;
111
+ text-align: center;
112
+ }
113
+ }
114
+ }
115
+
116
+ // Prevent underlining when hovered
117
+ a.VIpgJd-ZVi9od-xl07Ob-lTBxed {
118
+ text-decoration: none !important;
119
+ &:hover {
120
+ text-decoration: none !important;
121
+ }
122
+ }
123
+
124
+ // Removes the blue border surrounding the entire translate menu (when opened)
125
+ .VIpgJd-ZVi9od-vH1Gmf {
126
+ border: none !important;
127
+ }