// What the Cinemas faces share (the Picture House, 4 Nov 2026): a painted// layer laid by its catalogue name, the red enamel PROGRESS STRIP and the// ticket STUB. The film's one-sheet (`FilmPosterFace`) and the episode's// lobby card (`EpisodeLobbyFace`) lay the same two paintings// (`progress-strip`, `stub` and `stub-shadow`, imported once by// `scripts/import-cinemas-materials.py`), each where its own object's box// places them; what is drawn on the paint is the same, so it is drawn here// once. The knobs below are the paintings' own (`cinemas14-materials`'// `layout.json`: the strip's `nineSliceInsets`, the stub's `stampLiveType`// and `dateLiveType`); where each is laid is its face's.importCottonPaperimportCottonValuesimportSwiftUIenumCinemaPartsKnobs {// THE PROGRESS STRIP's painting, a 9-slice across (`nineSliceInsets`:// its rounded caps 26 pixels each, never stretched), squeezed to the// height it is laid at.staticlet strip = CGSize(width: 1402, height: 49)staticlet stripCap: CGFloat = 26// THE STUB's painting, its shadow 64 of its own pixels past it, and its// live type in its own pixels (`stampLiveType`, `dateLiveType`): each's// middle, size and turn, and the room each is set in along its line.staticlet stubPainted = CGSize(width: 1439, height: 913)staticlet stubShadowReach: CGFloat = 64staticlet stamp = CGPoint(x: 690, y: 350)staticlet stampSize: CGFloat = 170staticlet stampRoom: CGFloat = 1000staticlet day = CGPoint(x: 735, y: 600)staticlet daySize: CGFloat = 105staticlet dayRoom: CGFloat = 1000staticlet stubTurn: Double = -9.5}/// A painted layer, by its catalogue name, at the scale it was painted for;/// nothing where this build carries no pictures.structCinemaPainted: View {let name: Stringvar body: someView {iflet image = CottonMedia.image(name, scale: 3) { image.resizable().interpolation(.high).accessibilityHidden(true) } }}extensionView {/// This view laid at `rect` of its object's box, in the box's pixels,/// scaled by `s`.func cinemaLaid(_ rect: CGRect, _ s: CGFloat, alignment: Alignment = .center) -> someView { frame(width: rect.width * s, height: rect.height * s, alignment: alignment) .offset(x: rect.minX * s, y: rect.minY * s) }}/// The red strip laid at `rect` of its object's box: its whole length the/// enamel taken down, its first `share` the enamel itself; tagged as the/// card's state, said as `said`.structCinemaStrip: View {let rect: CGRectlet share: Doublelet said: Stringlet identifier: Stringlet s: CGFloatvar body: someView { ZStack(alignment: .topLeading) {CinemaNineStrip(width: rect.width, height: rect.height, s: s) .colorMultiply(CinemasMaterial.track.colour)CinemaNineStrip(width: rect.width * CGFloat(share), height: rect.height, s: s) } .frame(width: rect.width * s, height: rect.height * s, alignment: .topLeading) .contentShape(Rectangle()) .accessibilityElement() .accessibilityLabel(said) .accessibilityIdentifier(identifier) .facePart(.state) .offset(x: rect.minX * s, y: rect.minY * s) }}/// The strip's painting laid `width` by `height` of its object's pixels: its/// rounded caps kept their width (a third of a short strip's each), its/// middle stretched between them, the whole squeezed to the height.structCinemaNineStrip: View {let width: CGFloatlet height: CGFloatlet s: CGFloatvar body: someView {let knobs = CinemaPartsKnobs.selflet cap = min(knobs.stripCap, width / 3)let middle = knobs.strip.width - 2 * knobs.stripCap ZStack(alignment: .topLeading) { piece(from: 0, of: knobs.stripCap, at: 0, wide: cap) piece(from: knobs.stripCap, of: middle, at: cap, wide: width - 2 * cap) piece(from: knobs.strip.width - knobs.stripCap, of: knobs.stripCap, at: width - cap, wide: cap) } .frame(width: max(0, width) * s, height: height * s, alignment: .topLeading) }/// The painting's columns from `from`, `of` wide, laid at `at`, `wide`.privatefunc piece(from: CGFloat, of: CGFloat, at: CGFloat, wide: CGFloat) -> someView {let knobs = CinemaPartsKnobs.selflet across = wide / of * sreturnCinemaPainted(name: "progress-strip") .frame(width: knobs.strip.width * across, height: height * s) .offset(x: -from * across) .frame(width: max(0, wide) * s, height: height * s, alignment: .leading) .clipped() .offset(x: at * s) }}/// The ticket stub laid at `rect` of its object's box, its shadow under it,/// stamped and dated along its own tilt; tagged as the card's done.structCinemaStub: View {let rect: CGRectlet stamp: Stringlet day: String?let identifier: Stringlet s: CGFloatvar body: someView {let knobs = CinemaPartsKnobs.selflet k = rect.width / knobs.stubPainted.widthlet reach = knobs.stubShadowReach * k ZStack(alignment: .topLeading) {CinemaPainted(name: "stub-shadow").cinemaLaid(rect.insetBy(dx: -reach, dy: -reach), s) ZStack(alignment: .topLeading) {CinemaPainted(name: "stub") typed(stamp, at: knobs.stamp, size: knobs.stampSize, room: knobs.stampRoom, ink: CinemasMaterial.stamp.colour, k: k)iflet day { typed(day, at: knobs.day, size: knobs.daySize, room: knobs.dayRoom, ink: CinemasMaterial.ink.colour, k: k) } } .frame(width: rect.width * s, height: rect.height * s, alignment: .topLeading) .contentShape(Rectangle()) .accessibilityElement(children: .ignore) .accessibilityLabel([stamp, day].compactMap { $0 }.joined(separator: ShellLines.line("cards", "join"))) .accessibilityIdentifier(identifier) .facePart(.done) .offset(x: rect.minX * s, y: rect.minY * s) } }/// `words` typed centred on `at` of the stub's own pixels, along its tilt.privatefunc typed(_ words: String, at: CGPoint, size: CGFloat, room: CGFloat, ink: Color, k: CGFloat) -> someView {Text(words) .font(CottonFonts.type(size * k * s)) .foregroundStyle(ink) .lineLimit(1) .minimumScaleFactor(0.5) .frame(width: room * k * s, height: size * 1.4 * k * s) .rotationEffect(.degrees(CinemaPartsKnobs.stubTurn)) .position(x: at.x * k * s, y: at.y * k * s) .accessibilityHidden(true) }}