diff --git a/src/wmcads/assets/sass/_mixins.scss b/src/wmcads/assets/sass/_mixins.scss index f4ef8cee..daad9e7d 100755 --- a/src/wmcads/assets/sass/_mixins.scss +++ b/src/wmcads/assets/sass/_mixins.scss @@ -21,7 +21,7 @@ margin-top: 1.5rem * $multiplier; margin-bottom: 1.5rem * $multiplier; font-size: 2rem * $multiplier; - line-height: 3rem * $multiplier; + line-height: 2.3rem * $multiplier; } // Heading 3 (23px) @if $level == 3 { diff --git a/src/wmcads/components/breadcrumb/_breadcrumb.scss b/src/wmcads/components/breadcrumb/_breadcrumb.scss index cd3169aa..5d5b70b5 100755 --- a/src/wmcads/components/breadcrumb/_breadcrumb.scss +++ b/src/wmcads/components/breadcrumb/_breadcrumb.scss @@ -18,7 +18,7 @@ display: inline-block; height: 0.8em; margin: 0 $size-xs; - color: get-color(information); + color: get-color(primary); } } diff --git a/src/wmcads/components/content-card/_content-card.njk b/src/wmcads/components/content-card/_content-card.njk index d2cbe3e5..bc68ac32 100755 --- a/src/wmcads/components/content-card/_content-card.njk +++ b/src/wmcads/components/content-card/_content-card.njk @@ -15,7 +15,7 @@ <{{tag}}{{attributes | safe}} class="wmcads-content-card{{"--blue" if params.isCta else "" }} {{"wmcads-content-card--event" if params.isEvent else "" }} {{"wmcads-content-card--news" if params.isNews else "" }} "> {% if(params.src) %} content image + src="https://www.wmca.org.uk/media/3415/wmca-bournville-131.jpg{{"?anchor=center&mode=crop&width=920&height=300&rnd=132122595620000000" if params.isNewsFirst else "" }}{{"?anchor=center&mode=crop&width=480&height=357&rnd=132122595620000000" if params.isNewsSub else "" }}{{"?anchor=center&mode=crop&width=896&height=334&rnd=132122595620000000" if params.isSrcDefault else "" }}{{"?anchor=center&mode=crop&width=1216&height=345&rnd=132122595620000000" if params.isDoubleCard else "" }}{{"?anchor=center&mode=crop&width=576&height=334&rnd=132122595620000000" if params.isThirdCard else "" }}{{"?anchor=center&mode=crop&width=700&height=334&rnd=132122595620000000" if params.isDefault else "" }}" alt="content image"> {% endif %} {% if(params.isCta) %}
diff --git a/src/wmcads/components/content-card/_content-card.scss b/src/wmcads/components/content-card/_content-card.scss index b76477d9..ecbbcf97 100755 --- a/src/wmcads/components/content-card/_content-card.scss +++ b/src/wmcads/components/content-card/_content-card.scss @@ -56,23 +56,24 @@ &--news { border: 0; + background-color: transparent; p { margin: 0; } h3 { + margin: $size-xs 0; + a { - margin: $size-sm 0; + margin: $size-xs 0; } } } - h3 { - margin: $size-sm 0; - } - img { + height: 180px; padding: 1px; + object-fit: cover; } } diff --git a/src/wmcads/components/form-elements/dropdown/_dropdown.scss b/src/wmcads/components/form-elements/dropdown/_dropdown.scss index b4fe4098..10e5501b 100755 --- a/src/wmcads/components/form-elements/dropdown/_dropdown.scss +++ b/src/wmcads/components/form-elements/dropdown/_dropdown.scss @@ -9,7 +9,7 @@ border-radius: 0; // sass-lint:disable-all background: $white - url("data:image/svg+xml,%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 46 46' style='enable-background:new 0 0 46 46;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23FE811B;stroke:%23FE811B;%7D .st1%7Bfill:%23FFFFFF;%7D%0A%3C/style%3E%3Cg%3E%3Cpath class='st0' d='M0.5,0.5h45v45h-45V0.5z'/%3E%3Cpath class='st1' d='M15,18.9h17c1.2,0,1.8,1.4,0.9,2.2l-8.5,8.5c-0.5,0.5-1.4,0.5-1.9,0L14,21.2C13.2,20.4,13.8,18.9,15,18.9z'/%3E%3C/g%3E%3C/svg%3E%0A") + url("data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MCA1MCI+PHJlY3Qgd2lkdGg9IjUwIiBoZWlnaHQ9IjUwIiBmaWxsPSIjYzA1NzAxIi8+PGcgaWQ9IkZvcm0tRWxlbWVudHMiPjxnIGlkPSJGb3JtLUVsZW1lbnRzLV8tRHJvcGRvd24tXy1DbG9zZWQiIGRhdGEtbmFtZT0iRm9ybS1FbGVtZW50cy0vLURyb3Bkb3duLS8tQ2xvc2VkIj48ZyBpZD0iQ2FyZXQiPjxnIGlkPSJJY29uLV8tQ2FyZXQtXy1Eb3duIiBkYXRhLW5hbWU9Ikljb24tLy1DYXJldC0vLURvd24iPjxwYXRoIGlkPSJQYXRoIiBkPSJNMTcuMTExMiwxOUgzMi43MzYxYTEuMjEzMywxLjIxMzMsMCwwLDEsLjg1ODIsMi4wNzA5bC03LjgxMTIsNy44MTZhMS4yMTg1LDEuMjE4NSwwLDAsMS0xLjcxODksMGwtNy44MTEyLTcuODE2QTEuMjEzMywxLjIxMzMsMCwwLDEsMTcuMTExMiwxOVoiIGZpbGw9IiNmZmYiLz48L2c+PC9nPjwvZz48L2c+PC9zdmc+") no-repeat right; appearance: none; background-size: contain; diff --git a/src/wmcads/components/page-contents/_page-contents.njk b/src/wmcads/components/page-contents/_page-contents.njk index ad20ad93..75917cf4 100644 --- a/src/wmcads/components/page-contents/_page-contents.njk +++ b/src/wmcads/components/page-contents/_page-contents.njk @@ -4,9 +4,11 @@

Page contents

{{title}}
- link 1 - link 2 - link 3 - link 4 + {% if(params.example) %} + link 1 + link 2 + link 3 + link 4 + {% endif %}
{% endmacro %} \ No newline at end of file diff --git a/src/wmcads/components/page-contents/_page-contents.scss b/src/wmcads/components/page-contents/_page-contents.scss index d5894985..819857df 100644 --- a/src/wmcads/components/page-contents/_page-contents.scss +++ b/src/wmcads/components/page-contents/_page-contents.scss @@ -1,4 +1,6 @@ .wmcads-page-contents { + position: sticky; + top: 0; margin-bottom: 30px; padding: 10px; border-bottom: 3px solid $black; @@ -22,8 +24,7 @@ a { display: block; margin-bottom: 10px; - overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; + white-space: wrap; } } diff --git a/src/www/pages/components/page-contents/index.njk b/src/www/pages/components/page-contents/index.njk index e6a5dcf8..e0734c15 100644 --- a/src/www/pages/components/page-contents/index.njk +++ b/src/www/pages/components/page-contents/index.njk @@ -6,7 +6,9 @@ {% block content %} {{ compExample([ - wmcadsPageContents() + wmcadsPageContents({ + example: true + }) ]) }} {% endblock %} \ No newline at end of file diff --git a/src/www/pages/templates/campaign-one-column/index.njk b/src/www/pages/templates/campaign-one-column/index.njk index 488d160e..f48fc4bc 100644 --- a/src/www/pages/templates/campaign-one-column/index.njk +++ b/src/www/pages/templates/campaign-one-column/index.njk @@ -49,6 +49,7 @@ src: true, isThirdCard: false, title: 'Get Going Continue Rolling', + isDefault: true, copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.' }) }} @@ -60,35 +61,38 @@ src: true, isThirdCard: false, title: 'All things strolling', + isDefault: true, copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. ' }) }}
-
+
{{ wmcadsContentCard({ clickable: true, src: true, isThirdCard: false, title: 'Changes in your area', + isDefault: true, copy: 'Understand what changes are being made in your area to help you travel safely' }) }}
-
+
{{ wmcadsContentCard({ clickable: true, src: true, isThirdCard: false, title: 'Get active and travel safely', + isDefault: true, copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. ' }) }}
- +

Get the best from your bike

- +

Additional Information

@@ -155,6 +159,7 @@ src: true, isThirdCard: false, title: 'Support for businesses', + isDefault: true, copy: 'We have a wide range of options to support your business and employees at work and at home' }) }} @@ -166,13 +171,14 @@ src: true, isThirdCard: false, title: 'Be Aware and Share', + isDefault: true, copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.' }) }}
- +

Campaign Funding Partners

diff --git a/src/www/pages/templates/campaign-two-columns/campaign-template.js b/src/www/pages/templates/campaign-two-columns/campaign-template.js new file mode 100644 index 00000000..a7c15543 --- /dev/null +++ b/src/www/pages/templates/campaign-two-columns/campaign-template.js @@ -0,0 +1,33 @@ +const pageContents = () => { + const headings = document.querySelectorAll('.main h2'); + + headings.forEach(heading => { + const str = heading.innerHTML; + const linkStr = str.toLowerCase().replaceAll(' ', '-'); + const link = `#${linkStr}`; + + // add id to all the h2 + heading.setAttribute('id', linkStr); + + // function to decode htmlentities + function decodeHtml(html) { + const txt = document.createElement('textarea'); + txt.innerHTML = html; + return txt.value; + } + // function to add a link to the page contents + function createMenuItem() { + const li = document.createElement('a'); + li.textContent = decodeHtml(str); + li.setAttribute('href', link); + return li; + } + + // get the page contents + const menu = document.querySelector('.wmcads-page-contents'); + // add page contents link + menu.appendChild(createMenuItem()); + }); +}; + +export default pageContents; diff --git a/src/www/pages/templates/campaign-two-columns/index.njk b/src/www/pages/templates/campaign-two-columns/index.njk index e09b4f5d..7d864dd6 100644 --- a/src/www/pages/templates/campaign-two-columns/index.njk +++ b/src/www/pages/templates/campaign-two-columns/index.njk @@ -30,9 +30,13 @@ {{ wmcadsPageContents({ title: "Roll & Stroll", - rightMargin: true + rightMargin: true, + example: false }) }} + +
+
@@ -59,6 +63,7 @@ src: true, isThirdCard: false, title: 'Get Going Continue Rolling', + isDefault: true, copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.' }) }} @@ -70,35 +75,38 @@ src: true, isThirdCard: false, title: 'All things strolling', + isDefault: true, copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. ' }) }}
-
+
{{ wmcadsContentCard({ clickable: true, src: true, isThirdCard: false, title: 'Changes in your area', + isDefault: true, copy: 'Understand what changes are being made in your area to help you travel safely' }) }}
-
+
{{ wmcadsContentCard({ clickable: true, src: true, isThirdCard: false, title: 'Get active and travel safely', + isDefault: true, copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. ' }) }}
- +

Get the best from your bike

- +

Additional Information

@@ -165,6 +173,7 @@ src: true, isThirdCard: false, title: 'Support for businesses', + isDefault: true, copy: 'We have a wide range of options to support your business and employees at work and at home' }) }} @@ -176,13 +185,14 @@ src: true, isThirdCard: false, title: 'Be Aware and Share', + isDefault: true, copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.' }) }}
- +

Campaign Funding Partners

diff --git a/src/www/pages/templates/homepage/homepage.scss b/src/www/pages/templates/homepage/homepage.scss index 1932721b..cf80a6bd 100644 --- a/src/www/pages/templates/homepage/homepage.scss +++ b/src/www/pages/templates/homepage/homepage.scss @@ -1,4 +1,6 @@ .homepage { + margin-bottom: $size-xl; + .what-we-do { svg { display: block; @@ -26,6 +28,39 @@ padding: 0 $size-sm; } } + + .thirds { + .wmcads-col-sm-1-2:last-of-type { + @media screen and (max-width: $breakpoint-md) { + margin-top: $size-lg; + } + } + } + + .news { + .wmcads-col-md-12-24 { + padding-right: $size-lg; + @media screen and (max-width: $breakpoint-md) { + margin-bottom: $size-lg; + padding-right: 0; + } + } + + .wmcads-col-sm-1-2:nth-child(2) { + padding-right: $size-md; + @media screen and (max-width: $breakpoint-md) { + padding-right: 0; + } + } + + .wmcads-col-sm-1-2:nth-child(3) { + padding-left: $size-md; + @media screen and (max-width: $breakpoint-md) { + padding-left: 0; + } + } + + } } .wmcads-container.homepage { diff --git a/src/www/pages/templates/homepage/index.njk b/src/www/pages/templates/homepage/index.njk index ec699af1..9cc81e6f 100644 --- a/src/www/pages/templates/homepage/index.njk +++ b/src/www/pages/templates/homepage/index.njk @@ -84,7 +84,7 @@

Latest News

-
+
{{ wmcadsContentCard({ @@ -121,7 +121,7 @@
See all news stories -
+
{{ wmcadsContentCard({ @@ -145,7 +145,7 @@ }}
-
+
{{ wmcadsContentCard({ @@ -176,8 +176,8 @@

Upcoming events

-
-
+
+
{{ wmcadsContentCard({ eventTitle: 'Mayors Mentors', @@ -187,7 +187,7 @@ }) }}
-
+
{{ wmcadsContentCard({ eventTitle: 'Greater Birmingham LEP Skills Day', @@ -197,7 +197,7 @@ }) }}
-
+
{{ wmcadsContentCard({ eventTitle: 'Sprint exhibition - Walsall', diff --git a/src/www/wmcads-website.js b/src/www/wmcads-website.js index de7d7c15..4bc26874 100755 --- a/src/www/wmcads-website.js +++ b/src/www/wmcads-website.js @@ -7,6 +7,7 @@ import footerJs from '../wmcads/patterns/footer/_example'; import accordionsJS from '../wmcads/components/accordion/_example'; import boardMembersJS from '../wmcads/patterns/board-members/_example'; import searchFilterJs from '../wmcads/patterns/search/search-filter/_example'; +import pageContents from './pages/templates/campaign-two-columns/campaign-template'; import { componentExample, @@ -41,5 +42,6 @@ window.addEventListener( searchFilterJs(), componentExampleIframe(), componentExampleScript(), + pageContents(), componentExample) );