Back to Fieldnotes

Build note

Making a greeting appear once per session

A small change to keep my portfolio’s introduction personal without making returning visitors wait through it again.


The greeting started getting in the way

My portfolio has a short greeting that cycles through English, Japanese, and Nepali. I liked the personality it added, but watching those same three or four seconds again when returning to the homepage felt unnecessary.

Honestly, once you’ve seen the introduction, you probably just want to see the work.

In my Next.js portfolio, I use sessionStorage to show the greeting once per browser tab session.

  1. EnglishHello.
  2. Japaneseこんにちは.
  3. Nepaliनमस्ते.
The homepage greeting moves through English, Japanese, and Nepali.

What “once” should mean

I wanted “once per session” to mean once within a browser tab:

Expected behavior.Scenario, then expected behavior.
ScenarioExpected behavior
First homepage visitPlay the greeting.
Refresh in the same tabSkip it.
Navigate away and returnSkip it.
Refresh halfway through the greetingStill skip it.
Open the homepage in a fresh, independent tabAllow it to play again.

The greeting belongs to the homepage, so visiting another page first shouldn’t count as having seen it.

Remembering the first hello

The implementation uses sessionStorage with a flag called rupak:intro-seen:v1.

One small detail matters here: the flag gets saved when the greeting starts, rather than when it finishes. Otherwise, someone refreshing halfway through would have to watch it again.

There’s also an early inline check that hides the overlay before the page paints when the flag already exists. So, skipping the greeting should feel immediate, without a quick flash of the loader. An in-memory guard handles duplicate animation starts within the running page.

A little personality, with limits

I kept the greeting because, well, I still like it. The different languages make the site feel a little more personal. I just don’t want that detail to keep getting in someone’s way.

The first visit still comes with a delay. Reduced-motion visitors get a shorter, simpler version.

There are limits too. If session storage is unavailable, the fallback only remembers within the current page load, so refreshing can replay it. And a duplicated tab copies the session, so it skips the greeting too, even though it’s technically a new tab.

What I checked

Once the implementation was in, I went through each case in the browser before calling any of these behaviours tested.

My checklist was:

Checked in the browser

  1. First visit
  2. Refresh
  3. Navigation back home
  4. Refresh midway through
  5. A fresh tab
  6. A duplicated tab
  7. Browser back/forward
  8. Reduced motion
  9. Blocked storage

All nine behaved the way I intended, including the limits above.