chore: initial commit — Buddy v0.1.0 (Phase A complete)

Buddy is born. First commit of a new standalone WordPress plugin —
the spiritual successor to the tamagotchi that once lived inside
A-WP-Notes v1.1.5 (gracefully retired). Rebuilt from scratch with
all the v3-discipline lessons baked in from day one.

PHASE A — pet exists
- Dashboard widget at WP Admin → Dashboard showing SVG character +
  name + mood label + four stats bars.
- Dedicated admin page at WP Admin → Buddy → My Buddy (bigger view).
- About page with side-by-side intro + plain-prose cards (Logbook
  About-page pattern carried forward).
- Settings page with name-rename form + Updates panel.
- Per-user state in user_meta key buddy_state (each WP admin gets
  their own pet, no shared state).
- Inline SVG sprite renderer with three mood tones (happy/neutral/
  sad) and three sizes (sm/md/lg). CSS keyframe animations: bobbing
  + periodic blinking. Zero image files.
- Self-hosted update checker wired up from commit 1, ported from
  Logbook v3.3.5: /releases/latest with /tags?limit=1 fallback,
  12h success cache / 1h negative cache. UI on Settings page.
- dashicons-pets admin-menu icon — literal paw-print, brand match.

ARCHITECTURE LOCKED FROM COMMIT 1
- Single-word brand name "Buddy" — no WP prefix, no future rebrand.
- Public GPL v2+ Gitea repo (ranger/a-buddy).
- Constants prefix BUDDY_*, function prefix buddy_*, text domain
  buddy. Clean naming throughout — none of Logbook's wp-notes-*
  historical-artifact baggage.
- Single H1 per admin page, no nested toggle boxes, no duplicate
  sections — Tier-1 discipline carried forward from Logbook.
- All assets local (inline SVG, plain CSS), no third-party CDN,
  no Gravatar-style external pings.

NOT IN THIS RELEASE (planned)
- Phase B — Feed/Play/Clean/Sleep interactions + cooldown timers.
- Phase C — WP-cron decay + "Buddy is hungry" dismissible notices
  (port the persistent-dismissal pattern from Logbook).
- Phase D — Multiple species (dog, dragon, sprite), per-species
  personality phrases.
- Phase E — Site-health hook: pet stats react to wp_get_site_health()
  results. The killer feature.
- Phase F — Pro tier (€2.99 lifetime) with custom skins + multi-pet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 10:23:57 +01:00
commit 48e97862a6
12 changed files with 1135 additions and 0 deletions
+153
View File
@@ -0,0 +1,153 @@
/*
* Buddy plugin styles.
* Scoped via .buddy-* class names so we don't bleed into the WP admin.
* No external fonts, no @import, no images — just inline-SVG + plain CSS.
*/
/* ── Sprite (the character) ──────────────────────────────────────── */
.buddy-sprite {
display: block;
user-select: none;
animation: buddyBob 4s ease-in-out infinite;
}
.buddy-sprite--sm { width: 64px; height: 64px; }
.buddy-sprite--md { width: 96px; height: 96px; }
.buddy-sprite--lg { width: 160px; height: 160px; }
/* Eyes blink every ~5s. The fast-step keyframes simulate a quick blink. */
.buddy-sprite__eye {
transform-origin: center;
animation: buddyBlink 5s infinite;
}
.buddy-sprite--sad .buddy-sprite__eye {
animation-duration: 7s; /* sadder Buddy blinks slower */
}
@keyframes buddyBob {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-4px); }
}
@keyframes buddyBlink {
0%, 92%, 100% { transform: scaleY(1); }
94%, 98% { transform: scaleY(0.1); }
}
/* ── Dashboard widget ───────────────────────────────────────────── */
.buddy-widget {
display: flex;
gap: 16px;
align-items: center;
}
.buddy-widget__pet { flex: 0 0 auto; }
.buddy-widget__info { flex: 1 1 auto; min-width: 0; }
.buddy-widget__name {
font-size: 16px;
font-weight: 600;
margin-bottom: 8px;
}
.buddy-widget__mood {
display: inline-block;
margin-left: 6px;
padding: 2px 8px;
font-size: 11px;
font-weight: 500;
border-radius: 9px;
vertical-align: middle;
}
.buddy-widget__mood--happy { background:#e8f5ea; color:#1b6f2d; }
.buddy-widget__mood--neutral { background:#f0f0f1; color:#3c434a; }
.buddy-widget__mood--sad { background:#fcf0f1; color:#8a2424; }
.buddy-widget__cta { margin: 10px 0 0; }
/* ── Stats bars ─────────────────────────────────────────────────── */
.buddy-stats {
margin: 0;
padding: 0;
list-style: none;
}
.buddy-stat {
display: grid;
grid-template-columns: 22px 80px 1fr 36px;
align-items: center;
gap: 8px;
margin: 4px 0;
}
.buddy-stat__icon { text-align: center; font-size: 14px; }
.buddy-stat__label { font-size: 12px; color: #3c434a; }
.buddy-stat__bar {
height: 8px;
background: #f0f0f1;
border-radius: 4px;
overflow: hidden;
position: relative;
}
.buddy-stat__fill {
display: block;
height: 100%;
background: linear-gradient(90deg, #4ade80, #22c55e);
border-radius: 4px;
transition: width 0.4s ease;
}
.buddy-stat__fill--low {
background: linear-gradient(90deg, #f97316, #ef4444);
}
.buddy-stat__num {
text-align: right;
font-size: 12px;
color: #646970;
font-variant-numeric: tabular-nums;
}
/* ── Main admin page layout ─────────────────────────────────────── */
.buddy-main {
display: grid;
grid-template-columns: 280px 1fr;
gap: 22px;
margin-top: 20px;
}
@media (max-width: 782px) {
.buddy-main { grid-template-columns: 1fr; }
}
.buddy-main__card {
background: #fff;
border: 1px solid #ccd0d4;
border-radius: 4px;
padding: 22px;
}
.buddy-main__card--pet {
text-align: center;
}
.buddy-main__name {
font-size: 20px;
font-weight: 600;
margin: 14px 0 4px;
}
.buddy-main__mood {
display: inline-block;
margin-left: 8px;
padding: 2px 9px;
font-size: 12px;
font-weight: 500;
border-radius: 10px;
vertical-align: middle;
}
.buddy-main__mood--happy { background:#e8f5ea; color:#1b6f2d; }
.buddy-main__mood--neutral { background:#f0f0f1; color:#3c434a; }
.buddy-main__mood--sad { background:#fcf0f1; color:#8a2424; }
.buddy-main__age { color: #646970; font-size: 13px; margin: 0; }
.buddy-main__note {
margin-top: 14px;
padding: 10px 12px;
background: #f0f6fc;
border-left: 3px solid #2271b1;
color: #135e96;
font-size: 13px;
border-radius: 0 4px 4px 0;
}