Skip to content
Design system
v1.0
Tier 1, Marathon to the world

Tip carousels

Confirmed

Multi slide carousels with a cover, a body rhythm, and an end card.

Champion r12Confirmed in r12Repo folder build/tips-carousel/v/best/
Tip carousels, primary render

Primary render. Select it to open full size.

Renders

Every render from the champion round

Showing 40 of 56 renders. The rest are in build/tips-carousel/v/best/renders/.

Rules

How to use it, from the piece README

A multi-slide Instagram and LinkedIn carousel for Marathon marketing tips. You edit one file, fill.js, and every slide is built from it: cover, numbered steps, stat, before and after, quote, and end card. Colours, type, and the logo come from build/tokens/v/best/, so you never pick a colour or a font.

Make a new carousel

  1. Duplicate fill.js (or edit it) and change the words. Keep the slide types you need.
  2. Photos: copy a photo from brief/real-photos/ into photos/, then write its name without .jpg, for example photo: "mc_retouched_03". Set focus to move the crop, for example "50% 30%" keeps the top of a portrait shot. Photos go on the cover and on any step. Steps without a photo get a big number instead.
  3. Render the slides and the contact sheet: sh build/tips-carousel/v/r11/render.sh For a different fill file, open carousel.html?fill=fills/yours.js in Chrome.
  4. Open renders/primary.png and read the notes under each slide (see below).
  5. Post renders/slides/slide-01.png onward, in order.

Slide types and limits

TypeFieldsHard limits (characters)
coverphoto, focus, title, sub, credittitle 80, sub 190, credit 70
stepphoto (optional), focus, title, body, tip (optional)title 80, body 300, tip 120
statvalue, unit, label, context, source, confirmvalue 5, unit 16, label 110, context 200, source 90
comparetitle, before, after, note, confirmtitle 60, before 150, after 150, note 140
quotequote, name, rolequote 190, name 40, role 60
endtitle, body, services, cta, savetitle 60, body 200, cta 34, save 60

series (28) and topic (32) sit at the top of the file and print as the eyebrows. Services on the end card: photography, drone, video, social, print-signage, strategy, four at most.

What the template does for you, so you do not have to:

  • The cover always comes first and the end card always comes last, even if you put them elsewhere.
  • Steps number themselves, "Step 2 of 4" and the big numeral included.
  • 10 slides and six steps at most. Extra steps are dropped from the end first.
  • Long copy shrinks to fit, down to 60% of the design size. Past that, the longest paragraph is cut. A call to action never loses the web address.
  • How a cut works: a slide never goes out with half a sentence on it. Whole sentences are kept first. If that leaves a lot of room, or the field is one long sentence, the template keeps a complete clause. It cuts only where a new clause starts, right before words like "so", "because", "from", "before", "when", "with", "for", "in", "on", "not", or "but", or at a semicolon or colon. So "How to shoot and market a 42,000 square foot tilt-wall warehouse so the leasing broker gets tours in the first week" becomes "How to shoot and market a 42,000 square foot tilt-wall warehouse", never "...warehouse so the leasing". A paragraph cut keeps its full stop, and a question keeps its question mark. Numbers ("42,000", "$1,500", "3.5") and web addresses stay whole.
  • No clean place to cut? The field is kept whole and the type shrinks, with a red Over limit note. A title a few characters over the limit never kills the slide.
  • If the slide still cannot hold even at 60% type, the longest paragraph is shortened the same way, by sentences or clauses, and a "Do this" tip that cannot be shortened cleanly is removed whole. Only copy that cannot be held or cut cleanly by any of these steps is held back: that slide exports as a red Not exported card that names the field, so half a sentence is never posted by mistake. Test files: fills/stress-2x.js and fills/critic-2x.js, rendered as renders/stress-2x.png, renders/stress-critic-2x.png, renders/slides/s2x-0*.png, and renders/slides/c2x-0*.png.
  • One long word, a street or subdivision name pasted with no spaces ("Northchasewoodspa"), never runs past the margin and never splits without a hyphen, in any field: title, sub, body, Do this tip, stat label and context, before, after, note, quote, and end card. The slide may shrink to 80% to keep the word on one line, and the Auto-fit note says so only when the word really is whole in the export. Past 80%, the slide goes back to full size, every field still too wide breaks with a hyphen (at least four letters each side), and each one gets its own red Cut to fit note naming the field and the word. Fix it by adding the spaces back. Test files: fills/long-words.js (titles) and fills/long-words-body.js (body, sub, tip, and the rest).
  • The stat unit line (the words under the big number) is measured first, before anything else on the slide. A long unit such as "Northchasewoodsparkway" shrinks on its own, down to 80%, to stay whole on one line, while the number, label, and context keep their full size. The sheet shows an amber Auto-fit note with the unit's size. If the whole slide later has to shrink for height, the unit grows back as far as the width allows, so it is never shrunk twice. Past 80%, the unit wraps with a hyphen and gets a red Cut to fit note. It is never cut off at the right margin. If any field ever would be, the slide is held back as a Not exported card and the note says the word is cut off, so the sheet never claims a hyphen that is not there. Test file: fills/long-unit.js, rendered as renders/stress-long-unit.png and renders/slides/unit-0*.png. fills/critic-word.js is the same case from review.
  • The eyebrows at the top of each slide (series, topic, "Step 2 of 4") never wrap and never show a sliced letter. When series and topic run long, the left label stays whole, the row shrinks to 75%, and the sheet shows an Auto-fit note. Past 75%, the topic (then the series) is cut at a whole word with no dangling "and" or comma, and a red Cut to fit note shows the new wording. Test file: fills/long-eyebrows.js, both fields at their limits, rendered as renders/stress-eyebrow.png and renders/slides/eyebrow-0*.png.
  • Stat figures with a comma or a dollar sign ("1,500", "$1,500", "$95") never touch their neighbors. Space is reserved under the number for a comma tail, so the unit line below stays clear, and above the number for the top stroke of a $, so it stays clear of the red rule. Nothing to set, type the figure as you would say it. Test file: fills/stat-commas.js, rendered as renders/stress-stat-commas.png and renders/slides/statcomma-0*.png.
  • A photo name that is not in photos/ never shows a broken image. Before any slide is built, every named photo is loaded. If one fails, that slide switches to its no-photo layout (a step gets the big number, the cover becomes a full navy cover with no credit), and the contact sheet shows a red Missing photo note naming the file. The note says whether the file is in brief/real-photos/ (copy it into photos/ and render again) or nowhere (check the spelling). Test file: fills/missing-photo.js, rendered as renders/stress-missing-photo.png and renders/slides/missing-0*.png.
  • Type never sits on a photo. Words sit on a navy or white block, so a white marble showroom, a busy aerial, and a lot with a red boundary line all hold the same layout.

The notes on the contact sheet

  • Auto-fit (amber): type was shrunk. Fine to post, but shorter copy reads better on a phone.
  • Cut to fit (red): words were removed, at a whole sentence or clause. Read the new ending, then rewrite the field shorter and render again.
  • Over limit (red): the field is over its limit with no clean place to cut, so it was kept whole at a smaller size. Shorten it.
  • Missing photo (red): a named photo did not load. Copy it into photos/ and render again.
  • Editor note (amber): a figure Jacob has to confirm. Do not post until it is gone. Delete the confirm line from the fill file once Jacob signs off.

For Jacob to confirm

  • The 48 hour turnaround on the stat slide.
  • The 2.1 acre example headline on the before and after slide.
  • marathoncreative.co as the booking address on the end card.

Files

  • fill.js, the content. fills/stress-2x.js, the functional test with copy twice as long. fills/long-words.js, run-together street names in every title field. fills/long-words-body.js, the same in body, sub, tip, label, before, and end body.
  • carousel.html, carousel.css, carousel.js, the template. Do not edit for a normal post.
  • icons-inline.js, generated by build_icons.py from the shared icon system.
  • render.sh, renders everything into renders/.
  • renders/stress-longword.png and renders/slides/longword-0*.png, the long word test.
  • renders/stress-longword-body.png and renders/slides/lwbody-0*.png, the long word test for body, sub, and tip fields.
  • renders/photo-*.png, the cover and both photo steps on a tight interior, a wide aerial, a portrait original, the red boundary aerial, and the brightest frame.
Use it

Files to download and code to copy

  • Whole piece, source files29 files, zip, 6.6 MB. Paths inside follow the repo layout, so put tokens.css beside them as the README says.
    Download

Copy-paste code

carousel.css297 lines, 19.3 KB
/* Marathon tips carousel, 1080 x 1350.
   Load tokens.css and icons.css first. Every colour, weight, and space below is a token.
   A hex typed into this file is a defect. Sizes are fixed px because the canvas is fixed.

   Photo rule: type never sits on raw photography. Photos fill a frame, words sit on a solid
   navy or white block next to it. That is why the same slide holds on a white marble
   showroom, a busy rooftop aerial, a portrait crop, and a lot with a red boundary line. */

:root {
  /* Social scale. The document divider is 60 by 3, on a 1080 canvas it doubles. */
  --tc-w: var(--mc-social-portrait-w);
  --tc-h: var(--mc-social-portrait-h);
  --tc-top: var(--mc-social-portrait-safe-top);
  --tc-bottom: var(--mc-social-portrait-safe-bottom);
  --tc-side: var(--mc-social-portrait-safe-side);
  --tc-bar-w: calc(var(--mc-border-width-divider-length) * 2);
  --tc-bar-h: calc(var(--mc-border-width-bar) * 2);
  --tc-photo-cover: 690px;
  --tc-photo-step: 650px;
  --tc-tab: 180px;
  --tc-logo-w: 210px;
  --tc-logo-w-end: 300px;

  /* Type sizes at 100% fit. Auto-fit multiplies these by --fit, never below the floor. */
  --tc-eyebrow: 24px;
  --tc-cover-title: 88px;
  --tc-cover-sub: 34px;
  --tc-title: 86px;
  --tc-body: 42px;
  --tc-tip: 34px;
  --tc-num: 300px;
  --tc-tab-num: 104px;
  --tc-stat-label: 64px;
  --tc-stat-unit: 80px;
  --tc-context: 40px;
  --tc-source: 24px;
  --tc-compare-title: 76px;
  --tc-before: 42px;
  --tc-after: 52px;
  --tc-note: 38px;
  --tc-quote: 78px;
  --tc-quote-mark: 200px;
  --tc-name: 32px;
  --tc-role: 28px;
  --tc-end-title: 90px;
  --tc-end-body: 36px;
  --tc-service: 28px;
  --tc-cta: 38px;
  --tc-small: 26px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--mc-surface-muted); }
body { font-family: var(--mc-font); color: var(--mc-text-primary); -webkit-font-smoothing: antialiased; }

/* The slide frame. Exactly 1080 x 1350, nothing escapes it. */
.slide {
  position: relative; width: var(--tc-w); height: var(--tc-h); overflow: hidden;
  display: flex; flex-direction: column;
  padding: var(--tc-top) var(--tc-side) var(--tc-bottom);
  background: var(--mc-surface-page); color: var(--mc-text-primary);
  --fit: 1;
}
.fit { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.fs { font-size: calc(var(--size) * var(--fit)); }

/* Long words. A street or subdivision name with no spaces ("Northchasewoodspa") must never
   run past the margin. Safety net: every text line may break inside a word. While the engine
   measures, .measuring turns that off so it can see the overflow, shrink the slide until the
   word fits on one line, and only then let it break and flag the slide "Cut to fit". */
.fs, .attrib-name, .attrib-role, .save, .source, .credit, .service { overflow-wrap: anywhere; min-width: 0; }
.measuring .fs, .measuring .attrib-name, .measuring .attrib-role, .measuring .save, .measuring .source, .measuring .service { overflow-wrap: normal; }

/* Shared rows. */
.row-top, .row-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--mc-space-07); }
.row-top { margin-bottom: var(--mc-space-09); }
.row-foot { margin-top: var(--mc-space-08); height: 48px; }
.eyebrow {
  font-size: var(--tc-eyebrow); font-weight: var(--mc-type-eyebrow-weight);
  letter-spacing: var(--mc-type-eyebrow-tracking); text-transform: var(--mc-type-eyebrow-case);
  line-height: var(--mc-type-eyebrow-leading); color: var(--mc-text-label);
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.eyebrow--quiet { color: var(--mc-text-tertiary); }
/* Head eyebrows never wrap and never slice a glyph. In a two-label row the label on the left
   ("Step 2 of 4", "By the numbers") keeps its width and the topic on the right gives way. The
   engine then shrinks the row to 75% and, past that, cuts the topic or series at a whole word. */
.row-top .eyebrow, .tab-label .eyebrow { display: block; min-width: 0; text-overflow: clip; }
.row-top .eyebrow:first-child:not(:last-child) { flex: none; }
.row-top .eyebrow + .eyebrow { flex: 0 1 auto; text-align: right; }
.count {
  font-size: var(--tc-small); font-weight: var(--mc-weight-semibold); color: var(--mc-text-tertiary);
  font-variant-numeric: var(--mc-numeric-tabular); letter-spacing: 0.04em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--mc-space-04);
}
.count .mc-icon { width: 34px; height: 34px; stroke-width: var(--mc-icon-stroke-48); color: var(--mc-text-heading); }
.logo { display: block; width: var(--tc-logo-w); height: auto; }
.bar { flex: none; width: var(--tc-bar-w); height: var(--tc-bar-h); background: var(--mc-accent); }

.title {
  --size: var(--tc-title); font-weight: var(--mc-type-h1-weight); line-height: 1.06;
  letter-spacing: var(--mc-type-cover-tracking); color: var(--mc-text-heading); text-wrap: balance;
}
.body {
  --size: var(--tc-body); font-weight: var(--mc-type-body-weight); line-height: 1.42;
  color: var(--mc-text-primary); text-wrap: pretty; margin-top: var(--mc-space-08);
}

/* Photo frame. Fills its box, focus point set per slide in the fill file. */
.photo { position: absolute; left: 0; right: 0; top: 0; overflow: hidden; background: var(--mc-surface-inverse); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Cover. Photo on top, a solid navy panel carries every word. */
.slide--cover { padding: 0; background: var(--mc-surface-inverse); color: var(--mc-text-inverse); }
.slide--cover .photo { height: var(--tc-photo-cover); }
.credit {
  position: absolute; left: var(--tc-side); top: calc(var(--tc-photo-cover) - var(--mc-space-07) - 34px);
  max-width: calc(var(--tc-w) - 2 * var(--tc-side));
  background: var(--mc-scrim-photo-strong); color: var(--mc-text-inverse);
  font-size: 20px; font-weight: var(--mc-weight-semibold); line-height: 1.3;
  padding: var(--mc-space-03) var(--mc-space-04); border-radius: var(--mc-radius-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.panel {
  position: absolute; left: 0; right: 0; top: var(--tc-photo-cover); bottom: 0;
  display: flex; flex-direction: column;
  padding: var(--mc-space-10) var(--tc-side) var(--tc-bottom);
  background: var(--mc-surface-inverse);
}
.panel .row-top { margin-bottom: var(--mc-space-07); }
.panel .bar { background: var(--mc-accent-on-inverse); margin-bottom: var(--mc-space-06); }
.panel .eyebrow { color: var(--mc-accent-on-inverse); }
.panel .count, .slide--end .count { color: var(--mc-text-inverse-tertiary); }
.panel .count .mc-icon, .slide--end .count .mc-icon { color: var(--mc-text-inverse); }
/* Cover with no photo, used when the named photo is missing. The navy panel takes the whole
   slide and the title sits low, where the eye lands after the swipe. */
.slide--cover.no-photo .panel { top: 0; padding-top: var(--tc-top); }
.slide--cover.no-photo .fit { justify-content: flex-end; padding-bottom: var(--mc-space-10); }
.slide--cover.no-photo .cover-title { --size: calc(var(--tc-cover-title) * 1.18); }
.cover-title {
  --size: var(--tc-cover-title); font-weight: var(--mc-type-cover-weight);
  line-height: var(--mc-type-cover-leading); letter-spacing: var(--mc-type-cover-tracking);
  color: var(--mc-text-inverse); text-wrap: balance;
}
.cover-sub {
  --size: var(--tc-cover-sub); font-weight: var(--mc-weight-light); line-height: 1.4;
  color: var(--mc-text-inverse-secondary); margin-top: var(--mc-space-06); text-wrap: pretty;
}

/* Step, type only. A big numeral sets the rhythm across the carousel. */
.num {
  flex: none; font-size: var(--tc-num); font-weight: var(--mc-weight-extrabold); line-height: 0.78;
  letter-spacing: -0.05em; color: var(--mc-text-heading); font-variant-numeric: var(--mc-numeric-tabular);
  margin-bottom: var(--mc-space-08);
}
.slide--step .bar { margin-bottom: var(--mc-space-08); }
.tip {
  --size: var(--tc-tip); margin-top: auto; flex: none;
  background: var(--mc-surface-muted); padding: var(--mc-space-07) var(--mc-space-08);
  border-left: var(--tc-bar-h) solid var(--mc-border-accent);
}
.tip .eyebrow { display: block; margin-bottom: var(--mc-space-03); }
.tip p { font-weight: var(--mc-weight-semibold); line-height: 1.4; color: var(--mc-text-primary); }
.fit > .body + .tip { margin-top: auto; }
.fit .spacer { flex: 1 1 var(--mc-space-08); min-height: var(--mc-space-08); }

/* Step with a photo. The number rides on a navy tab, never on the photo itself. */
.slide--step.has-photo { padding-top: calc(var(--tc-photo-step) + var(--tc-tab) / 2 + var(--mc-space-08)); }
.slide--step.has-photo .photo { height: var(--tc-photo-step); }
.tab {
  position: absolute; left: var(--tc-side); top: calc(var(--tc-photo-step) - var(--tc-tab) / 2);
  width: var(--tc-tab); height: var(--tc-tab); background: var(--mc-surface-inverse);
  display: flex; align-items: center; justify-content: center;
  color: var(--mc-text-inverse); font-size: var(--tc-tab-num); font-weight: var(--mc-weight-extrabold);
  letter-spacing: -0.04em; font-variant-numeric: var(--mc-numeric-tabular);
}
.tab::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: var(--tc-bar-h);
  background: var(--mc-accent-on-inverse);
}
.tab-label { position: absolute; left: calc(var(--tc-side) + var(--tc-tab) + var(--mc-space-07)); right: var(--tc-side); top: calc(var(--tc-photo-step) + var(--mc-space-06)); }
.slide--step.has-photo .title { --size: calc(var(--tc-title) * 0.86); }
.slide--step.has-photo .body { --size: calc(var(--tc-body) * 0.95); }
.slide--step.has-photo .body { margin-top: var(--mc-space-07); }

/* Stat. */
.stat { flex: none; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--mc-space-06); margin: var(--mc-space-08) 0 var(--mc-space-07); }
.stat-value {
  font-weight: var(--mc-weight-extrabold); line-height: 0.82; letter-spacing: -0.05em;
  color: var(--mc-text-heading); font-variant-numeric: var(--mc-numeric-tabular); white-space: nowrap;
}
/* The value runs at line-height 0.82, so a comma or dollar tail drops below its box.
   Reserve that depth so a unit that wraps underneath, or the label, never meets it.
   Padding sits below the baseline, so a unit on the same line keeps its alignment. */
.stat-value--desc { padding-bottom: 0.2em; }
/* The same 0.82 line-height lets a dollar sign's top stroke rise above the box, into the
   red rule. Reserve that height too, so the rule and the $ always keep clear air between them. */
.stat-value--asc { padding-top: 0.14em; }
.stat-unit { --size: var(--tc-stat-unit); font-weight: var(--mc-weight-bold); color: var(--mc-text-heading); letter-spacing: -0.02em; white-space: nowrap; line-height: 1.05; }
/* The unit has its own shrink, --own, used only when the rest of the slide must stay at full
   size because another field is hyphenated. Past its own 80% floor the unit wraps, and on a
   broken slide it may wrap only at the soft hyphens the engine added, so it is never clipped. */
.slide .stat-unit { font-size: calc(var(--size) * var(--fit) * var(--own, 1)); }
.broken .stat-unit { white-space: normal; }
.stat-label { --size: var(--tc-stat-label); font-weight: var(--mc-weight-bold); line-height: 1.15; letter-spacing: -0.015em; color: var(--mc-text-heading); text-wrap: balance; }
.context { --size: var(--tc-context); line-height: 1.45; color: var(--mc-text-secondary); margin-top: var(--mc-space-07); text-wrap: pretty; }
.source {
  margin-top: auto; padding-top: var(--mc-space-06); border-top: var(--mc-border-width-hairline) solid var(--mc-border-subtle);
  font-size: calc(var(--tc-source) * var(--fit)); font-weight: var(--mc-weight-semibold); color: var(--mc-text-tertiary); line-height: 1.4;
}

/* Before and after. */
.slide--compare .title { --size: var(--tc-compare-title); margin-bottom: var(--mc-space-08); }
.card { flex: none; padding: var(--mc-space-09) var(--mc-space-09); }
.card .eyebrow { display: block; margin-bottom: var(--mc-space-04); }
.card--before { background: var(--mc-surface-muted); }
.card--before .eyebrow { color: var(--mc-text-tertiary); }
.card--before p { --size: var(--tc-before); font-weight: var(--mc-weight-regular); line-height: 1.4; color: var(--mc-text-secondary); }
.card--after {
  margin-top: var(--mc-space-06); background: var(--mc-surface-page);
  border: var(--mc-border-width-strong) solid var(--mc-border-subtle); border-left: var(--tc-bar-h) solid var(--mc-border-accent);
}
.card--after p { --size: var(--tc-after); font-weight: var(--mc-weight-bold); line-height: 1.3; letter-spacing: -0.01em; color: var(--mc-text-heading); }
.note { --size: var(--tc-note); margin-top: var(--mc-space-09); line-height: 1.45; color: var(--mc-text-primary); text-wrap: pretty; }
.note b { font-weight: var(--mc-weight-semibold); color: var(--mc-text-heading); }

/* Quote. */
.slide--quote { background: var(--mc-surface-muted); }
.slide--quote .fit { justify-content: center; padding-bottom: var(--mc-space-11); }
.quote-mark { flex: none; font-size: var(--tc-quote-mark); font-weight: var(--mc-weight-extrabold); line-height: 0.6; height: 0.5em; color: var(--mc-accent); }
.quote { --size: var(--tc-quote); font-weight: var(--mc-weight-bold); line-height: 1.18; letter-spacing: -0.015em; color: var(--mc-text-heading); text-wrap: balance; margin-top: var(--mc-space-08); }
.attrib { flex: none; margin-top: var(--mc-space-09); display: flex; flex-direction: column; gap: var(--mc-space-02); }
.attrib .bar { margin-bottom: var(--mc-space-06); }
.attrib-name { font-size: calc(var(--tc-name) * var(--fit)); font-weight: var(--mc-weight-bold); color: var(--mc-text-heading); }
.attrib-role { font-size: calc(var(--tc-role) * var(--fit)); font-weight: var(--mc-weight-semibold); color: var(--mc-text-secondary); }

/* End card. Navy, white lockup, one action. */
.slide--end { background: var(--mc-surface-inverse); color: var(--mc-text-inverse); }
.slide--end .eyebrow { color: var(--mc-accent-on-inverse); }
.slide--end .bar { background: var(--mc-accent-on-inverse); margin-bottom: var(--mc-space-08); }
.end-title { --size: var(--tc-end-title); font-weight: var(--mc-type-h1-weight); line-height: 1.04; letter-spacing: var(--mc-type-cover-tracking); color: var(--mc-text-inverse); text-wrap: balance; }
.end-body { --size: var(--tc-end-body); font-weight: var(--mc-weight-light); line-height: 1.45; color: var(--mc-text-inverse-secondary); margin-top: var(--mc-space-08); text-wrap: pretty; }
.services { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: var(--mc-space-07) var(--mc-space-08); margin-top: var(--mc-space-10); padding-top: var(--mc-space-09); border-top: var(--mc-border-width-hairline) solid var(--mc-border-inverse); }
.service { display: flex; align-items: center; gap: var(--mc-space-05); font-size: var(--tc-service); font-weight: var(--mc-weight-semibold); color: var(--mc-text-inverse); }
.service .mc-icon { width: 52px; height: 52px; stroke-width: var(--mc-icon-stroke-48); color: var(--mc-text-inverse); }
.cta {
  flex: none; margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: var(--mc-space-05);
  background: var(--mc-action-inverse); color: var(--mc-action-inverse-text);
  font-size: calc(var(--tc-cta) * var(--fit)); font-weight: var(--mc-weight-bold); letter-spacing: -0.01em; max-width: 100%;
  padding: var(--mc-space-07) var(--mc-space-09); border-radius: var(--mc-radius-md); white-space: nowrap;
}
.cta .mc-icon { width: 40px; height: 40px; stroke-width: var(--mc-icon-stroke-48); }
.save { flex: none; margin-top: var(--mc-space-06); font-size: calc(var(--tc-small) * var(--fit)); font-weight: var(--mc-weight-semibold); color: var(--mc-text-inverse-tertiary); }
.slide--end .logo { width: var(--tc-logo-w-end); }

/* Contact sheet. Chrome around the slides, never part of an exported slide. */
.sheet { padding: var(--mc-space-11); display: inline-block; min-width: 100%; }
.sheet-head { display: flex; align-items: baseline; gap: var(--mc-space-07); margin-bottom: var(--mc-space-09); }
.sheet-head h1 { font-size: 40px; font-weight: var(--mc-weight-extrabold); letter-spacing: -0.02em; color: var(--mc-text-heading); }
.sheet-head p { font-size: 22px; font-weight: var(--mc-weight-semibold); color: var(--mc-text-tertiary); }
.sheet-head .eyebrow { font-size: 18px; }
.row { display: flex; gap: var(--mc-space-08); align-items: flex-start; }
.thumb { flex: none; width: calc(var(--tc-w) * var(--z)); }
.thumb .frame { width: calc(var(--tc-w) * var(--z)); height: calc(var(--tc-h) * var(--z)); box-shadow: var(--mc-shadow-2); overflow: hidden; }
.zoomed .thumb .slide { zoom: var(--z); }
.thumb-label { margin-top: var(--mc-space-05); font-size: 18px; font-weight: var(--mc-weight-bold); color: var(--mc-text-heading); font-variant-numeric: var(--mc-numeric-tabular); }
.thumb-label span { color: var(--mc-text-tertiary); font-weight: var(--mc-weight-semibold); }
.flag { overflow-wrap: anywhere;
  margin-top: var(--mc-space-03); padding: var(--mc-space-03) var(--mc-space-04);
  border-left: var(--mc-border-width-bar) solid var(--mc-status-warning); background: var(--mc-surface-page);
  font-size: 15px; font-weight: var(--mc-weight-semibold); line-height: 1.35; color: var(--mc-text-primary);
}
.flag b { display: block; font-size: 12px; letter-spacing: var(--mc-type-eyebrow-tracking); text-transform: uppercase; color: var(--mc-text-secondary); }
.flag--cut { border-left-color: var(--mc-status-error); }

/* Set by the engine only when a word is still wider than the slide at the 60% floor. */
.broken .cta { white-space: normal; }
.broken .fs, .broken .cta, .broken .attrib-name, .broken .attrib-role, .broken .save, .broken .source, .broken .service { hyphens: manual; overflow-wrap: break-word; }
/* While a broken slide is measured again at export size, a word may only break at the soft
   hyphens the engine added, so any field still too wide shows up and gets hyphenated too. */
.broken.measuring .fs, .broken.measuring .cta, .broken.measuring .attrib-name, .broken.measuring .attrib-role, .broken.measuring .save, .broken.measuring .source, .broken.measuring .service { overflow-wrap: normal; }
/* Held slide. Set only when copy is too long to hold even at 60% type and has no clean place to cut.
   The card covers the whole slide, so an export of a held slide is an instruction sheet,
   not a post: no photo, no logo, no carousel count. */
.refusal {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; justify-content: center; gap: var(--mc-space-07);
  padding: var(--tc-top) var(--tc-side) var(--tc-bottom);
  background: var(--mc-status-error-surface);
  border: calc(var(--tc-bar-h) * 2) solid var(--mc-status-error);
}
.refusal .bar { background: var(--mc-status-error); }
.refusal .eyebrow { color: var(--mc-status-error); }
.refusal-title { font-size: 72px; font-weight: var(--mc-weight-extrabold); line-height: 1.05; letter-spacing: -0.02em; color: var(--mc-text-heading); }
.refusal-body { font-size: 34px; font-weight: var(--mc-weight-semibold); line-height: 1.35; color: var(--mc-text-primary); }
.refusal-how { font-size: 28px; font-weight: var(--mc-weight-regular); line-height: 1.4; color: var(--mc-text-secondary); }
carousel.html16 lines, 402 bytes
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Marathon tips carousel</title>
<link rel="stylesheet" href="../../../tokens/v/best/tokens.css">
<link rel="stylesheet" href="../../../icons/v/best/icons.css">
<link rel="stylesheet" href="carousel.css">
</head>
<body>
<div id="root"></div>
<script src="icons-inline.js"></script>
<script src="carousel.js"></script>
</body>
</html>
carousel.js475 lines, 35.2 KB
// Marathon tips carousel engine. Reads one fill file and builds every slide.
// URL options, all optional:
//   ?fill=fills/other.js     use a different fill file (default fill.js)
//   ?slide=3                 show only slide 3 at exact 1080 x 1350, for export
//   ?only=1,2                contact sheet of just those slides
//   ?photo=mc_fullres_12     put this photo on every photo slide (photo tests)
//   ?focus=50%25%2040%25     focus point for that photo
//   ?z=0.3                   contact sheet scale
(function () {
  var Q = new URLSearchParams(location.search);
  var LOGO = '../../../tokens/v/best/logos/';
  var PHOTOS = 'photos/';
  var BRIEF_PHOTOS = '../../../../brief/real-photos/';
  // Photo names that did not load from photos/. Filled by checkPhotos() before any slide is
  // built, so a missing file never reaches the layout as a broken image over an empty block.
  var MISSING = {};

  // Hard limits, in characters. Over the limit, copy is cut at a sentence or a word and the
  // contact sheet says so. Under it, auto-fit shrinks type until the slide holds.
  var LIMITS = {
    deck: { series: 28, topic: 32 },
    cover: { title: 80, sub: 190, credit: 70 },
    step: { title: 80, body: 300, tip: 120 },
    stat: { value: 5, unit: 16, label: 110, context: 200, source: 90 },
    compare: { title: 60, before: 150, after: 150, note: 140 },
    quote: { quote: 190, name: 40, role: 60 },
    end: { title: 60, body: 200, cta: 34, save: 60 }
  };
  var FLOOR = 0.6;          // auto-fit never goes below 60% of the design size
  var WORD_FLOOR = 0.8;     // one long word may shrink the slide to 80%, past that it is hyphenated
  var MAX_SLIDES = 10, MAX_STEPS = 6;
  var SERVICES = { photography: 'Photography', drone: 'Drone and aerial', video: 'Video and post', social: 'Social and ads', 'print-signage': 'Print and signage', strategy: 'Strategy' };
  var STOP = /\s+(and|or|but|the|a|an|of|to|for|with|from|in|on|at|by|your|our|we|you|it|is|that|then|just|not|so|whether|before|after|than)$/i;

  var notes = {};
  function note(i, kind, text) { (notes[i] = notes[i] || []).push({ kind: kind, text: text }); }

  function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); }
  function clean(s) { return String(s == null ? '' : s).replace(/\u2014|\u2013/g, ',').replace(/\s+/g, ' ').trim(); }

  // Cut to a limit. A cut never exports half a sentence. The rules, in order:
  // 1. Whole sentences first. If they fill most of the room, stop there.
  // 2. Otherwise add back a complete clause of the next sentence. A clause ends only where a
  //    new clause starts, right before "so", "because", "from", "before", "when", "with", "for",
  //    "in", "on", "not", "but", and the like, or at a semicolon or colon. "...a 42,000 square
  //    foot tilt-wall warehouse so the leasing broker..." is cut before "so", never after
  //    "leasing". The clause keeps its full stop or question mark.
  // 3. No clean clause fits? A title or line is kept whole and auto-fit shrinks the type, and
  //    the sheet shows an Over limit note. Being a few characters over never kills a slide.
  // 4. Only copy so long that even shrinking cannot hold it, with no clean place to cut, is
  //    held back. That slide exports as a Not exported card that names the field.
  // Never inside a word or a number: "42,000", "$1,500", "2.1", and "marathoncreative.co" are
  // single tokens, and a cut never ends on "and", "the", "a", or a bare number.
  var BREAK = /^(so|because|from|before|after|when|whenever|while|until|unless|since|where|which|with|without|for|in|on|at|into|across|through|during|via|not|but|then|once|if|instead|rather)$/i;
  var PHRASAL = /^(go|goes|went|going|come|comes|came|turn|turns|put|puts|get|gets|set|sets|sign|signs|signed|check|checks|show|shows|take|takes|hand|hands|carry|carries|log|logs|pass|passes|follow|follows|count|counts|depend|depends|focus|focuses|rely|relies|wait|waits|ask|asks|look|looks|pay|pays|call|calls|search|searches|plan|plans)$/i;
  // Eyebrow labels (series and topic) are names, not sentences. They are cut at a whole word
  // with no dangling "and", "for", or comma.
  function labelCut(s, max) {
    if (s.length <= max) return s;
    // "Marketing tip 07 for real estate agents" becomes "Marketing tip 07", cut before "for".
    var w = s.split(' '), out = '';
    for (var j = 2; j < w.length; j++) { var head = w.slice(0, j).join(' ').replace(/[\s,;:]+$/, ''); if (head.length > max) break; if (BREAK.test(w[j]) && !STOP.test(' ' + head)) out = head; }
    if (out.length >= max * 0.5) return out;
    out = '';
    for (var k = 0; k < w.length; k++) { var t = out ? out + ' ' + w[k] : w[k]; if (t.length > max) break; out = t; }
    var prev = '';
    while (prev !== out) { prev = out; out = out.replace(STOP, '').replace(/[\s,;:(\-]+$/, ''); }
    return out;
  }
  function sentences(s) { return s.split(/(?<=[.!?]["')]?)\s+(?=["'(]?[A-Z0-9$])/); }
  function bareEnd(t) { return STOP.test(' ' + t) || /\s[$]?[0-9][0-9,.%]*$/.test(t); }
  // The longest clean clause at the start of one sentence that fits in max characters.
  function clause(s, max, minWords) {
    var w = s.split(' '), best = '';
    for (var k = 1; k < w.length; k++) {
      var next = w[k].replace(/^["'(]+/, '').replace(/[,.;:!?"')]+$/, '');
      if (!BREAK.test(next) && !/[;:]$/.test(w[k - 1])) continue;
      var pre = w.slice(0, k).join(' ').replace(/[\s,;:(\-]+$/, '');
      if (pre.length > max) break;
      if (pre.split(' ').length < minWords || bareEnd(pre)) continue;
      // "the overlay goes" before "on" is half a phrasal verb, and "inbox, ready" before "for"
      // leaves one dangling word after a comma. Neither is a finished clause.
      if (PHRASAL.test(w[k - 1]) && /^(on|in|at|into|through|across|for)$/i.test(next)) continue;
      var lastPart = pre.split(/[,;:]\s/).pop();
      if (pre.indexOf(', ') > -1 && lastPart.split(' ').length < 2) continue;
      // Cutting inside a phrase that itself opens with "with", "for", or "in" leaves half of it
      // ("Greater Houston, with the files"), so the cut moves back to before that phrase.
      if (pre.indexOf(', ') > -1 && /^(with|without|for|in|on|at|into|across|through|during|via|from)$/i.test(lastPart.split(' ')[0])) continue;
      best = pre;
    }
    return best;
  }
  // Returns the cut text, or null when there is no clean place to cut.
  function cut(s, max, sentence) {
    if (s.length <= max) return s;
    var parts = sentences(s), out = '', k = 0;
    for (; k < parts.length; k++) { var t = out ? out + ' ' + parts[k] : parts[k]; if (t.length > max) break; out = t; }
    var plain = function (x) { return sentence ? x : x.replace(/[.]$/, ''); };
    if (out && out.length >= max * 0.6) return plain(out);
    var src = parts[k] || '', mark = /\?["')]?$/.test(src) ? '?' : '.';
    var room = max - (out ? out.length + 1 : 0) - 1;
    var bit = src ? clause(src.replace(/[.!?]+["')]*$/, ''), room, out ? 3 : 4) : '';
    if (!out && bit.length < max * 0.3) bit = '';
    if (bit) {
      var end = sentence || mark === '?' ? mark : '';
      return (out ? plain(out) + (sentence ? ' ' : '. ') : '') + bit + end;
    }
    return out ? plain(out) : null;
  }
  // Slides held back from export, by index, with the reason.
  var HELD = {};
  function field(i, type, s, key) {
    var v = clean(s[key]); var max = LIMITS[type][key];
    if (!v || !max) return v;
    var sentence = /body|sub|context|note|tip|before|after|quote|label|save/.test(key);
    var c = cut(v, max, sentence);
    var url = v.match(/[a-z0-9-]+\.(co|com|net|org)\b\S*/i);
    if (key === 'cta' && url && (c === null || c.indexOf(url[0]) < 0)) c = url[0].length + 8 <= max ? 'Book at ' + url[0] : url[0];
    if (c === null) {
      // No clean cut. Keep the first sentence whole and let auto-fit shrink it.
      var first = sentences(v)[0];
      if (first.length <= max * 1.6) {
        note(i, 'over', key + ' is ' + first.length + ' characters, the limit is ' + max + '. There is no clean place to cut it, so it is kept whole and the type shrinks.' + (first !== v ? ' The rest after the first sentence was dropped.' : '') + ' Shorten it.');
        return first;
      }
      HELD[i] = key + ' is ' + v.length + ' characters, the limit is ' + max + ', and it has no clean place to cut';
      note(i, 'cut', 'Not exported. ' + HELD[i] + '. Rewrite it in one or two short sentences.');
      return first;
    }
    if (c !== v) note(i, 'cut', key + ' was ' + v.length + ' characters, the limit is ' + max + '. Now ends "' + tail(c) + '".');
    return c;
  }
  function tail(c) { return c.length <= 44 ? c : '...' + c.slice(-44).replace(/^\S*\s/, ''); }
  function icon(name, cls) { return (window.MC_ICONS[name] || '').replace('<svg ', '<svg class="mc-icon ' + (cls || '') + '" aria-hidden="true" '); }
  function pad(n) { return (n < 10 ? '0' : '') + n; }
  function photoName(s) {
    var name = Q.get('photo') || s.photo;
    return name ? String(name).replace(/\.jpe?g$/i, '').replace(/[^a-z0-9_]/gi, '') : '';
  }
  // True when the slide asks for a photo and that photo actually loaded.
  function hasPhoto(s) { var n = photoName(s); return !!n && !MISSING[n]; }
  function missingNote(i, s) {
    var n = photoName(s), m = MISSING[n]; if (!n || !m) return;
    note(i, 'missing', n + '.jpg is not in photos/. ' + (m === 'brief'
      ? 'It is in brief/real-photos/, copy it into photos/ and render again.'
      : 'It is not in brief/real-photos/ either, check the spelling.') + ' This slide shows the no-photo layout until then.');
  }
  function photo(s) {
    var name = photoName(s); var focus = Q.get('focus') || (Q.get('photo') ? '50% 50%' : s.focus) || '50% 50%';
    // Second line of defence: if the file fails after the check, the image is removed rather
    // than shown as a broken-image icon.
    return '<div class="photo"><img alt="" src="' + PHOTOS + name + '.jpg" style="object-position:' + esc(focus) + '" onerror="this.remove()"></div>';
  }
  function foot(i, n, inverse) {
    var last = i === n - 1;
    return '<div class="row-foot"><img class="logo" alt="Marathon Creative" src="' + LOGO + (inverse ? 'marathon-logo-white.svg' : 'marathon-logo-dark.svg') + '">' +
      '<span class="count">' + pad(i + 1) + ' / ' + pad(n) + (last ? '' : icon('arrow-right')) + '</span></div>';
  }

  // Normalise the fill: cover first, end last, steps numbered, limits enforced.
  function plan(d) {
    var slides = (d.slides || []).filter(function (s) { return s && LIMITS[s.type]; });
    var cover = slides.filter(function (s) { return s.type === 'cover'; })[0];
    var end = slides.filter(function (s) { return s.type === 'end'; })[0];
    var middle = slides.filter(function (s) { return s.type !== 'cover' && s.type !== 'end'; });
    if (!cover) { cover = { type: 'cover', title: d.topic || 'Marketing tip', photo: 'mc_retouched_05' }; note(0, 'cut', 'No cover in the fill file. A default cover was added, write a real title.'); }
    if (!end) end = { type: 'end', title: 'Want it handled?', body: 'Photography, video, design, ads, and print. One team, all in-house, Greater Houston.', services: ['photography', 'drone', 'video', 'social'], cta: 'Book at marathoncreative.co', save: 'Save this for later.' };
    // Too many slides: drop steps from the end first, so the stat, quote, and before and after survive.
    var steps = middle.filter(function (s) { return s.type === 'step'; }).length, total = middle.length + 2;
    var keep = Math.min(MAX_STEPS, steps, Math.max(1, steps - Math.max(0, middle.length - (MAX_SLIDES - 2))));
    var seen = 0;
    middle = middle.filter(function (s) { if (s.type !== 'step') return true; seen++; return seen <= keep; }).slice(0, MAX_SLIDES - 2);
    if (middle.length + 2 < total) note(0, 'cut', total + ' slides and ' + steps + ' steps in the fill file. The limits are ' + MAX_SLIDES + ' slides and ' + MAX_STEPS + ' steps, so ' + (steps - keep) + ' steps from the end were dropped.');
    return [cover].concat(middle, [end]);
  }

  function render(d) {
    var list = plan(d); var n = list.length;
    var series = labelCut(clean(d.series), LIMITS.deck.series), topic = labelCut(clean(d.topic), LIMITS.deck.topic);
    if (series !== clean(d.series)) note(0, 'cut', 'series is longer than ' + LIMITS.deck.series + ' characters. Cut to "' + series + '".');
    if (topic !== clean(d.topic)) note(0, 'cut', 'topic is longer than ' + LIMITS.deck.topic + ' characters. Cut to "' + topic + '".');
    var totalSteps = list.filter(function (s) { return s.type === 'step'; }).length, stepNo = 0;
    return list.map(function (s, i) {
      var f = function (k) { return esc(field(i, s.type, s, k)); };
      if (s.confirm) note(i, 'confirm', clean(s.confirm));
      missingNote(i, s);
      var h = '', shown = (s.type === 'cover' || s.type === 'step') && hasPhoto(s);
      if (s.type === 'cover') {
        // A credit describes the photo, so it goes when the photo does.
        var credit = Q.get('photo') || !shown ? '' : f('credit');  // a test photo never carries the fill file credit
        h = (shown ? photo(s) : '') + (credit ? '<div class="credit">' + credit + '</div>' : '') +
          '<div class="panel"><div class="bar"></div><div class="row-top"><span class="eyebrow">' + esc(series) + (topic ? ', ' + esc(topic) : '') + '</span></div>' +
          '<div class="fit"><h1 class="cover-title fs">' + f('title') + '</h1>' + (s.sub ? '<p class="cover-sub fs">' + f('sub') + '</p>' : '') + '</div>' +
          foot(i, n, true) + '</div>';
      } else if (s.type === 'step') {
        stepNo++;
        var label = '<span class="eyebrow">Step ' + stepNo + ' of ' + totalSteps + '</span>';
        var tip = s.tip ? '<div class="spacer"></div><aside class="tip fs"><span class="eyebrow">Do this</span><p>' + f('tip') + '</p></aside>' : '';
        if (shown) {
          h = photo(s) + '<div class="tab">' + pad(stepNo) + '</div><div class="tab-label">' + label + '<span class="eyebrow eyebrow--quiet">' + esc(topic) + '</span></div>' +
            '<div class="fit"><h2 class="title fs">' + f('title') + '</h2><p class="body fs">' + f('body') + '</p>' + tip + '</div>' + foot(i, n, false);
        } else {
          h = '<div class="row-top">' + label + '<span class="eyebrow eyebrow--quiet">' + esc(topic) + '</span></div>' +
            '<div class="num">' + pad(stepNo) + '</div><div class="bar"></div>' +
            '<div class="fit"><h2 class="title fs">' + f('title') + '</h2><p class="body fs">' + f('body') + '</p>' + tip + '</div>' + foot(i, n, false);
        }
      } else if (s.type === 'stat') {
        var v = field(i, 'stat', s, 'value'); var size = v.length <= 2 ? 400 : v.length === 3 ? 330 : v.length === 4 ? 260 : 210;
        h = '<div class="row-top"><span class="eyebrow">By the numbers</span><span class="eyebrow eyebrow--quiet">' + esc(topic) + '</span></div>' +
          '<div class="bar"></div><div class="fit"><div class="stat"><span class="stat-value' + (/[,;$Qgjpqy]/.test(v) ? ' stat-value--desc' : '') + (/[$]/.test(v) ? ' stat-value--asc' : '') + '" style="font-size:' + size + 'px">' + esc(v) + '</span>' +
          (s.unit ? '<span class="stat-unit fs">' + f('unit') + '</span>' : '') + '</div>' +
          '<h2 class="stat-label fs">' + f('label') + '</h2>' + (s.context ? '<p class="context fs">' + f('context') + '</p>' : '') +
          (s.source ? '<p class="source">' + f('source') + '</p>' : '') + '</div>' + foot(i, n, false);
      } else if (s.type === 'compare') {
        h = '<div class="row-top"><span class="eyebrow">Before and after</span><span class="eyebrow eyebrow--quiet">' + esc(topic) + '</span></div>' +
          '<div class="fit"><h2 class="title fs">' + f('title') + '</h2>' +
          '<div class="card card--before"><span class="eyebrow">Before</span><p class="fs">' + f('before') + '</p></div>' +
          '<div class="card card--after"><span class="eyebrow">After</span><p class="fs">' + f('after') + '</p></div>' +
          (s.note ? '<p class="note fs">' + f('note') + '</p>' : '') + '</div>' + foot(i, n, false);
      } else if (s.type === 'quote') {
        h = '<div class="row-top"><span class="eyebrow">Worth repeating</span><span class="eyebrow eyebrow--quiet">' + esc(topic) + '</span></div>' +
          '<div class="fit"><div class="quote-mark" aria-hidden="true">“</div><blockquote class="quote fs">' + f('quote') + '</blockquote>' +
          '<div class="attrib"><div class="bar"></div><span class="attrib-name">' + f('name') + '</span>' + (s.role ? '<span class="attrib-role">' + f('role') + '</span>' : '') + '</div></div>' + foot(i, n, false);
      } else if (s.type === 'end') {
        var sv = (s.services || []).filter(function (k) { return SERVICES[k]; }).slice(0, 4);
        h = '<div class="bar"></div><div class="row-top"><span class="eyebrow">' + esc(series) + '</span></div>' +
          '<div class="fit"><h2 class="end-title fs">' + f('title') + '</h2>' + (s.body ? '<p class="end-body fs">' + f('body') + '</p>' : '') +
          (sv.length ? '<div class="services">' + sv.map(function (k) { return '<span class="service">' + icon(k) + SERVICES[k] + '</span>'; }).join('') + '</div>' : '') +
          '<span class="cta">' + f('cta') + icon('arrow-right') + '</span>' + (s.save ? '<p class="save">' + f('save') + '</p>' : '') + '</div>' + foot(i, n, true);
      }
      return { type: s.type, html: '<section class="slide slide--' + s.type + (shown ? ' has-photo' : s.type === 'cover' ? ' no-photo' : '') + '" data-i="' + i + '">' + h + '</section>' };
    });
  }

  // Auto-fit. Shrink every fitting line on the slide together, so hierarchy holds. At the
  // floor, drop whole sentences from the longest paragraph until it fits, and say so.
  // Two kinds of overflow are checked. Down: the copy is taller than the slide. Across: one
  // word with no spaces, a street or subdivision name, is wider than the column. Across is
  // measured with word breaking switched off (.measuring), so the engine can see the problem.
  function overflows(r) { return r.scrollHeight > r.clientHeight + 1; }
  var WIDE = '.fs, .attrib-name, .attrib-role, .cta, .save, .source, .service';
  var NAMES = { 'cover-title': 'title', 'cover-sub': 'sub', title: 'title', body: 'body', tip: 'tip', 'stat-unit': 'unit', 'stat-label': 'label',
    context: 'context', quote: 'quote', note: 'note', 'end-title': 'title', 'end-body': 'body', 'attrib-name': 'name', 'attrib-role': 'role', cta: 'cta', save: 'save', source: 'source', service: 'service' };
  function fieldName(el) {
    for (var k in NAMES) if (el.classList.contains(k)) return NAMES[k];
    if (el.closest('.card--before')) return 'before';
    if (el.closest('.card--after')) return 'after';
    if (el.closest('.tip')) return 'tip';
    return 'text';
  }
  function longest(t) { return String(t).replace(/\u00AD/g, '').split(/\s+/).map(function (w) { return w.replace(/^["(]+|[,.;:!?")]+$/g, ''); }).sort(function (a, b) { return b.length - a.length; })[0] || ''; }
  // Every element whose text runs past the right edge of its column, at the current size.
  function tooWide(slide) {
    var box = slide.querySelector('.fit'); if (!box) return [];
    var edge = box.getBoundingClientRect().right + 1, out = [];
    [].forEach.call(box.querySelectorAll(WIDE), function (el) {
      var rg = document.createRange(); rg.selectNodeContents(el);
      var right = el.getBoundingClientRect().right;
      [].forEach.call(rg.getClientRects(), function (q) { if (q.right > right) right = q.right; });
      if (right > edge || el.scrollWidth > el.clientWidth + 1 && getComputedStyle(el).display !== 'inline') out.push(el);
    });
    return out;
  }
  // Head eyebrows sit outside the fitting column and never wrap, so they get their own fitting,
  // the same order the title gets. 1. Shrink every eyebrow in the row together, down to 75%.
  // 2. Past that, cut the topic (or the series) at a whole word, never inside one, with no
  // dangling "and", "for", or comma, and say so. An eyebrow never renders a sliced glyph.
  var BROW_FLOOR = 0.75;
  function clipped(el) { return el.scrollWidth > el.clientWidth + 1; }
  function fitEyebrows(slide, i) {
    [].forEach.call(slide.querySelectorAll('.row-top, .tab-label'), function (row) {
      var els = [].slice.call(row.querySelectorAll(':scope > .eyebrow')); if (!els.length) return;
      var base = parseFloat(getComputedStyle(els[0]).fontSize), px = base;
      var any = function () { return els.some(clipped); };
      if (!any()) return;
      var before = els.map(function (el) { return el.textContent; });
      while (any() && px > base * BROW_FLOOR) { px = Math.max(base * BROW_FLOOR, px - 0.5); els.forEach(function (el) { el.style.fontSize = px + 'px'; }); }
      // Cut from the end of the line: the right-hand topic first, then the left label's tail.
      els.slice().reverse().forEach(function (el) {
        var w = el.textContent.split(' ');
        while (clipped(el) && w.length > 1) {
          w.pop();
          var t = w.join(' '), prev = '';
          while (prev !== t) { prev = t; t = t.replace(STOP, '').replace(/[\s,;:(\-]+$/, ''); }
          // A topic left with a single word after the comma reads as a stray, drop it.
          var k = t.lastIndexOf(', '); if (k > 0 && t.slice(k + 2).split(' ').length < 2) t = t.slice(0, k);
          w = t.split(' '); el.textContent = t;
        }
        if (clipped(el) && el.classList.contains('eyebrow--quiet')) el.textContent = '';
      });
      var pct = Math.round(px / base * 100);
      els.forEach(function (el, k) {
        if (el.textContent !== before[k]) note(i, 'cut', 'The eyebrow "' + before[k] + '" is too wide even at ' + pct + '% size. It now reads "' + (el.textContent || '(hidden)') + '". Shorten series or topic.');
      });
      if (pct < 100 && els.every(function (el, k) { return el.textContent === before[k]; })) note(i, 'fit', 'The eyebrow "' + before.join(' / ') + '" shrank to ' + pct + '% to stay whole. Shorter series or topic reads better.');
    });
  }
  // Break a run-together word with soft hyphens, so it wraps with a visible hyphen. Never
  // fewer than four letters on either side, and trailing punctuation does not count as a letter.
  function hyphenate(el) {
    var w = document.createTreeWalker(el, NodeFilter.SHOW_TEXT), t;
    while ((t = w.nextNode())) t.nodeValue = t.nodeValue.replace(/[A-Za-z0-9\u00C0-\u024F'-]{14,}/g, function (word) {
      var out = word.slice(0, 4);
      for (var k = 4; k < word.length - 4; k++) out += '\u00AD' + word[k];
      return out + word.slice(Math.max(4, word.length - 4));
    });
    el.dataset.hyph = '1';
  }
  // Measured shrink for the stat unit alone. True when the unit sits whole on one line at or
  // above WORD_FLOOR, false when it needs a hyphen. Leaves --own set only on success.
  function unitShrink(slide, el, shrunk) {
    if (tooWide(slide).indexOf(el) < 0) return shrunk.indexOf(el) > -1;
    var own = +el.style.getPropertyValue('--own') || 1;
    while (tooWide(slide).indexOf(el) > -1 && own > WORD_FLOOR) { own = Math.max(WORD_FLOOR, own - 0.02); el.style.setProperty('--own', own.toFixed(2)); }
    if (tooWide(slide).indexOf(el) > -1) { el.style.removeProperty('--own'); return false; }
    if (shrunk.indexOf(el) < 0) shrunk.push(el);
    el.dataset.own = Math.round(own * 100);
    return true;
  }
  function heightFit(slide, r, s) {
    while (overflows(r) && s > FLOOR) { s = Math.max(FLOOR, s - 0.02); slide.style.setProperty('--fit', s.toFixed(2)); }
    return s;
  }
  // Every field, title, sub, body, tip, label, context, note, and the rest, gets the same order.
  // 1. Shrink the whole slide, down to 80%, until every long word sits on one line.
  // 2. A word that cannot fit even at 80% sends the slide back to full size. Then every
  //    field still too wide at the size the slide actually exports at is hyphenated, and the
  //    sheet says so in red, field by field. A word is never split without a hyphen.
  // 3. The Auto-fit note "shrank to keep it on one line" is written only for a field that is
  //    whole on one line in the exported slide.
  function fit(slide) {
    var r = slide.querySelector('.fit'); if (!r) return;
    var i = +slide.dataset.i, s = 1, wideAt1 = [], broke = [], shrunk = [];
    slide.classList.add('measuring');
    // The stat unit is one line under the number. A long unit is measured first and shrinks on
    // its own, down to WORD_FLOOR, so the number, label, and context keep their full size. Only
    // a unit too wide even at its own 80% falls through to the hyphen pass below.
    var unit = slide.querySelector('.stat-unit');
    if (unit) unitShrink(slide, unit, shrunk);
    wideAt1 = tooWide(slide);
    // A long word may shrink the slide only to WORD_FLOOR. Shrinking further to save one word
    // makes every other line too small to read on a phone, so past that the word is hyphenated.
    while (tooWide(slide).length && s > WORD_FLOOR) { s = Math.max(WORD_FLOOR, s - 0.02); slide.style.setProperty('--fit', s.toFixed(2)); }
    if (!tooWide(slide).length) s = heightFit(slide, r, s);
    if (tooWide(slide).length) {
      // Shrinking the whole slide cannot hold the word, so it buys nothing. Back to full size.
      slide.classList.add('broken');
      s = 1; slide.style.setProperty('--fit', '1');
      // Hyphenate what is too wide at the export size, fit for height, and check again, since
      // a field that fit at a smaller size may not fit at this one.
      for (var pass = 0; pass < 6; pass++) {
        var wide = tooWide(slide).filter(function (el) { return broke.indexOf(el) < 0; });
        if (!wide.length) break;
        wide.forEach(function (el) {
          // The stat unit is one short line, so before it is hyphenated it gets its own measured
          // shrink, down to WORD_FLOOR, the same floor a title gets. Only past that does it break.
          if (el.classList.contains('stat-unit') && shrunk.indexOf(el) < 0 && unitShrink(slide, el, shrunk)) return;
          if (el.classList.contains('stat-unit')) { el.style.removeProperty('--own'); delete el.dataset.own; shrunk = shrunk.filter(function (x) { return x !== el; }); }
          hyphenate(el); broke.push(el);
        });
        s = heightFit(slide, r, s);
      }
    }
    // A unit that shrank on its own was measured at full slide size. If the whole slide shrank
    // afterwards, for height or for another field, give the unit back what it can hold, so it
    // never ends up at its own 80% times the slide's 80%.
    shrunk.forEach(function (el) {
      var own = +el.style.getPropertyValue('--own') || 1;
      while (own < 1) { var up = Math.min(1, own + 0.02); el.style.setProperty('--own', up.toFixed(2)); if (tooWide(slide).indexOf(el) > -1) { el.style.setProperty('--own', own.toFixed(2)); break; } own = up; }
      el.dataset.own = Math.round(own * 100);
    });
    shrunk = shrunk.filter(function (el) { if (+el.dataset.own >= 100) { el.style.removeProperty('--own'); return false; } return true; });
    // Truth check, still measuring, so a word may only break at a soft hyphen. Anything still
    // too wide here would be clipped or split without a hyphen in the export, and the note says so.
    var clippedEls = tooWide(slide);
    slide.classList.remove('measuring');
    clippedEls.forEach(function (el) {
      note(i, 'cut', fieldName(el) + ' "' + longest(el.textContent) + '" is still wider than the slide and is cut off at the right margin. Do not post. Add a space or shorten it.');
      HELD[i] = HELD[i] || fieldName(el) + ' has a word too wide for the slide even with hyphens';
    });
    shrunk.forEach(function (el) {
      note(i, 'fit', fieldName(el) + ' "' + longest(el.textContent) + '" is one long word, so it shrank on its own to ' + el.dataset.own + '% to stay whole on one line. Adding a space reads better.');
    });
    broke.filter(function (el) { return clippedEls.indexOf(el) < 0; }).forEach(function (el) {
      note(i, 'cut', fieldName(el) + ' has a word too wide for the slide, "' + longest(el.textContent) + '". It breaks mid-word with a hyphen' + (s < 1 ? ' at ' + Math.round(s * 100) + '% type' : '') + '. Shorten it, abbreviate it, or add a space.');
    });
    var whole = wideAt1.filter(function (el) { return broke.indexOf(el) < 0 && shrunk.indexOf(el) < 0; });
    if (whole.length && s < 1) note(i, 'fit', whole.map(function (el) { return fieldName(el) + ' "' + longest(el.textContent) + '"'; }).join(', ') + (whole.length > 1 ? ' are long words' : ' is one long word') + ', so the whole slide shrank to ' + Math.round(s * 100) + '% to keep ' + (whole.length > 1 ? 'each' : 'it') + ' on one line.');
    fitEyebrows(slide, i);
    var guard = 0;
    while (overflows(r) && guard++ < 40) {
      // Shorten the longest paragraph by whole sentences or a complete clause, never mid-clause.
      // A "Do this" tip that cannot be shortened cleanly is removed whole.
      var ps = [].slice.call(r.querySelectorAll('p.fs, .tip p')).sort(function (a, b) { return b.textContent.length - a.textContent.length; });
      var done = false;
      for (var q = 0; q < ps.length && !done; q++) {
        var p = ps[q], t = p.textContent, c = null;
        for (var f = 0.85; f >= 0.3 && !c; f -= 0.1) { var x = cut(t, Math.floor(t.length * f), true); if (x && x.length < t.length) c = x; }
        if (c) { p.textContent = c; note(i, 'cut', 'Too long to fit even at ' + Math.round(FLOOR * 100) + '% type. Paragraph now ends "' + tail(c) + '".'); done = true; }
        else if (p.closest('.tip')) { var tp = p.closest('.tip'); if (tp.previousElementSibling && tp.previousElementSibling.classList.contains('spacer')) tp.previousElementSibling.remove(); tp.remove(); note(i, 'cut', 'Too long to fit even at ' + Math.round(FLOOR * 100) + '% type. The Do this tip had no clean place to cut and was removed.'); done = true; }
      }
      if (!done) break;
    }
    if (overflows(r)) { HELD[i] = HELD[i] || 'the copy is too tall for the slide even at ' + Math.round(FLOOR * 100) + '% type and has no clean place to cut'; note(i, 'cut', 'Not exported. ' + HELD[i] + '. Shorten the title or body.'); }
    if (HELD[i] && !slide.classList.contains('held')) {
      // The card covers the whole slide, so a held slide exported by mistake is an instruction
      // sheet, not a post. Half a sentence is never posted.
      slide.classList.add('held');
      slide.insertAdjacentHTML('beforeend', '<div class="refusal"><div class="bar"></div><span class="eyebrow">Not exported, do not post</span>' +
        '<h2 class="refusal-title">Slide ' + pad(i + 1) + ' is too long to cut cleanly</h2><p class="refusal-body">' + esc(HELD[i]) + '.</p>' +
        '<p class="refusal-how">Edit the fill file, then render again. The template cuts at whole sentences and complete clauses only.</p></div>');
    }
    if (s < 1) slide.dataset.fit = Math.round(s * 100);
    var flags = (notes[i] || []).filter(function (x) { return x.kind === 'cut' || x.kind === 'over'; }).length;
    if (flags) slide.dataset.flags = flags;
  }

  function labelFor(t) { return { cover: 'Cover', step: 'Step', stat: 'Stat', compare: 'Before and after', quote: 'Quote', end: 'End card' }[t]; }

  function build() {
    var d = window.MC_CAROUSEL || { slides: [] };
    var slides = render(d);
    var one = parseInt(Q.get('slide'), 10);
    var root = document.getElementById('root');
    if (one) {
      var s = slides[one - 1] || slides[0];
      root.innerHTML = s.html; document.body.style.background = 'transparent';
      fit(root.querySelector('.slide'));
    } else {
      var only = (Q.get('only') || '').split(',').map(function (x) { return parseInt(x, 10); }).filter(Boolean);
      var z = parseFloat(Q.get('z')) || 0.32;
      var pick = slides.map(function (s, i) { return { s: s, i: i }; }).filter(function (o) { return !only.length || only.indexOf(o.i + 1) > -1; });
      var title = Q.get('title') || ((d.topic || 'Tips carousel') + ', ' + slides.length + ' slides');
      root.innerHTML = '<div class="sheet" style="--z:' + z + '"><div class="sheet-head"><span class="eyebrow">' + esc(d.series || 'Tips carousel') + '</span><h1>' + esc(title) + '</h1><p>1080 x 1350, ' + esc(Q.get('fill') || 'fill.js') + (Q.get('photo') ? ', photo ' + esc(Q.get('photo')) : '') + '</p></div><div class="row">' +
        pick.map(function (o) { return '<div class="thumb" data-t="' + o.i + '"><div class="frame">' + o.s.html + '</div><div class="thumb-label">' + pad(o.i + 1) + ' <span>' + labelFor(o.s.type) + '</span></div><div class="notes"></div></div>'; }).join('') + '</div></div>';
      [].forEach.call(root.querySelectorAll('.slide'), fit);
      [].forEach.call(root.querySelectorAll('.thumb'), function (t) {
        var i = +t.dataset.t, sl = t.querySelector('.slide');
        var list = (notes[i] || []).slice(); if (i === 0 && only.length && only.indexOf(1) < 0) list = [];
        if (sl.dataset.fit) list.unshift({ kind: 'fit', text: 'Type auto-fit to ' + sl.dataset.fit + '%.' });
        t.querySelector('.notes').innerHTML = list.map(function (x) {
          var red = x.kind === 'cut' || x.kind === 'missing' || x.kind === 'over';
          var head = { confirm: 'Editor note', cut: 'Cut to fit', over: 'Over limit', missing: 'Missing photo', fit: 'Auto-fit' }[x.kind];
          return '<div class="flag' + (red ? ' flag--cut' : '') + '"><b>' + head + '</b>' + esc(x.text) + '</div>';
        }).join('');
      });
      document.documentElement.classList.add('zoomed');
    }
    document.documentElement.dataset.ready = '1';
  }

  // Load every photo the fill file names before building. A name that fails in photos/ is
  // looked up in brief/real-photos/ so the note can say whether to copy it or fix a typo.
  function probe(src) { return new Promise(function (ok) { var im = new Image(); im.onload = function () { ok(true); }; im.onerror = function () { ok(false); }; im.src = src; }); }
  function checkPhotos() {
    var d = window.MC_CAROUSEL || { slides: [] }, names = {};
    (d.slides || []).forEach(function (s) { if (s && (s.type === 'cover' || s.type === 'step')) { var n = photoName(s); if (n) names[n] = 1; } });
    return Promise.all(Object.keys(names).map(function (n) {
      return probe(PHOTOS + n + '.jpg').then(function (ok) {
        if (ok) return;
        return probe(BRIEF_PHOTOS + n + '.jpg').then(function (inBrief) { MISSING[n] = inBrief ? 'brief' : 'nowhere'; });
      });
    }));
  }

  function start() {
    var fill = (Q.get('fill') || 'fill.js').replace(/[^a-z0-9_\-./]/gi, '');
    var sc = document.createElement('script'); sc.src = fill;
    sc.onload = function () { checkPhotos().then(function () { return document.fonts.load('800 80px Montserrat'); }).then(function () { return document.fonts.ready; }).then(build); };
    sc.onerror = function () { document.getElementById('root').textContent = 'Fill file not found: ' + fill; };
    document.head.appendChild(sc);
  }
  start();
})();
fill.js80 lines, 3.5 KB
// Marathon tips carousel, fill file. This is the only file you edit to make a new carousel.
// Change the words and photo names below, save, then render (see README.md).
// Every field has a hard limit in carousel.js. Long copy shrinks to fit, then is cut at a
// sentence, and the contact sheet lists every cut so nothing goes out trimmed by surprise.
// "confirm" is an editor note. It never prints on a slide, it prints under the slide on the
// contact sheet. Do not post while the contact sheet still shows one.

window.MC_CAROUSEL = {
  series: "Marketing tip 07",
  topic: "Listing shoot prep",

  slides: [
    {
      type: "cover",
      photo: "mc_rosehill_17",
      focus: "50% 60%",
      title: "Get more out of your next listing shoot",
      sub: "Four things to handle before we arrive, from the team that shoots it, edits it, and runs the ads.",
      credit: "Rosehill Reserve entry, Greater Houston. Shot by Marathon."
    },
    {
      type: "step",
      photo: "mc_retouched_03",
      focus: "50% 60%",
      title: "Clear every surface, then clear it again",
      body: "Desks, counters, and display tables read as clutter on a phone screen. Pull about 80% of what is out, and leave one object per surface."
    },
    {
      type: "step",
      title: "Pick the light, not just the date",
      body: "Interiors shoot best mid-morning, when the light is even. Exteriors and drone go up in the last hour before sunset.",
      tip: "Tell us which shots matter most and we build the schedule around them."
    },
    {
      type: "step",
      photo: "mc_fullres_12",
      focus: "50% 55%",
      title: "Send the survey before the drone goes up",
      body: "We draw the lot line from your plat, not from a guess. Acreage, frontage, and utilities go on the listing, so we need them first."
    },
    {
      type: "step",
      title: "Write the fact row before the shoot",
      body: "Square feet for a showroom. Acreage and frontage for a lot. Bays and clear height for a warehouse. The photos should prove the facts.",
      tip: "Send it with the booking. We plan the shot list from it."
    },
    {
      type: "stat",
      value: "48",
      unit: "hours",
      label: "From shoot day to edited photos in your inbox.",
      context: "Photo, drone, and video are edited in-house, so nothing waits on an outside vendor.",
      source: "Marathon standard turnaround, listing photography.",
      confirm: "Jacob to confirm the 48 hour turnaround before this posts."
    },
    {
      type: "compare",
      title: "Same lot, better headline",
      before: "Beautiful property in a great location! Must see!!",
      after: "2.1 wooded acres on the golf course. Utilities at the road, survey ready.",
      note: "Specific beats impressive. Lead with the fact a buyer would search for.",
      confirm: "Acreage is an example figure. Jacob to confirm or swap for the real listing."
    },
    {
      type: "quote",
      quote: "Most agencies execute. We think first. The plan comes before the camera does.",
      name: "Marathon Creative",
      role: "Pillar one, Strategic First"
    },
    {
      type: "end",
      title: "Want the whole shoot handled?",
      body: "Photography, drone, video, the listing copy, and the ads that run it. One team, all in-house, Greater Houston.",
      services: ["photography", "drone", "video", "social"],
      cta: "Book at marathoncreative.co",
      save: "Save this for your next listing."
    }
  ]
};
fills/critic-2x.js26 lines, 4.5 KB
// Second long-copy test, an industrial carousel where most fields run to twice the limit and
// most titles are one long sentence. Every cut must end on a whole sentence or a complete clause.
window.MC_CAROUSEL = {
  series: "Marketing tip 11 for industrial",
  topic: "Warehouse and flex space leasing",
  slides: [
    { type: "cover", photo: "mc_retouched_04", focus: "50% 50%",
      title: "How to shoot and market a 42,000 square foot tilt-wall warehouse so the leasing broker gets tours in the first week on market",
      sub: "Clear height, dock doors, trailer parking, power, and sprinkler spec are what a tenant rep searches for first, so we plan the drone flight, the interior shots, and the flyer copy around those facts before anyone books the shoot day, and we hand you the files in 48 hours with captions ready for the listing sites and the email blast.",
      credit: "Cangelosi showroom floor, Houston. Shot by Marathon for a commercial client with a long credit line." },
    { type: "step", photo: "mc_rosehill_16", focus: "50% 50%",
      title: "Lead with the clear height, the dock doors, and the trailer parking, not the lobby finishes or the paint color on the office side",
      body: "A tenant rep scrolling LoopNet decides in two seconds. Put 32 foot clear, 12 dock-high doors, two drive-in ramps, 3,000 amp three phase power, and ESFR sprinklers in the first line of the listing and the first frame of the carousel. The office build-out matters later, on the tour, when they already want the space. Square feet for the warehouse and square feet for the office go separate, never lumped, because a 5% office ratio is a selling point and a 20% ratio is a negotiation. We pull this from your site plan before the drone goes up.",
      tip: "Send the site plan, the power spec, and the sprinkler spec with the booking form so the shot list is built from real numbers before the crew drives out." },
    { type: "step", photo: "mc_retouched_08", focus: "50% 30%",
      title: "Shoot the truck court from 200 feet so the turning radius reads on a phone",
      body: "The truck court depth sells the building. A ground shot hides it. Fly at 200 feet, frame the full apron with a trailer parked for scale, and shoot one pass at dock height so the doors line up. Then shoot the yard fence, the gate, and the guard shack if there is one, because security is the second question every logistics tenant asks after clear height and before rate per square foot."},
    { type: "step", photo: "mc_fullres_12", focus: "50% 50%",
      title: "Draw the parcel line from the plat on Northchasewoodspringsindustrialparkway",
      body: "We draw the lot line from your plat, not from a guess. Acreage, frontage on the feeder road, rail spur access, detention pond location, and utilities at the road all go on the listing, so we need them first, and we need them signed off by the broker before the overlay goes on any image that a tenant will screenshot and forward to their CFO." },
    { type: "stat", value: "48", unit: "hours", label: "From shoot day to edited photos, drone stills, and a captioned flyer draft in the broker's inbox, ready for LoopNet and CoStar.", context: "Photo, drone, video, and the flyer are all edited in-house in Greater Houston, so nothing waits on an outside vendor, a freelancer, or an overnight print queue somewhere else in the country.", source: "Marathon standard turnaround for commercial and industrial listing photography, 2026." },
    { type: "compare", title: "Same warehouse, a headline a tenant rep would actually search", before: "Beautiful modern industrial facility in a great location with excellent access! Must see!! Call today for details and pricing information!!", after: "42,000 SF tilt-wall, 32 foot clear, 12 dock-high doors, 3,000 amp power, ESFR, 130 foot truck court, two miles to Beltway 8.", note: "Specific beats impressive. Lead with the facts a tenant rep filters on, and the tour request follows from there." },
    { type: "end", title: "Want the whole warehouse listing shoot handled end to end?", body: "Photography, drone, video, the listing copy, the flyer, the email blast, and the paid ads that run it all. One team, all in-house, Greater Houston, with the files in 48 hours and a person who answers the phone.", services: ["photography", "drone", "video", "print-signage"], cta: "Book your industrial shoot today at marathoncreative.co/commercial", save: "Save this for the next warehouse or flex space you list this year." }
  ]
};
fills/critic-word.js11 lines, 822 bytes
window.MC_CAROUSEL = {
  series: "Marketing tip 09",
  topic: "Street names",
  slides: [
    { type: "cover", photo: "mc_retouched_08", title: "Listing on Northchasewoodsparkwaydistributioncenterboulevard", sub: "Unbroken: Westheimerlakesboulevardfrontage.", credit: "Shot by Marathon." },
    { type: "step", photo: "mc_fullres_12", title: "Kingsbridgeplantationestatesreservedrive", body: "The parcel on Kingsbridgeplantationestatesreservedrivenorth has 2.1 acres." },
    { type: "stat", value: "1,500", unit: "Northchasewoodsparkway", label: "Squarefeetonnorthchasewoodsparkwayboulevard", context: "Ok.", source: "Ok." },
    { type: "end", title: "Northchasewoodsparkwaydistribution", body: "Photography and drone.", services: ["photography","drone"], cta: "Book at marathoncreative.co", save: "Save this." }
  ]
};
fills/long-eyebrows.js76 lines, 3.3 KB
// Long eyebrow test fill. The same carousel as fill.js, with series and topic at their full
// character limits in the widest capitals. The head eyebrows must shrink to stay whole, and past
// 75% cut the topic at a whole word. No eyebrow may ever render a sliced letter at the margin.
window.MC_CAROUSEL = {
  series: "Commercial marketing tip 12",
  topic: "Warehouse and flex shoot faster",

  slides: [
    {
      type: "cover",
      photo: "mc_rosehill_17",
      focus: "50% 60%",
      title: "Get more out of your next listing shoot",
      sub: "Four things to handle before we arrive, from the team that shoots it, edits it, and runs the ads.",
      credit: "Rosehill Reserve entry, Greater Houston. Shot by Marathon."
    },
    {
      type: "step",
      photo: "mc_retouched_03",
      focus: "50% 60%",
      title: "Clear every surface, then clear it again",
      body: "Desks, counters, and display tables read as clutter on a phone screen. Pull about 80% of what is out, and leave one object per surface."
    },
    {
      type: "step",
      title: "Pick the light, not just the date",
      body: "Interiors shoot best mid-morning, when the light is even. Exteriors and drone go up in the last hour before sunset.",
      tip: "Tell us which shots matter most and we build the schedule around them."
    },
    {
      type: "step",
      photo: "mc_fullres_12",
      focus: "50% 55%",
      title: "Send the survey before the drone goes up",
      body: "We draw the lot line from your plat, not from a guess. Acreage, frontage, and utilities go on the listing, so we need them first."
    },
    {
      type: "step",
      title: "Write the fact row before the shoot",
      body: "Square feet for a showroom. Acreage and frontage for a lot. Bays and clear height for a warehouse. The photos should prove the facts.",
      tip: "Send it with the booking. We plan the shot list from it."
    },
    {
      type: "stat",
      value: "48",
      unit: "hours",
      label: "From shoot day to edited photos in your inbox.",
      context: "Photo, drone, and video are edited in-house, so nothing waits on an outside vendor.",
      source: "Marathon standard turnaround, listing photography.",
      confirm: "Jacob to confirm the 48 hour turnaround before this posts."
    },
    {
      type: "compare",
      title: "Same lot, better headline",
      before: "Beautiful property in a great location! Must see!!",
      after: "2.1 wooded acres on the golf course. Utilities at the road, survey ready.",
      note: "Specific beats impressive. Lead with the fact a buyer would search for.",
      confirm: "Acreage is an example figure. Jacob to confirm or swap for the real listing."
    },
    {
      type: "quote",
      quote: "Most agencies execute. We think first. The plan comes before the camera does.",
      name: "Marathon Creative",
      role: "Pillar one, Strategic First"
    },
    {
      type: "end",
      title: "Want the whole shoot handled?",
      body: "Photography, drone, video, the listing copy, and the ads that run it. One team, all in-house, Greater Houston.",
      services: ["photography", "drone", "video", "social"],
      cta: "Book at marathoncreative.co",
      save: "Save this for your next listing."
    }
  ]
};
fills/long-unit.js17 lines, 2.3 KB
// Long word test for the stat unit line. A street name pasted into the unit with no spaces,
// as an MLS export or a plat often gives it. Every figure here is an example, not a claim.
window.MC_CAROUSEL = {
  series: "Marketing tip 09",
  topic: "Land listings",
  slides: [
    { type: "cover", photo: "mc_rosehill_16", title: "Name the road a buyer can find", sub: "Frontage is the fact a land buyer filters by. Put the road name where it reads." },
    { type: "stat", value: "1,500", unit: "Northchasewoodsparkway", label: "Feet of frontage, named on the first frame.", context: "The unit line is the road the frontage sits on.", source: "Example figure for the long unit test.", confirm: "Test only. Never post." },
    { type: "stat", value: "1,500", unit: "Northchasewoodsparkway", label: "Squarefeetonnorthchasewoodsparkwayboulevard", context: "The label forces a hyphen, so the slide stays at full size and the unit gets its own shrink.", source: "Example figure for the long unit test.", confirm: "Test only. Never post." },
    { type: "stat", value: "1,500", unit: "Woodmeadowmanormoundwood", label: "Squarefeetonkingsbridgeplantationestatesreserve", context: "A unit too wide even at its own 80% breaks with a hyphen.", source: "Example figure for the long unit test.", confirm: "Test only. Never post." },
    { type: "stat", value: "210", unit: "ftonNorthchase", label: "Feet of frontage, unit at its 16 character limit with no spaces.", source: "Example figure for the long unit test.", confirm: "Test only. Never post." },
    { type: "stat", value: "42000", unit: "squarefeetofwarehousespace", label: "Northchasewoodsparkwaydistributioncenterboulevard", context: "Industrial.", source: "Listing sheet.", confirm: "Test only. Never post." },
    { type: "stat", value: "14", unit: "lotsonGrandparkwaynorth", label: "Lots in the plat, all shot in one drone flight.", source: "Example figure for the long unit test.", confirm: "Test only. Never post." },
    { type: "end", title: "Want the land listing handled?", body: "Drone, photography, plat overlays, and copy. One team, all in-house, Greater Houston.", services: ["drone", "photography", "print-signage", "social"], cta: "Book at marathoncreative.co", save: "Save this for your next land listing." }
  ]
};
fills/long-words-body.js33 lines, 2.1 KB
// Long word test two. The run-together street name sits in the body, sub, tip, context, label,
// before, after, note, and quote, not only in titles. Every field gets the same handling: shrink
// the slide until the word holds on one line, and when it cannot, break it with a visible hyphen
// and flag the field in red. A word never splits without a hyphen.
window.MC_CAROUSEL = {
  series: "Marketing tip 12",
  topic: "Street names",
  slides: [
    { type: "cover", photo: "mc_rosehill_18", focus: "50% 50%",
      title: "Lot 14 Northchasewoodspringsplantationestates",
      sub: "A land listing on Northchasewoodspringsplantationestatesboulevard.",
      credit: "Rosehill Reserve, Greater Houston." },
    { type: "step", photo: "mc_fullres_11",
      title: "Shoot Northchasewoodspringsplantationestatesblvd",
      body: "1.4 acres, 210 ft frontage on Northchasewoodspringsplantationestatesboulevard, water and power at the road." },
    { type: "step",
      title: "Fix the name before the slide",
      body: "The MLS export reads Northchasewoodspringsplantationestatesboulevard. Add the spaces back so it reads on a phone.",
      tip: "Copy Northchasewoodspringsplantationestatesboulevard from the plat, then add spaces." },
    { type: "stat", value: "210", unit: "ft frontage",
      label: "On Northchasewoodspringsplantationestatesboulevard.",
      context: "No beds, no baths, just land. The frontage is the fact buyers ask about first.",
      confirm: "Example figures. Jacob to confirm or swap for a real listing." },
    { type: "compare", title: "Same street, readable name",
      before: "NORTHCHASEWOODSPRINGSPLANTATIONESTATESBOULEVARD lot, call now!!",
      after: "Lot 14 on Northchase Woodsprings Boulevard. 1.4 acres, utilities at the road.",
      note: "Write it the way a buyer types it into a search bar." },
    { type: "end", title: "Land listings, handled",
      body: "Drone, photography, and copy for Northchasewoodspringsplantationestatesboulevard.",
      services: ["drone", "photography"], cta: "Book at marathoncreative.co", save: "Save this." }
  ]
};
fills/long-words.js41 lines, 2.7 KB
// Long word test fill. Houston street and subdivision names often run together with no spaces
// when someone pastes them from a plat or an MLS export. Every title field below carries one.
// The template must shrink the slide until the word fits on one line, and when it still cannot,
// break the word inside the margin and flag the slide "Cut to fit". Nothing may run off the edge.
window.MC_CAROUSEL = {
  series: "Marketing tip 08",
  topic: "Naming the listing",
  slides: [
    { type: "cover", photo: "mc_fullres_11", focus: "50% 55%",
      title: "Shooting 14 lots on Northchasewoodspa Drive",
      sub: "How we name a land listing so buyers can find it, from the team that flies the drone and writes the copy.",
      credit: "Wooded acreage, Greater Houston. Shot by Marathon." },
    { type: "step", photo: "mc_retouched_05", focus: "50% 55%",
      title: "Spell out Northchasewoodspa",
      body: "Buyers search the street the way the county records it. Copy the name from the plat, then check it against the map pin." },
    { type: "step",
      title: "Cypresscreeklakesnorthwestvillage is not a headline",
      body: "A run-together subdivision name from an MLS export breaks on a phone. Add the spaces back before it goes on a slide.",
      tip: "Paste names from the plat, never from the MLS export." },
    { type: "stat", value: "14", unit: "lots",
      label: "Platted on Northchasewoodspa, each with its own boundary line.",
      context: "We draw every lot line from the survey, so the acreage on the photo matches the acreage in the listing.",
      source: "Example listing, figures for illustration.",
      confirm: "Example figures. Jacob to confirm or swap for a real listing." },
    { type: "compare", title: "Same street, readable name",
      before: "NORTHCHASEWOODSPADRIVELOTFOURTEEN, call now!!",
      after: "Lot 14 on Northchasewoods Parkway. 1.8 acres, utilities at the road.",
      note: "Write the name the way a buyer would type it into a search bar.",
      confirm: "Acreage is an example figure. Jacob to confirm." },
    { type: "quote",
      quote: "If a buyer cannot read the street name, Northchasewoodspa, on a phone, the photo never gets a chance.",
      name: "Marathon Creative", role: "Pillar one, Strategic First" },
    { type: "end",
      title: "Cypresscreeklakesnorthwestvillage, handled",
      body: "Drone, photography, the listing copy, and the ads that run it. One team, all in-house, Greater Houston.",
      services: ["drone", "photography", "social", "print-signage"],
      cta: "Book at marathoncreative.co",
      save: "Save this for your next land listing." }
  ]
};
fills/missing-photo.js82 lines, 3.7 KB
// Missing photo test. The cover names mc_retouched_09 and step one names mc_retouched_01, both
// in brief/real-photos/ but never copied into photos/. A later step names mc_fullres_21, a typo.
// Marathon tips carousel, fill file. This is the only file you edit to make a new carousel.
// Change the words and photo names below, save, then render (see README.md).
// Every field has a hard limit in carousel.js. Long copy shrinks to fit, then is cut at a
// sentence, and the contact sheet lists every cut so nothing goes out trimmed by surprise.
// "confirm" is an editor note. It never prints on a slide, it prints under the slide on the
// contact sheet. Do not post while the contact sheet still shows one.

window.MC_CAROUSEL = {
  series: "Marketing tip 07",
  topic: "Listing shoot prep",

  slides: [
    {
      type: "cover",
      photo: "mc_retouched_09",
      focus: "50% 60%",
      title: "Get more out of your next listing shoot",
      sub: "Four things to handle before we arrive, from the team that shoots it, edits it, and runs the ads.",
      credit: "Rosehill Reserve entry, Greater Houston. Shot by Marathon."
    },
    {
      type: "step",
      photo: "mc_retouched_01",
      focus: "50% 60%",
      title: "Clear every surface, then clear it again",
      body: "Desks, counters, and display tables read as clutter on a phone screen. Pull about 80% of what is out, and leave one object per surface."
    },
    {
      type: "step",
      title: "Pick the light, not just the date",
      body: "Interiors shoot best mid-morning, when the light is even. Exteriors and drone go up in the last hour before sunset.",
      tip: "Tell us which shots matter most and we build the schedule around them."
    },
    {
      type: "step",
      photo: "mc_fullres_21",
      focus: "50% 55%",
      title: "Send the survey before the drone goes up",
      body: "We draw the lot line from your plat, not from a guess. Acreage, frontage, and utilities go on the listing, so we need them first."
    },
    {
      type: "step",
      title: "Write the fact row before the shoot",
      body: "Square feet for a showroom. Acreage and frontage for a lot. Bays and clear height for a warehouse. The photos should prove the facts.",
      tip: "Send it with the booking. We plan the shot list from it."
    },
    {
      type: "stat",
      value: "48",
      unit: "hours",
      label: "From shoot day to edited photos in your inbox.",
      context: "Photo, drone, and video are edited in-house, so nothing waits on an outside vendor.",
      source: "Marathon standard turnaround, listing photography.",
      confirm: "Jacob to confirm the 48 hour turnaround before this posts."
    },
    {
      type: "compare",
      title: "Same lot, better headline",
      before: "Beautiful property in a great location! Must see!!",
      after: "2.1 wooded acres on the golf course. Utilities at the road, survey ready.",
      note: "Specific beats impressive. Lead with the fact a buyer would search for.",
      confirm: "Acreage is an example figure. Jacob to confirm or swap for the real listing."
    },
    {
      type: "quote",
      quote: "Most agencies execute. We think first. The plan comes before the camera does.",
      name: "Marathon Creative",
      role: "Pillar one, Strategic First"
    },
    {
      type: "end",
      title: "Want the whole shoot handled?",
      body: "Photography, drone, video, the listing copy, and the ads that run it. One team, all in-house, Greater Houston.",
      services: ["photography", "drone", "video", "social"],
      cta: "Book at marathoncreative.co",
      save: "Save this for your next listing."
    }
  ]
};
fills/stat-commas.js16 lines, 2.0 KB
// Stat test: comma and dollar figures with units at their 16 character limit.
// Every figure here is an example for the test only, not a Marathon claim.
window.MC_CAROUSEL = {
  series: "Marketing tip 08",
  topic: "Commercial leasing",
  slides: [
    { type: "cover", photo: "mc_fullres_12", title: "What a better listing does for a lease-up", sub: "Three numbers from flex, retail, and industrial space." },
    { type: "stat", value: "1,500", unit: "square feet", label: "Of flex space leased in 41 days after new photos went live.", context: "The prior listing sat for nine months.", source: "Example figure for the stat test.", confirm: "Example figure. Jacob to confirm before use." },
    { type: "stat", value: "$1,500", unit: "per month", label: "Ad budget that filled the retail center's last two bays.", context: "Paid social, run and reported in-house.", source: "Example figure for the stat test.", confirm: "Example figure. Jacob to confirm before use." },
    { type: "stat", value: "64,000", unit: "sq ft warehouse", label: "Shot in one afternoon, drone and ground, edited in 48 hours.", context: "Clear height and dock count went on the first frame.", source: "Example figure for the stat test.", confirm: "Example figure. Jacob to confirm before use." },
    { type: "stat", value: "12,5", unit: "square feet", label: "Short comma figure, the worst case for a wrapped unit.", source: "Example figure for the stat test.", confirm: "Test only. Never post." },
    { type: "stat", value: "$95", unit: "per month", label: "Short dollar figure, the tallest $ against the red rule.", source: "Example figure for the stat test.", confirm: "Test only. Never post." },
    { type: "end", title: "Want the listing handled?", body: "Photography, drone, video, copy, and ads. One team, all in-house, Greater Houston.", services: ["photography", "drone", "video", "social"], cta: "Book at marathoncreative.co", save: "Save this for your next lease-up." }
  ]
};
fills/stress-2x.js33 lines, 4.9 KB
// Functional test fill. Every field is roughly twice the length it should be, the photos are a
// portrait crop and the red boundary aerial, and there are 12 slides and seven steps, which is
// over the limits. This is what a rushed, untrained user would type. Render it and read the
// contact sheet: auto-fit and cut notes show exactly what the template did to hold the layout.
window.MC_CAROUSEL = {
  series: "Marketing tip 07 for real estate agents and builders",
  topic: "Everything to handle before listing shoot day",
  slides: [
    { type: "cover", photo: "mc_retouched_08", focus: "50% 40%",
      title: "How to photograph and market a 42,000 square foot warehouse, from the drone flight to the leasing flyer",
      sub: "Four things to handle before we arrive, from the team that shoots it, edits it, writes the listing copy, and runs the ads that put it in front of buyers across Greater Houston every single week.",
      credit: "Cangelosi showroom sample wall, Houston, Texas. Shot and retouched in-house by Marathon Creative." },
    { type: "step", photo: "mc_fullres_12",
      title: "Clear every surface in the space, then go back and clear it all again before we start",
      body: "Desks, counters, kitchen islands, and display tables read as clutter on a phone screen, even when they look fine in person. Pull about 80% of what is out. Leave one object per surface. Hide cords, mail, remotes, trash cans, and anything with a logo on it. Open every blind and turn on every light in the building before we arrive." },
    { type: "step",
      title: "Pick the light and the hour, not just the date on the calendar that works for the seller",
      body: "Interiors shoot best mid-morning, when the light is even and nothing is blown out, even in a 42,000 square foot space with 32 foot clear height and skylights. Exteriors and drone go up in the last hour before sunset, when the trees and rooftops get warm side light. If the listing needs both, we split the day or come back, and we tell you which shots matter most before the quote goes out.",
      tip: "Tell us which shots matter most and we build the whole schedule around them, including weather backup days for drone." },
    { type: "step", photo: "mc_retouched_08",
      title: "Send the survey and the plat before the drone goes up over the property",
      body: "We draw the lot line from your plat, not from a guess, because a wrong boundary on a listing photo is a real problem for the seller. Acreage, frontage, utilities, easements, and flood zone go on the listing too, so we need them before we fly, not after the photos are already edited." },
    { type: "step", title: "Write the fact row before the shoot happens, not after", body: "Square feet for a showroom. Acreage and frontage for a lot. Bays, dock doors, and clear height for a warehouse. The photos should prove the facts, so the facts come first and the shot list follows them.", tip: "Send it with the booking form. We plan the full shot list from it the same day." },
    { type: "step", title: "Fifth step that should not exist", body: "Extra step." },
    { type: "step", title: "Sixth step", body: "Extra step." },
    { type: "step", title: "Seventh step, over the limit", body: "This one is dropped." },
    { type: "stat", value: "48", unit: "business hours", label: "From the end of shoot day to fully edited photos delivered to your inbox and ready to post.", context: "Photo, drone, and video are edited in-house by the same team that shot them, so nothing waits on an outside vendor, a freelancer, or a second invoice.", source: "Marathon standard turnaround, listing photography, 2026.", confirm: "Jacob to confirm the turnaround." },
    { type: "compare", title: "Same lot, a much better and more specific headline", before: "Beautiful property in a great location!!! You have to see this one in person, it will not last long, call today!!!", after: "2.1 wooded acres on the golf course with utilities at the road, survey ready, and 310 feet of frontage.", note: "Specific beats impressive. Lead with the one fact a buyer would actually type into a search bar." },
    { type: "quote", quote: "Most agencies execute. We think first. The plan comes before the camera does, and the camera comes before the ads do, so every dollar is pointed at the right buyer.", name: "Marathon Creative, Greater Houston", role: "Pillar one of four, Strategic First" },
    { type: "end", title: "Want the whole shoot handled for you, start to finish?", body: "Photography, drone, video, the listing copy, the social posts, and the ads that run it. One team, all in-house, Greater Houston, nothing referred out to anyone else.", services: ["photography", "drone", "video", "social", "print-signage"], cta: "Book your shoot at marathoncreative.co today", save: "Save this post for your next listing, and send it to your seller." }
  ]
};
icons-inline.js11 lines, 3.2 KB
// Generated by build_icons.py from build/icons/v/best/svg. Do not edit by hand.
window.MC_ICONS = {
 "arrow-right": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"arrow-right\" role=\"img\" aria-label=\"Next\"><path d=\"M4 12h15M13 5l7 7-7 7\"/></svg>",
 "photography": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"photography\" role=\"img\" aria-label=\"Photography\"><path d=\"M3 9a2 2 0 0 1 2-2h3l1.5-3h5L16 7h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/><circle cx=\"12\" cy=\"13.5\" r=\"3.5\"/><path style=\"display:var(--mc-icon-detail,inline)\" d=\"M17.5 10.5h1\"/></svg>",
 "drone": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"drone\" role=\"img\" aria-label=\"Drone and aerial\"><path d=\"M2 6h7M15 6h7\"/><path d=\"M5.5 6v3h13V6\"/><path d=\"M8.5 9v3a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V9\"/><circle cx=\"12\" cy=\"19\" r=\"2\"/></svg>",
 "video": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"video\" role=\"img\" aria-label=\"Videography and post\"><rect x=\"2\" y=\"6\" width=\"13\" height=\"12\" rx=\"2\"/><path d=\"M15 10l6-3v10l-6-3\"/><path style=\"display:var(--mc-icon-detail,inline)\" d=\"M5.5 9.5h2\"/></svg>",
 "social": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"social\" role=\"img\" aria-label=\"Social management\"><path d=\"M6 3h12a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-7l-5 4.5V16a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\"/><path style=\"display:var(--mc-icon-detail,inline)\" d=\"M12 12.5L9.2 9.8a1.75 1.75 0 0 1 2.8-2.1 1.75 1.75 0 0 1 2.8 2.1z\"/></svg>",
 "print-signage": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"print-signage\" role=\"img\" aria-label=\"Print and signage\"><path d=\"M4 3v18M2 21h5M4 5h16\"/><path d=\"M8 5v3M16 5v3\"/><rect x=\"6\" y=\"8\" width=\"12\" height=\"8\" rx=\"2\"/><path style=\"display:var(--mc-icon-detail,inline)\" d=\"M9 12h6\"/></svg>",
 "strategy": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"1.5\" data-mc-icon=\"strategy\" role=\"img\" aria-label=\"Marketing strategy\"><circle cx=\"5.5\" cy=\"18\" r=\"2.5\"/><path d=\"M8 18h7a3 3 0 0 0 0-6H9a3 3 0 0 1 0-6h7\"/><circle cx=\"18.5\" cy=\"6\" r=\"2.5\"/></svg>"
};
build_icons.py14 lines, 882 bytes
# Copies the icons this carousel uses out of the shared icon system into icons-inline.js,
# so slides render from file:// without fetching a sprite. Rerun after the icon system changes.
import os, json
SRC = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'icons', 'v', 'best', 'svg')
USE = ['arrow-right', 'photography', 'drone', 'video', 'social', 'print-signage', 'strategy']
out = {}
for n in USE:
    svg = open(os.path.join(SRC, 'mc-icon-' + n + '.svg'), encoding='utf-8').read().strip()
    out[n] = svg.replace(' width="24" height="24"', '')
with open(os.path.join(os.path.dirname(__file__), 'icons-inline.js'), 'w', encoding='utf-8') as f:
    f.write('// Generated by build_icons.py from build/icons/v/best/svg. Do not edit by hand.\n')
    f.write('window.MC_ICONS = ' + json.dumps(out, indent=1) + ';\n')
print('wrote icons-inline.js with', len(out), 'icons')
render.sh31 lines, 3.6 KB
#!/bin/sh
# Renders every slide at 1080 x 1350, the contact sheet, the photo tests, and the stress test.
# Run from anywhere: sh build/tips-carousel/v/r12/render.sh
cd "$(dirname "$0")/../../../.." || exit 1
R=build/tips-carousel/v/r12; P="$R/carousel.html"; O="$R/renders"
mkdir -p "$O/slides"
for i in 1 2 3 4 5 6 7 8 9; do node build/_shared/render.mjs png "$P?slide=$i" "$O/slides/slide-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?z=0.36" "$O/primary.png" 1600 900 1 1
t() { node build/_shared/render.mjs png "$P?only=1,2,4&z=0.5&photo=$2&title=$3" "$O/$1.png" 1600 900 1 1; }
t photo-interior mc_retouched_05 "Photo test, tight interior, mc_retouched_05"
t photo-aerial mc_rosehill_16 "Photo test, wide aerial, mc_rosehill_16"
t photo-portrait mc_retouched_08 "Photo test, portrait original, mc_retouched_08"
t photo-boundary mc_fullres_12 "Photo test, red boundary line, mc_fullres_12"
t photo-bright mc_retouched_04 "Photo test, brightest frame, mc_retouched_04"
node build/_shared/render.mjs png "$P?fill=fills/stress-2x.js&z=0.36&title=Stress test, copy twice as long, 12 slides in" "$O/stress-2x.png" 1600 900 1 1
node build/_shared/render.mjs png "$P?fill=fills/long-words.js&z=0.36&title=Long word test, run-together street names in every title" "$O/stress-longword.png" 1600 900 1 1
for i in 1 3 7; do node build/_shared/render.mjs png "$P?fill=fills/long-words.js&slide=$i" "$O/slides/longword-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?fill=fills/long-eyebrows.js&z=0.36&title=Long eyebrow test, series and topic at their limits" "$O/stress-eyebrow.png" 1600 900 1 1
for i in 1 2 3 6; do node build/_shared/render.mjs png "$P?fill=fills/long-eyebrows.js&slide=$i" "$O/slides/eyebrow-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?fill=fills/missing-photo.js&z=0.36&title=Missing photo test, three photos named that are not in photos/" "$O/stress-missing-photo.png" 1600 900 1 1
for i in 1 2; do node build/_shared/render.mjs png "$P?fill=fills/missing-photo.js&slide=$i" "$O/slides/missing-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?fill=fills/critic-2x.js&z=0.36&title=Long copy test two, industrial, one-sentence titles over the limit" "$O/stress-critic-2x.png" 1600 900 1 1
for i in 1 2 3 4 5 6 7; do node build/_shared/render.mjs png "$P?fill=fills/critic-2x.js&slide=$i" "$O/slides/c2x-0$i.png" 1080 1350 0 1; done
for i in 1 2 3; do node build/_shared/render.mjs png "$P?fill=fills/stress-2x.js&slide=$i" "$O/slides/s2x-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?fill=fills/stat-commas.js&z=0.36&title=Stat test, comma and dollar figures with units under the number" "$O/stress-stat-commas.png" 1600 900 1 1
for i in 2 3 4 5 6; do node build/_shared/render.mjs png "$P?fill=fills/stat-commas.js&slide=$i" "$O/slides/statcomma-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?fill=fills/long-words-body.js&z=0.36&title=Long word test two, run-together street name in body, sub, tip, and context" "$O/stress-longword-body.png" 1600 900 1 1
for i in 1 2 3 4 5 6; do node build/_shared/render.mjs png "$P?fill=fills/long-words-body.js&slide=$i" "$O/slides/lwbody-0$i.png" 1080 1350 0 1; done
node build/_shared/render.mjs png "$P?fill=fills/long-unit.js&z=0.3&title=Long unit test, run-together street names in the stat unit" "$O/stress-long-unit.png" 1900 1000 1 1
for i in 2 3 4 5; do node build/_shared/render.mjs png "$P?fill=fills/long-unit.js&slide=$i" "$O/slides/unit-0$i.png" 1080 1350 0 1; done