maverick-wave-astro 1.13.0 → 1.15.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/README.md CHANGED
@@ -66,8 +66,8 @@ The toggles come from the MaverickWave script.
66
66
  ## Components
67
67
 
68
68
  - Frame: `Header`, `Footer` (social links and notes above a bar with copyright,
69
- credit and the legal `links`; `dark`, `compact`), `ThemeToggle`,
70
- `LanguageSwitch`, `Announcement`, `PromoBar`
69
+ the `FormatwerkeMark` for `credit` and the legal `links`; `dark`, `compact`),
70
+ `FormatwerkeMark`, `ThemeToggle`, `LanguageSwitch`, `Announcement`, `PromoBar`
71
71
  - Sections: `Hero` (`variant` start | fade), `SplitHero` (text beside a photo,
72
72
  no parallax), `Parallax` (a picture band between sections), `SectionHead`,
73
73
  `IconCard`, `ValueList`, `OpeningHours`, `Address`, `Accordion`, `Calendar`,
@@ -23,6 +23,8 @@ interface Props {
23
23
  always?: boolean;
24
24
  // At the bottom of its own frame instead of the window, e.g. a device.
25
25
  embedded?: boolean;
26
+ // Floats above the bottom edge as the counterpart to the header island.
27
+ island?: boolean;
26
28
  class?: string;
27
29
  }
28
30
 
@@ -46,6 +48,7 @@ const {
46
48
  items,
47
49
  always = false,
48
50
  embedded = false,
51
+ island = false,
49
52
  class: className,
50
53
  } = Astro.props;
51
54
  ---
@@ -55,6 +58,7 @@ const {
55
58
  'mw-action-bar',
56
59
  always && 'mw-action-bar-always',
57
60
  embedded && 'mw-action-bar-embedded',
61
+ island && 'mw-action-bar-island',
58
62
  className,
59
63
  ]}
60
64
  aria-label={label}
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { config } from '../dist/config.js';
7
7
  import { linkTo, withBase } from '../dist/path.js';
8
+ import FormatwerkeMark from './FormatwerkeMark.astro';
8
9
  import SocialLinks, { type SocialLink } from './SocialLinks.astro';
9
10
 
10
11
  interface Props {
@@ -38,7 +39,7 @@ interface Props {
38
39
  links?: readonly { label: string; href: string }[];
39
40
  owner: string;
40
41
  ownerHref?: string;
41
- // "umgesetzt von" - without it the link to formatwerke is left out.
42
+ // "ein Format von" - without it the formatwerke mark is left out.
42
43
  credit?: string;
43
44
  lastUpdated?: { label: string; date: string };
44
45
  // The dark bookend of the header bar, in both themes.
@@ -189,21 +190,6 @@ const frame = container
189
190
  ) : (
190
191
  owner
191
192
  )
192
- }{
193
- credit && (
194
- <>
195
- {' '}
196
- &middot; {credit}{' '}
197
- <a
198
- href="https://formatwerke.de"
199
- target="_blank"
200
- rel="noopener noreferrer"
201
- class="mw-link"
202
- >
203
- formatwerke
204
- </a>
205
- </>
206
- )
207
193
  }
208
194
  </p>
209
195
  {
@@ -215,6 +201,8 @@ const frame = container
215
201
  }
216
202
  </div>
217
203
 
204
+ {credit && <FormatwerkeMark label={credit} />}
205
+
218
206
  {
219
207
  legalLinks.length > 0 && (
220
208
  <nav aria-label={linksLabel}>
@@ -0,0 +1,88 @@
1
+ ---
2
+ // formatwerke's maker's mark under a customer site: the signet, whose three
3
+ // bars - the formats - are set in the site's colours.
4
+
5
+ import '../styles/formatwerke-mark.css';
6
+
7
+ import { config } from '../dist/config.js';
8
+
9
+ interface Props {
10
+ // "ein Format von", followed by the name
11
+ label?: string;
12
+ }
13
+
14
+ const german = config.site.lang.startsWith('de');
15
+ const { label = german ? 'ein Format von' : 'a format by' } = Astro.props;
16
+ ---
17
+
18
+ <a
19
+ class="mwa-fw-mark"
20
+ href="https://formatwerke.de"
21
+ target="_blank"
22
+ rel="noopener noreferrer"
23
+ >
24
+ <svg
25
+ class="mwa-fw-mark-signet"
26
+ viewBox="-6 -6 212 212"
27
+ aria-hidden="true"
28
+ focusable="false"
29
+ >
30
+ <path
31
+ class="mwa-fw-mark-frame"
32
+ d="M12.63,2.63L141.37,2.63C172.091,2.63 197.37,27.909 197.37,58.63L197.37,187.37C197.37,192.856 192.856,197.37 187.37,197.37L58.63,197.37C27.909,197.37 2.63,172.091 2.63,141.37L2.63,12.63C2.63,7.144 7.144,2.63 12.63,2.63Z"
33
+ ></path>
34
+ <path
35
+ class="mwa-fw-mark-arc"
36
+ d="M100.365,197.37L58.63,197.37C27.909,197.37 2.63,172.091 2.63,141.37L2.63,117.611"
37
+ ></path>
38
+ <path
39
+ class="mwa-fw-mark-arc"
40
+ transform="rotate(180 100 100)"
41
+ d="M100.365,197.37L58.63,197.37C27.909,197.37 2.63,172.091 2.63,141.37L2.63,117.611"
42
+ ></path>
43
+ <g transform="translate(0 -4.2)">
44
+ <path
45
+ class="mwa-fw-mark-bar"
46
+ d="M28.5,74.66L165.19,74.66C169.804,74.66 173.6,78.456 173.6,83.07L173.6,97.82C173.6,98.972 172.652,99.92 171.5,99.92L34.81,99.92C30.196,99.92 26.4,96.124 26.4,91.51L26.4,76.76C26.4,75.608 27.348,74.66 28.5,74.66Z"
47
+ ></path>
48
+ <path
49
+ class="mwa-fw-mark-bar"
50
+ d="M28.5,111.5L100.42,111.5C105.034,111.5 108.83,115.296 108.83,119.91L108.83,134.66C108.83,135.812 107.882,136.76 106.73,136.76L34.81,136.76C30.196,136.76 26.4,132.964 26.4,128.35L26.4,113.6C26.4,112.448 27.348,111.5 28.5,111.5Z"
51
+ ></path>
52
+ <path
53
+ class="mwa-fw-mark-bar"
54
+ d="M28.5,148.34L135.75,148.34C140.364,148.34 144.16,152.136 144.16,156.75L144.16,171.5C144.16,172.652 143.212,173.6 142.06,173.6L34.81,173.6C30.196,173.6 26.4,169.804 26.4,165.19L26.4,150.44C26.4,149.288 27.348,148.34 28.5,148.34Z"
55
+ ></path>
56
+ </g>
57
+ </svg>
58
+ <span>{label} <span class="mwa-fw-mark-name">formatwerke</span></span>
59
+ </a>
60
+
61
+ <script>
62
+ // A mark below the fold waits with its bars unset, so they are set in view.
63
+ // One already on screen stays as it is - unsetting it would make it blink.
64
+ if (
65
+ 'IntersectionObserver' in window &&
66
+ !matchMedia('(prefers-reduced-motion: reduce)').matches
67
+ ) {
68
+ const seen = new IntersectionObserver(
69
+ entries => {
70
+ for (const entry of entries) {
71
+ if (!entry.isIntersecting) continue;
72
+ entry.target.classList.replace(
73
+ 'mwa-fw-mark-waiting',
74
+ 'mwa-fw-mark-in'
75
+ );
76
+ seen.unobserve(entry.target);
77
+ }
78
+ },
79
+ { threshold: 0.6 }
80
+ );
81
+
82
+ for (const mark of document.querySelectorAll('.mwa-fw-mark')) {
83
+ if (mark.getBoundingClientRect().top < innerHeight) continue;
84
+ mark.classList.add('mwa-fw-mark-waiting');
85
+ seen.observe(mark);
86
+ }
87
+ }
88
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maverick-wave-astro",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "Shared frame for static Astro homepages built with MaverickWave: layout, SEO, design variants, schedule, building blocks.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "peerDependencies": {
54
54
  "astro": "^7.2.0",
55
- "maverick-wave": "^6.7.0"
55
+ "maverick-wave": "^6.12.0"
56
56
  },
57
57
  "dependencies": {
58
58
  "@astrojs/sitemap": "^3.7.3",
@@ -67,7 +67,7 @@
67
67
  "eslint-plugin-astro": "^1.5.0",
68
68
  "eslint-plugin-simple-import-sort": "^12.1.1",
69
69
  "globals": "^16.5.0",
70
- "maverick-wave": "^6.7.0",
70
+ "maverick-wave": "^6.12.0",
71
71
  "prettier": "^3.6.2",
72
72
  "prettier-plugin-astro": "^0.14.1",
73
73
  "typescript": "^6.0.3",
@@ -0,0 +1,131 @@
1
+ /* At rest the signet carries the site's own colours, on hover it turns into
2
+ formatwerke - where the click leads. */
3
+ .mwa-fw-mark {
4
+ --mwa-fw-mark-ink: var(--mw-text-muted-color);
5
+ --mwa-fw-mark-name: var(--mw-primary-text-color);
6
+ --mwa-fw-mark-line: color-mix(in srgb, currentColor 28%, transparent);
7
+ --mwa-fw-mark-surface: transparent;
8
+ --mwa-fw-mark-frame: color-mix(in srgb, currentColor 40%, transparent);
9
+ --mwa-fw-mark-arc: var(--mw-primary-color);
10
+ --mwa-fw-mark-bar: var(--mw-secondary-color);
11
+ --mwa-fw-mark-bar-lead: var(--mw-primary-color);
12
+ --mwa-fw-mark-ease: var(--mw-ease-out, ease-out);
13
+ --mwa-fw-mark-fade: calc(350ms * var(--mw-motion-scale, 1));
14
+
15
+ display: inline-flex;
16
+ align-items: center;
17
+ gap: 0.5em;
18
+ padding: 0.2em 0.85em 0.2em 0.5em;
19
+ /* formatwerke's own corners, whatever shape the site gives its surfaces */
20
+ border: 1px solid var(--mwa-fw-mark-line);
21
+ border-radius: 4px 12px;
22
+ background: var(--mwa-fw-mark-surface);
23
+ color: var(--mwa-fw-mark-ink);
24
+ font-size: 0.9rem;
25
+ line-height: 1.2;
26
+ text-decoration: none;
27
+ white-space: nowrap;
28
+ transition:
29
+ background-color var(--mwa-fw-mark-fade) var(--mwa-fw-mark-ease),
30
+ border-color var(--mwa-fw-mark-fade) var(--mwa-fw-mark-ease),
31
+ color var(--mwa-fw-mark-fade) var(--mwa-fw-mark-ease);
32
+ }
33
+
34
+ .mwa-fw-mark:is(:hover, :focus-visible) {
35
+ --mwa-fw-mark-ink: #c9c9d1;
36
+ --mwa-fw-mark-name: #f5f5f6;
37
+ --mwa-fw-mark-line: #535357;
38
+ --mwa-fw-mark-surface: #26262b;
39
+ --mwa-fw-mark-frame: #535357;
40
+ --mwa-fw-mark-arc: #f5f5f6;
41
+ --mwa-fw-mark-bar: #a7a7b1;
42
+ --mwa-fw-mark-bar-lead: #f5f5f9;
43
+ }
44
+
45
+ .mwa-fw-mark:focus-visible {
46
+ outline: var(--mw-focus-ring-width, 2px) solid var(--mw-focus-ring-color);
47
+ outline-offset: var(--mw-focus-ring-offset, 2px);
48
+ }
49
+
50
+ .mwa-fw-mark-name {
51
+ color: var(--mwa-fw-mark-name);
52
+ font-weight: 600;
53
+ transition: color var(--mwa-fw-mark-fade) var(--mwa-fw-mark-ease);
54
+ }
55
+
56
+ .mwa-fw-mark-signet {
57
+ flex: none;
58
+ width: 1.5em;
59
+ height: 1.5em;
60
+ overflow: visible;
61
+ }
62
+
63
+ .mwa-fw-mark-frame,
64
+ .mwa-fw-mark-arc {
65
+ fill: none;
66
+ stroke-width: 12;
67
+ transition: stroke var(--mwa-fw-mark-fade) var(--mwa-fw-mark-ease);
68
+ }
69
+
70
+ .mwa-fw-mark-frame {
71
+ stroke: var(--mwa-fw-mark-frame);
72
+ }
73
+
74
+ .mwa-fw-mark-arc {
75
+ stroke: var(--mwa-fw-mark-arc);
76
+ stroke-linecap: round;
77
+ }
78
+
79
+ .mwa-fw-mark-bar {
80
+ --mwa-fw-mark-step: 0;
81
+
82
+ fill: var(--mwa-fw-mark-bar);
83
+ transform-box: fill-box;
84
+ transform-origin: left center;
85
+ transition: fill var(--mwa-fw-mark-fade) var(--mwa-fw-mark-ease);
86
+ }
87
+
88
+ .mwa-fw-mark-bar:nth-child(2) {
89
+ --mwa-fw-mark-step: 1;
90
+
91
+ fill: var(--mwa-fw-mark-bar-lead);
92
+ }
93
+
94
+ .mwa-fw-mark-bar:nth-child(3) {
95
+ --mwa-fw-mark-step: 2;
96
+ }
97
+
98
+ @media (prefers-reduced-motion: no-preference) {
99
+ .mwa-fw-mark-waiting:not(:hover, :focus-visible) .mwa-fw-mark-bar {
100
+ transform: scaleX(0);
101
+ }
102
+
103
+ .mwa-fw-mark-in .mwa-fw-mark-bar {
104
+ animation: mwa-fw-mark-set calc(600ms * var(--mw-motion-scale, 1))
105
+ var(--mwa-fw-mark-ease)
106
+ calc(var(--mwa-fw-mark-step) * 90ms * var(--mw-motion-scale, 1)) backwards;
107
+ }
108
+
109
+ .mwa-fw-mark:is(:hover, :focus-visible) .mwa-fw-mark-bar {
110
+ animation-name: mwa-fw-mark-reset;
111
+ animation-duration: calc(600ms * var(--mw-motion-scale, 1));
112
+ animation-timing-function: var(--mwa-fw-mark-ease);
113
+ animation-delay: calc(
114
+ var(--mwa-fw-mark-step) * 90ms * var(--mw-motion-scale, 1)
115
+ );
116
+ animation-fill-mode: backwards;
117
+ }
118
+ }
119
+
120
+ /* Two names for one move: switching the name is what restarts it on hover. */
121
+ @keyframes mwa-fw-mark-set {
122
+ from {
123
+ transform: scaleX(0);
124
+ }
125
+ }
126
+
127
+ @keyframes mwa-fw-mark-reset {
128
+ from {
129
+ transform: scaleX(0);
130
+ }
131
+ }