mp-design-system 0.7.3 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/build/{Inter-Bold.39130deb.woff → Inter-Bold.419e8c71.woff} +0 -0
- package/dist/build/{Inter-Bold.a2748096.woff2 → Inter-Bold.af5441a3.woff2} +0 -0
- package/dist/build/{Inter-Regular.27892b21.woff → Inter-Regular.ca6858d7.woff} +0 -0
- package/dist/build/{Inter-Regular.03253301.woff2 → Inter-Regular.ed77b881.woff2} +0 -0
- package/dist/build/{Inter-SemiBold.ba1d0d7d.woff → Inter-SemiBold.cc1168df.woff} +0 -0
- package/dist/build/{Inter-SemiBold.97a52f0e.woff2 → Inter-SemiBold.dd034768.woff2} +0 -0
- package/dist/build/concentric.05eaed9c.svg +1 -0
- package/dist/build/dots-pattern.3c9c2a26.svg +1 -0
- package/dist/build/js/app.js +2 -24
- package/dist/build/js/app.js.map +1 -1
- package/dist/build/scss/library.css +2 -2
- package/dist/build/scss/library.css.map +1 -1
- package/dist/build/scss/main.css +2 -2
- package/dist/build/scss/main.css.map +1 -1
- package/package.json +6 -7
- package/src/_includes/components/accordion/accordion.config.js +27 -0
- package/src/_includes/components/accordion/accordion.md +15 -0
- package/src/_includes/components/accordion/accordion.njk +10 -0
- package/src/_includes/components/accordion/accordion.scss +49 -0
- package/src/_includes/components/accordion/macro.njk +5 -0
- package/src/_includes/components/button/button.njk +1 -1
- package/src/_includes/components/hero/hero.config.js +27 -3
- package/src/_includes/components/hero/hero.njk +29 -1
- package/src/_includes/components/hero/hero.scss +61 -1
- package/src/_includes/components/table/table.config.js +12 -0
- package/src/_includes/components/table/table.njk +8 -2
- package/src/_includes/includes/system-footer.njk +2 -4
- package/src/assets/js/app.js +7 -3
- package/src/assets/js/imports/accordion.js +19 -0
- package/src/assets/js/imports/gallery.js +6 -0
- package/src/assets/js/imports/hero-video.js +34 -0
- package/src/assets/scss/components/gallery.scss +0 -50
- package/src/assets/scss/components/index.scss +2 -0
- package/src/assets/scss/components/lightbox.scss +63 -0
- package/src/assets/scss/objects/grid.scss +3 -1
- package/src/brand/downloads.njk +16 -6
- package/src/brand/visual/images.md +17 -17
- package/src/brand/visual/logo.md +2 -0
- package/src/components/iconography.njk +12 -12
- package/src/content/index.njk +1 -1
- package/src/index.njk +12 -4
- package/src/prototype/product.njk +24 -1
- package/src/prototype/range.njk +1 -1
- package/src/static/pdf/PN12558_Physical_branding_v23.pdf +0 -0
- package/src/static/zip/MP_logo.zip +0 -0
- package/dist/build/concentric.797defa2.svg +0 -1
- package/dist/build/dots-pattern.7a77e237.svg +0 -1
- package/src/static/img/grid-captivate-2.jpg +0 -0
- package/src/static/img/grid-captivate-3.jpg +0 -0
- package/src/static/img/grid-captivate-4.jpg +0 -0
- package/src/static/img/grid-convince-1.jpg +0 -0
- package/src/static/img/grid-convince-2.jpg +0 -0
- package/src/static/img/grid-convince-3.jpg +0 -0
- package/src/static/img/grid-convince-4.jpg +0 -0
- package/src/static/img/grid-convince-6.jpg +0 -0
- package/src/static/img/grid-inform-applications-1.jpg +0 -0
- package/src/static/img/grid-inform-applications-2.jpg +0 -0
- package/src/static/img/grid-inform-applications-3.jpg +0 -0
- package/src/static/img/grid-inform-tech-1.jpg +0 -0
- package/src/static/img/grid-inform-tech-2.jpg +0 -0
- package/src/static/img/grid-inform-tech-4.jpg +0 -0
- package/src/static/img/grid-inspire-1.jpg +0 -0
- package/src/static/img/grid-inspire-2.jpg +0 -0
- package/src/static/img/grid-inspire-3.jpg +0 -0
- package/src/static/img/grid-inspire-4.jpg +0 -0
- package/src/static/img/grid-inspire-5.jpg +0 -0
- package/src/static/pdf/FINAL Tone of voice guidelines April 2021.pdf +0 -0
- package/src/static/pdf/Mastersizer 3000.pdf +58 -53069
- package/src/static/pdf/PN12316_Digital_brand_quickstart_v06.pdf +45 -19388
- package/src/static/ppt/MP Elevator pitch.pptx +0 -0
package/package.json
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "mp-design-system",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.8.2",
|
4
4
|
"description": "",
|
5
|
-
"main": "app.js",
|
6
5
|
"scripts": {
|
7
6
|
"dev": "npm-run-all --parallel bundle:*",
|
8
7
|
"bundle:eleventy": "eleventy --serve --quiet",
|
9
|
-
"bundle:parcel": "parcel src/assets/js/*.js src/assets/scss/*.scss -
|
8
|
+
"bundle:parcel": "parcel src/assets/js/*.js src/assets/scss/*.scss --dist-dir ./dist/build",
|
10
9
|
"build": "run-s prod:*",
|
11
10
|
"prod:eleventy": "eleventy",
|
12
|
-
"prod:parcel": "rimraf dist/build && parcel build src/assets/js/*.js src/assets/scss/*.scss -
|
11
|
+
"prod:parcel": "rimraf dist/build && parcel build src/assets/js/*.js src/assets/scss/*.scss --dist-dir ./dist/build",
|
13
12
|
"prepublishOnly": "rimraf dist && npm run prod:parcel"
|
14
13
|
},
|
15
14
|
"files": [
|
@@ -22,12 +21,13 @@
|
|
22
21
|
"devDependencies": {
|
23
22
|
"@11ty/eleventy": "^0.12.1",
|
24
23
|
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
|
24
|
+
"@parcel/transformer-sass": "^2.4.0",
|
25
25
|
"dotenv": "^8.6.0",
|
26
26
|
"html-prettify": "^1.0.3",
|
27
27
|
"markdown-it": "^12.1.0",
|
28
28
|
"markdown-it-prism": "^2.1.8",
|
29
29
|
"npm-run-all": "^4.1.5",
|
30
|
-
"parcel
|
30
|
+
"parcel": "^2.4.0",
|
31
31
|
"require-glob": "^3.2.0",
|
32
32
|
"rimraf": "^3.0.2",
|
33
33
|
"sass": "^1.35.2",
|
@@ -36,6 +36,5 @@
|
|
36
36
|
"alias": {
|
37
37
|
"mp": "./node_modules/mp-design-system/src/assets/scss",
|
38
38
|
"comp": "./src/_includes/components"
|
39
|
-
}
|
40
|
-
"dependencies": {}
|
39
|
+
}
|
41
40
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module.exports = {
|
2
|
+
title: 'Accordion',
|
3
|
+
component: {
|
4
|
+
name: 'accordion'
|
5
|
+
},
|
6
|
+
docs: true,
|
7
|
+
context: {
|
8
|
+
items: [
|
9
|
+
{
|
10
|
+
title: 'Do I need to prepare the workspace prior to installation?',
|
11
|
+
content: 'All instruments need a power source, and some have additional requirements such as a water supply or waste extraction. Where this the case, we will advise you prior to shipping your instrument.'
|
12
|
+
},
|
13
|
+
{
|
14
|
+
title: 'What specialist skills or knowledge are required?',
|
15
|
+
content: 'You don\'t need any specialist skills or knowledge to perform a Smart Install. Simply follow the instructions provided.'
|
16
|
+
},
|
17
|
+
{
|
18
|
+
title: 'Do I need specialist tools or equipment to Smart Install a new instrument?',
|
19
|
+
content: '<ul><li>For installation of a Mastersizer or Zetasizer system, you will need a computer with internet access in order to view the installation guides. For installation of an Epsilon 1 XRF instrument, you will also need a smartphone or tablet to connect with our support personnel via a secure, augmented reality (AR) platform.</li><li>Everything else you need to install your new instrument will be provided.</li></ul>'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
title: 'What languages are available for the Smart Install guides?',
|
23
|
+
content: '<ul><li>Mastersizer: English, Chinese, Korean, French, German and Japanese</li><li>Zetasizer: English, Chinese, Korean, French, German and Japanese</li><li>Epsilon 1: English, French, German and Japanese, Spanish and Portuguese</li></ul>'
|
24
|
+
}
|
25
|
+
]
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
## Blank HTML template
|
2
|
+
```
|
3
|
+
<dl class="c-accordion">
|
4
|
+
<div class="c-accordion__item">
|
5
|
+
<dt class="c-accordion__title">Title one</dt>
|
6
|
+
<dd class="c-accordion__content o-prose u-flow--prose">Content one</dd>
|
7
|
+
</div>
|
8
|
+
<div class="c-accordion__item">
|
9
|
+
<dt class="c-accordion__title">Title two</dt>
|
10
|
+
<dd class="c-accordion__content o-prose u-flow--prose">Content two</dd>
|
11
|
+
</div>
|
12
|
+
</dl>
|
13
|
+
```
|
14
|
+
- To make an item display in its opened state when the page loads, add the class `c-accordion--item__open`
|
15
|
+
- The classnames `o-prose` and `u-flow--prose` on the content are optional
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{% from "components/icon/macro.njk" import icon %}
|
2
|
+
|
3
|
+
<dl class="c-accordion">
|
4
|
+
{% for item in params.items %}
|
5
|
+
<div class="c-accordion__item {{ 'c-accordion__item--open' if item.state }}">
|
6
|
+
<dt class="c-accordion__title">{{ item.title }}</dt>
|
7
|
+
<dd class="c-accordion__content o-prose u-flow--prose">{{ item.content | safe }}</dd>
|
8
|
+
</div>
|
9
|
+
{% endfor %}
|
10
|
+
</dl>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
.c-accordion {
|
2
|
+
&__item {
|
3
|
+
@include padding('xs',0);
|
4
|
+
|
5
|
+
& + & {
|
6
|
+
border-top: 1px solid color('petrol', 'step-2');
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
&__title {
|
11
|
+
@include step(1);
|
12
|
+
@include padding('xs',0);
|
13
|
+
cursor: pointer;
|
14
|
+
font-weight: weight('bold');
|
15
|
+
position: relative;
|
16
|
+
|
17
|
+
&:before {
|
18
|
+
background-image: url('data:image/svg+xml;utf8,<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 1V17M1 9H17" stroke="%23252525" stroke-width="2" stroke-linecap="round"/></svg>');
|
19
|
+
background-position: center center;
|
20
|
+
background-repeat: no-repeat;
|
21
|
+
content: "";
|
22
|
+
display: block;
|
23
|
+
height: 1em;
|
24
|
+
left: 0;
|
25
|
+
position: absolute;
|
26
|
+
width: 1em;
|
27
|
+
}
|
28
|
+
|
29
|
+
.c-accordion__item--open &:before {
|
30
|
+
background-image: url('data:image/svg+xml;utf8,<svg width="10" height="2" viewBox="0 0 10 2" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1H9" stroke="%23252525" stroke-width="2" stroke-linecap="round"/></svg>');
|
31
|
+
transform: scaleX(1.75);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
&__content {
|
36
|
+
margin-left: 0;
|
37
|
+
@include padding-bottom('xs');
|
38
|
+
display: none;
|
39
|
+
|
40
|
+
.c-accordion__item--open & {
|
41
|
+
display: block;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
&__title,
|
46
|
+
&__content {
|
47
|
+
@include padding-left('l-xl');
|
48
|
+
}
|
49
|
+
}
|
@@ -22,7 +22,7 @@
|
|
22
22
|
{%- elseif params.type == 'span' -%}
|
23
23
|
<span class="{{ classNames }}" {{ attrs }}>
|
24
24
|
{%- else -%}
|
25
|
-
<button type="{{ params.type or 'button' }}" class="{{ classNames}}"{{ attrs }}>
|
25
|
+
<button type="{{ params.type or 'button' }}" class="{{ classNames}}" {{ attrs }}>
|
26
26
|
{%- endif -%}
|
27
27
|
{%- if params.icon -%}
|
28
28
|
{{ twi({ icon: params.icon, align: params.align, label: params.label }) }}
|
@@ -48,14 +48,14 @@ module.exports = {
|
|
48
48
|
},
|
49
49
|
cta: {
|
50
50
|
label: 'Download brochure',
|
51
|
-
link: '/
|
51
|
+
link: 'https://www.malvernpanalytical.com/en/assets/Mastersizer%203000%20Brochure%20%28EN%29_tcm50-58994.pdf',
|
52
52
|
attrs: 'download',
|
53
53
|
icon: 'file'
|
54
54
|
}
|
55
55
|
}
|
56
56
|
},
|
57
57
|
{
|
58
|
-
title: '
|
58
|
+
title: 'Homepage',
|
59
59
|
context: {
|
60
60
|
title: "We’re big on small.",
|
61
61
|
subtitle: null,
|
@@ -76,7 +76,7 @@ module.exports = {
|
|
76
76
|
}
|
77
77
|
},
|
78
78
|
{
|
79
|
-
title: '
|
79
|
+
title: 'Homepage (light)',
|
80
80
|
context: {
|
81
81
|
title: "We’re big on small.",
|
82
82
|
subtitle: null,
|
@@ -96,6 +96,30 @@ module.exports = {
|
|
96
96
|
homepage: 'light'
|
97
97
|
}
|
98
98
|
},
|
99
|
+
// {
|
100
|
+
// title: 'Homepage with video',
|
101
|
+
// context: {
|
102
|
+
// title: 'We\'re big on small.',
|
103
|
+
// subtitle: null,
|
104
|
+
// content: '<p>We make scientific instruments and services that make the invisible visible, and the impossible possible.</p>',
|
105
|
+
// videoplaceholder: {
|
106
|
+
// src: 'https://p3.aprimocdn.net/malvernpanalytical/bf169dc6-9edb-4609-9ba8-add301206d1e/bridge-bg_Original%20file.webp?quality=60'
|
107
|
+
// },
|
108
|
+
// shortvideo: [
|
109
|
+
// { src: '' },
|
110
|
+
// { type: 'video/mp4' },
|
111
|
+
// ],
|
112
|
+
// longvideo: [
|
113
|
+
// { src: '' },
|
114
|
+
// { type: 'video/mp4' },
|
115
|
+
// ],
|
116
|
+
// cta: {
|
117
|
+
// label: 'About Malvern Panalytical',
|
118
|
+
// link: ''
|
119
|
+
// },
|
120
|
+
// homepage: 'dark'
|
121
|
+
// },
|
122
|
+
// }
|
99
123
|
],
|
100
124
|
props: [
|
101
125
|
{
|
@@ -1,5 +1,7 @@
|
|
1
1
|
{% from "components/twi/macro.njk" import twi %}
|
2
2
|
{% from "components/breadcrumb/macro.njk" import breadcrumb %}
|
3
|
+
{% from "components/button/macro.njk" import button %}
|
4
|
+
{% from "components/icon/macro.njk" import icon %}
|
3
5
|
|
4
6
|
{%- set classes = 'mp c-hero' -%}
|
5
7
|
{% if params.classes %}{%- set classes = classes + ' ' + params.classes -%}{% endif %}
|
@@ -11,6 +13,10 @@
|
|
11
13
|
{%- set classes = classes + ' c-hero--homepage-light' -%}
|
12
14
|
{% endif %}
|
13
15
|
|
16
|
+
{% if params.shortvideo %}
|
17
|
+
{%- set classes = classes + ' c-hero--homepage-video' -%}
|
18
|
+
{% endif %}
|
19
|
+
|
14
20
|
<figure class="{{ classes }}">
|
15
21
|
<div class="u-wrap">
|
16
22
|
<div class="c-hero__content">
|
@@ -38,7 +44,6 @@
|
|
38
44
|
</div>
|
39
45
|
</div>
|
40
46
|
|
41
|
-
|
42
47
|
{% if params.image %}
|
43
48
|
<div class="c-hero__image-bg" style="background-image:url({{ params.image.src }});"></div>
|
44
49
|
{% elif params.images %}
|
@@ -47,6 +52,14 @@
|
|
47
52
|
{% endfor %}
|
48
53
|
{% endif %}
|
49
54
|
|
55
|
+
{% if params.shortvideo %}
|
56
|
+
<div class="c-hero__video-bg" style="background-image:url({{ params.videoplaceholder.src }});">
|
57
|
+
<video id="videoBackground" autoplay loop>
|
58
|
+
<source src="https://p3.aprimocdn.net/malvernpanalytical/304f04aa-ae04-4bed-9946-ae3101152327/PN12593_Brand_Movie_Malvern_Panalytical_MIX_0dBfs_website_header_Original%20file.mp4" type="video/mp4">
|
59
|
+
</video>
|
60
|
+
</div>
|
61
|
+
{% endif %}
|
62
|
+
|
50
63
|
{% if params.homepage %}
|
51
64
|
<canvas class="c-hero__canvas"></canvas>
|
52
65
|
{% endif %}
|
@@ -56,4 +69,19 @@
|
|
56
69
|
<div class="c-hero__image-fg" style="background-image:url({{ image.src }});"></div>
|
57
70
|
{% endfor %}
|
58
71
|
{% endif %}
|
72
|
+
|
73
|
+
{% if params.longvideo %}
|
74
|
+
{{ button({ link: '', label: 'Play video', colour: 'outline-white', classes: 'c-hero__button', attrs: 'id=playVideo' }) }}
|
75
|
+
{% endif %}
|
59
76
|
</figure>
|
77
|
+
|
78
|
+
<div id="lightboxVideo" class="c-lightbox u-hidden">
|
79
|
+
<div class="c-lightbox__close">
|
80
|
+
{{ icon({ id: 'cross' }) }}
|
81
|
+
</div>
|
82
|
+
<div class="c-lightbox__slide active">
|
83
|
+
<video class="c-lightbox__video" controls controlslist="nodownload">
|
84
|
+
<source src="https://p3.aprimocdn.net/malvernpanalytical/304f04aa-ae04-4bed-9946-ae3101152327/PN12593_Brand_Movie_Malvern_Panalytical_MIX_0dBfs_website_header_Original%20file.mp4" type="video/mp4">
|
85
|
+
</video>
|
86
|
+
</div>
|
87
|
+
</div>
|
@@ -141,7 +141,6 @@
|
|
141
141
|
z-index: -1;
|
142
142
|
transition: opacity 3s ease;
|
143
143
|
background-position: 60% 40%;
|
144
|
-
-webkit-mask-image: radial-gradient(circle farthest-side at top right, black 80%, transparent 98%);
|
145
144
|
|
146
145
|
&:after {
|
147
146
|
display: none;
|
@@ -160,6 +159,67 @@
|
|
160
159
|
}
|
161
160
|
}
|
162
161
|
|
162
|
+
&--homepage-video {
|
163
|
+
position: relative;
|
164
|
+
|
165
|
+
&::after {
|
166
|
+
position: absolute;
|
167
|
+
content: '';
|
168
|
+
top: 0;
|
169
|
+
left: 0;
|
170
|
+
background: rgba(black, 0.33);
|
171
|
+
width: 100%;
|
172
|
+
height: 100%;
|
173
|
+
|
174
|
+
@media (min-width: 38em) {
|
175
|
+
background: radial-gradient(circle farthest-side at top right, rgba(46, 50, 51, 0) 0%, rgba(46, 50, 51, 0) 15.16%, rgba(46, 50, 51, 0.2) 27.66%, rgba(41, 54, 56, 0.55) 39.61%, rgba(35, 66, 71, 0.8) 49.78%, #005461 59.87%, #003039 100%);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
.c-hero {
|
180
|
+
&__video-bg {
|
181
|
+
width: 100%;
|
182
|
+
height: auto;
|
183
|
+
margin-bottom: -6px;
|
184
|
+
background-size: cover;
|
185
|
+
|
186
|
+
@media (min-width: 38em) {
|
187
|
+
position: absolute;
|
188
|
+
top: 50%;
|
189
|
+
right: 0;
|
190
|
+
left: 40%;
|
191
|
+
max-width: 60%;
|
192
|
+
height: 100%;
|
193
|
+
transform: translateY(-50%);
|
194
|
+
}
|
195
|
+
|
196
|
+
video {
|
197
|
+
width: 100%;
|
198
|
+
height: 100%;
|
199
|
+
object-fit: cover;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
&__button {
|
204
|
+
position: absolute;
|
205
|
+
z-index: 2;
|
206
|
+
right: 0;
|
207
|
+
bottom: calc(56.25% / 2 - 25px);
|
208
|
+
left: 0;
|
209
|
+
background: rgba(black, 0.2);
|
210
|
+
margin: 0 auto;
|
211
|
+
|
212
|
+
@media (min-width: 38em) {
|
213
|
+
position: absolute;
|
214
|
+
top: 45%;
|
215
|
+
right: 20%;
|
216
|
+
bottom: unset;
|
217
|
+
left: unset;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
163
223
|
&--homepage-light {
|
164
224
|
@extend .c-hero--homepage;
|
165
225
|
background: linear-gradient(79.62deg, color('petrol', 'step-3') 0%, color('blue', 'step-2') 100%), color('petrol', 'step-3');
|
@@ -17,6 +17,18 @@ module.exports = {
|
|
17
17
|
classes: 'c-table--fixed'
|
18
18
|
}
|
19
19
|
},
|
20
|
+
{
|
21
|
+
title: 'Vertical headers',
|
22
|
+
context: {
|
23
|
+
theme: 'vertical'
|
24
|
+
}
|
25
|
+
},
|
26
|
+
{
|
27
|
+
title: 'No headers',
|
28
|
+
context: {
|
29
|
+
theme: 'none'
|
30
|
+
}
|
31
|
+
},
|
20
32
|
{
|
21
33
|
title: 'Center',
|
22
34
|
context: {
|
@@ -1,16 +1,22 @@
|
|
1
1
|
<table class="mp c-table {{ params.classes }}" {{ params.attrs }}>
|
2
|
+
{% if params.theme != 'none'%}
|
2
3
|
<thead>
|
3
4
|
<tr>
|
4
5
|
{% for header in params.headers %}
|
5
|
-
|
6
|
+
{% if (params.theme != 'vertical') or ((params.theme == 'vertical') and (loop.index0 == 0)) %}
|
7
|
+
<th>{{ header | safe }}</th>
|
8
|
+
{% else %}
|
9
|
+
<td>{{ header | safe }}</td>
|
10
|
+
{% endif %}
|
6
11
|
{% endfor %}
|
7
12
|
</tr>
|
8
13
|
</thead>
|
14
|
+
{% endif %}
|
9
15
|
<tbody>
|
10
16
|
{% for row in params.rows %}
|
11
17
|
<tr>
|
12
18
|
{% for cell in row %}
|
13
|
-
{% if loop.index0 == 0 %}
|
19
|
+
{% if (params.theme == 'vertical') and (loop.index0 == 0) %}
|
14
20
|
<th>{{ cell | safe }}</th>
|
15
21
|
{% else %}
|
16
22
|
<td>{{ cell | safe }}</td>
|
@@ -5,11 +5,9 @@
|
|
5
5
|
{% markdown %}
|
6
6
|
### Get in touch
|
7
7
|
|
8
|
-
This system is maintained by the Design System Team.
|
8
|
+
This system is maintained by the Design System Team. Any feedback, questions or ideas are welcome, so please share your thoughts.
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
- For all enquiries please contact [will.wallace@malvernpanalytical.com](mailto:will.wallace@malvernpanalytical.com).
|
10
|
+
- For all enquiries please contact [will.wallace@malvernpanalytical.com](mailto:will.wallace@malvernpanalytical.com) via email or Teams.
|
13
11
|
{% endmarkdown %}
|
14
12
|
|
15
13
|
</nav>
|
package/src/assets/js/app.js
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
+
import Accordion from './imports/accordion';
|
1
2
|
import Carousel from './imports/carousel';
|
2
3
|
import ClearForm from './imports/clear-form';
|
3
4
|
import Comparison from './imports/comparison';
|
4
5
|
import Gallery from './imports/gallery';
|
5
6
|
import HeroPattern from './imports/hero-pattern';
|
7
|
+
import HeroVideo from './imports/hero-video';
|
6
8
|
import ResponsiveTable from './imports/responsive-table';
|
7
|
-
import ScrollSpy from './imports/scroll-spy';
|
8
9
|
import ScrollbarWidth from './imports/scrollbar-width';
|
10
|
+
import ScrollSpy from './imports/scroll-spy';
|
9
11
|
import Tabs from './imports/tabs';
|
10
12
|
|
11
13
|
(() => {
|
@@ -16,13 +18,15 @@ import Tabs from './imports/tabs';
|
|
16
18
|
HTMLCollection.prototype.forEach = Array.prototype.forEach;
|
17
19
|
}
|
18
20
|
|
21
|
+
Accordion();
|
19
22
|
Carousel();
|
20
23
|
ClearForm();
|
21
24
|
Comparison();
|
22
25
|
Gallery();
|
23
26
|
HeroPattern();
|
24
|
-
|
25
|
-
ScrollSpy();
|
27
|
+
HeroVideo();
|
26
28
|
ResponsiveTable();
|
27
29
|
ScrollbarWidth();
|
30
|
+
ScrollSpy();
|
31
|
+
Tabs();
|
28
32
|
})();
|
@@ -0,0 +1,19 @@
|
|
1
|
+
function Accordion() {
|
2
|
+
const accordions = Array.from(document.querySelectorAll('.c-accordion__title'));
|
3
|
+
accordions.forEach(setupAccordions);
|
4
|
+
}
|
5
|
+
|
6
|
+
function setupAccordions(title) {
|
7
|
+
title.addEventListener('click', titleClick())
|
8
|
+
}
|
9
|
+
|
10
|
+
function titleClick() {
|
11
|
+
return (event) => {
|
12
|
+
console.log(event)
|
13
|
+
var item = event.currentTarget.parentElement;
|
14
|
+
console.log(item)
|
15
|
+
item.classList.toggle('c-accordion__item--open');
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
export default Accordion;
|
@@ -33,6 +33,12 @@ function Gallery() {
|
|
33
33
|
if(slide.classList.contains('c-gallery__video')) {
|
34
34
|
slide.remove();
|
35
35
|
}
|
36
|
+
if(!slide.classList.contains('c-gallery__video')) {
|
37
|
+
var slideImg = slide.querySelector('img');
|
38
|
+
if(slideImg.srcset != '') {
|
39
|
+
slideImg.removeAttribute('srcset');
|
40
|
+
}
|
41
|
+
}
|
36
42
|
slide.classList.add('c-lightbox__slide');
|
37
43
|
slide.classList.remove('c-gallery__slide');
|
38
44
|
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
function HeroVideo() {
|
2
|
+
document.addEventListener("DOMContentLoaded", () => {
|
3
|
+
const videoBackground = document.getElementById('videoBackground');
|
4
|
+
if(typeof(videoBackground) != 'undefined' && videoBackground != null) {
|
5
|
+
const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
|
6
|
+
if(!reducedMotion || reducedMotion.matches) {
|
7
|
+
videoBackground.classList.add('u-hidden');
|
8
|
+
}
|
9
|
+
|
10
|
+
const lightboxTrigger = document.getElementById('playVideo');
|
11
|
+
const lightboxVideo = document.getElementById('lightboxVideo');
|
12
|
+
|
13
|
+
lightboxTrigger.addEventListener('click', e => {
|
14
|
+
videoBackground.removeAttribute('autoplay');
|
15
|
+
lightboxVideo.classList.remove('u-hidden');
|
16
|
+
});
|
17
|
+
|
18
|
+
lightboxVideo.addEventListener('click', (e) => {
|
19
|
+
if (!e.target.classList.contains('c-lightbox__video')) {
|
20
|
+
videoBackground.setAttribute('autoplay','');
|
21
|
+
lightboxVideo.classList.add('u-hidden');
|
22
|
+
}
|
23
|
+
});
|
24
|
+
window.addEventListener('keydown', function(e) {
|
25
|
+
if (e.key == "Escape") {
|
26
|
+
videoBackground.setAttribute('autoplay','');
|
27
|
+
lightboxVideo.classList.add('u-hidden');
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}
|
33
|
+
|
34
|
+
export default HeroVideo;
|
@@ -52,54 +52,4 @@
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
}
|
55
|
-
}
|
56
|
-
|
57
|
-
.c-lightbox {
|
58
|
-
position: fixed;
|
59
|
-
z-index: 1000;
|
60
|
-
top: 0;
|
61
|
-
width: 100%;
|
62
|
-
height: 100%;
|
63
|
-
background-color: rgba(color('grey', 'step--1'), .9);
|
64
|
-
display: flex;
|
65
|
-
justify-content: center;
|
66
|
-
align-items: center;
|
67
|
-
|
68
|
-
&__slide {
|
69
|
-
max-width: 90vw;
|
70
|
-
margin: auto;
|
71
|
-
display: none;
|
72
|
-
|
73
|
-
&.active {
|
74
|
-
display: block;
|
75
|
-
|
76
|
-
img {
|
77
|
-
max-width: 85vw;
|
78
|
-
max-height: 90vh;
|
79
|
-
margin: auto;
|
80
|
-
display: block;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
|
85
|
-
&__prev,
|
86
|
-
&__next {
|
87
|
-
position: absolute;
|
88
|
-
height: 2rem;
|
89
|
-
width: 2rem;
|
90
|
-
background-repeat: no-repeat;
|
91
|
-
background-position: center;
|
92
|
-
padding: 0.5rem;
|
93
|
-
cursor: pointer;
|
94
|
-
}
|
95
|
-
|
96
|
-
&__prev {
|
97
|
-
background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="arrow-left" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12H2M2 12L9 5M2 12L9 19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
|
98
|
-
left: 0.5rem;
|
99
|
-
}
|
100
|
-
|
101
|
-
&__next {
|
102
|
-
background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="arrow-right" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12H22M22 12L15 5M22 12L15 19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
|
103
|
-
right: 0.5rem;
|
104
|
-
}
|
105
55
|
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
.c-lightbox {
|
2
|
+
position: fixed;
|
3
|
+
z-index: 1000;
|
4
|
+
top: 0;
|
5
|
+
width: 100%;
|
6
|
+
height: 100%;
|
7
|
+
background-color: rgba(color('grey', 'step--1'), .9);
|
8
|
+
display: flex;
|
9
|
+
justify-content: center;
|
10
|
+
align-items: center;
|
11
|
+
|
12
|
+
&__slide {
|
13
|
+
max-width: 90vw;
|
14
|
+
margin: auto;
|
15
|
+
display: none;
|
16
|
+
|
17
|
+
&.active {
|
18
|
+
display: block;
|
19
|
+
|
20
|
+
img {
|
21
|
+
max-width: 85vw;
|
22
|
+
max-height: 90vh;
|
23
|
+
margin: auto;
|
24
|
+
display: block;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
&__prev,
|
30
|
+
&__next {
|
31
|
+
position: absolute;
|
32
|
+
height: 2rem;
|
33
|
+
width: 2rem;
|
34
|
+
background-repeat: no-repeat;
|
35
|
+
background-position: center;
|
36
|
+
padding: 0.5rem;
|
37
|
+
cursor: pointer;
|
38
|
+
}
|
39
|
+
|
40
|
+
&__prev {
|
41
|
+
background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="arrow-left" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12H2M2 12L9 5M2 12L9 19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
|
42
|
+
left: 0.5rem;
|
43
|
+
}
|
44
|
+
|
45
|
+
&__next {
|
46
|
+
background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="arrow-right" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12H22M22 12L15 5M22 12L15 19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
|
47
|
+
right: 0.5rem;
|
48
|
+
}
|
49
|
+
|
50
|
+
&__close {
|
51
|
+
position: absolute;
|
52
|
+
top: 0.6rem;
|
53
|
+
right: 0.6rem;
|
54
|
+
color: color('white');
|
55
|
+
font-size: 1.6rem;
|
56
|
+
cursor: pointer;
|
57
|
+
}
|
58
|
+
|
59
|
+
&__video {
|
60
|
+
width: 100%;
|
61
|
+
max-height: 80vh;
|
62
|
+
}
|
63
|
+
}
|
@@ -185,13 +185,15 @@ $grid-gutter-width: 36;
|
|
185
185
|
flex-wrap: nowrap;
|
186
186
|
overflow-x: scroll;
|
187
187
|
scroll-snap-type: x mandatory;
|
188
|
+
scroll-padding: var(--gutter);
|
188
189
|
-webkit-overflow-scrolling: touch;
|
189
190
|
|
190
191
|
& > * {
|
191
192
|
flex: 0 0 auto;
|
192
193
|
max-width: 23em;
|
193
194
|
width: calc(85vw - var(--gutter)*2.333); // !important
|
194
|
-
scroll-snap-align:
|
195
|
+
scroll-snap-align: start;
|
196
|
+
scroll-snap-stop: always;
|
195
197
|
}
|
196
198
|
|
197
199
|
& > * + * {
|