maverick-wave-astro 1.3.0 → 1.4.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.
@@ -0,0 +1,60 @@
1
+ ---
2
+ // One device frame drawn by the framework - a laptop or a phone - with a page
3
+ // on the glass: a full-page screenshot from public/, or the live page in an
4
+ // iframe laid out at the device's width and scaled to fit. Both frames
5
+ // together are Devices.
6
+ import { config } from '../dist/config.js';
7
+ import { publicImage } from '../dist/image-size.js';
8
+ import { linkTo } from '../dist/path.js';
9
+
10
+ interface Props {
11
+ kind: 'laptop' | 'phone';
12
+ // 1280px wide for the laptop, 390px for the phone, as tall as the page
13
+ image?: string;
14
+ alt?: string;
15
+ // The page itself instead of a picture
16
+ src?: string;
17
+ title?: string;
18
+ // As a button: a tap scrolls the screenshot to its end and back
19
+ tour?: boolean;
20
+ tourLabel?: string;
21
+ class?: string;
22
+ }
23
+
24
+ const german = config.site.lang.startsWith('de');
25
+
26
+ const {
27
+ kind,
28
+ image,
29
+ alt = '',
30
+ src,
31
+ title,
32
+ tour = false,
33
+ tourLabel = german ? 'Seite durchscrollen' : 'Scroll through the page',
34
+ class: className,
35
+ } = Astro.props;
36
+
37
+ // A live page scrolls by itself - the tour needs a picture to move
38
+ const button = tour && Boolean(image);
39
+ const Frame = button ? 'button' : 'div';
40
+ ---
41
+
42
+ <Frame
43
+ class:list={['mw-device', `mw-device-${kind}`, className]}
44
+ {...button ? { type: 'button', 'aria-label': tourLabel } : {}}
45
+ >
46
+ <span class="mw-device-screen">
47
+ {
48
+ image ? (
49
+ <img
50
+ {...publicImage(image)}
51
+ alt={alt}
52
+ loading="lazy"
53
+ decoding="async"
54
+ />
55
+ ) : (
56
+ src && <iframe src={linkTo(src)} title={title} loading="lazy" />
57
+ )
58
+ }
59
+ </span>
60
+ </Frame>
@@ -0,0 +1,29 @@
1
+ ---
2
+ // Laptop and phone together: the phone stands over the laptop's lower right
3
+ // corner, below it once the container gets narrow. Each screen takes what
4
+ // Device takes.
5
+ import Device from './Device.astro';
6
+
7
+ interface Screen {
8
+ image?: string;
9
+ alt?: string;
10
+ src?: string;
11
+ title?: string;
12
+ }
13
+
14
+ interface Props {
15
+ laptop: Screen;
16
+ phone: Screen;
17
+ // The phone scrolls its screenshot on a tap - only with an image on it
18
+ tour?: boolean;
19
+ tourLabel?: string;
20
+ class?: string;
21
+ }
22
+
23
+ const { laptop, phone, tour = true, tourLabel, class: className } = Astro.props;
24
+ ---
25
+
26
+ <div class:list={['mw-devices', className]}>
27
+ <Device kind="laptop" {...laptop} />
28
+ <Device kind="phone" {...phone} tour={tour} tourLabel={tourLabel} />
29
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maverick-wave-astro",
3
- "version": "1.3.0",
3
+ "version": "1.4.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",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "astro": "^7.2.0",
54
- "maverick-wave": "^5.37.0"
54
+ "maverick-wave": "^5.39.0"
55
55
  },
56
56
  "dependencies": {
57
57
  "@astrojs/sitemap": "^3.7.3",
@@ -66,7 +66,7 @@
66
66
  "eslint-plugin-astro": "^1.5.0",
67
67
  "eslint-plugin-simple-import-sort": "^12.1.1",
68
68
  "globals": "^16.5.0",
69
- "maverick-wave": "^5.37.0",
69
+ "maverick-wave": "^5.39.0",
70
70
  "prettier": "^3.6.2",
71
71
  "prettier-plugin-astro": "^0.14.1",
72
72
  "typescript": "^6.0.3",