npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

magic.css

v1.4.8

Published

Magic CSS3 animations

Downloads

3,364

Readme

:tophat: magic

CSS3 Animations with special effects. (→ 3.1 kB gzip)

Demo

Checkout the demo for the animations here

Table of Contents

Installation

GitHub Package Registry - Package url

npm install @minimac/magic.css

NPM - Package url

npm i magic.css

YARN - Package url

yarn add magic.css

Getting Started

Include the file magic.css or include the minified version magic.min.css

<link rel="stylesheet" href="yourpath/magic.css">

or

<link rel="stylesheet" href="yourpath/magic.min.css">

Usage with JavaScript

This is a sample code for on hover effect with JavaScript. First, Include the class magictime and then a desired animation class.

const selector = document.querySelector('.yourdiv')
selector.classList.add('magictime', 'puffIn')

If you want to load the animation after certain time, you can use this example:

//set timer to 5 seconds, after that, load the magic animation
function myFunction() {
    const selector = document.querySelector('.yourdiv')
    selector.classList.add('magictime', 'puffIn')
}
setTimeout(myFunction, 5000);

If you want to load the animation after certain time but with an infinite loop, you can use this example:

//set timer to 3 seconds, after that, load the magic animation and repeat forever
function myFunction() {
    const selector = document.querySelector('.yourdiv')
    selector.classList.add('magictime', 'puffIn')
}
setInterval(myFunction, 3000);

Usage with jQuery

This is a sample code for on hover effect with jQuery. First, Include the class magictime and then the desired animation class.

$('.yourdiv').hover(function () {
    $(this).addClass('magictime puffIn');
});

If you want to load the animation after certain time, you can use this example:

//set timer to 5 seconds, after that, load the magic animation
setTimeout(function(){
    $('.yourdiv').addClass('magictime puffIn');
}, 5000);

If you want to load the animation after certain time but with infinite loop, you can use this example:

//set timer to 3 seconds, after that, load the magic animation and repeat forever
setInterval(function(){
    $('.yourdiv').toggleClass('magictime puffIn');
}, 3000 );

HTML & CSS tips

You can change the time of the animation by setting the class magictime for example:

.magictime {
    -webkit-animation-duration: 3s;
    animation-duration: 3s;
}

Default CSS timing is:

.magictime {
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
}

If you want to assign the timing to a specific animation, you can use the following code (use 2 class):

.magictime.magic {
    -webkit-animation-duration: 10s;
    animation-duration: 10s;
}

Animation Classes

| MAGIC EFFECTS | BLING | STATIC EFFECTS | STATIC EFFECTS OUT | PERSPECTIVE | ROTATE | |---------------|-----------|---------------------|--------------------|------------------------|-------------| | magic | puffIn | openDownLeft | openDownLeftOut | perspectiveDown | rotateDown | | twisterInDown | puffOut | openDownRight | openDownRightOut | perspectiveUp | rotateUp | | twisterInUp | vanishIn | openUpLeft | openUpLeftOut | perspectiveLeft | rotateLeft | | swap | vanishOut | openUpRight | openUpRightOut | perspectiveRight | rotateRight | | | | openDownLeftReturn | | perspectiveDownReturn | | | | | openDownRightReturn | | perspectiveUpReturn | | | | | openUpLeftReturn | | perspectiveLeftReturn | | | | | openUpRightReturn | | perspectiveRightReturn | |

| SLIDE | MATH | TIN | BOMB | BOING | ON THE SPACE | |------------------|-----------|-------------|--------------|--------------|---------------| | slideDown | swashOut | tinRightOut | bombRightOut | boingInUp | spaceOutUp | | slideUp | swashIn | tinLeftOut | bombLeftOut | boingOutDown | spaceOutRight | | slideLeft | foolishIn | tinUpOut | | | spaceOutDown | | slideRight | holeOut | tinDownOut | | | spaceOutLeft | | slideDownReturn | | tinRightIn | | | spaceInUp | | slideUpReturn | | tinLeftIn | | | spaceInRight | | slideLeftReturn | | tinUpIn | | | spaceInDown | | slideRightReturn | | tinDownIn | | | spaceInLeft |

:tada: Gulp and SCSS (SASS) compiling

If you want to customize the CSS files, now you will have the chance. For example, if you want to include only certain animations, you will have to go to this file:

assets/scss/magic.scss

Comment or uncomment your desired file and run from terminal the following commands:

npm install

and last command:

gulp

Automatically this generate the new files!

:white_check_mark: Browser Support

Browser | Chrome | Firefox | Safari | iOS Safari | Opera | Android | Android Chrome | IE | Opera Mini --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: Version | 31+ | 31+ | 7+ | 7.1+ | 27+ | 4.1+ | 42+ | 10+ | :x: