@dloizides/marketing-astro-kit 1.14.2 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.15.0
4
+
5
+ ### Added
6
+
7
+ - `openMotion` values `thrown-down` (drops in, lands, bounces once), `spins-in` (flies in turning one and a half times), `hex-assembles` (decorative hexagon tiles fly in from the photo, then the front sharpens in) and `rises-lit` (swings up on its bottom edge, tips past, settles). Each finishes by 1200 ms, plays only when motion is allowed and leaves Save contact untouched.
8
+ - `flipMotion` values `lift-turn` (lifts, turns past, settles), `toss-flip` (hops and spins one and a half turns) and `tumble` (end over end, lands on the same pose as the flat turn).
9
+
10
+ ### Changed
11
+
12
+ - Several opening beats on one part and property now play as one CSS animation with timed stops, so a later beat no longer overrides an earlier one while it waits.
13
+ - Save contact and the actions stack above the card (`position:relative;z-index:1`), so an opening that moves the card over them never covers or steals their taps.
14
+ - `tile-grows` and `turn-over` stay the defaults.
15
+
3
16
  ## 1.13.0
4
17
 
5
18
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dloizides/marketing-astro-kit",
3
- "version": "1.14.2",
3
+ "version": "1.15.0",
4
4
  "description": "Reusable, themeable Astro marketing sections for product sites — a Free-vs-Pro pricing comparison table, a trust / credibility section (security cards, customer-logo + testimonial placeholders, discreet built-by), a client-side \"try it\" demo shell, a meeting request form posting to a contact endpoint, and an SEO guides/content-hub card + frontmatter schema. Data-driven via a shared TypeScript schema; themed entirely through the host site's CSS custom properties.",
5
5
  "keywords": [
6
6
  "astro",
@@ -0,0 +1,6 @@
1
+ ---
2
+ import { HEX_TILE_COUNT } from './motion/hexTiles';
3
+
4
+ const tiles = Array.from({ length: HEX_TILE_COUNT }, (_, index) => index);
5
+ ---
6
+ <span class="tmk-card-hex-tiles" aria-hidden="true" data-part="hex-tiles">{tiles.map(() => <span class="tmk-card-hex"></span>)}</span>
@@ -2,6 +2,7 @@
2
2
  import CardActions from './CardActions.astro';
3
3
  import CardBack from './CardBack.astro';
4
4
  import CardFront from './CardFront.astro';
5
+ import CardHexTiles from './CardHexTiles.astro';
5
6
  import type { CardLink } from './cardLinks';
6
7
  import CardSave from './CardSave.astro';
7
8
  import CardTurn from './CardTurn.astro';
@@ -37,6 +38,7 @@ const onBack = motion.openMotion === OpenMotion.TileGrows && motion.openLands ==
37
38
  <CardFront person={person} portrait={portrait} links={links} contactsLabel={labels.contacts} faceLabel={frontLabel} hexLight={lights.hex} sweep={lights.sweep} hidden={onBack} />
38
39
  <CardBack brand={brand} markup={markup} animated={motion.openMotion !== OpenMotion.None} faceLabel={backLabel} sweep={lights.sweep} hidden={!onBack} />
39
40
  </div>
41
+ {motion.openMotion === OpenMotion.HexAssembles && <CardHexTiles />}
40
42
  {lights.edge && <span class="tmk-card-edge" aria-hidden="true" data-part="edge"><span data-part="edge-light"></span></span>}
41
43
  <CardTurn toBack={toBack} toFront={toFront} onBack={onBack} />
42
44
  </div>
@@ -2,4 +2,7 @@
2
2
  export const enum FlipMotion {
3
3
  None = 'none',
4
4
  TurnOver = 'turn-over',
5
+ LiftTurn = 'lift-turn',
6
+ TossFlip = 'toss-flip',
7
+ Tumble = 'tumble',
5
8
  }
@@ -1,4 +1,4 @@
1
- /** How the card opens after a scan; the last four grow, open, turn or rise into the two-sided card. */
1
+ /** How the card opens after a scan; from tile-grows on, each one brings in the two-sided card. */
2
2
  export const enum OpenMotion {
3
3
  None = 'none',
4
4
  MarkFirst = 'mark-first',
@@ -8,4 +8,8 @@ export const enum OpenMotion {
8
8
  MoonOpens = 'moon-opens',
9
9
  TurnsFaceUp = 'turns-face-up',
10
10
  PassRises = 'pass-rises',
11
+ ThrownDown = 'thrown-down',
12
+ SpinsIn = 'spins-in',
13
+ HexAssembles = 'hex-assembles',
14
+ RisesLit = 'rises-lit',
11
15
  }
@@ -22,6 +22,7 @@ const CHOICES: Readonly<Record<keyof ContactCardMotion, readonly string[]>> = {
22
22
  openMotion: [
23
23
  OpenMotion.None, OpenMotion.MarkFirst, OpenMotion.MarkLands, OpenMotion.WrittenIn,
24
24
  OpenMotion.TileGrows, OpenMotion.MoonOpens, OpenMotion.TurnsFaceUp, OpenMotion.PassRises,
25
+ OpenMotion.ThrownDown, OpenMotion.SpinsIn, OpenMotion.HexAssembles, OpenMotion.RisesLit,
25
26
  ],
26
27
  tiltMotion: [
27
28
  TiltMotion.None, TiltMotion.CardLeans, TiltMotion.PortraitLeans, TiltMotion.LayersDrift,
@@ -31,7 +32,7 @@ const CHOICES: Readonly<Record<keyof ContactCardMotion, readonly string[]>> = {
31
32
  saveMotion: [SaveMotion.None, SaveMotion.Tick, SaveMotion.LightCrosses, SaveMotion.CubeCloses],
32
33
  shareMode: [ShareMode.None, ShareMode.WhiteSheet, ShareMode.NightFrame, ShareMode.FaceAbove],
33
34
  openLands: [OpenLanding.TurnToFront, OpenLanding.Front, OpenLanding.Back],
34
- flipMotion: [FlipMotion.None, FlipMotion.TurnOver],
35
+ flipMotion: [FlipMotion.None, FlipMotion.TurnOver, FlipMotion.LiftTurn, FlipMotion.TossFlip, FlipMotion.Tumble],
35
36
  };
36
37
 
37
38
  /** The recommended motion, used for every setting the host leaves out. */
@@ -6,4 +6,6 @@ export const EASINGS: Readonly<Record<string, string>> = {
6
6
  turnOut: 'cubic-bezier(0.4,0,1,1)',
7
7
  turnIn: 'cubic-bezier(0,0,0.2,1)',
8
8
  swap: 'step-end',
9
+ fall: 'cubic-bezier(0.55,0,1,0.45)',
10
+ pass: 'cubic-bezier(0.18,1.15,0.32,1)',
9
11
  };
@@ -0,0 +1,94 @@
1
+ import { EASINGS } from './easings';
2
+ import { FlipMotion } from './FlipMotion';
3
+
4
+ const BACK_DEG = 180;
5
+ const EDGE_ON = 90;
6
+ const EDGE_STEP = 0.001;
7
+ const STEP_INDEX = 2;
8
+ const LIST = ',';
9
+
10
+ export interface FlipPlan {
11
+ flip: Keyframe[];
12
+ stage: Keyframe[] | null;
13
+ durationMs: number;
14
+ }
15
+
16
+ interface Turn {
17
+ degrees: number[];
18
+ ms: number[];
19
+ eases: string[];
20
+ }
21
+
22
+ interface Lift {
23
+ rise: string;
24
+ holdAt: number;
25
+ fallAt: number;
26
+ fallEase: string;
27
+ }
28
+
29
+ const numbers = (list: string): number[] => list.split(LIST).map(Number);
30
+ const ease = (name: string): string => EASINGS[name] ?? name;
31
+
32
+ /** Turns `degrees|ms|eases` (each a comma list) into a turn. */
33
+ function turnOf(spec: string): Turn {
34
+ const [degrees = '', ms = '', eases = ''] = spec.split('|');
35
+ return { degrees: numbers(degrees), ms: numbers(ms), eases: eases.split(LIST) };
36
+ }
37
+
38
+ const TURNS: Readonly<Record<string, string>> = {
39
+ [FlipMotion.TurnOver]: '0,90,180|280,280|turnOut,turnIn',
40
+ [FlipMotion.LiftTurn]: '0,90,194,180|210,250,220|turnOut,enter,settle',
41
+ [FlipMotion.TossFlip]: '0,90,180,270,360,450,540|85,90,95,100,110,140|turnOut,linear,linear,linear,linear,enter',
42
+ [FlipMotion.Tumble]: '0,90,190,180|220,240,200|turnOut,enter,settle',
43
+ };
44
+
45
+ const LIFTS: Readonly<Record<string, Lift>> = {
46
+ [FlipMotion.LiftTurn]: { rise: 'translateY(-10px) scale(1.08)', holdAt: 0.28, fallAt: 0.64, fallEase: 'pass' },
47
+ [FlipMotion.TossFlip]: { rise: 'translateY(-72px) scale(1.06)', holdAt: 0.38, fallAt: 0.38, fallEase: 'fall' },
48
+ };
49
+
50
+ function offsets(ms: readonly number[]): number[] {
51
+ const total = ms.reduce((sum, part) => sum + part, 0);
52
+ let at = 0;
53
+ return [0, ...ms.map((part) => { at += part; return at / total; })];
54
+ }
55
+
56
+ function turnFrames(from: number, way: number, turn: Turn, pose: (degrees: number, offset: number) => string): Keyframe[] {
57
+ const at = offsets(turn.ms);
58
+ return turn.degrees.map((delta, index) => ({
59
+ offset: at[index], transform: pose(from + way * delta, at[index] ?? 0), easing: ease(turn.eases[index] ?? 'linear'),
60
+ }));
61
+ }
62
+
63
+ function liftFrames(lift: Lift): Keyframe[] {
64
+ const rest = 'translateY(0px) scale(1)';
65
+ return [
66
+ { offset: 0, transform: rest, easing: ease('settle') },
67
+ { offset: lift.holdAt, transform: lift.rise },
68
+ { offset: lift.fallAt, transform: lift.rise, easing: ease(lift.fallEase) },
69
+ { offset: 1, transform: rest },
70
+ ];
71
+ }
72
+
73
+ function tumbleFrames(from: number, turn: Turn): Keyframe[] {
74
+ const edgeAt = offsets(turn.ms)[1] ?? 0;
75
+ const spin = (offset: number): number => from + (offset > edgeAt ? BACK_DEG : 0);
76
+ const frames = turnFrames(from, 1, turn, (degrees, offset) => `rotateX(${String(degrees)}deg) rotateZ(${String(spin(offset))}deg)`);
77
+ const step = { offset: edgeAt + EDGE_STEP, transform: `rotateX(${String(from + EDGE_ON)}deg) rotateZ(${String(from + BACK_DEG)}deg)`, easing: ease('enter') };
78
+ frames.splice(STEP_INDEX, 0, step);
79
+ frames[1] = { ...frames[1], easing: 'linear' };
80
+ return frames;
81
+ }
82
+
83
+ /** The keyframes of a turn toward the back (or the front), with the lift the bolder turns add. */
84
+ export function flipPlan(flipMotion: FlipMotion, onBack: boolean): FlipPlan {
85
+ const from = onBack ? 0 : BACK_DEG;
86
+ const turn = turnOf(TURNS[flipMotion] ?? TURNS[FlipMotion.TurnOver] ?? '');
87
+ const durationMs = turn.ms.reduce((sum, part) => sum + part, 0);
88
+ const lift = LIFTS[flipMotion];
89
+ const stage = lift === undefined ? null : liftFrames(lift);
90
+ if (flipMotion === FlipMotion.Tumble) return { flip: tumbleFrames(from, turn), stage, durationMs };
91
+ const way = flipMotion === FlipMotion.TurnOver && !onBack ? -1 : 1;
92
+ const flip = turnFrames(from, way, turn, (degrees) => `rotateY(${String(degrees)}deg)`);
93
+ return { flip, stage, durationMs };
94
+ }
@@ -0,0 +1,68 @@
1
+ import { EASINGS } from './easings';
2
+
3
+ const TILE_W = 64;
4
+ const TILE_H = 74;
5
+ const ROW_STEP = 55.5;
6
+ const COVER_W = 560;
7
+ const COVER_H = 520;
8
+ const FROM_X = 244;
9
+ const FROM_Y = 72;
10
+ const PULL = 0.9;
11
+ const TURN_SPREAD = 120;
12
+ const TURN_STEP = 47;
13
+ const FIRST_MS = 200;
14
+ const SPREAD_MS = 420;
15
+ const FLY_MS = 340;
16
+ const HALF = 2;
17
+ const NTH_BASE = 1;
18
+ const EDGE_PX = 1;
19
+
20
+ export interface HexTile {
21
+ left: number;
22
+ top: number;
23
+ dx: number;
24
+ dy: number;
25
+ turn: number;
26
+ atMs: number;
27
+ }
28
+
29
+ function gridCells(): { left: number; top: number }[] {
30
+ const cells: { left: number; top: number }[] = [];
31
+ for (let row = 0, top = -TILE_H / HALF; top < COVER_H; row += 1, top += ROW_STEP) {
32
+ for (let left = (row % HALF === 0 ? 0 : -TILE_W / HALF) - TILE_W / HALF; left < COVER_W; left += TILE_W) {
33
+ cells.push({ left: Math.round(left), top: Math.round(top) });
34
+ }
35
+ }
36
+ return cells;
37
+ }
38
+
39
+ /** The hexagon tiles that cover the largest card face, each flying in from the photo, nearest first. */
40
+ export function hexTiles(): HexTile[] {
41
+ const cells = gridCells().map((cell) => {
42
+ const x = cell.left + TILE_W / HALF - FROM_X;
43
+ const y = cell.top + TILE_H / HALF - FROM_Y;
44
+ return { ...cell, x, y, distance: Math.hypot(x, y) };
45
+ });
46
+ const farthest = Math.max(...cells.map((cell) => cell.distance));
47
+ return cells.map((cell, index) => ({
48
+ left: cell.left,
49
+ top: cell.top,
50
+ dx: Math.round(-cell.x * PULL),
51
+ dy: Math.round(-cell.y * PULL),
52
+ turn: ((index * TURN_STEP) % TURN_SPREAD) - TURN_SPREAD / HALF,
53
+ atMs: FIRST_MS + Math.round((cell.distance / farthest) * SPREAD_MS),
54
+ }));
55
+ }
56
+
57
+ /** How many tiles the hexagon opening draws. */
58
+ export const HEX_TILE_COUNT = hexTiles().length;
59
+
60
+ /** The tile places, flights and keyframes for the hexagon opening, scoped to the card. */
61
+ export function hexTilesCss(scope: string): string {
62
+ const tiles = hexTiles().map((tile, index) =>
63
+ `${scope} .tmk-card-hex:nth-child(${String(index + NTH_BASE)}){left:${String(tile.left)}px;top:${String(tile.top)}px;`
64
+ + `--tmk-hex-from:translate(${String(tile.dx)}px,${String(tile.dy)}px) rotate(${String(tile.turn)}deg);animation-delay:${String(tile.atMs)}ms}`);
65
+ const frames = '@keyframes tmk-card-hex-in{from{opacity:0;transform:var(--tmk-hex-from) scale(0.2)}35%{opacity:1}to{opacity:1;transform:none}}';
66
+ const shape = `${scope} .tmk-card-hex{width:${String(TILE_W + EDGE_PX)}px;height:${String(TILE_H + EDGE_PX)}px;animation:tmk-card-hex-in ${String(FLY_MS)}ms ${EASINGS['pass'] ?? 'ease-out'} backwards}`;
67
+ return frames + shape + tiles.join('');
68
+ }
@@ -1,9 +1,7 @@
1
- import { EASINGS } from './easings';
1
+ import { flipPlan } from './flipKeyframes';
2
2
  import { FlipMotion } from './FlipMotion';
3
3
 
4
- const TURN_MS = 560;
5
4
  const BACK_DEG = 180;
6
- const HALF = 2;
7
5
  const BACK = 'back';
8
6
  const CONTROLS = 'a,button,input,select,textarea';
9
7
 
@@ -32,29 +30,28 @@ function show(card: HTMLElement, faces: Faces, onBack: boolean): void {
32
30
  if (live !== null) live.textContent = (onBack ? faces.back : faces.front).getAttribute('aria-label') ?? '';
33
31
  }
34
32
 
35
- function turnKeyframes(onBack: boolean): Keyframe[] {
36
- const [from, to] = onBack ? [0, BACK_DEG] : [BACK_DEG, 0];
37
- return [
38
- { transform: `rotateY(${from}deg)`, easing: EASINGS['turnOut'] },
39
- { transform: `rotateY(${(from + to) / HALF}deg)`, easing: EASINGS['turnIn'] },
40
- { transform: `rotateY(${to}deg)` },
41
- ];
33
+ function play(card: HTMLElement, flip: HTMLElement, flipMotion: FlipMotion, onBack: boolean): Animation[] {
34
+ const plan = flipPlan(flipMotion, onBack);
35
+ const turned = flip.animate(plan.flip, { duration: plan.durationMs });
36
+ const stage = card.querySelector<HTMLElement>('[data-part="stage"]');
37
+ if (plan.stage === null || stage === null) return [turned];
38
+ return [turned, stage.animate(plan.stage, { duration: plan.durationMs })];
42
39
  }
43
40
 
44
41
  /** Turns the two-sided card on a tap outside its links, its turn button, Enter or Space; a tap mid-turn reverses it. */
45
42
  export function mountFlip(card: HTMLElement, flipMotion: FlipMotion, reduced: boolean, signal?: AbortSignal): void {
46
43
  const faces = findFaces(card);
47
44
  if (faces === null) return;
48
- let running: Animation | null = null;
45
+ let running: Animation[] = [];
49
46
  const turn = (): void => {
50
47
  const onBack = faces.flip.dataset['face'] !== BACK;
51
48
  show(card, faces, onBack);
52
49
  if (reduced || flipMotion === FlipMotion.None || typeof faces.flip.animate !== 'function') return;
53
- if (running?.playState === 'running') {
54
- running.reverse();
50
+ if (running[0]?.playState === 'running') {
51
+ running.forEach((animation) => animation.reverse());
55
52
  return;
56
53
  }
57
- running = faces.flip.animate(turnKeyframes(onBack), { duration: TURN_MS });
54
+ running = play(card, faces.flip, flipMotion, onBack);
58
55
  };
59
56
  faces.button.addEventListener('click', turn, { signal });
60
57
  card.querySelector('[data-part="stage"]')?.addEventListener('click', (event) => {
@@ -1,18 +1,59 @@
1
+ import type { Beat } from './beats';
2
+ import { hexTilesCss } from './hexTiles';
3
+ import { OpenMotion } from './OpenMotion';
1
4
  import { partSelector } from './parts';
2
5
  import { openingBeats } from './twoSidedBeats';
3
6
 
7
+ const PERCENT = 100;
8
+
9
+ interface Track {
10
+ selector: string;
11
+ beats: Beat[];
12
+ }
13
+
14
+ const percentOf = (atMs: number, startMs: number, lengthMs: number): string =>
15
+ `${String(Math.round(((atMs - startMs) / lengthMs) * PERCENT * PERCENT) / PERCENT)}%`;
16
+
17
+ function groupTracks(beats: readonly Beat[]): Track[] {
18
+ const tracks = new Map<string, Track>();
19
+ beats.forEach((beat) => {
20
+ const selector = partSelector(beat.part);
21
+ const key = `${selector}|${beat.property}`;
22
+ const track = tracks.get(key) ?? { selector, beats: [] };
23
+ track.beats.push(beat);
24
+ tracks.set(key, track);
25
+ });
26
+ return Array.from(tracks.values());
27
+ }
28
+
29
+ function trackFrames(beats: readonly Beat[], startMs: number, lengthMs: number): string {
30
+ return beats.map((beat) => {
31
+ const from = `${percentOf(beat.atMs, startMs, lengthMs)}{${beat.property}:${beat.from};animation-timing-function:${beat.easing}}`;
32
+ const to = `${percentOf(beat.atMs + beat.lengthMs, startMs, lengthMs)}{${beat.property}:${beat.to};animation-timing-function:linear}`;
33
+ return from + to;
34
+ }).join('');
35
+ }
36
+
4
37
  /** The opening as CSS animations scoped to the option, played only when motion is allowed; `''` for `none`. */
5
38
  export function buildOpenCss(openMotion: string, openLands?: string): string {
6
39
  const beats = openingBeats(openMotion, openLands);
7
40
  if (beats.length === 0) return '';
8
41
  const scope = `.tmk-card[data-open-motion="${openMotion}"]`;
9
- const byPart = new Map<string, string[]>();
10
- const frames = beats.map((beat, index) => {
11
- const name = `tmk-card-${openMotion}-${index}`;
12
- const selector = partSelector(beat.part);
13
- byPart.set(selector, [...(byPart.get(selector) ?? []), `${name} ${beat.lengthMs}ms ${beat.easing} ${beat.atMs}ms backwards`]);
14
- return `@keyframes ${name}{from{${beat.property}:${beat.from}}to{${beat.property}:${beat.to}}}`;
42
+ const bySelector = new Map<string, string[]>();
43
+ const frames: string[] = [];
44
+ groupTracks(beats).forEach((track) => {
45
+ const sorted = [...track.beats].sort((first, second) => first.atMs - second.atMs);
46
+ const startMs = sorted[0]?.atMs ?? 0;
47
+ const lengthMs = Math.max(...sorted.map((beat) => beat.atMs + beat.lengthMs)) - startMs;
48
+ const single = sorted.length === 1 ? sorted[0] : undefined;
49
+ const name = `tmk-card-${openMotion}-${String(frames.length)}`;
50
+ frames.push(single === undefined
51
+ ? `@keyframes ${name}{${trackFrames(sorted, startMs, lengthMs)}}`
52
+ : `@keyframes ${name}{from{${single.property}:${single.from}}to{${single.property}:${single.to}}}`);
53
+ const animation = `${name} ${String(lengthMs)}ms ${single?.easing ?? 'linear'} ${String(startMs)}ms backwards`;
54
+ bySelector.set(track.selector, [...(bySelector.get(track.selector) ?? []), animation]);
15
55
  });
16
- const rules = Array.from(byPart, ([selector, animations]) => `${scope} ${selector}{animation:${animations.join(',')}}`);
17
- return `@media (prefers-reduced-motion:no-preference){${frames.join('')}${rules.join('')}}`;
56
+ const rules = Array.from(bySelector, ([selector, animations]) => `${scope} ${selector}{animation:${animations.join(',')}}`);
57
+ const tiles = openMotion === String(OpenMotion.HexAssembles) ? hexTilesCss(scope) : '';
58
+ return `@media (prefers-reduced-motion:no-preference){${frames.join('')}${rules.join('')}${tiles}}`;
18
59
  }
@@ -4,6 +4,23 @@ import { OpenMotion } from './OpenMotion';
4
4
 
5
5
  const POP = 'cubic-bezier(0.34,1.4,0.64,1)';
6
6
  const TURN_TO_FRONT = 'flip|transform|rotateY(180deg)|rotateY(0deg)|700|500|settle';
7
+ const DROP = 'translateY(-30px) rotate(-7deg) scale(1.7)';
8
+ const LANDED = 'translateY(0px) rotate(0deg) scale(1)';
9
+ const BOUNCE = 'translateY(-9px) rotate(0deg) scale(1.012)';
10
+ const SPIN = [
11
+ 'flip|transform|rotateY(540deg)|rotateY(450deg)|150|90|linear',
12
+ 'flip|transform|rotateY(450deg)|rotateY(360deg)|240|95|linear',
13
+ 'flip|transform|rotateY(360deg)|rotateY(270deg)|335|105|linear',
14
+ 'flip|transform|rotateY(270deg)|rotateY(180deg)|440|120|linear',
15
+ 'flip|transform|rotateY(180deg)|rotateY(90deg)|560|150|linear',
16
+ 'flip|transform|rotateY(90deg)|rotateY(0deg)|710|210|linear',
17
+ 'flip|transform|rotateY(0deg)|rotateY(-10deg)|920|110|enter',
18
+ 'flip|transform|rotateY(-10deg)|rotateY(0deg)|1030|130|settle',
19
+ ];
20
+ const HINGE = 'perspective(1100px) translateY(50%)';
21
+ const FLAT = `${HINGE} rotateX(80deg) translateY(-50%) translateY(120px) scale(0.86)`;
22
+ const PAST = `${HINGE} rotateX(-9deg) translateY(-50%) translateY(0px) scale(1.02)`;
23
+ const UPRIGHT = `${HINGE} rotateX(0deg) translateY(-50%) translateY(0px) scale(1)`;
7
24
 
8
25
  export const TWO_SIDED_BEATS: Readonly<Record<string, readonly string[]>> = {
9
26
  [OpenMotion.TileGrows]: [
@@ -25,6 +42,30 @@ export const TWO_SIDED_BEATS: Readonly<Record<string, readonly string[]>> = {
25
42
  'tilt|opacity|0|1|300|160|enter',
26
43
  'turn|opacity|0|1|800|200|enter',
27
44
  ],
45
+ [OpenMotion.ThrownDown]: [
46
+ 'tilt|opacity|0|1|80|120|enter',
47
+ `tilt|transform|${DROP}|${LANDED}|80|400|fall`,
48
+ `tilt|transform|${LANDED}|${BOUNCE}|480|110|enter`,
49
+ `tilt|transform|${BOUNCE}|${LANDED}|590|190|settle`,
50
+ 'turn|opacity|0|1|600|180|enter',
51
+ ],
52
+ [OpenMotion.SpinsIn]: [
53
+ 'tilt|opacity|0|1|150|120|enter',
54
+ 'tilt|transform|scale(0.42)|scale(1)|150|880|glide',
55
+ ...SPIN,
56
+ 'turn|opacity|0|1|1000|200|enter',
57
+ ],
58
+ [OpenMotion.HexAssembles]: [
59
+ 'hexTiles|opacity|1|0|1100|1|swap',
60
+ 'front|opacity|0|1|960|140|linear',
61
+ 'turn|opacity|0|1|1000|200|enter',
62
+ ],
63
+ [OpenMotion.RisesLit]: [
64
+ 'tilt|opacity|0|1|250|150|enter',
65
+ `tilt|transform|${FLAT}|${PAST}|250|560|settle`,
66
+ `tilt|transform|${PAST}|${UPRIGHT}|810|300|settle`,
67
+ 'turn|opacity|0|1|900|200|enter',
68
+ ],
28
69
  };
29
70
 
30
71
  /** The beats of an opening, with the turn to the front when tile-grows lands that way. */
@@ -17,10 +17,16 @@
17
17
  .tmk-card-front .tmk-card-value{grid-area:value;font-size:16px}
18
18
  .tmk-card-back{display:grid;place-items:center;transform:rotateY(180deg)}
19
19
  .tmk-card-lockup{display:flex;align-items:center;justify-content:center}
20
- .tmk-card-back .tmk-card-mark{width:96px;height:96px}
21
- .tmk-card-back-logo{display:block;width:auto;height:96px}
20
+ .tmk-card-back .tmk-card-lockup{flex-wrap:wrap;gap:8px;min-width:0;max-width:100%}
21
+ .tmk-card-back .tmk-card-mark{width:min(96px,30cqi);height:min(96px,30cqi)}
22
+ .tmk-card-back .tmk-card-wordmark{min-width:0;max-width:100%;margin-left:0;font-size:clamp(12px,5.4cqi,16px)}
23
+ .tmk-card-back .tmk-card-wordmark *{font-family:var(--tmk-card-font,inherit)!important}
24
+ .tmk-card-back-logo{display:block;width:auto;max-width:100%;height:96px;object-fit:contain}
22
25
  .tmk-card-turn{position:absolute;right:8px;bottom:8px;z-index:4;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--card-edge);border-radius:50%;background:var(--card-raised);color:var(--card-text);transform:translateZ(1px)}
23
- .tmk-card-side{display:flex;flex-direction:column;gap:8px;padding-bottom:4px}
26
+ .tmk-card-side{position:relative;z-index:1;display:flex;flex-direction:column;gap:8px;padding-bottom:4px}
27
+ .tmk-card-hex-tiles{position:absolute;inset:0;z-index:3;overflow:hidden;border-radius:var(--card-radius);opacity:0;pointer-events:none}
28
+ .tmk-card-hex{position:absolute;background:var(--card-accent);clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%)}
29
+ .tmk-card-hex::before{content:'';position:absolute;inset:2px;background:var(--card-raised);clip-path:inherit}
24
30
  .tmk-card-side .tmk-card-save{margin-bottom:4px}
25
31
  .tmk-card-face .tmk-card-sweep>span{left:50%;width:140px;margin-left:-70px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--card-accent) 18%,transparent),transparent)}
26
32
  .tmk-card-face .tmk-card-sweep{border-radius:var(--card-radius)}