Skip to content

v0.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Oct 16:01

Added

  • Themes. defineTheme in @walangstudio/badgetrip-assets puts colors, icons and celebrations in one validated object, with extends to start from another theme. Five built-ins ship in themes: classic (the look without a theme), dark, arcade, minimal and aurora. Theme values can't escape their CSS declaration, and every url() is vetted like an image.
    • React: theme on BadgetripProvider and useTheme(). Badges, <UnlockNotifier> and useUnlocks follow it, and a new theme prop switches it live.
    • Vue: theme on createBadgetrip and provideBadgetrip; useTheme() returns a ref, and assigning it switches the theme.
    • Angular: theme on provideBadgetrip, BadgetripService.theme and setTheme(), and the BADGETRIP_THEME token. Colors apply in the browser only.
    • HTML: applyTheme(theme, target?), a theme option on createNotifier, renderBadge, renderCatalog and defineBadgetripElements, which now returns { setTheme }.
    • React Native: useTheme(); a theme brings its icons and celebrations.
    • A provider nested in another uses the outer theme unless it has its own, and page colors come from the outermost provider. A notifier with its own theme ignores the page's colors.
  • themeCss(theme) writes a theme's colors as one CSS rule for server-rendered pages.
  • Popup animations. animation on any celebration layer sets how a popup enters and leaves: fade, slide (from its own edge), slide-up/-down/-left/-right, scale, pop, bounce or none, with duration, easing (named or cubic-bezier) and slide distance. It merges field by field across layers. The defaults keep the old motion; arcade, minimal and aurora get their own. Exits play before the popup is removed, and nothing moves under reduced motion.
  • Gradients. Theme backgrounds (bg, fullscreenBg, backdrop, iconBg) and icons (icons.color, icons.tierColors) take a gradient as plain data: 2-8 colors with optional stops, linear with an angle or to direction, or radial with a shape and position. A gradient icon is one sweep across the whole drawing. gradient(spec) returns the CSS. A fifth built-in theme, aurora, is the sample.
  • notifier.update() also takes theme, icons and celebrations. Popups on screen change colors at once and waiting ones pick up the new icons; layout, position and sound stay as queued. Progress popups start or stop to match.
  • The docs site and playground at walangstudio.github.io/badgetrip, deployed from main. The playground splits the config into tabs (Achievements, Theme, Animations, Sounds, Popups), each with samples and a short reference. Tabs take the same JavaScript objects as the docs, rules.count(...) included, and Apply points at the tab, line and column of every mistake.
  • A "Saving data" guide: picking a store, the rules a store must follow, and checking it with runStoreContract.
  • A themes guide, and docs for replacing a built-in sound and giving popups your own icons.
  • Sample GIF badges, drawn for badgetrip (MIT), each with a still frame: a GIF for every built-in icon, used by the playground's animated sample theme, plus three standalone badges (a star, a trophy and a flame). Sample sounds too: coin.wav, powerup.wav, levelup.mp3 and a short tune, victory.mp3.

Changed

  • defineAchievements rejects unknown fields on an achievement or a tier, and createEngine rejects unknown keys in definitions, so a typo like icno fails at startup instead of being ignored. A config that carried extra fields, such as a stray code, now throws: remove them.
  • Locked badges and progress bars read --badgetrip-locked-filter, --badgetrip-locked-opacity and --badgetrip-accent, falling back to the old values, so nothing looks different without a theme.