StealThis .dev

News — Front-page Layout Builder

A newsroom-style front-page builder for a fictional broadsheet, pairing a left story queue of draggable cards with a right canvas of slot zones — Lead, two Secondary wells, an analysis Sidebar and an auto-composing Briefs strip. Drop a story into any slot and it renders live as editorial copy, with headline size, drop caps and pull quotes scaling to the slot; a desktop, tablet and mobile width toggle reflows the grid, and a Publish action confirms the edition with a toast. Vanilla JS, no libraries.

In Lab öffnen
html css vanilla-js
Targets: JS HTML

Code

Front-page Layout Builder

A two-panel newsroom tool for laying out the front page of The Meridian Ledger, a fictional broadsheet. The left rail is the story queue: a column of draggable cards, each colour-keyed by section — Politics, Business, Climate, Culture, Sport — with a serif headline, byline and read-time. The right side is the live front page itself, framed by a real masthead with volume line, dateline and price, and divided into slot zones: a tall Lead, two Secondary wells, an analysis Sidebar rail, and a five-column In Brief strip across the foot.

Drag any card onto a slot and it renders as a fully set article in place — and the typography scales to where it landed. The Lead gets a two-column justified body, a red drop cap and a pull quote; the Secondary wells set tighter; the Sidebar runs a narrow analysis column with its own rule; and the Briefs strip auto-composes a digest from whatever stories are not already on the page. Dropping a story that is already placed swaps it cleanly between slots, and every slot carries a remove control to vacate it. Cards are keyboard-operable too: focus one and press Enter to drop it into the next open slot.

A Desktop / Tablet / Mobile toggle reflows the grid so you can preview each edition without leaving the page, a layout meter tracks how full the front is, and Publish layout validates that a Lead exists before confirming the edition with a toast. Reset wipes back to a blank slate. All headlines, bylines, datelines and body copy are written as real-feeling editorial prose, and every interaction is plain vanilla JavaScript with no external libraries.

Illustrative UI only — masthead, headlines, bylines, and articles are fictional; not a real news publication.