@pixerate/flair 0.13.1 → 0.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.
@@ -10316,6 +10316,8 @@ var flowNetwork = {
10316
10316
  ]
10317
10317
  }
10318
10318
  };
10319
+ var DRIP_BASELINE = 120;
10320
+ var DRIP_CAP = 75;
10319
10321
  var DRIP_TOP = 106;
10320
10322
  var DRIPS2 = [
10321
10323
  { at: 0.067, width: 11, length: 34, delay: 0, ms: 1500 },
@@ -10330,7 +10332,7 @@ var dripText = {
10330
10332
  kind: "vector",
10331
10333
  id: "drip-text",
10332
10334
  name: "Drip text",
10333
- description: "A chunky outlined title popping in, then oozing slime drips from its letters.",
10335
+ description: "A chunky outlined title popping in, then oozing slime drips from its letters; Inline sets it in a line of text.",
10334
10336
  category: "text",
10335
10337
  tags: ["title", "text", "drip", "slime", "y2k", "headline"],
10336
10338
  hold: 1200,
@@ -10345,6 +10347,10 @@ var dripText = {
10345
10347
  const left = 200 - width / 2;
10346
10348
  return {
10347
10349
  width,
10350
+ // Inline, the picture frames just the word's capitals, from cap height to baseline, so it sits on
10351
+ // the line like a letter would; the pop, outline and drips spill out over the text around it.
10352
+ viewBox: v.inline ? `${left} ${DRIP_BASELINE - DRIP_CAP} ${width} ${DRIP_CAP}` : "0 0 400 200",
10353
+ overflow: v.inline ? "visible" : "hidden",
10348
10354
  ...Object.fromEntries(
10349
10355
  DRIPS2.flatMap((d, i) => {
10350
10356
  const x = Math.round((left + d.at * width) * 10) / 10;
@@ -10361,14 +10367,14 @@ var dripText = {
10361
10367
  };
10362
10368
  },
10363
10369
  motion: (() => {
10364
- const word = `<text x="200" y="120" text-anchor="middle" textLength="{{width}}" lengthAdjust="spacingAndGlyphs" font-family="'Arial Black', Impact, system-ui, sans-serif" font-size="104" font-weight="900" stroke-linejoin="round"`;
10370
+ const word = `<text x="200" y="${DRIP_BASELINE}" text-anchor="middle" textLength="{{width}}" lengthAdjust="spacingAndGlyphs" font-family="{{font}}" font-size="104" font-weight="{{weight}}" stroke-linejoin="round"`;
10365
10371
  const drips = (layer, paint) => DRIPS2.map(
10366
10372
  (d, i) => `<rect id="${layer}r${i}" x="{{left${i}}}" y="${DRIP_TOP}" width="${d.width}" height="0" rx="${d.width / 2}" ${paint}/><circle id="${layer}c${i}" cx="{{x${i}}}" cy="${DRIP_TOP}" r="${d.width * 0.72}" ${paint}/>`
10367
10373
  ).join("");
10368
10374
  const outline = `fill="{{outline}}" stroke="{{outline}}" stroke-width="{{stroke}}"`;
10369
10375
  const pop = (from, to) => [`translate(200 100) scale(${from}) translate(-200 -100)`, `translate(200 100) scale(${to}) translate(-200 -100)`];
10370
10376
  return {
10371
- svg: `<svg viewBox="0 0 400 200"><!-- {{word: text default=SLOP label='Word'}} {{fill: color default=#FF7EB6 label='Fill'}} {{outline: color default=#3A0A2C label='Outline'}} {{shine: color default=#FFD1E6 label='Shine'}} {{drip: float min=0.2 max=2 default=1 label='Drip length'}} {{stroke: float min=0 max=14 default=7 step=0.5 label='Outline width'}} --><g id="word" transform="${pop(0.6, 1)[0]}" opacity="0">${drips("o", outline)}${word} fill="none" stroke="{{outline}}" stroke-width="{{stroke}}">{{word}}</text>${drips("f", `fill="{{fill}}"`)}${word} fill="{{fill}}">{{word}}</text>${DRIPS2.map(
10377
+ svg: `<svg viewBox="{{viewBox}}" overflow="{{overflow}}"><!-- {{word: text default=SLOP label='Word'}} {{font: text default='Arial Black, Impact, system-ui, sans-serif' label='Font'}} {{weight: int min=100 max=900 default=900 step=100 label='Weight'}} {{fill: color default=#FF7EB6 label='Fill'}} {{outline: color default=#3A0A2C label='Outline'}} {{shine: color default=#FFD1E6 label='Shine'}} {{drip: float min=0.2 max=2 default=1 label='Drip length'}} {{stroke: float min=0 max=14 default=7 step=0.5 label='Outline width'}} {{inline: bool default=false label='Inline'}} --><g id="word" transform="${pop(0.6, 1)[0]}" opacity="0">${drips("o", outline)}${word} fill="none" stroke="{{outline}}" stroke-width="{{stroke}}">{{word}}</text>${drips("f", `fill="{{fill}}"`)}${word} fill="{{fill}}">{{word}}</text>${DRIPS2.map(
10372
10378
  (d, i) => `<circle id="s${i}" cx="{{shine${i}}}" cy="${DRIP_TOP}" r="${d.width * 0.2}" fill="{{shine}}" opacity="0"/>`
10373
10379
  ).join("")}</g></svg>`,
10374
10380
  animate: [
@@ -10542,4 +10548,4 @@ export {
10542
10548
  effectControls,
10543
10549
  effectDefaults
10544
10550
  };
10545
- //# sourceMappingURL=chunk-L4NFQM5N.js.map
10551
+ //# sourceMappingURL=chunk-KWNFZ5NC.js.map