How Do You Build a Website Hero in Codex?
Let’s build a barbershop hero section in Codex where haircuts switch on a single portrait. Seven haircut prompts and the full interface prompt inside.

“Short on the sides, just a little off the top.” A familiar request, except your “just a little” and your barber’s can look very different. I built a website hero section in Codex where you can switch haircuts on a single portrait and instantly see how the silhouette changes.
I’ll show you how I prepared the portraits and built the interactive KONTUR screen. Inside you’ll find seven standalone haircut prompts and the full Codex prompt for building the interface.
The final KONTUR screen. In the demo, picking a card changes the portrait and the haircut’s name and description.
How the Try-On Idea Came About
It all started with a joke video about some barbers I know. That’s how “VSPYSHKA” came about, with its “Boombox” and an option for anyone who suddenly feels like shaving their head. While putting the video together, I realized that one and the same face makes it easy to compare haircuts and show your barber exactly what shape and length you have in mind.
In a barbershop, you can run this kind of try-on with a client’s photo, provided they consent to being photographed and having the image edited. The picture helps you talk through the shape. The barber will tell you what’s realistic given the hair’s length, thickness, and texture.
“VSPYSHKA.” Here you can try on a half-box and a fully shaved head.
Prepare the Base Portrait
I started with a character sheet and used the large close-up on the left as my base. From it, I generated a single 4:5 frame with the head turned 90° to the right. A profile view clearly shows how the temples, the back of the head, and the volume on top change. If showing the fringe matters more, try a three-quarter angle and keep it across the whole series.
For your own project, take a sharp photo or a ready-made character sheet; that article includes a prompt for creating one. In the Curtains prompt, swap in your own distinguishing features, hair color, and clothing, or ask the model to keep them from the reference.

The character sheet from the video. To generate the profile, I worked from the large close-up on the left.
Generate the Haircuts on a Single Profile
Create the base Curtains profile and attach it for every new haircut. In ChatGPT, Seedream, or Nano Banana, edit only the hair. Keep the face, lighting, clothing, and head position unchanged. The examples below were exported on a gray background; for the site, I prepared separate transparent cutouts.

Curtains · French Crop · Buzz Cut
Curtains
Medium length, a part, and loose volume. In “VSPYSHKA,” this option is called “Short on the sides, a little off the top.” Attach the character sheet or your own photo as the main reference for appearance.
Use this prompt
Use case: identity-preserving photographic reference for an interactive barbershop website. Use the supplied reference as the precise identity, wardrobe and studio-look guide, especially the large close-up on the left. Generate ONE premium photorealistic vertical 4:5 head-and-upper-torso studio photograph of this exact same adult male character turned into a strict 90-degree lateral profile, nose pointing to the RIGHT edge of the image. He has an angular straight nose, clean-shaven fair skin, the same bone structure, ear and brow from the reference, and wears the original deep crimson cable-free knitted crewneck over the original faded blue denim collar. Hair: medium length natural ash-blond curtains as in the source, softly swept back with a visible textured side contour and a tapered temple. Camera level, natural neck, neutral expression, 85mm portrait lens, subtle film grain, sharp natural skin and detailed knit. Matte charcoal grey (#424243) studio backdrop like the reference, very subtle soft light gradient, soft key from upper right. Entire hair and profile in frame, head centered at x=53%, crown around y=11%, eyes y=35%, chin y=57%, shoulders run off bottom edge. Medium close bust, strong profile silhouette, straight spine. Only one person, no other viewpoints, no words, borders or graphics.
French Crop
A short textured fringe brushed forward, with a smooth taper at the temples. In “VSPYSHKA,” this is “Well, aren’t you cool.” Attach the color Curtains portrait on the gray background.
Use this prompt
Use case: identity-preserve / precise-object-edit. Edit the supplied portrait directly as a localized replacement of the haircut only. New haircut: French crop with a short clearly forward-brushed textured ash-blond top and a blunt short choppy horizontal fringe at the forehead, short low taper. Short at the crown, no quiff, no swept-back strands. A visibly compact, forward silhouette. Everything outside the hair and immediate hairline area stays identical to the input, especially head angle and position, forehead below the hairline, ear position, gaze, eyebrow, nose, lips, jaw, neck and exact red sweater and blue denim. Identical 4:5 framing, right-facing 90-degree profile, same charcoal studio background, same pixel positions, exact same overall head size and torso. Do not move, zoom, rotate, crop, or recompute the face or body. Restore matching charcoal backdrop where volume is removed. Single photorealistic portrait. No graphics. This will be spatially registered with the input image to switch just the hair on a website.
Buzz Cut
About 5 mm on top, with a smooth fade at the temples and the nape. Attach the color Curtains portrait on the gray background.
Use this prompt
Use case: identity-preserve / precise-object-edit. Edit the supplied portrait directly as a localized replacement of the haircut only. New haircut: Very close 5 mm military buzz cut with a light natural ash-blond top and smooth low fade at the nape and around the sideburn. The rounded outline follows the skull, almost no added volume, matte natural short stubble. Everything outside the hair and immediate hairline area stays identical to the input, especially head angle and position, forehead below the hairline, ear position, gaze, eyebrow, nose, lips, jaw, neck and exact red sweater and blue denim. Identical 4:5 framing, right-facing 90-degree profile, same charcoal studio background, same pixel positions, exact same overall head size and torso. Do not move, zoom, rotate, crop, or recompute the face or body. Restore matching charcoal backdrop where volume is removed. Single photorealistic portrait. No graphics. This will be spatially registered with the input image to switch just the hair on a website.

Mod Cut · Fully Shaved Head · Half-Box
Mod Cut
A layered shape, an eyebrow-length fringe, and longer strands around the ear. In “VSPYSHKA,” this is “Not like everyone else.” Attach the color Curtains portrait on a transparent background.
Use this prompt
Use case: identity-preserving localized haircut edit for a virtual barbershop try-on. Edit the exact supplied COLOR transparent right-facing profile. Replace only the haircut with a recognizable modern British MOD CUT: medium-length softly rounded shaggy shape, choppy swept-forward layered crown, textured eyebrow-skimming fringe with separated points, longer soft sides with a few wisps over the upper/back edge of the visible ear, and a slightly grown-out tapered nape stopping well above the denim collar. No skin fade, no harsh disconnected sides, no undercut or slick-back. Natural light ash-blond highlights with slightly darker roots just like the original. Keep the untouched portrait, normal skin tone, blue eye, ear location, forehead, nose, jaw, chin, neck, deep red knit sweater and blue denim shirt fixed pixel-for-pixel. Only hair may cover some of the temple and ear. Same exact 1122x1402 canvas, camera, framing, placement and scale. All background stays truly transparent, including areas around the new hair silhouette. Preserve realistic wispy alpha at the hair edges. High-quality color photographic portrait, no text, no matte or simulated background.
Fully Shaved Head
A smooth head with no stubble or hair shadow. In “VSPYSHKA,” this is “Just f*cking do it!” Attach the color Curtains portrait on a transparent background.
Use this prompt
Edit the supplied transparent color profile photograph. Change only the scalp and hair. Keep the exact same right-facing profile, placement and scale, the same ear and facial features, skin tone and texture, neutral expression, denim collar, red sweater, lighting, and transparent background. Output one high quality photorealistic transparent PNG, same 1122 × 1402 canvas and head position, no text, no objects, no compositing background. This will be used as a pixel-aligned hairstyle layer for a browser try-on. Replace all head hair, including the hairline and any sideburns, with a completely shaved bald scalp, smooth and clean with natural realistic skin texture and subtle tonal variations. Absolutely zero visible hair or buzzed stubble, no shaved shadow at the temples or nape. Reveal the natural rounded skull shape. Preserve the eyebrows, ear, face, neck, and sweater. Precisely preserve image framing.
Half-Box
Short sides and back, with about 2–3 cm on top, styled lightly forward and up. In “VSPYSHKA,” this is “Boombox.” Attach the color Curtains portrait on a transparent background.
Use this prompt
Edit the supplied transparent color profile photograph. Change only the scalp and hair. Keep the exact same right-facing profile, placement and scale, the same ear and facial features, skin tone and texture, neutral expression, denim collar, red sweater, lighting, and transparent background. Output one high quality photorealistic transparent PNG, same 1122 × 1402 canvas and head position, no text, no objects, no compositing background. This will be used as a pixel-aligned hairstyle layer for a browser try-on. Replace the long swept blond hair with a recognizable men's poluboks (half-box) haircut. Neat athletic short cut; near-bare lower sides and nape with low taper, blended smoothly; a visibly fuller, compact top of about 2–3 cm of natural dark blond hair, brushed subtly up and forward, low flat silhouette with soft texture at the hairline. No long fringe, no hard disconnected part, no curls, no pompadour. The top must read as clearly longer than a buzz cut but shorter than a French crop. Precisely preserve image framing.
Slick Back
Hair combed smoothly back, forehead open, with the length tapering gradually to short at the temples and the nape. This option was in the early KONTUR. The prompt was reconstructed from a screen recording. Attach the color Curtains portrait on a gray or transparent background.
Use this prompt
Edit the supplied color portrait as a localized hairstyle replacement for a browser haircut try-on. Change only the hair and its immediate transition into the hairline. Create a classic slick back with a medium-length top brushed smoothly from the forehead toward the crown, a controlled lift above the forehead and a continuous swept-back silhouette. Show fine, parallel comb lines, soft natural sheen, and the same hair color and roots as the source. Keep the forehead fully open, with no forward fringe, center part, hard part, loose curls, or high pompadour. Taper the sides and nape neatly, blending into the longer top without a disconnected undercut. Keep the exact same right-facing 90-degree profile, face, ear, eyebrows, skin texture, expression, neck, outfit, light, camera, placement, scale, and crop. Retain the input aspect ratio and canvas dimensions. If the input has a studio backdrop, restore that backdrop only where the old hair silhouette is removed. If the input is transparent, keep a true alpha channel and fine hair edges. Output one photorealistic portrait with no text or graphics.

Slick Back in the early KONTUR. A frame from the interface recording.
How to Apply This Approach to a Portfolio
I used this same character sheet in a portfolio website project. On your own site, you decide the order of your case studies and can show right away how you handle interface, motion, and typography. For a client or employer, it’s a single link with your work and a way to get in touch.
In the new Nexfield Academy course “Portfolio Website with AI” we build a project like this from scratch. We plan the screens in Figma, make an animatic in Blender, generate video in Seedance, and build the site in Codex. By the end of the course, you’ll have a live link to your own site and a certificate of completion. If you’ve never gotten around to building your own portfolio website, now’s the time!
Build the Hero Section in Codex
Open a chat in your project folder, attach the portraits, and paste the prompt below. In the final KONTUR, Curtains comes first, followed by French Crop, Buzz Cut, and Mod Cut. For your own project, specify the barbershop name, the file order, and the labels. The number of cards should match the number of portraits you’ve chosen.
I placed the brand name behind the cutout portrait so the hair covers part of the letters. The gray background stays a separate layer. When you pick a card, the portrait, caption, and active state update at the same time. In the demo, the booking button opens a dialog with the selected haircut and saves your choice on the device.

Attachments in Codex. Each selected portrait becomes its own option in the switcher.
Watch the portraits being uploaded to Codex
The Full Prompt for the KONTUR Interface
Use this prompt
Build a working, responsive haircut try-on website based on the final English-language KONTUR design. Use my uploaded portraits as the site's actual assets. Deliver runnable source and a short local launch command. For a new project, plain HTML, CSS, and JavaScript are enough. If a project already exists, use its stack. ### Inputs - Use **KONTUR** as the default brand name. Apply any brand name I provide to the header, the oversized title, and the document title. - Each uploaded portrait represents one haircut. Use the order and labels I provide. Otherwise, use the upload order and short English labels that match the images. Use the first portrait as the initial selection, with an option to restore a previously saved choice. - Keep each cut in one data record with an `id`, portrait, thumbnail, label, short description, and accessible image text. If I supply only the full portrait, derive the thumbnail from the same asset. Store the assets locally with the site so the demo works independently of external image hosts. ### Desktop composition - Make a single screen consisting of a slim masthead, a large framed hero, and a dark control strip directly beneath the hero. Center the page in a shell about 1664 px wide at most, with responsive side gutters around 3vw. At 1920×1080, all three sections should fit in the frame. - Use warm gray `#dededb` for the page, near-black `#171716` for text, muted gray `#454543` for secondary text, charcoal `#181817` for the control strip, and red `#c52439` for the primary button. The hero has a thin `#a6a6a3` border and a neutral gray radial gradient, from `#d7d7d7` at about 52% across and 24% down, through `#c4c4c4`, to `#a5a5a5` at the outer edge. Preserve the natural color of the portrait assets. - Keep the masthead about 66 px high. On the left, place a small black square with three light diagonal slashes and a compact, bold wordmark. On the right, place an outlined **Book a haircut** button. - Treat the hero as an editorial cover. Put the brand name in giant, tightly tracked, uppercase black type. Keep it on one line, nearly edge to edge. Set its centerline roughly 29% down the hero and fit its width to the container. Put the title behind the portrait so the head and hair naturally cover part of the middle letters. - Place a large, centered, full-color portrait in front of the title. The original framing is a right-facing profile from the chest up, with the top of the image starting roughly 9% down the hero. The figure meets the bottom edge of the stage, where the clothing is cropped by the frame. Use the existing pose in my images, with an identical anchor and scale for every cut. - In the lower left, show a bold tagline and a short explanatory sentence. In the lower right, show the small uppercase label **Selected cut**, the active style in bold type, and its short description. Keep both text blocks on the gray stage and clear of the face. Use a clean rectangular layout, strong contrast, and a system sans-serif or Inter for the interface. Use an extra-heavy sans-serif for the title and a small tracked monospace font for the selected-cut label. - On the control strip, place **Try on a haircut** at the far left. Follow it with four equal-width cut cards and one equally wide red booking button in the original layout. Generate the actual card count from my uploads. Each cut card has a small rectangular portrait thumbnail on the left and its label on the right. Use `#292927` for inactive cards and `#e8e8e4` with dark text for the active card. Keep borders thin and corners square. Give the red **Book a haircut** button a small calendar icon. ### Portraits and interaction - Use transparent PNG or WebP portraits when available. If I provide gray-background JPEGs, prepare clean cutouts so that the oversized title remains visible around the head. Preserve skin tone, clothing, and fine hair edges. Keep the gray background in CSS, separate from the portrait. - Register portraits of the same person using stable visual landmarks such as the eye, nose, ear, and collar. Where the inputs line up closely, retain the base face and clothing and swap the hair using change-specific feathered masks. Where alignment differs visibly, switch to the complete aligned portrait so skin and silhouette edges stay clean. - Load and decode the new portrait before displaying it. When a card is selected, update the hero portrait, selected-cut label and description, booking thumbnail, and active-card styling together. Use semantic buttons with a visible keyboard focus indicator, `aria-pressed` for selection, and `aria-live="polite"` for the updated caption. - Both booking buttons open the same compact dialog. Show the active thumbnail and label under **Your cut**. If the site is a demo, display “This is a booking demo. Save your cut on this device to find it again later.” Provide a **Save my cut** button using `localStorage`, a visible confirmation, and a close button. Support Escape and restore focus to the button that opened the dialog. ### Motion and responsive layout - Run the entrance once, after the first portrait is ready. Start with the portrait rising from below the frame over about 780 ms. Fade the header and the two text blocks into place starting at about 470, 530, and 590 ms. At about 770 ms, lower the oversized brand name from above over 560 ms, behind the portrait. At about 1330 ms, reveal the dark control strip downward over 380 ms. Clip the portrait and title to the hero while they move. Render the stable final state when `prefers-reduced-motion` is enabled. - On compact screens, move the control-strip heading above the cards. On a phone, keep the brand title at the top of the scene, center the portrait beneath it, and softly fade the lower edge of the portrait before the two caption columns. The four original haircut cards and the red booking action share one compact row, with each thumbnail stacked above its label. If my asset count makes the row too narrow, wrap the tiles into additional rows while keeping the booking action last. Keep the complete layout free of horizontal scrolling. - Verify a 1920×1080 desktop view and a 390×844 mobile view. Check every image switch, the booking dialog, and the reveal order. Confirm that the entire control strip and the active cut are visible together in the desktop recording frame. ### Default copy for the original KONTUR version Use the exact copy below when I supply the matching portraits or ask to reproduce the original. For a different number of images, adapt the explanatory sentence to match the actual count. **Brand** KONTUR **Page title** Kontur Barbershop | Haircut Try-On **Tagline** Find your next cut. **Description** See how four cuts change the same profile. Pick the one you’d like to bring to your barber. **Selector heading** Try on a haircut **Caption heading** Selected cut **Booking action** Book a haircut | Position | Cut | Description | | --- | --- | --- | | 1 | Curtains | A center part with loose volume. | | 2 | French Crop | A short fringe with a textured top. | | 3 | Buzz Cut | A close cut with a soft fade. | | 4 | Mod Cut | A textured fringe with soft, longer sides. |
Compare the First Version with the Final Screen
In the first KONTUR, I split the text and a black-and-white portrait into two columns. In the final version, I brought the color back, moved the oversized title behind the portrait, and made the booking button red. On load, the portrait rises first, then the title appears, and finally the selection strip unfolds.

The same French Crop haircut in both versions. On the left, the two-column screen; on the right, the color portrait over the brand name.
What to Check Before You Show It
- Switch between the haircuts quickly. If the eye, ear, nose, or collar jumps, align the portraits to those points and make sure every file is at the same scale.
- Open the screen on a phone. Make sure the cards and the booking button fit the width and the selected haircut is easy to spot.
- Open the booking dialog with different haircuts selected. Check that it shows the one you picked. If you add entrance animations, test the screen in reduced-motion mode.
For a first test, the base profile and one haircut that looks clearly different from it are enough. Once they switch without any jumps, add the rest.
If you want to level up your skills and get the hang of vibe coding, jump into the courses at Nexfield Academy, where, besides Codex, we cover several more up-to-date tools with a range of use cases.
.jpg&w=3840&q=75)
%2520-%2520hover.jpg&w=3840&q=75)



