"""The nine frame looks from the wardrobe mockup, as band profiles plus ornaments. Greyscale meaning (see the gradient map in docs/THEMES.md): black = dark backing, mid grey = trim or card colour, white = highlight. Source units are 4x screen pixels. """ from frames import FrameStyle, Stroke from svg_common import LEAF_PATH, MAPLE_LEAF_PATH, grey, num def _scaled_ornament(card_corner_in_box, band_mid, inner): """Place a mockup ornament (drawn in screen px) so its card-corner point lands on the band corner.""" shift = band_mid - card_corner_in_box * 4 return f'{inner}' def memphis(colours): """Flat ink outline; squiggle and triangle on the corners.""" ornament = (f'') return FrameStyle(band_mid=64, radius=40, corner_size=(160, 160), strokes=[Stroke(12, 0.5)], corner_fixed=_scaled_ornament(16, 64, ornament), notes=["no hard plum drop shadow (mirrored corners cannot offset one way)"]) def neon(colours): """A bright tube with a soft halo on both sides, faked with stacked strokes.""" halo = [Stroke(64, 0.5, 0.05), Stroke(48, 0.5, 0.09), Stroke(34, 0.5, 0.15), Stroke(22, 0.5, 0.3)] return FrameStyle(band_mid=40, radius=28, corner_size=(112, 112), edge_length=32, strokes=halo + [Stroke(10, 0.5, 1.0), Stroke(4, 1.0, 0.85)]) def leaf(colours): """Rust edge with a maple leaf on the corners.""" ornament = (f'' f'') return FrameStyle(band_mid=64, radius=32, corner_size=(176, 176), strokes=[Stroke(16, 0.0, 0.5), Stroke(12, 0.5), Stroke(3, 1.0, 0.35)], corner_fixed=_scaled_ornament(15, 64, ornament), notes=["leaf shows on all four corners (mockup: two)"]) def plank(colours): """A thick wood frame: darker in the middle, grain along the band, mitred corners, nail heads.""" shading = [Stroke(40, 0.0), Stroke(36, 0.5), Stroke(30, 0.43), Stroke(22, 0.37), Stroke(14, 0.33)] grain = [Stroke(1.5, 0.1, 0.45, offset) for offset in (-12, -5, 6, 13)] shine = [Stroke(1.5, 1.0, 0.22, offset) for offset in (-16, 16)] mitre = '' nail_x = 44 nail = (f'' f'') return FrameStyle(band_mid=40, radius=0, corner_size=(112, 112), edge_length=128, strokes=shading + grain + shine, band_inside_px=3, corner_extras=mitre, corner_fixed=nail, notes=["one nail per corner; the mockup's grain is drawn as straight lines along the band"]) def vine(colours): """A thin dark-wood edge; a vine curl (trim) with leaves on the corners.""" curl = ('') leaves = (f'' f'' f'') return FrameStyle(band_mid=72, radius=40, corner_size=(216, 216), strokes=[Stroke(12, 0.0, 0.4), Stroke(9, 0.5), Stroke(2, 1.0, 0.3)], corner_extras=_scaled_ornament(18, 72, curl), corner_fixed=_scaled_ornament(18, 72, leaves), notes=["all four corners match, so the leaf-cut shape (two round, two sharp corners) is lost", "vine shows on all four corners (mockup: two)"]) def cloud(colours): """A round white rim with a cloud puff on the corner.""" puff = ('' '') return FrameStyle(band_mid=48, radius=64, corner_size=(288, 176), strokes=[Stroke(16, 0.0, 0.08), Stroke(8, 1.0)], band_inside_px=-2, corner_fixed=f'{puff}', notes=["cloud puff shows on all four corners (mockup: top right only)", "no soft blue drop shadow"]) def glass(colours): """Frosted glass rim: a faint wide band with a bright thin line.""" return FrameStyle(band_mid=40, radius=52, corner_size=(128, 128), band_inside_px=-1, strokes=[Stroke(22, 0.0, 0.08), Stroke(14, 0.5, 0.45), Stroke(4, 1.0, 0.95)], notes=["no backdrop blur and no blue drop shadow"]) def stone(colours): """A thick carved stone band, blocks with mortar joints, cracks on the corner.""" shading = [Stroke(36, 0.0), Stroke(32, 0.63), Stroke(26, 0.58), Stroke(18, 0.53), Stroke(10, 0.5)] joint = '' crack = ('') corner_joints = ('') return FrameStyle(band_mid=56, radius=80, corner_size=(168, 168), edge_length=96, strokes=shading, edge_extras=joint, corner_extras=corner_joints + f'{crack}', notes=["all four corners are rounded the same; the mockup's pointed top (round top, square " "bottom) needs separate top and bottom corners"]) def ascii_box(colours): """A double-line box, like box-drawing characters.""" return FrameStyle(band_mid=34, radius=0, corner_size=(128, 128), edge_length=32, strokes=[Stroke(4, 0.5, 1.0, -4), Stroke(4, 0.5, 1.0, 4)]) FRAME_STYLES = {"memphis": memphis, "neon": neon, "leaf": leaf, "plank": plank, "vine": vine, "cloud": cloud, "glass": glass, "stone": stone, "ascii": ascii_box} from frame_styles_more import MORE_FRAME_STYLES # noqa: E402 (second batch of looks) FRAME_STYLES.update(MORE_FRAME_STYLES)