/** * Line art for the toolbox. * * Flatsome ships a PNG per element. Drawings are better here: they are a few hundred bytes * instead of a folder of bitmaps, they take the colour of the surface they sit on, and they stay * sharp on a screen of any density. Every shape lives in the same 24x16 field so the entries * line up in the grid. * * Each value is the inside of an ``; `stroke` and `fill` come from the wrapper, so a shape * only says what it is, not what colour it has. */ /** A filled bar, the building block most of these are made of. */ const bar = (x, y, width, height = 2) => ``; /** Several bars under each other, as a paragraph of text. */ const lines = (...widths) => widths.map((width, index) => bar(3, 4 + index * 3.4, width, 1.7)).join(''); export const PREVIEWS = { // Aufbau section: '', row: '', column: '', // Inhalt heading: `${bar(3, 3.6, 18, 3)}${bar(3, 9, 11, 2)}`, text: lines(18, 16, 11), image: '', button: '', icon: '', divider: '', spacer: '', // Bausteine iconcard: `${bar(3, 9, 12, 1.9)}${bar(3, 12, 8, 1.5)}`, stat: `${bar(3, 3, 9, 5)}${bar(3, 10.5, 14, 1.7)}`, quote: `${bar(14, 5.6, 7, 1.6)}${bar(14, 9, 5, 1.6)}`, cta: `${bar(2.5, 4, 12, 2.4)}`, contact: '', logos: [2.5, 8, 13.5, 19].map(x => ``).join(''), progress: '', social: [4.5, 12, 19.5].map(x => ``).join('') + '', // Gruppen gallery: [2.5, 12.5].flatMap(x => [2.5, 8.5].map(y => ``)).join(''), accordion: '', accordionitem: '', tabs: '', tabitem: '', slider: '', // Seite und Daten postlist: '' + `${bar(11.5, 3.2, 10, 1.6)}${bar(11.5, 6, 7, 1.4)}${bar(11.5, 9.2, 10, 1.6)}${bar(11.5, 12, 7, 1.4)}`, postnav: '', breadcrumb: `${bar(2, 7.2, 5, 1.7)}${bar(11.6, 7.2, 4, 1.7)}${bar(20.2, 7.2, 2, 1.7)}`, menu: `${bar(2, 7.2, 5, 1.8)}${bar(9, 7.2, 6, 1.8)}${bar(17, 7.2, 5, 1.8)}`, form: '', legal: `${bar(2, 4, 20, 1.6)}${bar(2, 7.4, 16, 1.6)}${bar(2, 10.8, 11, 1.6)}`, partialref: '', embed: '', }; /** The picture for one element type, ready to drop into the markup. */ export function preview(type) { const shape = PREVIEWS[type]; if (!shape) return ''; return ``; } /** A row of columns, for the entries that add a row with a column count. */ export function rowPreview(columns) { const gap = 1.4; const inner = (22 - gap * (columns - 1)) / columns; const cells = Array.from({ length: columns }, (_, index) => ``).join(''); return ``; }