@foeewni/web-core 3.0.0-alpha.1 → 3.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -1
- package/dist/css/foe.critical.min.css +8 -8
- package/dist/css/foe.extras.min.css +1 -1
- package/dist/css/foe.main.min.css +9 -9
- package/dist/js/foe.fonts.min.js +1 -1
- package/dist/js/foe.main.min.js +1 -1
- package/package.json +3 -4
- package/src/components/form/buttons.scss +58 -0
- package/src/components/form/inputs.scss +45 -2
- package/src/components/go-top/index.js +1 -1
- package/src/components/hero-panel/style.scss +37 -13
- package/src/components/layout/backgrounds.scss +82 -0
- package/src/components/layout/reset.scss +13 -0
- package/src/components/navigation/_header.scss +7 -6
- package/src/components/navigation/_nav-items.scss +36 -39
- package/src/components/navigation/_search.scss +18 -6
- package/src/components/tools/data-defer-src.js +2 -7
- package/src/components/tools/jaunty.js +246 -0
- package/src/components/typography/blockquotes.scss +18 -24
- package/src/components/typography/fonts.scss +2 -2
- package/src/fonts.js +31 -20
- package/src/main.js +1 -0
- package/src/utils/scss/helpers/_mixins.scss +4 -3
- package/src/utils/scss/helpers/_variables.scss +62 -34
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/* @docs
|
|
2
|
+
|
|
3
|
+
# Scripts:Jaunty
|
|
4
|
+
|
|
5
|
+
Jauntifies a text header with the data-jaunt-factor attribute.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
```
|
|
9
|
+
<h1 data-jaunt-factor="1">Jaunty Title</h1>
|
|
10
|
+
|
|
11
|
+
<h2 data-jaunt-factor="2">Very Jaunty Title</h2>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Based on James South Codepen https://codepen.io/jrsouth/pen/ZEmeoJz with ideas from
|
|
15
|
+
https://www.bennadel.com/blog/4310-detecting-rendered-line-breaks-in-a-text-node-in-javascript.htm
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
(() => {
|
|
19
|
+
// Config
|
|
20
|
+
const ROTATION_MAX_DEGREES = 3; // Degrees. "Normal" is around 2.5
|
|
21
|
+
const BACKGROUND_EXTENSION = 0.5; // rem. Normal is around 1
|
|
22
|
+
const CORNER_JIGGLE_MAX = 1; // rem. Normal is around .2
|
|
23
|
+
let oneRemInPx = 0;
|
|
24
|
+
let extension = 0;
|
|
25
|
+
|
|
26
|
+
// Helpers
|
|
27
|
+
const generateRandomHex = (length) => {
|
|
28
|
+
let result = '';
|
|
29
|
+
const characters = 'ABCDEF1234567890';
|
|
30
|
+
const charactersLength = characters.length;
|
|
31
|
+
for (let i = 0; i < length; i++) {
|
|
32
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const drawPolygon = (context, points) => {
|
|
38
|
+
context.beginPath();
|
|
39
|
+
context.moveTo(points[0].x, points[0].y);
|
|
40
|
+
for (let i = 1; i < points.length; i++) {
|
|
41
|
+
context.lineTo(points[i].x, points[i].y);
|
|
42
|
+
}
|
|
43
|
+
context.lineTo(points[0].x, points[0].y);
|
|
44
|
+
context.fill();
|
|
45
|
+
context.stroke();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// const drawPoint = (context, x, y) => {
|
|
49
|
+
// if (!context.fillStyle) {
|
|
50
|
+
// context.fillStyle = "#61bdaa";
|
|
51
|
+
// }
|
|
52
|
+
// context.fillRect(x - 1.5, y - 1.5, 3, 3);
|
|
53
|
+
// };
|
|
54
|
+
|
|
55
|
+
const jauntTarget = (target) => {
|
|
56
|
+
if (!target.firstChild || target.firstChild.nodeType !== Node.TEXT_NODE) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Create a unique ID to link this element with the canvas background
|
|
61
|
+
if (!target.dataset.backgroundCanvasId) {
|
|
62
|
+
target.dataset.backgroundCanvasId = generateRandomHex(12);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Clean up any existing jauntiness
|
|
66
|
+
const existingCanvas = document.getElementById(
|
|
67
|
+
target.dataset.backgroundCanvasId
|
|
68
|
+
);
|
|
69
|
+
if (existingCanvas) {
|
|
70
|
+
existingCanvas.remove();
|
|
71
|
+
}
|
|
72
|
+
const previousTransform = getComputedStyle(target).transform;
|
|
73
|
+
target.style.transition = 'none';
|
|
74
|
+
target.style.transform = null;
|
|
75
|
+
|
|
76
|
+
// Set up the parameters
|
|
77
|
+
const jauntFactor = parseFloat(target.dataset.jauntFactor);
|
|
78
|
+
extension = BACKGROUND_EXTENSION * oneRemInPx * jauntFactor;
|
|
79
|
+
// jauntSeed is stored on page so remains constant when resizing or hovering
|
|
80
|
+
const jauntSeed = target.dataset.jauntSeed ? target.dataset.jauntSeed : generateRandomHex(4 * 8);
|
|
81
|
+
target.dataset.jauntSeed = jauntSeed;
|
|
82
|
+
|
|
83
|
+
// Figure out the bounding boxes
|
|
84
|
+
|
|
85
|
+
// Collapse whitespace
|
|
86
|
+
target.textContent = target.textContent.replace(/\s+/g, ' ').trim();
|
|
87
|
+
|
|
88
|
+
// Get the individual lines as rendered on screen
|
|
89
|
+
const { textContent } = target.firstChild;
|
|
90
|
+
const range = document.createRange();
|
|
91
|
+
range.setStart(target.firstChild, 0);
|
|
92
|
+
range.setEnd(target.firstChild, textContent.length);
|
|
93
|
+
|
|
94
|
+
// Get the bounding boxes
|
|
95
|
+
const targetBox = target.getBoundingClientRect();
|
|
96
|
+
const parentBox = target.offsetParent ? target.offsetParent.getBoundingClientRect() : targetBox;
|
|
97
|
+
const outerBox = range.getBoundingClientRect();
|
|
98
|
+
const boxes = Array.from(range.getClientRects());
|
|
99
|
+
|
|
100
|
+
// Insert the new 2D canvas element
|
|
101
|
+
const canvas = document.createElement('canvas');
|
|
102
|
+
canvas.id = target.dataset.backgroundCanvasId;
|
|
103
|
+
target.parentNode.insertBefore(canvas, target);
|
|
104
|
+
canvas.style.position = 'absolute';
|
|
105
|
+
canvas.style.zIndex = -1;
|
|
106
|
+
canvas.style.top = `${(targetBox.top - parentBox.top) - 2 * extension}px`;
|
|
107
|
+
canvas.style.left = `${(targetBox.left - parentBox.left) - 2 * extension}px`;
|
|
108
|
+
canvas.style.width = `${targetBox.width + 4 * extension}px`;
|
|
109
|
+
canvas.style.height = `${targetBox.height + 4 * extension}px`;
|
|
110
|
+
canvas.width = targetBox.width + 4 * extension;
|
|
111
|
+
canvas.height = targetBox.height + 4 * extension;
|
|
112
|
+
canvas.style.pointerEvents = 'none';
|
|
113
|
+
|
|
114
|
+
// Draw the background boxes
|
|
115
|
+
const context = canvas.getContext('2d');
|
|
116
|
+
|
|
117
|
+
// set the background color and remove and existing background
|
|
118
|
+
target.style.backgroundColor = null;
|
|
119
|
+
target.style.borderColor = null;
|
|
120
|
+
context.fillStyle = getComputedStyle(target).backgroundColor;
|
|
121
|
+
if (!context.fillStyle) {
|
|
122
|
+
context.fillStyle = '#61bdaa';
|
|
123
|
+
}
|
|
124
|
+
context.strokeStyle = getComputedStyle(target).borderColor;
|
|
125
|
+
target.style.backgroundColor = 'transparent';
|
|
126
|
+
target.style.borderColor = 'transparent';
|
|
127
|
+
|
|
128
|
+
const leftShift = getComputedStyle(target).textAlign === 'center'
|
|
129
|
+
? (targetBox.width - outerBox.width) / 2 - extension
|
|
130
|
+
: 0;
|
|
131
|
+
boxes.forEach((lineBox, i) => {
|
|
132
|
+
const points = [];
|
|
133
|
+
|
|
134
|
+
points.push({
|
|
135
|
+
// Top left
|
|
136
|
+
x: leftShift + lineBox.left - outerBox.left + 2 * extension,
|
|
137
|
+
y: lineBox.top - outerBox.top + 2 * extension,
|
|
138
|
+
});
|
|
139
|
+
points.push({
|
|
140
|
+
// Top right
|
|
141
|
+
x: points[0].x + lineBox.width + 2 * extension,
|
|
142
|
+
y: points[0].y,
|
|
143
|
+
});
|
|
144
|
+
points.push({
|
|
145
|
+
// Bottom right
|
|
146
|
+
x: points[0].x + lineBox.width + 2 * extension,
|
|
147
|
+
y: points[0].y + lineBox.height + 2 * extension,
|
|
148
|
+
});
|
|
149
|
+
points.push({
|
|
150
|
+
// Bottom left
|
|
151
|
+
x: points[0].x,
|
|
152
|
+
y: points[0].y + lineBox.height + 2 * extension,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// context.fillRect(
|
|
156
|
+
// lineBox.left - outerBox.left + 2 * extension,
|
|
157
|
+
// lineBox.top - outerBox.top + 2 * extension,
|
|
158
|
+
// lineBox.width + 2 * extension,
|
|
159
|
+
// lineBox.height + 2 * extension,
|
|
160
|
+
// );
|
|
161
|
+
|
|
162
|
+
// Jiggle them points around
|
|
163
|
+
const boxSeed = jauntSeed.substring(i) + jauntSeed.substring(0, i);
|
|
164
|
+
const seedLength = boxSeed.length;
|
|
165
|
+
const pointSeedLength = seedLength / points.length;
|
|
166
|
+
points.forEach((point, index) => {
|
|
167
|
+
const startPoint = index * pointSeedLength;
|
|
168
|
+
const endPointX = startPoint + (pointSeedLength / 2);
|
|
169
|
+
const endPointY = startPoint + pointSeedLength;
|
|
170
|
+
const middle = pointSeedLength / 2 + 1;
|
|
171
|
+
let xRandom = boxSeed.substring(startPoint, endPointX);
|
|
172
|
+
let yRandom = boxSeed.substring(endPointX, endPointY);
|
|
173
|
+
xRandom = Number(`0x${xRandom}`);
|
|
174
|
+
yRandom = Number(`0x${yRandom}`);
|
|
175
|
+
xRandom /= 10 ** middle;
|
|
176
|
+
yRandom /= 10 ** middle;
|
|
177
|
+
points[index] = {
|
|
178
|
+
x:
|
|
179
|
+
point.x
|
|
180
|
+
+ (xRandom * 2 - 1)
|
|
181
|
+
* oneRemInPx
|
|
182
|
+
* CORNER_JIGGLE_MAX
|
|
183
|
+
* jauntFactor,
|
|
184
|
+
y:
|
|
185
|
+
point.y
|
|
186
|
+
+ (yRandom * 2 - 1)
|
|
187
|
+
* oneRemInPx
|
|
188
|
+
* CORNER_JIGGLE_MAX
|
|
189
|
+
* jauntFactor,
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// points.forEach((point) => {
|
|
194
|
+
// drawPoint(context, point.x, point.y);
|
|
195
|
+
// });
|
|
196
|
+
|
|
197
|
+
drawPolygon(context, points);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
target.style.transform = previousTransform;
|
|
201
|
+
target.style.transition = null;
|
|
202
|
+
|
|
203
|
+
// Add rotation
|
|
204
|
+
const middle = jauntSeed.length / 2 + 1;
|
|
205
|
+
let rotationSeed = jauntSeed.substring(1, middle);
|
|
206
|
+
rotationSeed = Number(`0x${jauntSeed}`);
|
|
207
|
+
rotationSeed /= 10 ** (`${rotationSeed}`).length;
|
|
208
|
+
const rotationFactor = ROTATION_MAX_DEGREES * jauntFactor
|
|
209
|
+
* (rotationSeed * 2 - 1); // -1 to +1
|
|
210
|
+
target.style.transform = `rotate(${rotationFactor}deg)`;
|
|
211
|
+
canvas.style.transform = `rotate(${rotationFactor}deg)`;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// The main event
|
|
215
|
+
const createBackground = () => {
|
|
216
|
+
oneRemInPx = parseFloat(
|
|
217
|
+
getComputedStyle(document.documentElement).fontSize
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const targets = document.querySelectorAll('[data-jaunt-factor]');
|
|
221
|
+
|
|
222
|
+
// Insert some jaunt
|
|
223
|
+
targets.forEach((target) => {
|
|
224
|
+
jauntTarget(target);
|
|
225
|
+
[
|
|
226
|
+
'mouseenter',
|
|
227
|
+
'mouseleave',
|
|
228
|
+
'focus',
|
|
229
|
+
].forEach((action) => {
|
|
230
|
+
target.addEventListener(action, (e) => {
|
|
231
|
+
jauntTarget(e.target);
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const init = () => {
|
|
238
|
+
createBackground();
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// Go time
|
|
242
|
+
document.addEventListener('DOMContentLoaded', init);
|
|
243
|
+
document.addEventListener('load', init);
|
|
244
|
+
window.addEventListener('resize', createBackground);
|
|
245
|
+
window.runJaunt = init;
|
|
246
|
+
})();
|
|
@@ -19,21 +19,18 @@ The Friends of the Earth blockquotes use the secondary font
|
|
|
19
19
|
@import '../../utils/scss/loader';
|
|
20
20
|
|
|
21
21
|
blockquote {
|
|
22
|
-
|
|
23
|
-
border-style: double;
|
|
24
|
-
border-width: .2em 0;
|
|
25
|
-
padding: $spacer*1.5 0;
|
|
22
|
+
padding: $spacer * 1.5 0;
|
|
26
23
|
width: 80%;
|
|
27
|
-
margin: $spacer*2 auto;
|
|
24
|
+
margin: ($spacer * 2) auto;
|
|
28
25
|
float: none;
|
|
29
26
|
clear: both;
|
|
30
27
|
|
|
31
28
|
p {
|
|
32
29
|
font-family: $font-family-serif;
|
|
33
|
-
font-weight:
|
|
30
|
+
font-weight: normal;
|
|
34
31
|
font-size: $blockquote-font-size;
|
|
35
32
|
line-height: $blockquote-font-size * 1.35;
|
|
36
|
-
color: $foe-
|
|
33
|
+
color: $foe-extradark;
|
|
37
34
|
|
|
38
35
|
@include media-breakpoint-down(sm) {
|
|
39
36
|
font-size: strip-units($blockquote-font-size) * $font-size-sm;
|
|
@@ -54,8 +51,6 @@ blockquote {
|
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
@include media-breakpoint-up(sm) {
|
|
57
|
-
width: calc(100% * 4 / 6);
|
|
58
|
-
|
|
59
54
|
// NOTE: The width, margin-left, and margin-right values below are
|
|
60
55
|
// over-ridden for sanity within CKEditor contexts.
|
|
61
56
|
&.left {
|
|
@@ -63,6 +58,7 @@ blockquote {
|
|
|
63
58
|
clear: left;
|
|
64
59
|
margin-left: calc(-100% / 6);
|
|
65
60
|
margin-right: 2em;
|
|
61
|
+
width: calc(100% * 4 / 6);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
&.right {
|
|
@@ -70,29 +66,27 @@ blockquote {
|
|
|
70
66
|
clear: right;
|
|
71
67
|
margin-left: 2em;
|
|
72
68
|
margin-right: calc(-100% / 6);
|
|
69
|
+
width: calc(100% * 4 / 6);
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
cite,
|
|
77
74
|
& + .citation {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
font-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
width: 80%;
|
|
76
|
+
margin: auto;
|
|
77
|
+
font-family: $font-family-serif;
|
|
78
|
+
font-size: $blockquote-font-size;
|
|
79
|
+
line-height: $spacer * 2;
|
|
80
|
+
font-weight: bold;
|
|
81
|
+
color: $foe-extradark;
|
|
84
82
|
display: block;
|
|
85
|
-
text-align:
|
|
86
|
-
margin-top:
|
|
87
|
-
padding-left: 10%;
|
|
88
|
-
|
|
89
|
-
&::before {
|
|
90
|
-
content: "\2014\00A0\00A0";
|
|
91
|
-
color: $foe-primary;
|
|
92
|
-
}
|
|
83
|
+
text-align: left;
|
|
84
|
+
margin-top: $spacer;
|
|
93
85
|
}
|
|
94
86
|
|
|
95
87
|
& + .citation {
|
|
96
|
-
margin-top: $spacer * -
|
|
88
|
+
margin-top: $spacer * -2.5;
|
|
89
|
+
margin-bottom: $spacer * 2;
|
|
90
|
+
text-align: center;
|
|
97
91
|
}
|
|
98
92
|
}
|
|
@@ -20,8 +20,8 @@ Our type system is comprised of two fonts:
|
|
|
20
20
|
To use them on your CSS please import the webfonts through Google Fonts
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;1,400;1,700&display=swap');
|
|
23
|
+
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&display=swap');
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
*/
|
|
27
|
-
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;1,400;1,700&display=swap');
|
|
27
|
+
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&display=swap');
|
package/src/fonts.js
CHANGED
|
@@ -32,6 +32,7 @@ To use them on your CSS please import the webfonts through Google Fonts
|
|
|
32
32
|
// Note, single line deep imports are needed here, for some reason fontawesome messes up
|
|
33
33
|
// with normal imports and webpack ends up bundling the whole library (1.25mb!)
|
|
34
34
|
import { library, dom } from '@fortawesome/fontawesome-svg-core';
|
|
35
|
+
|
|
35
36
|
import { faEnvelope } from '@fortawesome/free-solid-svg-icons/faEnvelope';
|
|
36
37
|
import { faSearch } from '@fortawesome/free-solid-svg-icons/faSearch';
|
|
37
38
|
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
@@ -40,19 +41,6 @@ import { faExternalLinkSquareAlt } from '@fortawesome/free-solid-svg-icons/faExt
|
|
|
40
41
|
import { faArrowAltCircleUp } from '@fortawesome/free-solid-svg-icons/faArrowAltCircleUp';
|
|
41
42
|
import { faShare } from '@fortawesome/free-solid-svg-icons/faShare';
|
|
42
43
|
import { faLink } from '@fortawesome/free-solid-svg-icons/faLink';
|
|
43
|
-
import { faTwitter } from '@fortawesome/free-brands-svg-icons/faTwitter';
|
|
44
|
-
import { faFacebook } from '@fortawesome/free-brands-svg-icons/faFacebook';
|
|
45
|
-
import { faFacebookF } from '@fortawesome/free-brands-svg-icons/faFacebookF';
|
|
46
|
-
import { faPinterest } from '@fortawesome/free-brands-svg-icons/faPinterest';
|
|
47
|
-
import { faLinkedin } from '@fortawesome/free-brands-svg-icons/faLinkedin';
|
|
48
|
-
import { faInstagram } from '@fortawesome/free-brands-svg-icons/faInstagram';
|
|
49
|
-
import { faYoutube } from '@fortawesome/free-brands-svg-icons/faYoutube';
|
|
50
|
-
import { faTumblr } from '@fortawesome/free-brands-svg-icons/faTumblr';
|
|
51
|
-
import { faWhatsapp } from '@fortawesome/free-brands-svg-icons/faWhatsapp';
|
|
52
|
-
import { faFacebookMessenger } from '@fortawesome/free-brands-svg-icons/faFacebookMessenger';
|
|
53
|
-
import { faTelegram } from '@fortawesome/free-brands-svg-icons/faTelegram';
|
|
54
|
-
import { faTelegramPlane } from '@fortawesome/free-brands-svg-icons/faTelegramPlane';
|
|
55
|
-
import { faTiktok } from '@fortawesome/free-brands-svg-icons/faTiktok';
|
|
56
44
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
57
45
|
import { faChevronUp } from '@fortawesome/free-solid-svg-icons/faChevronUp';
|
|
58
46
|
import { faAngleDown } from '@fortawesome/free-solid-svg-icons/faAngleDown';
|
|
@@ -76,6 +64,23 @@ import { faSave } from '@fortawesome/free-solid-svg-icons/faSave';
|
|
|
76
64
|
import { faSignInAlt } from '@fortawesome/free-solid-svg-icons/faSignInAlt';
|
|
77
65
|
import { faTrashAlt } from '@fortawesome/free-solid-svg-icons/faTrashAlt';
|
|
78
66
|
|
|
67
|
+
import { faTwitter } from '@fortawesome/free-brands-svg-icons/faTwitter';
|
|
68
|
+
import { faXTwitter } from '@fortawesome/free-brands-svg-icons/faXTwitter';
|
|
69
|
+
import { faFacebook } from '@fortawesome/free-brands-svg-icons/faFacebook';
|
|
70
|
+
import { faFacebookF } from '@fortawesome/free-brands-svg-icons/faFacebookF';
|
|
71
|
+
import { faPinterest } from '@fortawesome/free-brands-svg-icons/faPinterest';
|
|
72
|
+
import { faLinkedin } from '@fortawesome/free-brands-svg-icons/faLinkedin';
|
|
73
|
+
import { faInstagram } from '@fortawesome/free-brands-svg-icons/faInstagram';
|
|
74
|
+
import { faYoutube } from '@fortawesome/free-brands-svg-icons/faYoutube';
|
|
75
|
+
import { faTumblr } from '@fortawesome/free-brands-svg-icons/faTumblr';
|
|
76
|
+
import { faWhatsapp } from '@fortawesome/free-brands-svg-icons/faWhatsapp';
|
|
77
|
+
import { faFacebookMessenger } from '@fortawesome/free-brands-svg-icons/faFacebookMessenger';
|
|
78
|
+
import { faTelegram } from '@fortawesome/free-brands-svg-icons/faTelegram';
|
|
79
|
+
import { faTelegramPlane } from '@fortawesome/free-brands-svg-icons/faTelegramPlane';
|
|
80
|
+
import { faTiktok } from '@fortawesome/free-brands-svg-icons/faTiktok';
|
|
81
|
+
import { faBluesky } from '@fortawesome/free-brands-svg-icons/faBluesky';
|
|
82
|
+
import { faThreads } from '@fortawesome/free-brands-svg-icons/faThreads';
|
|
83
|
+
|
|
79
84
|
|
|
80
85
|
// Add actually used FA icons
|
|
81
86
|
library.add(
|
|
@@ -88,6 +93,7 @@ library.add(
|
|
|
88
93
|
faShare,
|
|
89
94
|
faLink,
|
|
90
95
|
faTwitter,
|
|
96
|
+
faXTwitter,
|
|
91
97
|
faFacebook,
|
|
92
98
|
faFacebookF,
|
|
93
99
|
faPinterest,
|
|
@@ -121,20 +127,25 @@ library.add(
|
|
|
121
127
|
faSave,
|
|
122
128
|
faTrashAlt,
|
|
123
129
|
faCloudUploadAlt,
|
|
124
|
-
faSignInAlt
|
|
130
|
+
faSignInAlt,
|
|
131
|
+
faBluesky,
|
|
132
|
+
faThreads
|
|
125
133
|
);
|
|
126
134
|
|
|
127
135
|
// Look for Google fonts and append them if they are not there already
|
|
128
136
|
// We avoiding using @import url(); because the new URL has semicolons on it
|
|
129
137
|
// and it tremendously gets broken from some preprocessors.
|
|
130
138
|
|
|
131
|
-
const fonts = window.document.createElement('link');
|
|
132
139
|
// eslint-disable-next-line max-len
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
fonts.
|
|
137
|
-
|
|
140
|
+
const googleFontsHref = 'https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;1,400;1,700&display=swap';
|
|
141
|
+
const googleFontsLink = window.document.querySelector(`link[href="${googleFontsHref}"]`);
|
|
142
|
+
if (!googleFontsLink) {
|
|
143
|
+
const fonts = window.document.createElement('link');
|
|
144
|
+
fonts.setAttribute('rel', 'stylesheet');
|
|
145
|
+
fonts.setAttribute('crossorigin', 'anonymous');
|
|
146
|
+
fonts.setAttribute('href', googleFontsHref);
|
|
147
|
+
document.head.appendChild(fonts);
|
|
148
|
+
}
|
|
138
149
|
|
|
139
150
|
// Kicks off the process of finding <i> tags and replacing with <svg>
|
|
140
151
|
dom.watch();
|
package/src/main.js
CHANGED
|
@@ -19,6 +19,7 @@ import './components/tools/data-click-track';
|
|
|
19
19
|
import './components/tools/rubik-tracking';
|
|
20
20
|
import './components/tools/data-defer-src';
|
|
21
21
|
import './components/tools/stickystack';
|
|
22
|
+
import './components/tools/jaunty';
|
|
22
23
|
|
|
23
24
|
// Bootstrap helpers
|
|
24
25
|
import './components/layout/alerts.scss';
|
|
@@ -8,28 +8,44 @@
|
|
|
8
8
|
//
|
|
9
9
|
|
|
10
10
|
// Colours
|
|
11
|
-
$foe-
|
|
12
|
-
$foe-
|
|
13
|
-
$foe-
|
|
14
|
-
$foe-
|
|
15
|
-
|
|
16
|
-
$foe-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
$foe-
|
|
11
|
+
$foe-leaf: #61bdaa !default;
|
|
12
|
+
$foe-iris: #5a54a0 !default;
|
|
13
|
+
$foe-sunset: #ed6132 !default;
|
|
14
|
+
$foe-space: #1e234d !default;
|
|
15
|
+
$foe-ice: #f3f3f7 !default;
|
|
16
|
+
$foe-conch: #f1e2d4 !default;
|
|
17
|
+
|
|
18
|
+
// Tints, would prefer to do this algorithmically but it's useful to have the hex codes on hand to compare with figmas
|
|
19
|
+
$foe-leaf-75: #81cabb !default;
|
|
20
|
+
$foe-leaf-50: #c0e5dd !default;
|
|
21
|
+
$foe-leaf-25: #dff2ee !default;
|
|
22
|
+
$foe-sunset-75: #f1815b !default;
|
|
23
|
+
$foe-sunset-50: #f6b099 !default;
|
|
24
|
+
$foe-sunset-25: #fbdfd6 !default;
|
|
25
|
+
$foe-iris-75: #6d68a7 !default;
|
|
26
|
+
$foe-iris-50: #adaad0 !default;
|
|
27
|
+
$foe-iris-25: #deddec !default;
|
|
28
|
+
|
|
29
|
+
$foe-primary: $foe-leaf !default;
|
|
30
|
+
$foe-light: $foe-leaf-25 !default;
|
|
31
|
+
$foe-secondary: $foe-light !default;
|
|
32
|
+
$foe-dark: $foe-iris !default;
|
|
33
|
+
$foe-extradark: $foe-space !default;
|
|
34
|
+
|
|
35
|
+
$foe-white: #fff !default;
|
|
20
36
|
$foe-gray: #b1b8c0 !default;
|
|
21
|
-
$foe-accent:
|
|
22
|
-
$foe-offwhite:
|
|
37
|
+
$foe-accent: $foe-iris !default;
|
|
38
|
+
$foe-offwhite: $foe-ice !default;
|
|
23
39
|
|
|
24
40
|
$foe-success: #5cb85c !default;
|
|
25
41
|
$foe-info: #5bc0de !default;
|
|
26
42
|
$foe-warning: #f0ad4e !default;
|
|
27
43
|
$foe-danger: #d9534f !default;
|
|
28
44
|
|
|
29
|
-
$foe-text:
|
|
45
|
+
$foe-text: $foe-extradark !default;
|
|
30
46
|
|
|
31
|
-
$foe-donate:
|
|
32
|
-
$foe-donate-text: $foe-
|
|
47
|
+
$foe-donate: $foe-iris !default;
|
|
48
|
+
$foe-donate-text: $foe-ice !default;
|
|
33
49
|
|
|
34
50
|
$foe-join: #ffef1e !default;
|
|
35
51
|
$foe-join-text: $foe-text !default;
|
|
@@ -51,6 +67,11 @@ $foe-nav-shadow: 0 0 .5em .2em rgba(0, 0, 0, .25);
|
|
|
51
67
|
|
|
52
68
|
$foe-text-shadow: 0 0 .5rem $foe-tint-overlay-heavy !default;
|
|
53
69
|
|
|
70
|
+
$foe-backgrounds:
|
|
71
|
+
$foe-leaf-50,
|
|
72
|
+
$foe-sunset-50,
|
|
73
|
+
$foe-iris-50;
|
|
74
|
+
|
|
54
75
|
//
|
|
55
76
|
// Palettes vars, needed for Campaignion (mostly) maybe also D8
|
|
56
77
|
//
|
|
@@ -219,11 +240,11 @@ $theme-colors: map-merge(
|
|
|
219
240
|
$theme-color-interval: 8%;
|
|
220
241
|
|
|
221
242
|
// The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255.
|
|
222
|
-
$yiq-contrasted-threshold:
|
|
243
|
+
$yiq-contrasted-threshold: 142; // this works for a hover cover for text-dark over leaf - any higher and it uses text-light.
|
|
223
244
|
|
|
224
245
|
// Customize the light and dark text colors for use in our YIQ color contrast function.
|
|
225
|
-
$yiq-text-dark: $
|
|
226
|
-
$yiq-text-light: $
|
|
246
|
+
$yiq-text-dark: $foe-extradark;
|
|
247
|
+
$yiq-text-light: $foe-offwhite;
|
|
227
248
|
|
|
228
249
|
// Options
|
|
229
250
|
//
|
|
@@ -288,8 +309,8 @@ $body-color: $foe-text;
|
|
|
288
309
|
//
|
|
289
310
|
// Style anchor elements.
|
|
290
311
|
|
|
291
|
-
$link-color: theme-color("
|
|
292
|
-
$link-decoration:
|
|
312
|
+
$link-color: theme-color("accent");
|
|
313
|
+
$link-decoration: underline;
|
|
293
314
|
$link-hover-color: darken($link-color, 15%);
|
|
294
315
|
$link-hover-decoration: underline;
|
|
295
316
|
|
|
@@ -391,7 +412,7 @@ $line-height-sm: 1.5;
|
|
|
391
412
|
$border-width: 1px;
|
|
392
413
|
$border-color: $gray-300;
|
|
393
414
|
|
|
394
|
-
$border-radius: .1rem * 3;
|
|
415
|
+
$border-radius: 0; // .1rem * 3;
|
|
395
416
|
$border-radius-lg: .1rem * 4;
|
|
396
417
|
$border-radius-sm: .1rem * 2;
|
|
397
418
|
|
|
@@ -399,8 +420,8 @@ $box-shadow-sm: 0 .125rem .25rem rgba($black, .075);
|
|
|
399
420
|
$box-shadow: 0 .5rem 1rem rgba($black, .15);
|
|
400
421
|
$box-shadow-lg: 0 1rem 3rem rgba($black, .175);
|
|
401
422
|
|
|
402
|
-
$component-active-color: $
|
|
403
|
-
$component-active-bg: theme-color("
|
|
423
|
+
$component-active-color: $foe-extradark;
|
|
424
|
+
$component-active-bg: theme-color("primary");
|
|
404
425
|
|
|
405
426
|
$caret-width: .3em;
|
|
406
427
|
|
|
@@ -408,6 +429,12 @@ $transition-base: all .2s ease-in-out;
|
|
|
408
429
|
$transition-fade: opacity .15s linear;
|
|
409
430
|
$transition-collapse: height .35s ease;
|
|
410
431
|
|
|
432
|
+
$foe-element-default-focus-width: .125rem;
|
|
433
|
+
$foe-element-default-focus-color: $black;
|
|
434
|
+
|
|
435
|
+
$foe-element-default-outline: .125rem solid $white;
|
|
436
|
+
$foe-element-default-outline-offset: .125rem;
|
|
437
|
+
|
|
411
438
|
|
|
412
439
|
// Fonts
|
|
413
440
|
//
|
|
@@ -422,7 +449,8 @@ $font-family-base: $font-family-sans-serif;
|
|
|
422
449
|
|
|
423
450
|
$font-size-base: 1rem; // Assumes the browser default, typically `16px`
|
|
424
451
|
$font-size-lg: ($font-size-base * 1.25);
|
|
425
|
-
|
|
452
|
+
// #13222 increase small text to just above 12px as per footer design https://www.figma.com/design/gimnDUG8AGkZdwuLTSGdkK/Design-system-%E2%80%93-Meg?node-id=197-22&t=bFuYz1SRqubH1qkg-0
|
|
453
|
+
$font-size-sm: ($font-size-base * .8);
|
|
426
454
|
|
|
427
455
|
$font-weight-light: 300;
|
|
428
456
|
$font-weight-normal: 400;
|
|
@@ -432,9 +460,9 @@ $font-weight-heavy: 700;
|
|
|
432
460
|
$font-weight-base: $font-weight-normal;
|
|
433
461
|
$line-height-base: 1.5;
|
|
434
462
|
|
|
435
|
-
$h1-font-size: calc(
|
|
436
|
-
$h2-font-size: calc(
|
|
437
|
-
$h3-font-size: calc(
|
|
463
|
+
$h1-font-size: calc(60 / 16) * $font-size-base;
|
|
464
|
+
$h2-font-size: calc(40 / 16) * $font-size-base;
|
|
465
|
+
$h3-font-size: calc(32 / 16) * $font-size-base;
|
|
438
466
|
$h4-font-size: calc(26 / 16) * $font-size-base;
|
|
439
467
|
$h5-font-size: calc(20 / 16) * $font-size-base;
|
|
440
468
|
$h6-font-size: calc(16 / 16) * $font-size-base;
|
|
@@ -450,23 +478,23 @@ $headings-map: (
|
|
|
450
478
|
|
|
451
479
|
$headings-margin-bottom: calc($spacer / 2);
|
|
452
480
|
$headings-font-family: inherit;
|
|
453
|
-
$headings-font-weight:
|
|
481
|
+
$headings-font-weight: 900;
|
|
454
482
|
$headings-line-height: 1.2;
|
|
455
|
-
$headings-color: $foe-
|
|
483
|
+
$headings-color: $foe-accent;
|
|
456
484
|
|
|
457
485
|
$display1-size: calc(60 / 16) * $font-size-base;
|
|
458
486
|
$display2-size: calc(60 / 16) * $font-size-base;
|
|
459
487
|
$display3-size: 4.5rem;
|
|
460
488
|
$display4-size: 3.5rem;
|
|
461
489
|
|
|
462
|
-
$display1-weight:
|
|
490
|
+
$display1-weight: 900;
|
|
463
491
|
$display2-weight: 300;
|
|
464
492
|
$display3-weight: 300;
|
|
465
493
|
$display4-weight: 300;
|
|
466
494
|
$display-line-height: $headings-line-height;
|
|
467
495
|
|
|
468
|
-
$lead-font-size:
|
|
469
|
-
$lead-font-weight:
|
|
496
|
+
$lead-font-size: $font-size-base;
|
|
497
|
+
$lead-font-weight: bold;
|
|
470
498
|
|
|
471
499
|
$small-font-size: 80%;
|
|
472
500
|
|
|
@@ -528,9 +556,9 @@ $input-btn-padding-y: .5rem;
|
|
|
528
556
|
$input-btn-padding-x: .75rem;
|
|
529
557
|
$input-btn-line-height: $line-height-base;
|
|
530
558
|
|
|
531
|
-
$input-btn-focus-width:
|
|
532
|
-
$input-btn-focus-color:
|
|
533
|
-
$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;
|
|
559
|
+
$input-btn-focus-width: $foe-element-default-focus-width;
|
|
560
|
+
$input-btn-focus-color: $foe-element-default-focus-color;
|
|
561
|
+
$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color !important; //to override bootstrap default in button-variant mixin
|
|
534
562
|
|
|
535
563
|
$input-btn-padding-y-sm: .25rem;
|
|
536
564
|
$input-btn-padding-x-sm: .5rem;
|