danielegarciav / animated-heart-bar

🧡 An animated health bar written in Vue

Home Page:https://animated-heart-bar.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Animated Heart Bar

An animated heart bar based on the one from The Legend of Zelda: Breath of the Wild.

How it works

The HeartBar component takes two props: health and maxHealth.

This component will keep track of the health value, and keep an internal value that smoothly transitions any changes made to the input value (currently thanks to VueUse's useTransition).

The amount of hearts rendered depends on the input max health as well as the healthPerHeart internal value.

Each heart has a foreground and a background, and is assigned a value from 0 to 1. In order to achieve the radial fill effect, the CSS clip-path property is used in combination with a dynamically created SVG circle path.

Install dependencies

npm install
# or
yarn install

Fire up dev server

npm run dev
# or
yarn dev

License

MIT

About

🧡 An animated health bar written in Vue

https://animated-heart-bar.vercel.app

License:MIT License


Languages

Language:Vue 78.7%Language:TypeScript 18.0%Language:HTML 3.3%