0.1.51 • Published 5 months ago

@omicrxn/mercury v0.1.51

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Mercury

Mercury is a Svelte animation library offering a declarative syntax for popular JavaScript animation tools like AnimeJS, Motion, and (soon) GSAP. Unlike other libraries, Mercury avoids custom components, using Svelte actions for native element animations. It’s engine-agnostic, allowing developers to choose their preferred animation library without compromising functionality. Mercury allows for seamless integration with existing Svelte features like transitions, actions, and motion, while eliminating the need for wrapper components. It also introduces layout animations and exit animations inspired by Framer Motion, all while keeping a clean and svelte-friendly syntax.

Documentation

See in-depth documentation and examples at this site

Working Demo / Examples

Check some examples of how to use Mercury

Features

  • Choose your sauce: You can opt in to your preferred animation library such as Motion, AnimeJS or GSAP. Feel free to submit new cores for Mercury through issues.
  • Supports layout animations
  • Allows exit animations
  • Simple, expressive Svelte syntax using use:mercury
  • No wrapper components, all animations applied directly to DOM elements
  • Works with all Svelte features for the DOM like transitions, actions, and motion, which also allows for direct binding to the element
  • Event animations like whileHover, whileClick, etc.

Installation

npm install @omicrxn/mercury
pnpm install @omicrxn/mercury
yarn install @omicrxn/mercury

Usage

<script lang="ts">
		import { mercury } from '@omicrxn/mercury';
</script>

<div class="h-16 w-16 rounded-md bg-blue-300"
use:mercury={{
	initial: { scale: 0.5 },
	animate: { scale: 1.5 },
	transition: { ease: 'circInOut', duration: 1 }
}}
></div>

Acknowledgments

Mercury is built on the shoulders of giants. Special thanks to the creators and maintainers of Svelte, Anime.js, Motion and GSAP and special thanks to @Char2sGu for helping me integrate layout projections into the library.

License

MIT License

0.1.51

5 months ago

0.1.50

5 months ago

0.1.49

5 months ago

0.1.48

5 months ago

0.1.47

5 months ago

0.1.46

5 months ago

0.1.45

5 months ago

0.1.44

5 months ago

0.1.43

5 months ago

0.1.42

5 months ago

0.1.41

5 months ago

0.1.40

5 months ago

0.1.39

5 months ago

0.1.38

5 months ago

0.1.37

5 months ago

0.1.36

5 months ago

0.1.35

5 months ago

0.1.34

5 months ago

0.1.33

11 months ago

0.1.32

11 months ago

0.1.31

11 months ago