diff --git a/CHANGELOG.md b/CHANGELOG.md index 09f7b6a..3f54a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,25 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versi --- +## [0.1.3] — 2026-05-27 + +### Fixed — Wink no longer gets stuck + +The v0.1.1 wink was implemented as a static SVG render (left eye drawn as a closed curved line). Once the random 5% chance picked the `wink` tone, the page rendered with one eye closed and stayed that way until the next page reload — and 95% of subsequent reloads went back to a non-wink tone, but if the dashboard sat idle, Buddy was stuck mid-wink indefinitely. David reported it as *"buddy has the wink face but the eye does not unblink."* + +v0.1.2's lower probability (30% → 5%) reduced how often you'd see the stuck state but did not fix the underlying issue. + +v0.1.3 makes the wink a real CSS animation: + +- **sprite.php** no longer renders the left eye as a closed path when tone is `wink` — both eyes are always open circles in the SVG. +- **buddy.css** has a new `@keyframes buddyWink` that briefly closes the left eye (`scaleY(0.1)`) for ~250 ms every 2.5 s. The right eye keeps its normal 5 s blink. That asymmetric pattern is what makes it read as a wink rather than a synchronised blink. +- The wink animation only runs when the parent has the `buddy-sprite--wink` class, which is still controlled by the same 5% probability gate from v0.1.2. +- The mouth (asymmetric smirk), cheek opacity (rosier), and mood label (`Cheeky 😉`) all still differ for the wink tone — those are valid static state changes. Only the eye behaviour moved from static-state to transient-animation. + +Net effect: when the 5% chance fires, Buddy now actually winks (closes left eye, opens it, closes it, opens it, etc., every 2.5 s) instead of freezing one-eye-shut. + +--- + ## [0.1.2] — 2026-05-26 ### Tuned — Wink probability lowered from 30% to 5% diff --git a/assets/css/buddy.css b/assets/css/buddy.css index f930340..763d6e5 100644 --- a/assets/css/buddy.css +++ b/assets/css/buddy.css @@ -24,6 +24,17 @@ animation-duration: 7s; /* sadder Buddy blinks slower */ } +/* Cheeky wink: when the mood-label picks the 'wink' tone, the LEFT eye + runs a faster, more dramatic keyframe that closes for ~250ms every + 2.5s. The right eye keeps its normal 5s blink — that asymmetry is + what makes it read as a wink rather than a synchronised blink. + v0.1.3 fix: previously the wink was a static SVG render (left eye + drawn as a closed curve), which got stuck on the page until the next + render. Now it's a real transient animation, so Buddy unblinks. */ +.buddy-sprite--wink .buddy-sprite__eye--left { + animation: buddyWink 2.5s infinite; +} + @keyframes buddyBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } @@ -32,6 +43,10 @@ 0%, 92%, 100% { transform: scaleY(1); } 94%, 98% { transform: scaleY(0.1); } } +@keyframes buddyWink { + 0%, 80%, 100% { transform: scaleY(1); } /* eye open most of the cycle */ + 85%, 95% { transform: scaleY(0.1); } /* closes briefly = the wink */ +} /* ── Dashboard widget ───────────────────────────────────────────── */ diff --git a/buddy.php b/buddy.php index 3438942..6159ab5 100644 --- a/buddy.php +++ b/buddy.php @@ -5,7 +5,7 @@ * Plugin Name: Buddy * Plugin URI: https://icanhelp.ie/buddy * Description: Adopt a small companion that lives in your WordPress dashboard. Its mood reflects your site's health — published posts feed it, outdated plugins make it sick, clearing spam makes it happy. Gamifies WordPress maintenance with a bit of charm. - * Version: 0.1.2 + * Version: 0.1.3 * Requires at least: 5.0 * Requires PHP: 7.4 * Author: David Keane @@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Plugin coordinates. -if ( ! defined( 'BUDDY_VERSION' ) ) { define( 'BUDDY_VERSION', '0.1.2' ); } +if ( ! defined( 'BUDDY_VERSION' ) ) { define( 'BUDDY_VERSION', '0.1.3' ); } if ( ! defined( 'BUDDY_FILE' ) ) { define( 'BUDDY_FILE', __FILE__ ); } if ( ! defined( 'BUDDY_PATH' ) ) { define( 'BUDDY_PATH', plugin_dir_path( __FILE__ ) ); } if ( ! defined( 'BUDDY_URL' ) ) { define( 'BUDDY_URL', plugin_dir_url( __FILE__ ) ); } diff --git a/inc/sprite.php b/inc/sprite.php index f8acbf4..91a7129 100644 --- a/inc/sprite.php +++ b/inc/sprite.php @@ -8,8 +8,10 @@ * dog / dragon / sprite / etc. * * Mood tone changes the expression: 'happy' = open smile, 'neutral' - * = flat mouth, 'sad' = downturned. Eyes blink via CSS keyframes - * regardless of tone (it's always alive). + * = flat mouth, 'sad' = downturned, 'wink' = asymmetric smirk + rosier + * cheeks + CSS-driven left-eye wink animation. Eyes blink via CSS + * keyframes regardless of tone (it's always alive); the wink keyframe + * lives in buddy.css alongside the regular blink. */ if ( ! defined( 'ABSPATH' ) ) { exit; } @@ -45,18 +47,16 @@ function buddy_render_sprite( $species = 'default', $tone = 'happy', $size = 'md aria-label=""> - + - - - - - - - + + - +