Profile
Back to NewsBack
GitHub Trending 28 min
Reader Mode
AnnoyingC/scene-cv: An explorable 3D résumé template: a desk room at a rainy night window, built with Blender and three.js.

AnnoyingC/scene-cv: An explorable 3D résumé template: a desk room at a rainy night window, built with Blender and three.js.

SceneCV · Step into your résumé

Trendoday Rising: Peak #22

A 3D résumé template you can walk into.
The old computer tells visitors about you, the printed pages on the desk are your résumé, the TV plays your work, the bookshelf holds what you have read and the notepad has your contact details. Look around, click things, and get to know someone.

Live demo · Run it locally · Make it yours · What you can do · Credits

!A desk at a city window at night: an old computer, a green desk lamp, a telephone and a TV playing a project

  • The objects are the menu. Click the computer, the printed pages, a tape, the bookshelf, the cork board or the notepad, and the camera flies over and opens that section. The books on the shelf are real books: click one and it slides out, flies up to you and opens. The top navigation bar and the address bar follow along, so every view has a link you can share.
  • The view outside is alive. A light rain keeps falling, stars and the Milky Way turn slowly through gaps in the clouds, office lights switch on and off, car lights crawl along the streets, and raindrops ripple the reflections on the river.
  • The lighting is baked. Blender scripts build the room and bake its lighting into textures, so the browser only has to display it; the first visit downloads about 8.5 MB. Switching lamps on and off or changing tapes still changes the light in the room.
  • One page, two ways to see it. The 3D room and the plain-text version read the same index.html; devices that cannot run the 3D room get the text version automatically.
  • A static site with no dependencies. There is no build step and no npm dependency. Edit index.html and put it on GitHub Pages, Vercel or Netlify.
Inspired by the spatial personal site at felixrieseberg.com. The name, résumé, work, reading list, photos and contact details in this repository are all samples; replace them with your own.

A look around

Close-up of the computer screen: a terminal menu and a short introduction Two printed pages float up and stack into a résumé in front of the viewer
Computer · About
The camera flies to the screen, where a terminal shows a menu: who I am, what I'm up to, how I got here, how I think, and questions people ask. Pick an item and its text types itself out letter by letter.
Printed pages · Résumé
Click the two sheets on the desk and they float up into a stack of A4 pages you can leaf through. Several languages can share one stack, and you can jump straight to another language.
The TV on a cart plays a short programme with subtitles underneath The bookshelf left of the desk, with one book pulled out and open in front of the viewer
VCR · Work
Each tape is a short programme in chapters, with subtitles under the TV. Click a tape on the rack and it flies into the VCR; after a burst of static it starts playing and the TV's colours light up the room. When a programme ends, the next tape goes in.
Bookshelf · Reading list
Turn left to the bookshelf. Click a book and it slides out, flies up to you and opens: the left page carries the book's signature line, the right pages carry your highlights.
A few aged photos pinned loosely to a cork board With the room light off, only the desk lamp, the screens and the city outside are left
Cork board · Photos
Aged photos are pinned under the wall clock, overlapping, with their corners curling. Up close you can drag them around.
Lights
The desk lamp and the room lights can be switched off, leaving only the screens and the city outside. The image has a cinematic grade: warm lights bleed an orange-red halo, small bright lights draw thin horizontal streaks, and the focus follows whatever the camera is looking at.

Interface language and fonts

The interface is in English: the navigation bar, the hints on objects, the panels, the record card, the tape sleeves, the photo wall, the résumé viewer's buttons, the loading screen, the footer and the credits. The sample books on the shelf are in Chinese. The computer menu and the résumé can hold several languages, and visitors switch between them on the screen or on the stack of pages.

Fonts live in assets/fonts/ (Latin subsets, SIL OFL; the licence texts are in the same folder): Cinzel for the navigation and headings, EB Garamond for hints, panels and buttons, and Playfair Display for the big titles on the tape sleeves. Chinese text falls back to Songti or the system font. The site serves its own font files and makes no requests to Google.

Run it locally

You need Node.js 22 or newer. There are no npm dependencies and nothing to install or build:

node scripts/serve.mjs

Then open http://localhost:5173. ?room=1 forces the 3D version and ?plain=1 forces the text version. Everything is static files, so the folder can go straight to GitHub Pages, Vercel or Netlify.

Scope: the repository contains the desk room, its front-end interactions, the Blender scripts that build it and a local static file server. There are no accounts, no database, no API for saving a résumé and no online editor. Three.js and the Draco decoder load from a CDN, so the first run needs a network connection.

Checks: npm test covers the local server's access rules and the credits list; npm run audit:public scans tracked files for local paths, common credential patterns, contact details and files that should not be published. You can also keep a .private-terms word list that stays out of Git, listing words that must not appear in public files (see scripts/audit_public.py). Automated scans do not replace reading new content and third-party assets yourself.

What you can do

| Interaction | Details | |---|---| | Opening view | The camera faces the computer on the desk under the window and orbits around it. Drag left to see the bookcase (the orbit centre shifts 15 cm to the left and the camera pulls back a little so the whole bookcase fits, and returns when you turn back); drag right to see the record player on the sideboard and the cork board (the centre shifts right and forward, the camera pulls back and tilts down slightly so the record player fits, and returns the same way). Scroll or pinch to zoom. The TV starts playing your work as soon as the page opens and cycles through the tapes | | Navigation bar | Your name on the left; About / Résumé / Work / Books / Photos / Contact on the right. Clicking an item does the same as clicking its object: the camera flies over, the panel opens and the address changes. Hovering an item highlights its object. The current item is shown inverted; click it again or click your name to return to the desk. At first only About / Work / Contact are readable: Résumé, Books and Photos are blurred placeholders that cannot be clicked (hovering says "Not yet discovered") until the visitor finds them in the room (see Achievements). The text version has no locks | | Achievements | Steam-style: the first time a visitor finds something, an achievement card slides in at the bottom right (it moves aside when a panel is open there): picking up the printed pages (Paper Trail), walking to the bookshelf (Bookworm) and taking a closer look at the cork board (Pinned Memories). At the same moment the matching navigation item comes into focus and becomes clickable. Unlocks are remembered in the browser (localStorage), so returning visitors don't have to find them again | | Hover | Objects brighten and a hint appears next to them; a tape lifts a little out of the rack | | Computer | The camera flies to the screen, which shows a terminal menu (the .pc-menu inside #about). Each item is a page of text or a list you can open (a timeline, notes, Q&A), typed out letter by letter; a timeline entry can "Play on the TV" the matching tape. There is one menu per language, switched on the screen | | Printed pages · Résumé | Click the two sheets on the desk and they float up into a stack of A4 pages you leaf through left and right (#resume). One stack can hold several languages; the buttons above it jump to a language, and a data-pdf attribute adds a download button. Pages whose text does not fit are scaled down slightly | | TV / tape rack | Work. The tapes on the rack (a Sketchfab model) stand upright in sleeves that the page draws from #work: the name runs down the spine, the front looks like an old rental tape and the back carries the summary and a barcode (the name is the text, the colour is data-color). Click any tape: the previous one flies back to its slot, the new one lifts out whole and flies into the VCR, and after the static it starts playing while the TV's colours light the room. A tape can be a short programme in chapters (title card, an animation drawn in code, number cards, images, before/after wipes, video, side-by-side comparisons, end card), with subtitles and chapter marks under the TV; ↑↓ or clicking the TV changes chapters, and when it ends the next tape goes in | | Panel | In the Work view there are ◀◀ ■ ▶▶ controls (keys ← → and Space) and a link to the project | | Notepad / telephone | The contact details are handwritten on the notepad (a decal on the baked paper that follows the desk lamp's light), and the panel has clickable links | | Bookshelf | On the left wall (drag left to turn towards it). The camera flies over without opening a list: the shelf itself is the table of contents, so visitors click the book they want (hovering shows its title). Books slide out a little on hover; clicked, a book slides out, flies up and opens (the address becomes #shelf/</code>), again without a panel. Books with many highlights have several pages: click the right page to turn forward, the left page to turn back, and anywhere else to put the book back; ← → turn pages and move to the next book at the end, Esc closes it | | Cork board · Photos | Under the wall clock, with aged photos pinned to it. Click it and the camera moves up to the board, where the photos are viewed in place (<code>#photos</code>) and can be dragged around | | Record player | Once you add tracks (see Make it yours), clicking the record player opens a record card: choose a record, play or pause, set the volume and switch between a vinyl sound and the clean recording; the record spins up to about 33⅓ RPM and slows to a stop when paused. Without tracks the turntable holds a blank record | | Desk lamp, floor lamp, cabinet lamp | Click to switch them on and off; the lighting changes in real time | | Credits | The "Credits" link in the footer (<code>#credits</code>): the author, original link, licence and changes for every third-party asset in the room. The camera stays where it is and only the panel opens | | Routes | <code>#about</code> <code>#resume</code> <code>#work</code> <code>#shelf</code> <code>#photos</code> <code>#online</code> <code>#credits</code> are real addresses you can share; the browser's back button, the on-page "← Back", Esc and the name in the navigation bar all return to the desk | | Loading | A download progress bar (about 8.5 MB); devices that cannot run WebGL2 go straight to the text version | | Phones | In portrait the panel sits at the bottom and the camera tilts down to keep the object above it; resolution drops automatically and bloom and depth of field are switched off to keep the frame rate up |</p> <h2>Make it yours</h2> <p>All content lives in <code>index.html</code>: the 3D version reads it, and the text version is that HTML itself. How to write each section is explained in comments inside <code>index.html</code>.</p> <ul><li>Navigation: every <code><section></code> with a <code>data-nav</code> attribute gets an item in the top bar, labelled with the <code>data-nav</code> value. If you add a section that has no object in the room yet, its navigation item opens that section of the text version.</li> <li>Name and introduction: <code><h1></code>, <code>.tagline</code> and <code>#about</code>. The computer's menu is the <code>.pc-menu</code> inside <code>#about</code> (one per language).</li> <li>Résumé: each <code>article.cv-page</code> in <code>#resume</code> is one A4 page. If you'd rather not put your phone number and email in the public <code>index.html</code>, write the pages in <code>assets/resume/resume.html</code> instead (same markup; the folder is ignored by Git) and the page swaps them in at startup.</li> <li>Work: each <code><li></code> in <code>#work</code> is a tape; the rack on the desk holds 4. <code>data-tape</code> picks what the TV shows: <code>bars</code> / <code>synth</code> / <code>bounce</code> / <code>rain</code> are pictures drawn in code, and <code>show</code> is a programme in chapters whose <code>data-show</code> points to its programme file (<code>assets/tapes/<name>/show.json</code>; the chapter types are documented at the top of <code>js/tapes/show.js</code>, and there is a sample in <code>assets/tapes/sample/</code>). Animations used in programmes are written in <code>js/tapes/anims.js</code>. <code>data-color</code> sets the colour of the sleeve and of the TV's light.</li> <li>Reading list: each <code><li></code> in <code>#shelf</code> is one book: <code><a></code> holds the title and link, <code>.by</code> the author, <code><blockquote class="key"></code> the line printed on its own on the left page, and the other <code><blockquote></code>s the highlights on the right pages. <code>data-size</code> (width × height × thickness in mm), <code>data-kind</code> (hardcover / paperback), <code>data-color</code> / <code>data-ink</code>, <code>data-style</code> (the style of the generated cover) and <code>data-read</code> / <code>data-progress</code> (when you finished it / how far you are) are explained in the comments. Changing the number of books or their sizes means re-baking the room, because the books are modelled from those sizes. Books fill the shelves in list order: first the shelf at eye level, then the one below, then the top one, and the remaining gaps are filled with old books. Real covers go in <code>assets/books/covers/</code> together with a <code>covers.json</code> (title → image file); that folder is ignored by Git, and <code>js/main.js</code> adds the covers by title at load time, falling back to generated covers.</li> <li>Photos: each <code><li></code> in <code>#photos</code> is an <code><img></code> plus an optional caption. Age your photos first: put the originals in <code>photos-src/</code> and run <code>/Applications/Blender.app/Contents/MacOS/Blender -b --factory-startup --python blender/age_photos.py -- --src photos-src --out assets/photos</code>. This produces <code><name>.webp</code>, <code><name>.board.webp</code> (for the board, 1024 px on the long side) and a <code>photos.json</code> list; when that list exists the cork board uses those photos, otherwise it uses the ones in <code>#photos</code>. Ageing means yellowing, fading, blotchy stains and mould spots, worn corners and creases; the curling corners are real geometry in the page. Photo positions are remembered in the browser; run <code>__room.cmd('photos-reset')</code> in the console to put them back. Ageing re-encodes the images, so the originals' EXIF data (capture time, GPS location) is not carried over. <code>photos-src/</code> and <code>assets/photos/</code> are ignored by Git; the samples in this repository are a few blank aged photos (<code>assets/photos-sample/</code>, generated with <code>--demo 1</code>).</li> <li>Contact details: <code>#online</code>, shown both on the notepad and in the panel. You can also write them in <code>assets/resume/contact.html</code> (a few <code><li></code>s, ignored by Git); <code>js/main.js</code> swaps them into <code>#online</code> at load time.</li> <li>Wall poster and prints: the wall between the corner easel and the window has room for one large poster and five small prints below it (taped up like printouts in a lab; their sizes and places are <code>POSTERS</code> in <code>blender/bake_room.py</code>, keys <code>poster</code>, <code>poster_2</code> … <code>poster_6</code>). Age each image with <code>/Applications/Blender.app/Contents/MacOS/Blender -b --factory-startup --python blender/age_poster.py -- --src <image> --out assets/posters --name <name> --key <key> --title "<hover text>"</code>: a magazine cover gets faded ink, yellowed paper, a sun-bleached side, fold lines, worn edges and faint water stains; for a paper figure add <code>--sheet 1.414 --margin 0.06 --folds 0 --age 0.45</code> to lay it on a lightly aged sheet of white paper. Each run adds its entry to <code>assets/posters/posters.json</code>; the folder is ignored by Git, since covers and figures are usually someone else's work. Every piece has white tape on its corners, is baked into the room lighting together with the wall and casts no shadow, so without them the wall looks exactly as before.</li> <li>Personal mode: the private files above (<code>assets/resume/</code>, <code>assets/books/covers/</code>, <code>assets/photos/photos.json</code>, <code>assets/posters/posters.json</code>) are only read when the page is opened with <code>?personal</code> (for example <code>http://localhost:5173/?personal</code>) or the <code><html></code> tag carries a <code>data-personal</code> attribute. Without it the page shows only the samples in <code>index.html</code>, exactly as the public copy does, even if those folders exist on your machine.</li> <li>Music: the repository ships without music. Put mp3 files in <code>assets/audio/</code> (ignored by Git) and add an entry per track in <code>js/music-tracks.js</code> (<code>id</code>, title, artist, mp3 path, and the colour and text of the record label; the file has an example), and the record player works: a track loops once it plays, the default volume is 25%, the chosen record and volume are remembered in the browser, and audio only loads when you press play. The vinyl sound softens the highs and adds a little hiss and sparse crackle in real time; the files themselves are untouched.</li> <li>A new kind of TV picture: write a module in <code>js/tapes/</code> with the interface <code>mount({ ctx, width, height, tape }) → { frame(t, dt) }</code> and register it in <code>js/tapes/index.js</code>.</li></ul> <h2>Code layout</h2> <p>| File | Purpose | |---|---| | <code>js/main.js</code> | Checks the device and loads the 3D version or the text version; builds the navigation bar; swaps in a local résumé, contact list and cover list when they exist | | <code>js/nav.js</code> | The navigation bar: built from the <code>section[data-nav]</code> elements; in 3D it calls the scene's <code>go()</code> (the same entry point as clicking an object), in the text version it uses in-page anchors; items not found yet are locked (blurred, not clickable) | | <code>js/achievements.js</code> | Achievements: the list, the Steam-style card in the corner, unlocking navigation items, remembering unlocks in localStorage | | <code>js/content.js</code> | Reads the content out of the HTML (introduction, menu, work, books, photos, contacts) | | <code>js/baked.js</code> | Loads the baked scene (with progress), the lightmap shader, hotspot highlighting, the notepad decal, and splits the tapes into objects that can move on their own | | <code>js/room.js</code> | Interaction: the camera (orbiting the computer and flying to objects), picking, routing, panels, tape animations, TV subtitles, lights | | <code>js/grade.js</code> | Rendering and the overall look: the scene pass (multisampled) with white balance and depth of field, horizontal light streaks, then colour grading, vignetting, sharpening / softening, noise / grain and the VHS effect, with several presets | | <code>js/pc.js</code> | The computer terminal: menu, typewriter effect, language switching | | <code>js/resume.js</code> | The printed résumé: pages float up from the desk into a stack, page turning, language switching, automatic text fitting | | <code>js/sleeves.js</code> | The tape sleeves: drawn from <code>#work</code>; sleeve and tape are merged into one box, with the sleeve's open top and finger notches filled in | | <code>js/tv.js</code> / <code>js/tapes/</code> | The TV and each tape's picture (drawn on a 2D canvas used as a texture); <code>show.js</code> plays programmes in chapters, <code>anims.js</code> holds the animations drawn in code | | <code>js/books.js</code> | The real books on the shelf: covers (spine and cover drawn on canvas, or real covers), sliding out on hover, flying up to the viewer, and opening as a live-lit book (signature line and reading status on the left page, highlights from the right page on, overflowing onto later pages, with a page that bends as it turns) | | <code>js/photos.js</code> | The photo wall: a cork layer over the board, aged photos pinned on it (pins, shadows, curled corners), draggable | | <code>js/music.js</code> / <code>js/turntable.js</code> / <code>js/vinyl-audio.js</code> / <code>js/music-tracks.js</code> | The record card and playback, the spinning record on the turntable, the vinyl sound, the track list | | <code>js/window-view.js</code> | The rainy night outside: two layers of city panorama (read from data maps: the odd window light switching, traffic, obstacle lights), a live sky (for Tokyo: low rain clouds lit warm-grey by the city; for the old procedural city: stars, the Milky Way turning around the pole, the moon, drifting clouds) and rain | | <code>js/deskcal.js</code> | The perpetual calendar on the desk: its cubes, weekday roller and month bars turn to today's date; click it to scramble them | | <code>js/sfx.js</code> | Sound: rain outside the window, a quiet soundtrack while the TV plays a project, and short effects for books, papers, photos, switches, tapes, the calendar and the computer menu. It starts after the first click (browsers do not allow sound before that); the "Sound on / off" link at the bottom is remembered. The files and their CC0 sources are listed in <a href="assets/sfx/README.md" target="_blank" rel="noopener"><code>assets/sfx/README.md</code></a> | | <code>js/paint.js</code> | The notepad page | | <code>blender/</code> | Python scripts that render the night view, build the room and bake its lighting; <code>age_photos.py</code> / <code>age_poster.py</code> age photos and the wall poster | | <code>blender/render_view.py</code> and helpers | The view outside: <code>plateau_prep.py</code> converts PLATEAU CityGML, <code>osm_city.py</code> builds the OpenStreetMap buildings, roads and Tokyo Tower, <code>street_detail.py</code> the utility poles, trees, gardens and shop fronts, <code>window_atlas.py</code> / <code>sign_atlas.py</code> make the facade-photo and shop-sign atlases, <code>postfx.py</code> adds bloom and AgX tone mapping | | <code>assets/vendor/</code> | The list of third-party 3D assets (<code>credits.json</code>) and notes on their licences | | <code>scripts/fetch_assets.mjs</code> | Downloads the original third-party files used in the room into <code>vendor-src/</code> (not in the repository) | | <code>scripts/fetch_city.mjs</code> | Downloads the city data for the view outside (OpenStreetMap, PLATEAU, three night photos) into <code>vendor-src/</code> and builds the intermediate files | | <code>scripts/credits_html.mjs</code> | Generates the credits list in <code>index.html</code> from <code>credits.json</code> | | <code>scripts/serve.mjs</code> | Local static file server (binds to localhost, serves only allowed file types) |</p> <h2>Third-party assets</h2> <p>The room uses 25 third-party assets: 19 from Sketchfab (CC BY 4.0, which requires attribution and a note of changes) and 6 from Poly Haven (CC0). The view outside is built from map data and a city model: OpenStreetMap (© OpenStreetMap contributors, ODbL), MLIT's PLATEAU 3D city model of Minato City (Government of Japan Standard Terms of Use 2.0, compatible with CC BY 4.0), three CC0 night photos from Wikimedia Commons, and shop signs lettered in Noto Sans CJK (SIL OFL, the copy bundled with Blender; the font itself is not redistributed). The attribution is on the site under <code>#credits</code>, including the text version. The list is generated into <code>index.html</code> from <code>credits.json</code> by <code>node scripts/credits_html.mjs</code>; run it again whenever the assets change (<code>npm test</code> checks that it is up to date). These assets keep their own licences and are not covered by the repository's code licence; see <a href="assets/vendor/README.md" target="_blank" rel="noopener"><code>assets/vendor/README.md</code></a> (in Chinese). The original files are not in the repository; download them again when you need them:</p> <pre><code class="bash">node scripts/fetch_assets.mjs node scripts/fetch_city.mjs # the data for the view outside (about 1.5 GB, then a few minutes of processing)</code></pre> <p>No coordinate in the room is hard-coded in JavaScript: every object's hotspot boxes, and where the camera looks and how much it frames when you click it, are computed by the bake script and written to <code>assets/baked/manifest.json</code> (<code>hotspots</code>, <code>views</code>, <code>tapes</code>, <code>books</code>, <code>photos</code>). Move an object in Blender and export again.</p> <h2>Baked lighting (Blender → browser)</h2> <p>Two steps, both Python scripts that run without opening the Blender UI:</p> <pre><code class="bash">/Applications/Blender.app/Contents/MacOS/Blender -b --factory-startup --python blender/render_view.py -- --width 3840 --samples 64</code></pre> <pre><code class="bash">/Applications/Blender.app/Contents/MacOS/Blender -b --factory-startup --python blender/bake_room.py -- --size 2048 --samples 1024</code></pre> <p>When you have only changed things that don't affect the lighting, such as hotspots or camera views, add <code>--skip-bake 1</code> to skip baking and re-export the model and manifest in a few seconds:</p> <pre><code class="bash">/Applications/Blender.app/Contents/MacOS/Blender -b --factory-startup --python blender/bake_room.py -- --skip-bake 1</code></pre> <ul><li><strong>The view outside</strong> (<code>blender/render_view.py</code> + <code>js/window-view.js</code>): a rainy night over the real neighbourhood around Tokyo Tower, seen from 70 m above Azabu-Jūban, 0.8 km from Tokyo Tower, which stands just right of the computer. The buildings come from MLIT's PLATEAU 3D city model of Minato City (17,000 buildings, most with real roof shapes, measured heights, uses and storey counts, on real terrain) and, beyond the ward, from OpenStreetMap; the roads follow OpenStreetMap's lane counts, bridges and layers, so the Shuto Expressway runs on viaducts with parapets and piers. Tokyo Tower itself is modelled by script to its real profile: lattice legs, the arches at its foot, two observation decks, the antenna mast and the red-and-white paint bands, floodlit orange. Up close (within about 280 m) windows are drawn per floor from each building's use and storey height: office floors lit or dark as a whole, flats lit per home in mixed warm and cool light, some curtains half drawn; further away the facades are swatches cut from CC0 night photos of this same area, so distant windows look photographed. Near the camera there are utility poles with wires and street lamps, street trees, small trees in the gardens of detached houses, and shop fronts — izakaya with rows of red lanterns and noren, cafés with awnings and plants, a convenience store — with protruding and rooftop signs lettered in Noto Sans CJK. Cycles renders it as two partial panoramas (equirectangular, ±80° horizontally and −40° to +55° vertically, so no camera angle reaches an edge) in high dynamic range; <code>postfx.py</code> adds layered bloom and AgX tone mapping, and the near layer is rendered at 1.5× resolution and sharpened so that near detail is crisper than the distance. One layer holds everything within 250 m and one the rest, both WebP with transparent backgrounds, mapped in the browser onto spheres of 10 m and 40 m radius centred on the window so that near and far shift against each other as the mouse moves. Each layer has a half-resolution data map (per category: a random value for each lit window, traffic lanes, obstacle lights), which the browser uses to switch the odd window light on and off and blink the obstacle lights. Car lights are drawn separately: <code>view.json</code> stores each lane's start and end, cars drive along them at realistic speeds on the sphere of their layer, and the data map tells whether that direction is a lane or hidden behind a building. The sky is drawn live in the browser: low rain clouds lit warm-grey from below by the city, the moon hidden behind them; outside the window there are also a few thousand instanced rain streaks. A flat image, <code>view_full.jpg</code>, is rendered only to light the room during baking. <code>--osm ""</code> brings back the earlier procedural riverside city with its starry sky.</li> <li><strong>The room</strong> (<code>blender/bake_room.py</code>): a small 3.3 × 3.0 m study with warm-white, linen-textured wallpaper. Behind the desk a 2.2 m white grid window (a Sketchfab model, glazed with a faint pane of glass) is centred on the computer and runs from a stone sill just above the desk up to the cornice, so its top never shows. In front of it stands a 1.5 m walnut desk (a 5.5 cm top with a bevelled edge, three drawers on the right and a shallow one in the middle, all with brass pulls; the wood grain is a 1024² texture generated at bake time, three boards with cathedral grain). In the middle is a beige vintage desktop computer (square screen, thin bezel, the monitor sitting on a horizontal case with a floppy in the drive and a sticky note on the side), with a home-built keyboard in front and a mouse to the right. Around it: a desk lamp standing on two old books, a wooden perpetual calendar in front of the lamp (a Sketchfab model whose number cubes, weekday roller and month bars the page turns to today's date), a tape rack (four tapes standing in sleeves), a coffee mug, glasses, a remote, a notepad and a pen pot, and some clutter: two printed pages, a stack of floppies and a push-button telephone (it counts as "contact" too). To the right of the desk a small cart carries the TV and the VCR, angled towards the camera. On the left wall, set forward so that it does not face the desk, stands a 2.3 m carved wooden bookcase (a Sketchfab model with a drawer at the bottom and five shelves), holding rows of old hardcovers (also Sketchfab), the real books modelled from the reading list, an 8 mm film camera, a few cassettes and a small trailing pothos; a monstera stands at its far end and a pile of books waits on the floor in front of it. In the back-left corner, standing out from the walls, a studio easel (Sketchfab) holds a gilded frame (Poly Haven) with Claude Monet's <em>Impression, Sunrise</em> (1872, public domain); hovering it shows the title. Right of the window hangs a tied-back oatmeal linen curtain; on the right wall are a sideboard, the record player, a picture, a clock and a 90 cm cork board (the photo wall) below it. The opening camera stands in front of the computer and orbits around it, with the computer and the window in the middle of the frame and half the TV showing on the right; the field of view is 34°, and the camera cannot tilt up to the ceiling. Turning left, the camera also drifts towards the left end of the desk: it passes the bookcase and ends facing the painting in the corner; turning right brings in the record player.</li> <li><strong>Four light layers</strong> are baked: ambient (moonlight, the city outside and the computer screen), room lights (the floor lamp, the cabinet lamp, a soft invisible light along the top of the window and another on the bookcase), the desk lamp and the TV. Switching lights and changing the TV's colour only change coefficients in the shader; nothing is recomputed.</li> <li><strong>Rendering and the overall look</strong> (<code>js/grade.js</code>), in several passes. <code>CameraPass</code> replaces RenderPass: it renders the scene into a 4× multisampled HDR buffer, then applies white balance and depth of field in linear light (thin-lens model: the focal length follows from the field of view and a 24 mm film height, and the focus distance follows the object the camera looks at, pulling slowly when it changes; a single spiral gather that reads mipmaps where the blur is large, so lights turn into bokeh). The five levels of bloom (UnrealBloomPass) can be tinted separately; an orange-red outer level is film halation. <code>StreakPass</code> stretches small bright lights horizontally, like an anamorphic lens: the highlights are reduced to a quarter, blurred four times horizontally only and added back. <code>GradePass</code> runs after tone mapping and handles colour grading, vignetting / natural lens falloff (cos⁴), sharpening / softening, chromatic aberration, sensor noise / film grain, and scanlines for the VHS look. The default is <code>cinema</code> (ACES, warm bloom with an orange-red halo, horizontal streaks on small bright lights, slightly teal shadows and warm highlights, a light f/4 depth of field, fine grain); <code>?look=<name></code> picks another (<code>none</code> as rendered / <code>real</code> realistic camera / <code>film</code> warm film / <code>cine</code> night film / <code>vhs</code> VHS tape / <code>polaroid</code> faded print / <code>lofi</code> late-night lo-fi), and <code>?looks</code> shows a row of buttons at the bottom left to switch live. All parameters are in <code>LOOKS</code>, and each look can also change the bloom and halo colours, the streaks, the tone mapping and the aperture.</li> <li><strong>Hotspots</strong>: while building the model, <code>with hot('about'):</code> tags the faces that belong to the computer, and the export computes tight boxes from those tags (they can rotate around the vertical axis to follow the angled notepad). In the browser, the box that contains the first face hit by the ray is what was clicked; the highlight is also computed in the shader from that box, so no extra geometry is needed.</li> <li><strong>The real books on the shelf</strong>: the bake script reads the reading list from <code>index.html</code> and models each book at its size (hardcover boards overhang the pages), lays out the cover UVs horizontally as [back | spine | front], and the page paints the cover onto it. The manifest's <code>books</code> stores each book's position and size, and <code>photos</code> stores the position and orientation of the cork board's surface.</li> <li><strong>Shared dimensions</strong> are in <code>blender/shared.py</code> (window size, desk height, moon direction, parameters of the view outside).</li></ul> Measured on an Apple M5 (10-core GPU): the Tokyo view (far layer 3840×2280, near layer 5760×3420, 64 samples) takes about 7 minutes including building the scene, the data maps and the flat image; baking the room at 2048², 1024 samples and four layers takes about a minute. <h2>Debugging</h2> <ul><li>The page exposes <code>window.__room</code>; navigation clicks also go through <code>__room.go(id)</code>. <code>__room.go('work')</code> switches views, <code>__room.tick(dt)</code> advances one frame by hand (browsers slow animations down in background tabs), and <code>__room.hoverAt(x, y)</code> / <code>clickAt(x, y)</code> simulate the mouse.</li> <li>Achievements: <code>window.__achievements</code>. <code>__achievements.reset()</code> clears the unlocks (the navigation bar locks again after a reload), and <code>__achievements.unlock('photos')</code> unlocks one directly.</li></ul> <h2>About this repository</h2> <p>The name, résumé, work, reading list, photos and contact details in this repository are samples. Real résumés and contact details, real book covers, personal photos, music and the original third-party downloads are kept out of the repository (see <code>.gitignore</code>) and can stay on your own machine. The Blender scripts stay editable, and local path metadata has been removed from images and models. What was checked before publishing is listed in the <a href="docs/PUBLICATION.md" target="_blank" rel="noopener">publication checklist</a>, and GitHub Pages setup is described in <a href="docs/PAGES.md" target="_blank" rel="noopener">docs/PAGES.md</a> (both in Chinese).</p> <p>The code is released under the <a href="LICENSE" target="_blank" rel="noopener">MIT licence</a>. The third-party 3D assets keep their own licences (CC BY 4.0 / CC0 1.0, see Third-party assets above) and the fonts are under the SIL OFL; neither is covered by the MIT licence.</p> <h2>Next steps</h2> <ol><li>Rain: the rain streaks outside and the ripples on the water are there; raindrops on the glass and wet streets with reflections are still missing.</li> <li>Sound effects: rain, light switches, inserting a tape, terminal typing.</li> <li>Model compression (Meshopt) and AVIF / KTX2 textures to bring the 8.5 MB download down.</li></ol> </article> <!-- Article Completion Section --> <div class="reader-footer mt-5 pt-5"> <div class="reader-completion-box rounded-3 p-4 text-center"> <div class="reader-completion-icon mb-3"> <i class="fas fa-check-circle"></i> </div> <p class="reader-completion-text fw-semibold mb-1" style="font-size: 1rem;">You finished the article!</p> <p class="reader-completion-subtext small mb-4">Want to go deeper or explore more stories?</p> <div class="d-flex justify-content-center gap-3 flex-wrap"> <a href="https://github.com/AnnoyingC/scene-cv" target="_blank" rel="noopener noreferrer" class="btn btn-primary-custom btn-sm rounded-pill px-4"> <i class="fas fa-external-link-alt me-2"></i>Full Article on GitHub Trending </a> <a href="https://neshdevtech.com/news" class="reader-back-btn btn btn-sm rounded-pill px-4"> <i class="fas fa-newspaper me-2"></i>More Tech News </a> </div> </div> </div> <!-- Internal Linking CTA --> </div> </div> </div> <!-- Sidebar (desktop only) --> <div class="col-lg-4 col-xl-3 d-none d-lg-block"> <div class="sticky-top" style="top: 80px;"> <!-- Mini Controller Widget --> <div class="card border-0 shadow-sm mb-4 bg-surface"> <div class="card-body p-4"> <h6 class="fw-bold mb-3"><i class="fas fa-glasses me-2 text-primary-custom"></i>Reading Mode</h6> <p class="text-secondary-custom small mb-4">Adjust typography and theme to your preference.</p> <div class="mb-3"> <label class="text-muted-custom small d-block mb-2">Typography</label> <div class="d-flex gap-2"> <button class="btn btn-light btn-sm flex-grow-1 border-custom" id="sidebar-font-serif">Serif</button> <button class="btn btn-light btn-sm flex-grow-1 border-custom" id="sidebar-font-sans">Sans</button> </div> </div> <div class="mb-4"> <label class="text-muted-custom small d-block mb-2">Text Scale</label> <div class="d-flex gap-2"> <button class="btn btn-light btn-sm flex-grow-1 border-custom" id="sidebar-size-dec"><i class="fas fa-minus small"></i></button> <button class="btn btn-light btn-sm flex-grow-1 border-custom" id="sidebar-size-inc"><i class="fas fa-plus small"></i></button> </div> </div> <div class="border-top border-light-custom pt-3"> <a href="https://github.com/AnnoyingC/scene-cv" target="_blank" rel="noopener noreferrer" class="btn btn-outline-primary btn-sm w-100 rounded-pill"> View Original <i class="fas fa-external-link-alt ms-1"></i> </a> </div> </div> </div> <!-- Sidebar Related News --> <div class="card border-0 shadow-sm bg-surface"> <div class="card-header bg-transparent border-0 pt-4 pb-0 px-4"> <h5 class="card-title fw-bold mb-0" style="font-size: 1.05rem;"> <i class="fas fa-newspaper me-2 text-primary-custom"></i>Related Stories </h5> </div> <div class="card-body p-0"> <div class="list-group list-group-flush rounded-0 bg-transparent"> <a href="https://neshdevtech.com/news/the-third-cup-five-elements-one-it-company-wLw3J" class="list-group-item list-group-item-action border-0 px-4 py-3 bg-transparent border-bottom border-light-custom hover-bg-light"> <h6 class="mb-1 fw-semibold text-truncate-2" style="font-size: 0.875rem; line-height: 1.4;"> The Third Cup: Five Elements, One IT Company </h6> <div class="d-flex align-items-center justify-content-between text-muted-custom mt-1" style="font-size: 0.72rem;"> <span>Dev.to</span> <span>13 hours ago</span> </div> </a> <a href="https://neshdevtech.com/news/a-vs-code-extension-to-turn-any-free-chatbot-website-into-an-ai-agent-kind-of-1A66W" class="list-group-item list-group-item-action border-0 px-4 py-3 bg-transparent border-bottom border-light-custom hover-bg-light"> <h6 class="mb-1 fw-semibold text-truncate-2" style="font-size: 0.875rem; line-height: 1.4;"> A VS Code extension to turn ANY free chatbot website into an AI agent (kind of) </h6> <div class="d-flex align-items-center justify-content-between text-muted-custom mt-1" style="font-size: 0.72rem;"> <span>Dev.to</span> <span>1 day ago</span> </div> </a> <a href="https://neshdevtech.com/news/everybody-has-an-ai-apocalypse-story-almost-nobody-reads-the-fine-print-OhFQY" class="list-group-item list-group-item-action border-0 px-4 py-3 bg-transparent border-bottom border-light-custom hover-bg-light"> <h6 class="mb-1 fw-semibold text-truncate-2" style="font-size: 0.875rem; line-height: 1.4;"> Everybody Has an AI Apocalypse Story. Almost Nobody Reads the Fine Print. </h6> <div class="d-flex align-items-center justify-content-between text-muted-custom mt-1" style="font-size: 0.72rem;"> <span>Dev.to</span> <span>2 days ago</span> </div> </a> <a href="https://neshdevtech.com/news/after-the-thirty-six-stratagems-three-questions-f3Vpo" class="list-group-item list-group-item-action border-0 px-4 py-3 bg-transparent border-bottom border-light-custom hover-bg-light"> <h6 class="mb-1 fw-semibold text-truncate-2" style="font-size: 0.875rem; line-height: 1.4;"> After the Thirty-Six Stratagems: Three Questions </h6> <div class="d-flex align-items-center justify-content-between text-muted-custom mt-1" style="font-size: 0.72rem;"> <span>Dev.to</span> <span>2 days ago</span> </div> </a> <a href="https://neshdevtech.com/news/c-15-unpacked-unions-have-arrived-heres-why-they-matter-gZi6b" class="list-group-item list-group-item-action border-0 px-4 py-3 bg-transparent border-bottom border-light-custom hover-bg-light"> <h6 class="mb-1 fw-semibold text-truncate-2" style="font-size: 0.875rem; line-height: 1.4;"> C# 15 Unpacked: Unions Have Arrived. Here's Why They Matter </h6> <div class="d-flex align-items-center justify-content-between text-muted-custom mt-1" style="font-size: 0.72rem;"> <span>Dev.to</span> <span>2 days ago</span> </div> </a> </div> </div> </div> </div> </div> </div> <!-- Mobile: Related News horizontal scroll strip --> <div class="d-block d-lg-none mt-4"> <h6 class="fw-bold mb-3 px-1"> <i class="fas fa-newspaper me-2 text-primary-custom"></i>Related Stories </h6> <div class="related-scroll-strip"> <a href="https://neshdevtech.com/news/the-third-cup-five-elements-one-it-company-wLw3J" class="related-scroll-card"> <p class="related-scroll-title">The Third Cup: Five Elements, One IT Company</p> <div class="related-scroll-meta"> <span>Dev.to</span> <span>13 hours ago</span> </div> </a> <a href="https://neshdevtech.com/news/a-vs-code-extension-to-turn-any-free-chatbot-website-into-an-ai-agent-kind-of-1A66W" class="related-scroll-card"> <p class="related-scroll-title">A VS Code extension to turn ANY free chatbot website into an AI agent...</p> <div class="related-scroll-meta"> <span>Dev.to</span> <span>1 day ago</span> </div> </a> <a href="https://neshdevtech.com/news/everybody-has-an-ai-apocalypse-story-almost-nobody-reads-the-fine-print-OhFQY" class="related-scroll-card"> <p class="related-scroll-title">Everybody Has an AI Apocalypse Story. Almost Nobody Reads the Fine Pri...</p> <div class="related-scroll-meta"> <span>Dev.to</span> <span>2 days ago</span> </div> </a> <a href="https://neshdevtech.com/news/after-the-thirty-six-stratagems-three-questions-f3Vpo" class="related-scroll-card"> <p class="related-scroll-title">After the Thirty-Six Stratagems: Three Questions</p> <div class="related-scroll-meta"> <span>Dev.to</span> <span>2 days ago</span> </div> </a> <a href="https://neshdevtech.com/news/c-15-unpacked-unions-have-arrived-heres-why-they-matter-gZi6b" class="related-scroll-card"> <p class="related-scroll-title">C# 15 Unpacked: Unions Have Arrived. Here's Why They Matter</p> <div class="related-scroll-meta"> <span>Dev.to</span> <span>2 days ago</span> </div> </a> </div> </div> </div> </section> </main> <!-- Footer --> <!-- Footer --> <footer class="py-5 mt-5 position-relative overflow-hidden" style="background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg);"> <!-- Decorative subtle background gradients --> <div class="position-absolute" style="top: -200px; right: -200px; width: 400px; height: 400px; background: rgba(var(--primary-rgb), 0.03); filter: blur(100px); border-radius: 50%; pointer-events: none;"></div> <div class="position-absolute" style="bottom: -200px; left: -200px; width: 400px; height: 400px; background: rgba(var(--accent-rgb), 0.03); filter: blur(100px); border-radius: 50%; pointer-events: none;"></div> <div class="container position-relative z-3"> <div class="row g-4"> <!-- Column 1: Brand & About --> <div class="col-lg-4 col-md-6"> <div class="d-flex align-items-center mb-3"> <span class="brand-mark me-2" style="width: 42px; height: 42px;" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg> </span> <span class="fs-4 fw-extrabold text-primary-custom" style="letter-spacing: -0.05em; font-family: 'JetBrains Mono', monospace;">NeshDevTech</span> </div> <p class="text-secondary-custom mb-4 pe-lg-4" style="font-size: 0.95rem; line-height: 1.6;">NeshDevTech is a professional technology firm passionate about creating innovative, high-performance web and mobile solutions.</p> <div class="d-flex gap-2"> </div> </div> <!-- Column 2: Navigation Links --> <div class="col-lg-2 col-md-6 col-6"> <h6 class="text-primary-custom fw-bold text-uppercase mb-3" style="font-size: 0.85rem; letter-spacing: 0.05em;">Quick Navigation</h6> <ul class="list-unstyled mb-0"> <li class="mb-2"><a href="https://neshdevtech.com" class="footer-link text-secondary-custom text-decoration-none d-inline-block">Home</a></li> <li class="mb-2"><a href="https://neshdevtech.com/projects" class="footer-link text-secondary-custom text-decoration-none d-inline-block">Projects</a></li> <li class="mb-2"><a href="https://neshdevtech.com/blog" class="footer-link text-secondary-custom text-decoration-none d-inline-block">Tech Blog</a></li> <li class="mb-2"><a href="https://neshdevtech.com/pricing" class="footer-link text-secondary-custom text-decoration-none d-inline-block">Get Quote</a></li> <li class="mb-2"><a href="https://neshdevtech.com/contact" class="footer-link text-secondary-custom text-decoration-none d-inline-block">Contact Me</a></li> </ul> </div> <!-- Column 3: Tech Stack & Services --> <div class="col-lg-3 col-md-6 col-6"> <h6 class="text-primary-custom fw-bold text-uppercase mb-3" style="font-size: 0.85rem; letter-spacing: 0.05em;">Core Services</h6> <ul class="list-unstyled mb-0"> <li class="text-secondary-custom mb-2 small"><i class="bi bi-rocket-takeoff text-primary-custom me-2"></i>Custom Laravel Apps</li> <li class="text-secondary-custom mb-2 small"><i class="bi bi-laptop text-primary-custom me-2"></i>SPA (React & Vue.js)</li> <li class="text-secondary-custom mb-2 small"><i class="bi bi-phone-vibrate text-primary-custom me-2"></i>Flutter Mobile Apps</li> <li class="text-secondary-custom mb-2 small"><i class="bi bi-search text-primary-custom me-2"></i>SEO & Performance Opt</li> </ul> </div> <!-- Column 4: Contact & Availability --> <div class="col-lg-3 col-md-6"> <h6 class="text-primary-custom fw-bold text-uppercase mb-3" style="font-size: 0.85rem; letter-spacing: 0.05em;">Get in Touch</h6> <ul class="list-unstyled mb-3"> <li class="text-secondary-custom mb-2 small d-flex align-items-center"> <i class="bi bi-geo-alt text-primary-custom me-2 fs-6"></i>Nairobi, Kenya </li> <li class="text-secondary-custom mb-2 small d-flex align-items-center"> <i class="bi bi-envelope-at text-primary-custom me-2 fs-6"></i> <a href="mailto:info@neshdevtech.com" class="text-secondary-custom text-decoration-none footer-link">info@neshdevtech.com</a> </li> </ul> <div class="bg-primary-custom-light border border-primary-custom border-opacity-10 p-3 rounded-3" style="border-radius: 12px !important;"> <small class="d-block fw-semibold text-primary-custom mb-1"><i class="bi bi-patch-check-fill me-1"></i>Available for Projects</small> <p class="mb-0 text-secondary-custom small" style="font-size: 0.8rem; line-height: 1.4;">Need a high-performing system? Let's discuss your project.</p> </div> </div> </div> <hr style="border-color: var(--border); opacity: 0.8; margin: 2.5rem 0 2rem;"> <div class="row align-items-center"> <div class="col-md-6 text-center text-md-start mb-2 mb-md-0"> <p class="mb-0 text-secondary-custom small">© 2026 NeshDevTech. All rights reserved.</p> </div> <div class="col-md-6 text-center text-md-end"> <p class="mb-0 text-secondary-custom small">Built with <i class="bi bi-heart-fill text-danger"></i></p> </div> </div> </div> </footer> <!-- Bootstrap JS --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> <!-- Custom JavaScript --> <script> // Theme Management System class ThemeManager { constructor() { this.themeToggle = document.getElementById('themeToggle'); this.themeIcon = document.getElementById('theme-icon'); this.mobileThemeToggle = document.getElementById('mobileThemeToggle'); this.mobileThemeIcon = document.getElementById('mobile-theme-icon'); this.init(); } init() { // Get current theme (already applied in head) const currentTheme = document.documentElement.getAttribute('data-theme') || 'light'; // Update icons to match current theme this.updateIcon(currentTheme); // Listen for desktop theme toggle clicks if (this.themeToggle) { this.themeToggle.addEventListener('click', (e) => { e.preventDefault(); this.toggleTheme(); }); } // Listen for mobile theme toggle clicks if (this.mobileThemeToggle) { this.mobileThemeToggle.addEventListener('click', (e) => { e.preventDefault(); this.toggleTheme(); }); } // Listen for system theme changes window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => { if (!localStorage.getItem('theme')) { this.setTheme(e.matches ? 'dark' : 'light'); } }); } setTheme(theme) { document.documentElement.setAttribute('data-theme', theme); document.documentElement.setAttribute('data-bs-theme', theme); if (theme === 'dark') { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.remove('dark'); } localStorage.setItem('theme', theme); this.updateThemeColor(theme); this.updateIcon(theme); } updateThemeColor(theme) { document.querySelectorAll('meta[name="theme-color"]').forEach((meta) => { meta.setAttribute('content', theme === 'dark' ? '#1c2028' : '#e4e8f0'); }); } toggleTheme() { const currentTheme = document.documentElement.getAttribute('data-theme'); const newTheme = currentTheme === 'dark' ? 'light' : 'dark'; this.setTheme(newTheme); // Close mobile menu if open const navbarCollapse = document.querySelector('.navbar-collapse'); if (navbarCollapse && navbarCollapse.classList.contains('show') && window.innerWidth < 992) { setTimeout(() => { const bsCollapse = new bootstrap.Collapse(navbarCollapse, { toggle: false }); bsCollapse.hide(); }, 150); } } updateIcon(theme) { const iconClass = theme === 'dark' ? 'bi bi-sun-fill' : 'bi bi-moon-fill'; // Update desktop icon if (this.themeIcon) { this.themeIcon.className = iconClass; } // Update mobile icon if (this.mobileThemeIcon) { this.mobileThemeIcon.className = iconClass; } } } // Initialize theme manager when DOM is loaded document.addEventListener('DOMContentLoaded', () => { new ThemeManager(); // Initialize navbar live clock (function initNavClock(){ const clockEls = Array.from(document.querySelectorAll('[data-clock]')); if (!clockEls.length) return; const locale = navigator.language || 'en-US'; // Detect 12/24h by locale: use resolvedOptions hourCycle when available const dtf = new Intl.DateTimeFormat(locale, { hour: 'numeric' }); const uses12h = (dtf.resolvedOptions().hour12 === true); const fmt = new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: uses12h }); const update = () => { const now = new Date(); const text = fmt.format(now); clockEls.forEach(el => { el.textContent = text; }); }; update(); setInterval(update, 1000); })(); }); // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // Navbar background on scroll window.addEventListener('scroll', () => { const navbar = document.querySelector('.navbar'); if (window.scrollY > 50) { navbar.style.backdropFilter = 'blur(20px)'; navbar.style.backgroundColor = 'rgba(var(--background-rgb), 0.8)'; } else { navbar.style.backdropFilter = 'blur(10px)'; navbar.style.backgroundColor = 'var(--background)'; } }); // Add fade-in animation to elements when they come into view const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-fade-in-up'); } }); }, observerOptions); // Observe elements with animation class document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.animate-on-scroll').forEach(el => { observer.observe(el); }); }); // Enhanced mobile menu functionality document.addEventListener('DOMContentLoaded', function() { const navbarToggler = document.querySelector('.navbar-toggler'); const navbarCollapse = document.querySelector('.navbar-collapse'); const navLinks = document.querySelectorAll('.navbar-nav .nav-link'); const socialLinks = document.querySelectorAll('.navbar-nav .d-flex a'); let isToggling = false; // Prevent rapid clicking // Enhanced menu close function function closeMenu() { if (navbarCollapse && navbarCollapse.classList.contains('show')) { // Use Bootstrap's collapse API for smooth transition const bsCollapse = new bootstrap.Collapse(navbarCollapse, { toggle: false }); bsCollapse.hide(); } // Reset hamburger animation and aria-expanded if (navbarToggler) { navbarToggler.classList.remove('active'); navbarToggler.setAttribute('aria-expanded', 'false'); } } // Enhanced hamburger toggle functionality if (navbarToggler) { navbarToggler.addEventListener('click', function(e) { e.preventDefault(); // Prevent rapid clicking if (isToggling) return; isToggling = true; const isMenuOpen = navbarCollapse.classList.contains('show'); if (isMenuOpen) { closeMenu(); } else { // Open menu const bsCollapse = new bootstrap.Collapse(navbarCollapse, { toggle: false }); bsCollapse.show(); navbarToggler.setAttribute('aria-expanded', 'true'); } // Reset toggle flag after animation setTimeout(() => { isToggling = false; }, 350); }); } // Close menu when clicking outside document.addEventListener('click', function(event) { const isClickInsideNav = navbarCollapse.contains(event.target); const isToggler = navbarToggler.contains(event.target); const isMenuOpen = navbarCollapse.classList.contains('show'); if (!isClickInsideNav && !isToggler && isMenuOpen && window.innerWidth < 992) { closeMenu(); } }); // Close menu when clicking on navigation links (mobile) navLinks.forEach(function(link) { link.addEventListener('click', function(e) { const isMenuOpen = navbarCollapse.classList.contains('show'); if (isMenuOpen && window.innerWidth < 992 && !this.classList.contains('dropdown-toggle')) { // Add a small delay to let the link navigation start setTimeout(() => { closeMenu(); }, 100); } }); }); // Close menu when clicking on social links (mobile) socialLinks.forEach(function(link) { link.addEventListener('click', function() { if (window.innerWidth < 992) { setTimeout(() => { closeMenu(); }, 100); } }); }); // Escape key closes menu document.addEventListener('keydown', function(event) { if (event.key === 'Escape' && window.innerWidth < 992) { closeMenu(); } }); // Handle window resize to close menu when switching to desktop window.addEventListener('resize', function() { if (window.innerWidth >= 992) { closeMenu(); } }); // Theme toggle functionality is handled by ThemeManager class // No separate event listener needed here // Prevent menu items from being too small on touch devices if ('ontouchstart' in window) { navLinks.forEach(function(link) { link.style.minHeight = '44px'; link.style.display = 'flex'; link.style.alignItems = 'center'; }); } // Add smooth scrolling for anchor links within pages navLinks.forEach(function(link) { const href = link.getAttribute('href'); if (href && href.startsWith('#')) { link.addEventListener('click', function(e) { e.preventDefault(); const target = document.querySelector(href); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } closeMenu(); }); } }); }); </script> <script> // Sticky navbar scroll enhancement (desktop only) (function () { const navbar = document.querySelector('.navbar'); if (!navbar) return; let ticking = false; const SCROLL_THRESHOLD = 20; // px function updateNavbar() { if (window.innerWidth >= 992) { if (window.scrollY > SCROLL_THRESHOLD) { navbar.classList.add('scrolled'); } else { navbar.classList.remove('scrolled'); } } else { // Always remove on mobile so it doesn't affect mobile look navbar.classList.remove('scrolled'); } ticking = false; } window.addEventListener('scroll', function () { if (!ticking) { requestAnimationFrame(updateNavbar); ticking = true; } }, { passive: true }); window.addEventListener('resize', updateNavbar, { passive: true }); // Run once on page load in case page is already scrolled (e.g. back-navigation) updateNavbar(); })(); </script> <script> // Lightweight toast badge notifications (function(){ function ensureContainer(){ let c = document.getElementById('toast-badge-container'); if(!c){ c = document.createElement('div'); c.id = 'toast-badge-container'; c.setAttribute('aria-live','polite'); c.setAttribute('aria-atomic','true'); document.body.appendChild(c); } return c; } function iconFor(type){ switch(type){ case 'success': return '<i class="bi bi-check-circle"></i>'; case 'warning': return '<i class="bi bi-exclamation-triangle"></i>'; case 'error': return '<i class="bi bi-x-circle"></i>'; default: return '<i class="bi bi-info-circle"></i>'; } } window.notifyBadge = function(message, opts={}){ const { type = 'success', timeout = 2500 } = opts; const container = ensureContainer(); const el = document.createElement('div'); el.className = 'toast-badge ' + type; el.setAttribute('role','status'); el.innerHTML = '<span class="icon">'+iconFor(type)+'</span><span>'+message+'</span>'; container.appendChild(el); requestAnimationFrame(()=>{ el.classList.add('show'); }); const remove = () => { el.classList.remove('show'); setTimeout(()=> el.remove(), 200); }; setTimeout(remove, timeout); return { remove }; }; // Global copy helper used by inline buttons window.copyToClipboard = function(url){ try { navigator.clipboard.writeText(url).then(()=>{ // Update the clicked button, if available let btn = document.activeElement && document.activeElement.tagName === 'BUTTON' ? document.activeElement : (window.event && window.event.target && window.event.target.closest ? window.event.target.closest('button') : null); if (btn){ const original = btn.innerHTML; btn.innerHTML = '<i class="fas fa-check me-1"></i> Copied!'; btn.classList.remove('btn-outline-secondary'); btn.classList.add('btn-success'); setTimeout(()=>{ btn.innerHTML = original; btn.classList.remove('btn-success'); btn.classList.add('btn-outline-secondary'); }, 2000); } notifyBadge('Link copied to clipboard', { type: 'success' }); }).catch((err)=>{ console.error('Clipboard error:', err); notifyBadge('Could not copy link', { type: 'error' }); }); } catch (e) { console.error(e); notifyBadge('Copy not supported', { type: 'error' }); } }; })(); </script> <a href="https://wa.me/254768033943?text=Hi%2C+I+visited+your+website+and+would+like+to+inquire+about+your+services." class="whatsapp-btn-float" target="_blank" rel="noopener noreferrer" aria-label="Chat on WhatsApp"> <i class="fab fa-whatsapp"></i> <span class="whatsapp-tooltip">Chat with me</span> </a> <style> .whatsapp-btn-float { position: fixed; bottom: 24px; right: 24px; z-index: 1050; display: flex; align-items: center; justify-content: center; background-color: #25d366; color: #fff !important; width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45); text-decoration: none; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .whatsapp-btn-float i { font-size: 32px; transition: transform 0.3s ease; } .whatsapp-btn-float:hover { background-color: #128c7e; transform: scale(1.1); box-shadow: 0 6px 20px rgba(18, 140, 126, 0.6); } .whatsapp-btn-float:hover i { transform: rotate(10deg); } /* Pulsing ring animation */ .whatsapp-btn-float::before { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; background-color: #25d366; opacity: 0.7; z-index: -1; animation: whatsapp-pulse 2s infinite; } @keyframes whatsapp-pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.6); opacity: 0; } } /* Tooltip style utilizing site-wide theme colors */ .whatsapp-btn-float .whatsapp-tooltip { position: absolute; right: 76px; background-color: var(--surface); color: var(--text-primary); border: 1px solid var(--border); padding: 8px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateX(10px); transition: all 0.3s ease; box-shadow: var(--shadow); pointer-events: none; } .whatsapp-btn-float:hover .whatsapp-tooltip { opacity: 1; visibility: visible; transform: translateX(0); } /* Responsive Design */ @media (max-width: 768px) { .whatsapp-btn-float { bottom: 16px; right: 16px; width: 50px; height: 50px; } .whatsapp-btn-float i { font-size: 26px; } .whatsapp-btn-float .whatsapp-tooltip { display: none; /* Hide tooltip on small screens to prevent overlap issues */ } } </style> <!-- Mobile More Menu (Offcanvas Bottom Sheet) - Auth actions only --> <style> /* ══════════════════════════════════════════════════════════════ NEUMORPHISM REVAMP (front-end only) Soft-extruded UI: same-tone surfaces with dual light/dark shadows. This block sits at the end of the body so it layers over every page's own styles without touching page markup. ══════════════════════════════════════════════════════════════ */ /* ── Buttons: extruded, press-in on click ─────────────────────── */ .btn { box-shadow: var(--shadow) !important; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important; } .btn:hover { transform: translateY(-2px) !important; box-shadow: var(--shadow-md) !important; } .btn:active:not(.btn-link), .btn.show { transform: translateY(1px) scale(0.99) !important; box-shadow: var(--shadow-inset) !important; } .btn-primary-custom, .btn-primary, .btn-success { background: var(--primary-color) !important; border-color: var(--primary-color) !important; color: #fff !important; box-shadow: var(--shadow) !important; } .btn-primary-custom:hover, .btn-primary:hover, .btn-success:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; color: #fff !important; box-shadow: var(--shadow-md) !important; } .btn-outline-primary-custom, .btn-outline-primary, .btn-outline-success, .btn-outline-secondary, .btn-outline-danger, .btn-outline-dark, .btn-light { background-color: var(--surface) !important; border-color: transparent !important; color: var(--text-primary) !important; box-shadow: var(--shadow) !important; } .btn-outline-primary-custom:hover, .btn-outline-primary:hover { background-color: var(--primary-color) !important; border-color: var(--primary-color) !important; color: #fff !important; box-shadow: var(--shadow-md) !important; } .btn-outline-success:hover { background-color: var(--primary-color) !important; border-color: var(--primary-color) !important; color: #fff !important; box-shadow: var(--shadow-md) !important; } .btn-outline-secondary:hover { background-color: var(--text-secondary) !important; border-color: var(--text-secondary) !important; color: #fff !important; box-shadow: var(--shadow-md) !important; } .btn-outline-danger:hover { background-color: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; box-shadow: var(--shadow-md) !important; } .btn-outline-dark:hover, .btn-light:hover { background-color: var(--text-secondary) !important; border-color: var(--text-secondary) !important; color: var(--background) !important; box-shadow: var(--shadow-md) !important; } .btn-dark { background-color: var(--text-primary) !important; border-color: var(--text-primary) !important; color: var(--background) !important; box-shadow: var(--shadow) !important; } /* ── Forms: pressed-in surfaces ────────────────────────────────── */ .form-control, .form-select { background-color: var(--surface) !important; border: 1px solid transparent !important; color: var(--text-primary) !important; border-radius: 14px !important; box-shadow: var(--shadow-inset) !important; transition: box-shadow 0.3s ease, background-color 0.25s ease !important; } .form-control:focus, .form-select:focus { background-color: var(--surface) !important; border-color: transparent !important; color: var(--text-primary) !important; box-shadow: var(--shadow-inset), 0 0 0 4px rgba(var(--primary-rgb), 0.15) !important; } .form-control::placeholder { color: var(--text-muted) !important; } .input-group-text { background-color: var(--surface-alt) !important; border: 1px solid transparent !important; color: var(--text-secondary) !important; box-shadow: var(--shadow-inset-sm) !important; } /* ── Navbar: floating neumorphic pill (tablet & desktop) ──────── */ .navbar { background-color: rgba(var(--background-rgb), 0.9) !important; border-bottom: 1px solid transparent !important; backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; box-shadow: var(--shadow-md) !important; } [data-theme="dark"] .navbar { box-shadow: var(--shadow-md) !important; } @media (min-width: 768px) { .navbar { top: 14px !important; left: 18px !important; right: 18px !important; width: auto !important; border-radius: 20px !important; padding: 0.6rem 0 !important; box-shadow: var(--shadow-lg) !important; } [data-theme="dark"] .navbar { box-shadow: var(--shadow-lg) !important; } .navbar.scrolled { background-color: rgba(var(--background-rgb), 0.95) !important; border-bottom-color: transparent !important; padding: 0.5rem 0 !important; box-shadow: var(--shadow-lg) !important; } [data-theme="dark"] .navbar.scrolled { background-color: rgba(28, 32, 40, 0.95) !important; box-shadow: var(--shadow-lg) !important; } body { padding-top: 96px !important; } .reading-progress-container { top: 88px !important; } } /* ── Tablet refinements (768px - 991.98px) ────────────────────── */ @media (min-width: 768px) and (max-width: 991.98px) { /* Hamburger dropdown panel blends with the floating pill */ .navbar-collapse { border-radius: 20px !important; border-color: transparent !important; } body { padding-bottom: 0 !important; } .whatsapp-btn-float { bottom: 24px !important; } /* Hero: tighten the inline 80px top padding that assumed a full-height bar, so tablets don't get excessive empty space */ .hero-section-bg { padding-top: 40px !important; } } /* ── Neumorphic brand icon mark ────────────────────────────────── */ .brand-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 13px; background-color: var(--surface) !important; color: var(--primary-color) !important; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow) !important; transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); } .brand-mark svg { width: 21px; height: 21px; } a:hover .brand-mark { box-shadow: var(--shadow-inset-sm) !important; transform: translateY(1px); } .mobile-logo .brand-mark { width: 34px; height: 34px; border-radius: 11px; } .mobile-logo .brand-mark svg { width: 17px; height: 17px; } /* ── Uploaded brand logo image ─────────────────────────────────── */ .brand-img { height: 38px; width: auto; max-width: 160px; object-fit: contain; flex-shrink: 0; } .brand-img-sm { height: 28px; max-width: 120px; } .brand-img-footer { height: 44px; max-width: 180px; } /* ── Mobile bars: floating neumorphic pills (phones) ──────────── */ @media (max-width: 767.98px) { .mobile-top-bar { top: 8px !important; left: 12px !important; right: 12px !important; height: 52px !important; border-radius: 16px !important; border-bottom: none !important; background-color: rgba(var(--surface-rgb), 0.92) !important; box-shadow: var(--shadow-md) !important; } .mobile-bottom-bar { left: 12px !important; right: 12px !important; bottom: 12px !important; height: 58px !important; border-radius: 18px !important; border-top: none !important; background-color: rgba(var(--surface-rgb), 0.92) !important; box-shadow: var(--shadow-md) !important; } body { padding-top: 74px !important; padding-bottom: 86px !important; } .whatsapp-btn-float { bottom: 88px !important; } .reading-progress-container { top: 70px !important; } } /* ── Nav pill widgets: pressed-in ──────────────────────────────── */ .theme-toggle, .mobile-theme-toggle, .nav-clock { background-color: var(--surface) !important; border-color: transparent !important; box-shadow: var(--shadow-inset-sm) !important; } /* ── Icon chips, markers & circles: extruded ───────────────────── */ .icon-wrap, .icon-wrapper, .expertise-card-icon, .timeline-marker, .mobile-more-icon-wrapper, .social-circle, .value-icon, .skill-icon-box { box-shadow: var(--shadow) !important; border-color: transparent !important; } /* ── Panels: extruded ──────────────────────────────────────────── */ .accordion-item { border-color: transparent !important; box-shadow: var(--shadow) !important; } .timeline-content { background: var(--surface) !important; border-radius: 12px !important; padding: 1rem 1.25rem !important; box-shadow: var(--shadow) !important; } .feature-item { background: var(--surface) !important; border-color: transparent !important; box-shadow: var(--shadow) !important; } .feature-item:hover { transform: translateY(-2px) !important; box-shadow: var(--shadow-md) !important; } .progress { background-color: var(--surface-alt) !important; box-shadow: var(--shadow-inset-sm) !important; } /* Card hover: consistent soft neu shadow */ .card-hover:hover, .project-card:hover, .blog-card:hover, .post-card:hover, .news-card:hover, .testimonial-card:hover, .hover-lift:hover, .stats-item:hover { box-shadow: var(--shadow-lg) !important; } </style> <script> document.addEventListener('DOMContentLoaded', function() { const readerCard = document.getElementById('reader-card'); if (!readerCard) return; // Settings Key constants const THEME_KEY = 'reader_mode_theme'; const FONT_KEY = 'reader_mode_font'; const SIZE_KEY = 'reader_mode_size'; // Available Options const themes = ['light', 'sepia', 'dark', 'oled']; const fonts = ['serif', 'sans']; const sizes = ['xs', 'sm', 'md', 'lg', 'xl']; // Default Configs const siteTheme = document.documentElement.getAttribute('data-theme') || 'light'; const defaultTheme = siteTheme === 'dark' ? 'dark' : 'light'; let currentTheme = localStorage.getItem(THEME_KEY) || defaultTheme; let currentFont = localStorage.getItem(FONT_KEY) || 'serif'; let currentSize = localStorage.getItem(SIZE_KEY) || 'md'; // Apply initial config applySettings(); // Register Action Listeners (Toolbar) document.getElementById('btn-font-serif').addEventListener('click', () => setFont('serif')); document.getElementById('btn-font-sans').addEventListener('click', () => setFont('sans')); document.getElementById('btn-size-decrease').addEventListener('click', () => adjustSize(-1)); document.getElementById('btn-size-increase').addEventListener('click', () => adjustSize(1)); document.getElementById('theme-light').addEventListener('click', () => setTheme('light')); document.getElementById('theme-sepia').addEventListener('click', () => setTheme('sepia')); document.getElementById('theme-dark').addEventListener('click', () => setTheme('dark')); document.getElementById('theme-oled').addEventListener('click', () => setTheme('oled')); // Register Action Listeners (Sidebar widgets, if present) const sidebarSerif = document.getElementById('sidebar-font-serif'); const sidebarSans = document.getElementById('sidebar-font-sans'); const sidebarSizeDec = document.getElementById('sidebar-size-dec'); const sidebarSizeInc = document.getElementById('sidebar-size-inc'); if (sidebarSerif) sidebarSerif.addEventListener('click', () => setFont('serif')); if (sidebarSans) sidebarSans.addEventListener('click', () => setFont('sans')); if (sidebarSizeDec) sidebarSizeDec.addEventListener('click', () => adjustSize(-1)); if (sidebarSizeInc) sidebarSizeInc.addEventListener('click', () => adjustSize(1)); // Action Core Functions function setTheme(theme) { currentTheme = theme; localStorage.setItem(THEME_KEY, theme); applySettings(); } function setFont(font) { currentFont = font; localStorage.setItem(FONT_KEY, font); applySettings(); } function adjustSize(delta) { let index = sizes.indexOf(currentSize); index = Math.max(0, Math.min(sizes.length - 1, index + delta)); currentSize = sizes[index]; localStorage.setItem(SIZE_KEY, currentSize); applySettings(); } function applySettings() { // 1. Reset theme classes and apply selected themes.forEach(t => readerCard.classList.remove('reader-theme-' + t)); readerCard.classList.add('reader-theme-' + currentTheme); // Update Theme circles highlight themes.forEach(t => { const circle = document.getElementById('theme-' + t); if (circle) { if (t === currentTheme) { circle.classList.add('active'); } else { circle.classList.remove('active'); } } }); // 2. Reset Font classes and apply selected fonts.forEach(f => readerCard.classList.remove('reader-font-' + f)); readerCard.classList.add('reader-font-' + currentFont); // Highlight Font buttons const serifBtns = [document.getElementById('btn-font-serif'), document.getElementById('sidebar-font-serif')]; const sansBtns = [document.getElementById('btn-font-sans'), document.getElementById('sidebar-font-sans')]; serifBtns.forEach(btn => { if (btn) { if (currentFont === 'serif') { btn.classList.add('btn-primary-custom'); btn.classList.remove('btn-light'); } else { btn.classList.add('btn-light'); btn.classList.remove('btn-primary-custom'); } } }); sansBtns.forEach(btn => { if (btn) { if (currentFont === 'sans') { btn.classList.add('btn-primary-custom'); btn.classList.remove('btn-light'); } else { btn.classList.add('btn-light'); btn.classList.remove('btn-primary-custom'); } } }); // 3. Reset Sizing classes and apply selected sizes.forEach(s => readerCard.classList.remove('reader-size-' + s)); readerCard.classList.add('reader-size-' + currentSize); } // Reading Scroll progress calculation const progressBar = document.getElementById('reading-progress-bar'); window.addEventListener('scroll', () => { const documentHeight = document.documentElement.scrollHeight - window.innerHeight; if (documentHeight > 0) { const scrollProgress = (window.pageYOffset / documentHeight) * 100; progressBar.style.width = scrollProgress + '%'; } }); }); </script> <script> // ══════════════════════════════════════════════════════════════ // PWA: Service Worker registration + install prompt // ══════════════════════════════════════════════════════════════ (function () { const PWA_VERSION = '20260805-1'; // ---- Service worker ------------------------------------ if ('serviceWorker' in navigator) { window.addEventListener('load', () => { navigator.serviceWorker.register('/sw.js?v=' + PWA_VERSION).then((reg) => { // Apply updates (new deploy) on the next load without disruption reg.addEventListener('updatefound', () => { const newWorker = reg.installing; if (!newWorker) return; newWorker.addEventListener('statechange', () => { if (newWorker.state === 'installed' && navigator.serviceWorker.controller) { newWorker.postMessage({ type: 'SKIP_WAITING' }); } }); }); }).catch(() => {}); }); } // ---- Install prompt -------------------------------------- let deferredPrompt = null; const bannerId = 'pwa-install-banner'; const DISMISS_KEY = 'nesh-install-dismissed'; function showInstallBanner() { if (localStorage.getItem(DISMISS_KEY) || document.getElementById(bannerId)) return; const banner = document.createElement('div'); banner.id = bannerId; banner.setAttribute('role', 'dialog'); banner.setAttribute('aria-label', 'Install app'); banner.innerHTML = '<div class="pwa-install-content">' + '<span class="pwa-install-icon">' + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>' + '</span>' + '<div class="pwa-install-text">' + '<strong>Install NeshDevTech</strong>' + '<span>Get the app on your device</span>' + '</div>' + '<button type="button" class="pwa-install-btn" id="pwa-install-btn">Install</button>' + '<button type="button" class="pwa-install-close" id="pwa-install-close" aria-label="Dismiss">×</button>' + '</div>'; document.body.appendChild(banner); document.getElementById('pwa-install-btn').addEventListener('click', () => { if (!deferredPrompt) return; deferredPrompt.prompt(); deferredPrompt.userChoice.finally(() => { deferredPrompt = null; hideInstallBanner(); }); }); document.getElementById('pwa-install-close').addEventListener('click', () => { localStorage.setItem(DISMISS_KEY, '1'); hideInstallBanner(); }); requestAnimationFrame(() => banner.classList.add('show')); } function hideInstallBanner() { const banner = document.getElementById(bannerId); if (banner) { banner.classList.remove('show'); setTimeout(() => banner.remove(), 250); } } window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferredPrompt = e; showInstallBanner(); }); window.addEventListener('appinstalled', () => { deferredPrompt = null; hideInstallBanner(); localStorage.setItem(DISMISS_KEY, '1'); }); })(); </script> <style> .pwa-install-content { display: flex; align-items: center; gap: 12px; padding: 14px 18px; } #pwa-install-banner { position: fixed; left: 50%; transform: translate(-50%, 20px); bottom: 84px; z-index: 1070; background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .25s cubic-bezier(.16, 1, .3, 1), transform .25s cubic-bezier(.16, 1, .3, 1); width: min(420px, calc(100vw - 32px)); } #pwa-install-banner.show { opacity: 1; transform: translate(-50%, 0); } .pwa-install-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: rgba(var(--primary-rgb), 0.1); border: 1px solid rgba(var(--primary-rgb), 0.2); color: var(--primary-color); } .pwa-install-icon svg { width: 20px; height: 20px; } .pwa-install-text { display: flex; flex-direction: column; flex: 1; min-width: 0; } .pwa-install-text strong { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pwa-install-text span { font-size: 0.78rem; color: var(--text-secondary); } .pwa-install-btn { background: var(--primary-color); border: none; color: #fff; font-weight: 600; font-size: 0.85rem; padding: 8px 18px; border-radius: 9999px; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25); transition: all .2s ease; } .pwa-install-btn:hover { background: var(--primary-dark); transform: translateY(-1px); } .pwa-install-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 50%; transition: background-color .2s ease, color .2s ease; } .pwa-install-close:hover { background: var(--surface-alt); color: var(--text-primary); } @media (min-width: 992px) { #pwa-install-banner { bottom: 24px; } } </style> </div><!-- /.page-wrapper --> </body> </html>