Skip to content

feat: add kawai logo in npmx.dev homepage#2346

Merged
patak-cat merged 12 commits intonpmx-dev:mainfrom
alfonsusac:feat-kawai-logos
Mar 31, 2026
Merged

feat: add kawai logo in npmx.dev homepage#2346
patak-cat merged 12 commits intonpmx-dev:mainfrom
alfonsusac:feat-kawai-logos

Conversation

@alfonsusac
Copy link
Copy Markdown
Contributor

@alfonsusac alfonsusac commented Mar 31, 2026

🧭 Context

April fools is coming up, something fun needs to be done. I present to you a kawaii variant of the npmx home page.

📚 Description

  • ?kawai=true is detected in index.vue using window.location.search
  • Hydration issue is solved using onPrerender()
  • Kawai logo is rendered using <img> stored in /public/extra
  • On load, it will fade in. On hover, it will scale-105
  • Non-persistent (unlike Bsky's implementation) and can be removed by removing query.

Discussion:
https://discord.com/channels/1464542801676206113/1486838820556116051/1488491068285522021

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 31, 2026 5:02pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 31, 2026 5:02pm
npmx-lunaria Ignored Ignored Mar 31, 2026 5:02pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The app/pages/index.vue file adds an onPrehydrate hook that reads window.location.search for kawaii=true and conditionally sets display styles on four elements by id: the normal logo, a kawaii <img> (initially hidden), the environment/version <span>, and the tagline <p>. The header <h1> now contains both the existing <AppLogo> and an additional kawaii image, each assigned distinct IDs for runtime visibility switching.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the kawaii variant feature, including the activation method (?kawai=true), technical implementation details (hydration solution, logo rendering, animations), and non-persistence behavior.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/pages/index.vue (1)

43-43: Simplify boolean conditions for readability.

The mixed === true / !== true checks work, but they add noise. Using direct booleans (and v-else) makes the template easier to scan.

♻️ Suggested simplification
-          <img
-            v-if="isKawaii === true"
+          <img
+            v-if="isKawaii"
             width="400"
             class="pb-8 motion-safe:animate-fade-in motion-safe:hover:scale-105 motion-safe:transition"
             src="/extra/npmx-cute.svg"
             alt="npmx kawaii logo"
           />
-          <AppLogo v-if="isKawaii !== true" class="w-42 h-auto sm:w-58 md:w-70" />
+          <AppLogo v-else class="w-42 h-auto sm:w-58 md:w-70" />
           <span
-            v-if="isKawaii !== true"
+            v-if="!isKawaii"
             aria-hidden="true"
             class="text-sm sm:text-base md:text-lg transform-origin-br font-mono tracking-widest text-accent absolute -bottom-4 -inset-ie-1.5"
           >
@@
-        <p
-          v-if="isKawaii !== true"
+        <p
+          v-if="!isKawaii"
           class="text-fg-muted text-lg sm:text-xl max-w-xl mb-12 lg:mb-14 motion-safe:animate-slide-up motion-safe:animate-fill-both"
           style="animation-delay: 0.1s"
         >

Also applies to: 49-49, 51-51, 60-60


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f63adce0-831f-4aec-bfd5-141651ab73dd

📥 Commits

Reviewing files that changed from the base of the PR and between 516808b and fb57265.

⛔ Files ignored due to path filters (1)
  • public/extra/npmx-cute.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • app/pages/index.vue

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/pages/index.vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Update app/pages/index.vue

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81411527-01e2-4996-a11b-c22f03802f09

📥 Commits

Reviewing files that changed from the base of the PR and between 4c1eab6 and d2f2a2f.

📒 Files selected for processing (1)
  • app/pages/index.vue

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/pages/index.vue (1)

34-45: Rename the queried env element so it no longer shadows env.

env already means the build environment in this file, so reusing it for a DOM node makes the prehydrate block harder to read and keeps the shadowing warning alive.

Suggested fix
-  const env = el.querySelector('#npmx-index-h1-logo-env') as HTMLElement
+  const envBadge = el.querySelector('#npmx-index-h1-logo-env') as HTMLElement
   const tagline = el.querySelector('#npmx-index-tagline') as HTMLElement
-  if (!normal || !kawaii || !env || !tagline) return
+  if (!normal || !kawaii || !envBadge || !tagline) return
   if (isKawaii) {
     normal.style.display = 'none'
     kawaii.style.display = 'block'
-    env.style.display = 'none'
+    envBadge.style.display = 'none'
     tagline.style.display = 'none'
   } else {
     normal.style.display = 'block'
     kawaii.style.display = 'none'
-    env.style.display = 'block'
+    envBadge.style.display = 'block'
     tagline.style.display = 'block'
   }

As per coding guidelines, **/*.{ts,tsx,vue}: Use clear, descriptive variable and function names.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dceb0402-8249-4103-9bb7-7a618e45069f

📥 Commits

Reviewing files that changed from the base of the PR and between d2f2a2f and d5cab9c.

📒 Files selected for processing (1)
  • app/pages/index.vue

@alfonsusac
Copy link
Copy Markdown
Contributor Author

alfonsusac commented Mar 31, 2026

Ok I made some changes:

  • fixed the hydration issue (no longer showing hydration warning)
  • improve entry animation (scale-in)
  • improve responsiveness (make logo smaller in phone)

Questions:

  1. coderabbit is suggesting me creating i18n token for the alt text, i can do that, but can i directly write the en.json entry in the same PR? can i also write the id-ID.json entry while im at it too? 👀

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
app/pages/index.vue (1)

67-67: ⚠️ Potential issue | 🟡 Minor

Localise the logo alt text.

The alt text is still hard-coded in English on Line 67. Use an i18n token so it follows the active locale.

Suggested patch
-            alt="npmx kawaii logo"
+            :alt="$t('home.logo_kawaii_alt')"

Please add the new key in locale files (including en.json and id-ID.json if you’re updating both in this PR). Based on learnings: in this Nuxt i18n setup, $t() is auto-exposed and should be used directly.

🧹 Nitpick comments (1)
app/pages/index.vue (1)

28-29: Remove stale commented code.

Line 28-Line 29 keep dead commented logic in the component. Please delete these lines before merge.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0261a588-9568-4219-8bfa-ba292a1723b4

📥 Commits

Reviewing files that changed from the base of the PR and between d5cab9c and 37f1b25.

📒 Files selected for processing (1)
  • app/pages/index.vue

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@patak-cat patak-cat added this pull request to the merge queue Mar 31, 2026
@alexdln alexdln removed this pull request from the merge queue due to a manual request Mar 31, 2026
@patak-cat patak-cat added this pull request to the merge queue Mar 31, 2026
Merged via the queue into npmx-dev:main with commit b0d97ff Mar 31, 2026
20 checks passed
@github-actions github-actions bot mentioned this pull request Mar 31, 2026
@alfonsusac alfonsusac deleted the feat-kawai-logos branch March 31, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants