JomMula

Gallery Blog · Lesson 02

Mockup with opencode

Before we build the real app, let's vibe code first. With opencode, we'll make a mockup using plain HTML — easy to see everything right away.

8 min readDesignopencodeUpdated October 2026

Okay, after we understand the basic system architecture, usually we want to build it right away — but hold on. Let’s vibe code for a bit.

Vibe code what? A mockup. There are actually many ways to do mockups — in SAD we learned to use Figma, but personally I find using AI easier and faster for mockups.

Why mockup first, not code straight away?

Easy to change

Want a different colour? Just prompt. In the real code later, changing a colour can touch many files.

Design focus

During mockups we usually focus on the design and flow, like in SAD.

Becomes a reference

When we start developing later, it’s easier because we already have a design we’re happy with.

Tools for the mockup: just 4 things

Usually for mockups, this is what I find best after building an unhealthy amount:

HT

HTML

page skeleton

Tw

Tailwind

colour & layout

FA

Font Awesome

icons

JS

JavaScript

interactions

Why not just build the real app from the start? Because a mockup is quick — we’re only focusing on the design and the flow. The real app comes with its own rules (auth, database, storage), and none of that helps you see a layout faster.

Prompts

The most important part: how you tell opencode to do the work. This is the basic template — what I always use:

build a mockup using html tailwind font awesome and javascript for [PROJECT]
with this feature [FEATURES]
i want to use this color [COLOR]
the design i want it to be [DESIGN]

Simple right? But in reality, the more detail you give in your prompt, the better the output.

Create a mockup in a single index.html file using HTML + Tailwind CSS (CDN) + Font Awesome + vanilla JavaScript.

Project: Gallery Blog — a photo gallery website where users can view, like, and comment on pictures.

Features:

Image grid layout

Folder / category filter

Lightbox modal when clicking on an image

Like and comment functionality

Admin: image upload form

Color Palette:

Background: #FAF7F2

Accent: #4F46E5

Highlight: #F97316

Design: Clean & minimal — plenty of white space and rounded corners.

Ensure it is responsive and uses placeholder images.

this makes it easier to learn, but it’s even better if you learn how to prompt

Prompt Builder

Choose, copy and paste inside opencode

1 · What do you want to build?
2 · Which features do you want?
3 · Colours
4 · Design

lots of whitespace, tidy layout, no unnecessary decoration

Your prompt

Build a website mockup using HTML + Tailwind CSS (via CDN) + Font Awesome + vanilla JavaScript.
Keep everything in a single index.html file — no build tools, open it straight in the browser.

Project: Gallery Blog — a photo website — people can view photos, filter by folder, like and comment. There's an admin section to upload new photos.

Features needed:
- Image grid
- Folder/category filter
- Lightbox (click to enlarge)
- Like button on photos
- Comments on photos
- Admin: upload photos
- Admin: create folders
- Responsive (mobile friendly)

Colors: use this palette — background #FAF7F2, primary/accent #4F46E5, highlight #F97316. Keep the colors consistent across the page.

Design: Clean & minimal — lots of whitespace, tidy layout, no unnecessary decoration.

Make sure it is responsive on phone and desktop, use placeholder images from picsum.photos, and every basic interaction is clickable.

Paste this prompt into opencode. Then iterate — fix it bit by bit, it won't be perfect in one shot.

Using opencode

Okay now let’s run it. If you don’t have opencode yet, here’s the short version:

  1. 1

    Install opencode

    Use npm — the easiest way, and it runs on Windows too.

                  npm install -g opencode-ai
                

    There's also an install script (curl -fsSL https://opencode.ai/install | bash) for Mac/Linux. On Windows, WSL gives the fullest experience.

  2. 2

    Connect a model

    Run opencode, then type /connect to pick a provider and model. If you're not sure which model to use, OpenCode Zen has a tested list.

                  opencode
    /connect
                
  3. 3

    Make an empty folder

    Create a new folder just for the mockup — don't mix it with your code project.

                  mkdir mockup-gallery
    cd mockup-gallery
    opencode
                
  4. 4

    Paste the prompt

    Copy the prompt from the Prompt Builder, paste it into opencode and hit enter. Let it do the work — it will create an index.html file.

  5. 5

    Open it in the browser

    See the result. On Windows, run the command inside that folder. Mac: use open index.html.

                  start index.html
                

    Or just double-click the index.html file.

  6. 6

    Didn't land? Don't edit it yourself

    Just tell opencode what's off: "the colours are too dark, make them cream". If it's way off, type /undo and prompt again.

Iterating is normal

Most people expect the first prompt to be perfect. In reality it isn’t — and that’s fine. Here’s a real session, notice how it talks:

A sample iterate session

the first prompt is rarely perfect — and that's normal
Prompt 1
Build a gallery blog mockup with HTML + Tailwind + Font Awesome + JavaScript. In a single index.html file. Include a photo grid, folder filter, and lightbox. Cream background #FAF7F2 with indigo accent #4F46E5. Clean design, plenty of whitespace.
oc

opencode

Done — index.html has the photo grid, folder filter and lightbox. Open it in the browser and try clicking around.
Follow-up
Almost there, but the background is too bright and the grid feels cramped. Change the background to #F5F1E8, add more spacing between the cards. Keep everything else.
oc

opencode

Done — background changed, spacing is roomier now. Everything else stays the same.
Follow-up
Nice. Now add an 'Admin' button at the top right — when clicked, an upload form appears. Mockup only.
oc

opencode

Done. Hit Admin for the upload form, hit Visitor to go back to the gallery.

The actual result

Here’s an example mockup I made using the default prompt in the builder above. The actual output, no hand edits:

Open in new tab

This is the real file, not a screenshot — just oneindex.html. Try clicking folders, opening photos, liking and commenting. Hit the Admin button at the top right inside it to upload a photo.

Notice? It looks like a real website, but there’s nothing behind it. Refresh and the data resets. That’s a mockup — and that’s the point.

When the mockup is enough

Don’t over-polish. A mockup has an enough point — after that we move on. Checklist:

Requirements checklist

0/5 done

If everything’s ticked — you’re ready for the next lesson.

Recap

Mockup = blueprint. Not the real website, no data.

Tools: HTML + Tailwind CDN + Font Awesome + JavaScript.

Prompt recipe: tool, project, features, colour, design.

With opencode: paste the prompt, see the result, iterate.

The first prompt is rarely perfect — refine bit by bit.

In the next lesson, we meet the blueprint we’ll follow for the whole build — the master plan. Then the real code starts.

Previous: The big picture: what we're building
03

Up next

The Master Plan

Before the first line of code, meet the blueprint we'll follow for the whole build — one app, eight phases, and one rule: no phase is done until you've verified it.

Read now