Giter Club home page Giter Club logo

animate-sass's Introduction

animate-sass

Sassy just-add-water CSS animation

animate-sass is a Sass version of Dan Eden's Animate.css.

Installation

Add animate-sass to your project using one of the methods below.

NPM: https://www.npmjs.com/

$ npm install animate-sass --save-dev

Yarn: https://yarnpkg.com/en/

$ yarn add animate-sass --dev

Bower: http://bower.io

$ bower install animate-sass

Features

animate-sass has a couple of features to make the most of what Sass has to offer for more efficient development.

Animations

All individual animation modules are kept in their own Sass partials so they can be found easily. You shouldn't need to edit these as they are part of the animate.css library.

Modules are arranged by the following animation types;

Animation Types
attention-seekers
bounce-enter
bounce-exit
fade-enter
fade-exit
flippers
lightspeed
rotate-enter
rotate-exit
special
Helpers

Base Styles The helpers/_base.scss file contains the main .animate css rules for animate-sass to work.

Mixins There are a couple of Sass mixins defined in helpers/_mixins.scss that some of the modules use to generate the necessary compiled css.

Settings The helpers/_settings.scss file defines a range of default Sass variables which are used by some of the animation modules. You can override the defaults in your own settings or style sass file(s).

Animation Module loading

The settings file also sets all animation modules to false (nothing gets loaded). To include an animation module in your project, simply override the $use-[moduleName] variable in your own settings file to true.

By only choosing the animation modules you need, you're keeping the compiled css at it's leanest!

Eg:

// These animation modules will be included in output css
$use-fadeIn: true;
$use-fadeOut: true;

Usage

To use animate.scss in your project, you will need to have Sass installed. Visit the Sass site to find out how to do this.

Once Sass has been installed, you can download or clone this repo into your project and import animate.scss into your main Sass stylesheet.

Eg: inside css/style.scss

@import "[path-to-node_modules-or-bower_components]/animate-sass/animate";

Choose which modules you want to use in you project by overriding the variables set in the helpers/_settings.scss file in your own settings or variables file.

Eg: inside _vars.scss

...
// These override the default vars inside animate-sass/helpers/_settings.scss
$use-fadeIn: true;
$use-fadeOut: true;
...

Eg: inside css/style.scss

@import "vars"; // project's Sass vars file
@import "[path-to-node_modules-or-bower_components]/animate-sass/animate";

Finally in your markup, simply add the class animated to an element, along with any of the animation class names.

You may also want to include the class infinite for an infinite loop.

    <div class="animated fadeIn">
    	<p>Watch me fade in!</p>
    </div>

That's it! You've got a CSS animated element. Super!

License

Animate.scss is licensed under the MIT license. http://opensource.org/licenses/MIT

Contributing

Pull requests are where it's at!

Apologies in advance for the slow action on pull requests and issues. When submitting your pull request please make sure you match the naming convention (camelCase, categorised [fades, bounces, etc]).

Learn more

You can check out Dan Eden's original animate.css here. See working examples as well as how to use with javascript or creating custom css classes

Change log

See Changelog

animate-sass's People

Contributors

benhodgson87 avatar blowsie avatar dennis-f avatar lencioni avatar lougreenwood avatar mcnasby avatar oller avatar tgdev avatar zack9433 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animate-sass's Issues

Breaks Bourbon

Bourbon, the simple and lightweight mixin library for Sass also implements a prefixer() mixin. When importing this library after Bourbon, many things break. As a quick fix I can just import this library before Bourbon, but in the long run it would be best to avoid this naming collision.

Problem in IE and Firefox

Hi,
There is a problem in your animation prefixer which causes most animations not to play in FF and IE.
It' adds quotes to the animation-name property like this: animation-name: 'zoomIn';
It works fine in webkit but in other browsers it causes a parse error. Here is the fix:
@mixin animate-prefixer($property, $value...) {
-webkit-#{$property}:unquote($value);
-moz-#{$property}:unquote($value);
-o-#{$property}:unquote($value);
#{$property}:unquote($value);
}
please update the master code.

missing package.json

Due to the missing package.json no one is able to install this git repo directly via npm.

Use @extend instead of variable configuration

Instead of writing lots of configuration variables (that might be added and forgot to be removed as the project goes), why not define all animation classes using % selectors and @extend ?

Before:

$use-fadeIn: true;
@import 'animate-sass/animate';

.some-class {
...
}

After:

@import 'animate-sass/animate';

.some-class {
@extend %animate-fadeIn; // prefix with "animate" to prevent collision
...
}

This way only animations actually used will be outputted by sass compiler.

Cannot make it working

First of all, thank you for porting it into usable .SCSS files!

Could you provide an example based on your files, I cannot make it working.

UPDATE: It works, missed one part from your tutorial.

Problems "reusing and rewriting" some animate.scss classes

Hello everyone,

I working on a project that has a version of animate-sass in a physical form but I try to pass that inside my node_modules with yarn them execute one task for generating all my styles but I see a problem because my re-write classes don't recognize the include sentence. How can I fix that problem?

//This is my variable content inside my _variable.scss

$use-fadeInLeft: true !default;
$use-fadeInUp: true !default;
$use-fadeInDown: true !default;
$use-fadeOutRight: true !default;
$use-flash: true !default;

//This is a part of the content inside my mobile.scss

@import "../../global/_variables";
@import '../../../../node_modules/animate-sass/_animate';
@import "../../global/_animations";

And the error is this:
animate-sas-error

My little code that shows that problem is this one:

.fadeInLeftEffect {
	@include fadeInLeft(
	$duration: 2s,
	$count: 1,
	$delay: .5s,
	$function: ease,
	$fill: both
	);
}

Anyone that could help me to fix this problem, please.

New release?

Any chance of a version bump release to include recent changes? cheers

$use-bounce issue

Hello,

You are using $use-bounce variable for multiple purpose :

  • Activate all bounces effects
  • Attention seekers bounce effect

It seems that cause some trouble when want to use only the attention seekers.

Mabye it should be good to separate the variables
with $use-bounce and $use-bounces

Thanks in advance

Readme is inaccurate; instructions are confusing

Your readme file says "There is a small section at the bottom of the _animate.scss file" etc., and lists out some code.

First, this isn't true: there is no such code at the bottom of _animate.scss.

Second, this is baffling. I'm new to Sass, but I can't understand why there would be any reason to put this code into my main sass file. At most, I might put it in a separate sass file and import it into the main sass file. But why can't you just put this code in a module that's part of animate-sass?

Deprecation warnings with sass 3.4.11

I've started receiving many deprecation warnings similar to the following:

DEPRECATION WARNING: Passing (1s,), a non-string value, to unquote() will be an error in future versions of Sass.
DEPRECATION WARNING: Passing (fadeOutLeft,), a non-string value, to unquote() will be an error in future versions of Sass.

.animate mixin?

Hi,

I'm trying to use the library to assign animation to certain classes by default, for example, I want a specific animation to be applied to all modals.

However, I'm trying to avoid the needs to add 'animate pulse' to the markup anywhere a modal is displayed. One solution to this is to @extend .animate class in my modal class, however, we all know that @extend has issues and @mixin is preferred.

Is there any existing mixing to include the .animate rules in arbitrary sass classes, if not, would you accept a PR where _base defines an animate main and .animate class in base uses this mixing?

Thanks!

All settings should use `!default`

When using this library in conjunction with a package manager, such as Bower, I want to be able to provide configuration without modifying the code. This makes upgrading more straightforward.

Thankfully, Sass gives us a way to specify that variables have a default value: !default. This will allow consumers to set these values before importing, and then after importing their values will not be overridden.

Zoom effects do not work

Generated animation-name has a zoom-effect name in quotes, and it is not work.

Sample of CSS code after I turned on ZoomIn:

.zoomIn {
  -webkit-animation-name: "zoomIn";
  -o-animation-name: "zoomIn";
  animation-name: "zoomIn"; }

and it should be without quotes:

.zoomIn {
  -webkit-animation-name: zoomIn;
  -o-animation-name: zoomIn;
  animation-name: zoomIn; }

I see that the bug is in @include animate-prefixer(animation-name, $animate-name);. You have to change it on @include animate-prefixer(animation-name, #{$animate-name});.


I am using Firefox 39 / Windows 7.

npm it?

Hello @tgdev
Please, can you take it to npm? I would like to use it with node_modules

gulp

Hello im trying to use animate-sass in my project using gulp but the _animate.scss dont compile with my entire scripts in my css task. Any trick i have to do? Thank you

Please Tag Latest

Hi, thanks for your great repo. I've installed the package with Bower, but ran into an issue that it wasn't pulling the latest commit code.

I specifically wanted the updated _settings.scss file with the !default added in. Is that latest commit ready for production, and if so, could you tag it? \

Right now I did a workaround by installing that specific commit's hash.

Thanks!

Version on Bower

Hey Tom,

The version of this package on bower is quite a few behind this master branch, when you get some time would you be able to update this?

SASS build warning using / for division outside of calc

Building the source from the npm pacakge with sass gives a depreciation warning:

Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(-$base-degrees, 2) or calc(-$base-degrees / 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
6 │         80% { -webkit-transform: translateX(0%) skewX(-$base-degrees / 2); opacity: 1; }
  │                                                       ^^^^^^^^^^^^^^^^^^
  ╵
    node_modules/animate-sass/animations/lightspeed/_lightSpeedIn.scss 6:49  @import
    node_modules/animate-sass/_animate.scss 58:9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.