Repository navigation
Releases
Releases · mtblck/tipjar
v2.2.0
v2.1.0
linksturns the button into a menu of ways to support: it opens a list above a bottom-corner button or below a top-corner one, using the browser's popover, so it needs no script. Each link takes an icon, a description and acount.hrefis no longer needed when there arelinks, andmount()then returns the<button>.- A
countoption shows a number after the label, in a small pill: numbers are shortened the way GitHub does (1,204,12.3k,1.2M), and a string is shown as is.--tipjar-count-bgand--tipjar-count-labelcolour it. githubStars('owner/name')asks GitHub how many stars a repo has, for a "Star on GitHub" button. It caches the count insessionStoragefor an hour, takes atokenfor build servers, and resolves toundefinedinstead of throwing when GitHub can't answer.
v2.0.0
- Breaking, look change: four icons are redrawn, each with a new animation.
coinis a coin that spins on its edge, slows, and catches a shine; a pixel coin turns through frames.teahas the bag's string over the rim and its tag hanging outside the cup, swaying.pizzais a whole pie with one slice sliding out.musicis two beamed notes that bop to a beat. - Breaking, look change: the coffee's steam is drawn as curly wisps (flat and outline; pixel is unchanged). It no longer rises past the button's edge: it sways, drifts a little and fades in and out over the cup.
- Look change: the big sparkle now glimmers too, on a slower beat than the two small ones. Its drawing is unchanged.
v1.2.0
- A
compact: 'hover'button no longer lifts as it opens; it only grows sideways. It doesn't pop or wiggle either: opening is its hover effect. Shine and fill still play. hover: 'wiggle'now tilts the whole button, like the nudge, instead of the icon.hoveris for the button andanimatefor the icon's own moving part.
v1.1.0
compact: 'hover'shows just the icon in a circle, and opens into the full button with the label sliding in on hover or keyboard focus. On touch screens it stays a circle.- The
hoveroption picks a hover effect:lift(the default, as before),pop,wiggle,shine,fillornone.--tipjar-shineand--tipjar-fillset their colours. - The
enteroption adds an entrance when the page loads:fade,slideorpop, after--tipjar-enter-delay(0.6s by default). - Look change: the button squishes slightly while pressed, on every device.
- A new
jaricon, drawn flat, pixel and outline, with a coin that drops in. - Icons can have moving parts, played by the new
animateoption: onhover(the default, and on keyboard focus),loop(three times on load, and on hover) ornone. Coffee's steam rises past the edge of the button, and jar's coin drops in.--tipjar-accentcolours the moving parts. - Four new icons, drawn flat, pixel and outline:
coin(flips),tea(the tag swings),pizza(the slice pulls away) andmusic(a note floats up). - Look change: every 1.0 icon now moves on hover: the heart beats, the coffee steams, the star turns (a pixel star pulses), the gift's lid hops and the small sparkles twinkle. Their still drawings are unchanged; pass
animate: 'none'to keep them still. mount()takesnudgeAfter: seconds before one small wiggle, at most once per visit, never while tucked, hidden, already hovered or focused, or for people who ask for less motion.nudge(button, seconds)does the same for a button already on the page.- Reduced motion now also turns off every new effect, and wins over a site's own transitions on the button.
v1.0.0
- Breaking:
escapeHtmlandsafeHrefare no longer exported.tipjar()still checks every link and escapes every text option inside; they were never meant as general-purpose helpers. - The README has a Stability section saying what semver covers from 1.0.
- The package now includes CHANGELOG.md.
- Look change: on a dark page (
prefers-color-scheme: dark) the default button is now light (#f4f1eafill,#1f1d2blabel) with a dark ring, instead of a dark button with a white halo. Only tipjar's fallbacks change: a--tipjar-bg,--tipjar-labelor--tipjar-ringyou set still wins. - In forced-colours mode (Windows High Contrast) the button gets a
LinkTextborder, so it still reads as a button. - The hover lift only applies on devices that can hover, so it no longer sticks after a tap on a phone.
- Security:
hrefwith control characters before the scheme, such as"\u0001javascript:…", was let through as a relative link, but browsers drop those characters and run it asjavascript:. It now throws like any other unsafe link. - With
newTab, screen readers now hear "(opens in a new tab)" after the label. Change the words with the newnewTabHintoption, or pass''for none. The link still has nonoreferrer; the README explains why and how to hide the referrer site-wide. tuck(button, watch)tucks a button that's already on the page, such as server-renderedtipjar()markup, and returns a function that stops.mount()uses it.hideWhenVisible(andtuck) take several elements: a selector watches every match, or pass a list. The button tucks while any of them is on screen.- A
hideWhenVisibleselector that matches nothing now warns in the console instead of silently doing nothing. - Breaking: tipjar now supports Node 22 and newer (
engines.nodeis>=22), since Node 20 reached end of life. CI tests Node 22, 24 and 26.
v0.1.0 First Release
First version
- tipjar(), mount(), icon(), style.css, and five icons (heart, coffee, star, gift, sparkle) drawn flat, pixel and outline.