UI/UX Engineer · Game Developer · Graphic Designer
A space-themed personal portfolio: case studies, playable browser games, design galleries and a few 3D surprises, built with Next.js and shipped as a fully static site.
- A quick tour
- What's inside
- Built with
- Run it locally
- How the project is organised
- Performance
- Working with images
- License
Every page is designed for small screens too, down to 320px wide.
| Feature | What it does | |
|---|---|---|
| 🌌 | Living starfield | A three.js star field drifts behind every page, with the odd shooting star. |
| 💧 | Liquid space preloader | Nebula skies pour into one another while the logo gathers from liquid, counting the site in as it really loads. Page changes flood and drain in a different sky each time. |
| 🛸 | 3D figures | A UFO, an astronaut peeking over the footer and a desk scene, all real-time WebGL. |
| 🎮 | Playable games | Nine browser games and five Unity games, each with its own case-study page. |
| 🖼️ | Galleries & lightbox | Logos, artworks, posters, wallpapers and more, in a swipeable full-screen viewer. |
| ⬇️ | Wallpaper & artwork downloads | A short thank-you card counts down from 3, then the original high-res file downloads. |
| 🎵 | Ambient music & sound effects | A space-jazz soundtrack that fades in once you interact, with soft UI sounds. One tap pauses it, and the choice sticks. |
| 🖱️ | Custom cursor | A glowing cursor that reacts to links, buttons and popups. |
| 🫧 | Skills cloud | Skill bubbles that bounce around with simple physics. |
| 💬 | Testimonials constellation | Colleagues as linked stars; pick one to read what they said. |
| 🥚 | Easter egg | Hidden on the About page. Have a look around. |
| ♿ | Accessible by default | Respects reduced motion, keyboard focus states, alt text and screen-reader labels. |
| Layer | Tools |
|---|---|
| Framework | Next.js 15 (App Router) with React 19 |
| Language | TypeScript |
| 3D | three.js |
| Styling | Plain CSS, one stylesheet per page, under styles/ |
| Icons | Simple Icons and inline SVG |
| Hosting | Vercel, served as static files (security headers in vercel.json) |
| Analytics | Vercel Analytics and Speed Insights |
The site builds to plain HTML, CSS and JavaScript (output: 'export'), so there's no server
to run. The out/ folder can go on any static host.
You'll need Node.js 20 or newer.
# 1. Get the code
git clone https://github.com/ruchira-edirisinghe/My-Web-Revamp.git
cd My-Web-Revamp
# 2. Install dependencies
npm install
# 3. Start the dev server (with hot reload)
npm run devThen open http://localhost:3000.
| Command | What it does |
|---|---|
npm run dev |
Starts the development server with hot reload. |
npm run build |
Builds the static site into out/. |
npm run images:check |
Shows what the image optimiser would change, without changing anything. |
npm run images |
Resizes images and creates the small -card versions. |
npm run images:webp |
Converts images to WebP and updates every reference to them. |
Tip:
npm run buildrewrites the.nextfolder. Stopnpm run devbefore you build, or the running dev server will break.
app/ One folder per page (Next.js App Router)
├─ page.tsx Home → /
├─ about/ experience/ contact/ links/ coming-soon/
└─ projects/ Projects hub → /projects
├─ web/ Web projects + a case study per project → /projects/web/<name>
└─ graphic/ Graphic design + 5 galleries → /projects/graphic/<name>
components/ React components
├─ StandardShell.tsx Shared frame: navbar, preloader, footer, cursor, music
├─ about/ Sections of the About page
└─ pages/ Page-level components
├─ galleries/ Gallery page, lightbox and the gallery data
├─ showcase/ Case-study layout and project data
└─ games/ Game case studies
lib/
├─ scripts/ The animations and 3D scenes (starfield, figures, cursor, music…)
├─ sfx.ts UI sound effects
├─ pause-offscreen.ts Pauses animations you can't see
└─ when-idle.ts Loads heavy 3D scenes when the browser is idle
styles/ CSS, one file per page
public/ Images, audio, models and documents that get deployed
scripts/ The image optimiser and WebP converter
docs/readme/ The screenshots in this README
How the animations hook into React
Each animation lives in its own module in lib/scripts/ and exports a function such as
initAbout() that starts it and returns a cleanup function. A page component calls it
inside useEffect and runs the cleanup when the page unmounts:
useEffect(() => {
const stop = initAbout();
return stop; // canvases, listeners, audio and animation loops are torn down
}, []);That keeps navigation clean: moving between pages never leaves an animation loop or event listener running in the background, and it's safe under React's Strict Mode.
A site full of animation still has to feel smooth on an ordinary laptop or phone. A few things make that happen:
- Off-screen pausing. Sections you've scrolled past stop animating (
lib/pause-offscreen.ts). - GPU-friendly animation. Movement uses
transformandopacity, which the graphics card handles, instead of properties that make the browser repaint the page. - Lazy 3D. WebGL scenes load when you get near them or when the browser is idle, and their shaders compile in the background so scrolling doesn't stutter.
- Low-power GPU. The starfield asks for the power-saving graphics chip and draws at 30 fps.
- Lean images. Everything ships as WebP, with small "card" versions for thumbnails.
- Reduced motion. If your device asks for less motion, the site turns the big animations off.
Image pipeline (formats, sizes and the helper scripts)
Everything under public/Images ships as WebP (quality 85).
- Case-study screenshots are stored up to 1920px wide. Each one also gets a
<name>-card.webpat 1100px for the gallery cards. - Wallpapers and artworks also keep their original high-resolution file
(
…/original/). That's what the download button gives you, so the scripts never touch those folders. - A few files keep their format on purpose, because crawlers and the web manifest don't all
read WebP:
Images/favicon/**(PNG),Images/og-card.jpg(the 1200×630 card shown when a link is shared) andImages/mynew.png(the photo in the structured data search engines read).
Run the scripts in this order:
npm run images:check # preview: report what would change, touch nothing
npm run images # resize in place and write missing -card versions
npm run images:webp # convert to WebP and update every src in the codeThe scripts only touch images git already has, so a new screenshot you haven't committed
yet is reported and left alone. Pass --include-untracked to override that.
Game covers (16:9)
All ten games ship cover.webp at 1600×900, cover-thumb.webp at 700×394 and
cover-card.webp at 1100×619, matching the 16:9 cards they appear in.
© 2026 Ruchira Edirisinghe. All rights reserved.
This code is public so you can see how the site works, not so it can be reused. The code, design, artwork, music and written content may not be copied, modified or redistributed without written permission. See LICENSE for the full terms.










