Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

One screenshot, three TikTok tools: building Slide, Story and Notes pages from a single layout

A few weeks ago I had one screenshot and three jobs to do. A visitor had sent me a picture of the layout they liked, and I needed three new pages for the downloader: one for TikTok photo slideshows, one for TikTok storie

A few weeks ago I had one screenshot and three jobs to do. A visitor had sent me a picture of the layout they liked, and I needed three new pages for the downloader: one for TikTok photo slideshows, one for TikTok stories, and one for TikTok notes. Three different things to download, but the same job from the visitor's point of view: paste a link, get the file.

My first instinct was to build three separate pages from scratch. But I already had a layout that worked. The homepage and the existing tool pages all share the same shape: a heading that says what the page does, a link box, a button, a place for the result, and a short set of steps underneath. People arrive, look for the box, paste, and tap. If the box moves on every page, they have to learn the page before they can use it. So I made a decision: one layout, three jobs.

I started by copying the working tool page, not the screenshot. The screenshot was the target for how it should look, but the live page was the target for how it should behave. The live page already had the paste handling, the resolve call, the quality dropdown, and the error messages that say plainly when a link did not work. Rebuilding from the screenshot alone would have meant rewriting all of that, and introducing small differences by accident. Copying the working page meant the three new pages inherited behaviour that was already tested.

Then I changed only what each job actually needed. A photo slideshow is not a video, so the result is a set of images, not a single file with a quality choice. A story is usually one clip that expires, so the page says so, instead of pretending it will be there tomorrow. Notes are mostly text with a picture attached, so the page shows the text first and the file second. Everything else stayed the same: the same box, the same button in the same place, the same steps, the same footer. A visitor who has used one of the pages can use all three without thinking about it.

The shared JavaScript engine did most of the heavy lifting. All eight tool pages on the site run off one script, so the resolve flow, the paste event, and the error handling are the same everywhere. Each new page only tells the engine which platform and which kind of content it is dealing with. That is also what keeps the pages in sync: when I fixed the paste handling last month, the fix landed on every page at once, because there is only one copy of that code. If each page had its own script, I would have had to remember to fix it three times, and I would have missed one.

There was one trap I had to watch for. Three pages that look the same can start to read the same, and that helps nobody. Each page needed its own title, its own heading, and its own short explanation of what it does, written for the person who landed on that page. A slideshow page that talks about stories is a broken page, even if the download works. So I wrote each page's copy separately, in plain words, and checked each one on a real phone before it went live. The layout is shared; the words are not.

The lesson is a small one, but it keeps coming back: when the job is the same, reuse the page. Spend the effort on the part that is actually different, and say so plainly on the page. You can try the three pages on ramrom.io and see how alike they are — that sameness is the point.

The three pages went live the same day, from one screenshot, one layout, and one shared script. Nothing about it was clever. It was just the boring choice, made three times in a row, and it worked.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.