@conduction/docusaurus-preset 1.4.2 → 1.5.0
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/package.json
CHANGED
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
* Each cta object also accepts `tone: "orange"` to flip the primary
|
|
38
38
|
* (or secondary) variant to the KNVB-orange accent. Reserved for
|
|
39
39
|
* product pages with an orange-leaning brand identity (mydash).
|
|
40
|
+
*
|
|
41
|
+
* `background="cobalt"` paints the hero in a full-bleed cobalt panel
|
|
42
|
+
* with white type — the product-page identity used on the
|
|
43
|
+
* {slug}.conduction.nl landings. Default (undefined) keeps the
|
|
44
|
+
* existing on-cream rendering used by the connext apps detail pages.
|
|
40
45
|
*/
|
|
41
46
|
|
|
42
47
|
import React from 'react';
|
|
@@ -61,12 +66,18 @@ export default function DetailHero({
|
|
|
61
66
|
className,
|
|
62
67
|
appId,
|
|
63
68
|
downloads,
|
|
69
|
+
background,
|
|
64
70
|
}) {
|
|
65
71
|
const dlCount = downloads != null ? downloads : (appId ? downloadsForApp(appId) : 0);
|
|
66
72
|
const hasIllustration = Boolean(illustration);
|
|
73
|
+
/* `background="cobalt"` flips the hero to a full-bleed cobalt panel
|
|
74
|
+
with white type — the product-page identity used on
|
|
75
|
+
{slug}.conduction.nl landings. Default (undefined) keeps the
|
|
76
|
+
existing on-cream rendering used by connext apps detail pages. */
|
|
77
|
+
const bgClass = background === 'cobalt' ? styles.bgCobalt : null;
|
|
67
78
|
|
|
68
79
|
return (
|
|
69
|
-
<section className={[styles.head, hasIllustration && styles.withIllustration, className].filter(Boolean).join(' ')}>
|
|
80
|
+
<section className={[styles.head, hasIllustration && styles.withIllustration, bgClass, className].filter(Boolean).join(' ')}>
|
|
70
81
|
{crumb && Array.isArray(crumb) && (
|
|
71
82
|
<div className={styles.crumb}>
|
|
72
83
|
{crumb.map((c, i) => {
|
|
@@ -8,8 +8,43 @@
|
|
|
8
8
|
margin: 0 auto;
|
|
9
9
|
padding: 24px 64px 56px;
|
|
10
10
|
font-family: var(--conduction-typography-font-family-body);
|
|
11
|
+
position: relative;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
/* Cobalt-background hero variant for product-page identity. The brand
|
|
15
|
+
panel sits full-bleed via a pseudo-element so the centred content
|
|
16
|
+
keeps its 1280px max-width. Text + crumb + badges flip to white /
|
|
17
|
+
cobalt-100 against the dark surface; the icon hex and the action
|
|
18
|
+
buttons carry their own colour via iconColor + Button tone. */
|
|
19
|
+
.bgCobalt {
|
|
20
|
+
padding-top: 56px;
|
|
21
|
+
padding-bottom: 64px;
|
|
22
|
+
color: white;
|
|
23
|
+
}
|
|
24
|
+
.bgCobalt::before {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
inset: 0;
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translateX(-50%);
|
|
30
|
+
width: 100vw;
|
|
31
|
+
background: var(--c-blue-cobalt);
|
|
32
|
+
z-index: -1;
|
|
33
|
+
}
|
|
34
|
+
.bgCobalt > * { position: relative; }
|
|
35
|
+
|
|
36
|
+
.bgCobalt .crumb,
|
|
37
|
+
.bgCobalt .crumb a { color: var(--c-cobalt-100); }
|
|
38
|
+
.bgCobalt .crumb a:hover { color: var(--c-orange-knvb); }
|
|
39
|
+
.bgCobalt .sep { color: var(--c-cobalt-300); }
|
|
40
|
+
.bgCobalt .badge { color: var(--c-cobalt-100); }
|
|
41
|
+
.bgCobalt .versionBadge { color: var(--c-cobalt-200); }
|
|
42
|
+
.bgCobalt .downloadsBadge { color: white; }
|
|
43
|
+
.bgCobalt .title,
|
|
44
|
+
.bgCobalt .titleText { color: white; }
|
|
45
|
+
.bgCobalt .tagline { color: var(--c-cobalt-100); }
|
|
46
|
+
.bgCobalt .tagline :global(.next-blue) { color: var(--c-nextcloud-cyan); }
|
|
47
|
+
|
|
13
48
|
.crumb {
|
|
14
49
|
font-family: var(--conduction-typography-font-family-code);
|
|
15
50
|
font-size: 12px;
|
|
@@ -129,15 +129,37 @@
|
|
|
129
129
|
/* Product pages opt out of the boat-sinking mini-game by setting
|
|
130
130
|
`themeConfig.minigames = false` in createConfig(); the Footer
|
|
131
131
|
swizzle then doesn't render the .game-hud / .game-over / boat
|
|
132
|
-
templates. The
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
templates. The static decoration (trapgevel skyline, drift speeds,
|
|
133
|
+
Conduction-house Maps link, drift-boat caches) is still wanted —
|
|
134
|
+
run those first so a no-game build doesn't ship an empty .skyline.
|
|
135
|
+
Then bail out before the game-only wiring rather than null-deref'ing
|
|
136
|
+
on the missing HUD / restart-button. The script's `resize` handler
|
|
137
|
+
re-runs buildSkyline() on viewport changes too, so the skyline
|
|
138
|
+
stays full when a viewer resizes the window. */
|
|
135
139
|
if (!hud || !goRestart || !goPanel) {
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
buildSkyline();
|
|
141
|
+
rollSpeeds();
|
|
142
|
+
wireConductionHouse();
|
|
143
|
+
captureDriftTemplates();
|
|
144
|
+
const onResizeNoGame = () => {
|
|
145
|
+
clearTimeout(window._canalNoGameResizeT);
|
|
146
|
+
window._canalNoGameResizeT = setTimeout(() => {
|
|
147
|
+
buildSkyline();
|
|
148
|
+
rollSpeeds();
|
|
149
|
+
wireConductionHouse();
|
|
150
|
+
}, 200);
|
|
151
|
+
};
|
|
152
|
+
window.addEventListener('resize', onResizeNoGame);
|
|
153
|
+
/* Mark hydrated and expose hydrate as a no-op (the IIFE's later
|
|
154
|
+
`window.CanalFooter.hydrate = init` already handles the SPA
|
|
155
|
+
re-mount path; we just need _cleanup to tear down the resize
|
|
156
|
+
listener so it doesn't leak across SPA navigations. */
|
|
138
157
|
window.CanalFooter = window.CanalFooter || {};
|
|
139
|
-
window.CanalFooter.hydrate
|
|
140
|
-
window.CanalFooter._cleanup =
|
|
158
|
+
window.CanalFooter.hydrate = window.CanalFooter.hydrate || function () {};
|
|
159
|
+
window.CanalFooter._cleanup = function () {
|
|
160
|
+
window.removeEventListener('resize', onResizeNoGame);
|
|
161
|
+
clearTimeout(window._canalNoGameResizeT);
|
|
162
|
+
};
|
|
141
163
|
return;
|
|
142
164
|
}
|
|
143
165
|
|