Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set 0 Opacity to Out animation classes #1043

Merged
merged 9 commits into from
Apr 21, 2020
Merged

Set 0 Opacity to Out animation classes #1043

merged 9 commits into from
Apr 21, 2020

Conversation

warengonzaga
Copy link
Member

Kindly review @eltonmesquita thank you!

Fixes #914

@daneden
Copy link
Collaborator

daneden commented Apr 21, 2020

We could avoid having to maintain an exact list of selectors for out class names by using an attribute selector: https://codepen.io/daneden/pen/bbf8ad456518477c1c93048f3fada81f

@warengonzaga
Copy link
Member Author

@daneden got it...

@warengonzaga
Copy link
Member Author

@eltonmesquita @daneden it looks like it auto prefix all classes...

@warengonzaga
Copy link
Member Author

How to exclude this [class*='Out'] from auto namespace? cc @eltonmesquita @daneden

@eltonmesquita
Copy link
Collaborator

eltonmesquita commented Apr 21, 2020

True, let me check and get back to you.

@eltonmesquita
Copy link
Collaborator

eltonmesquita commented Apr 21, 2020

Actually, it should be prefixed. That's the desired outcome. Can you update the PR then?
Don't forget to update your branch as it's already outdated.

@daneden
Copy link
Collaborator

daneden commented Apr 21, 2020

This might do the trick:

@media (prefers-reduced-motion) {
  .animate[class*="Out"] {
    opacity: 0;
  }
}

And you should just be able to adjust the settings for postcss-prefixer:

// in postcss.config.js
// ...
'postcss-prefixer': {
  prefix,
  ignore: ['/\[class\*=.*\]/'],
},

@eltonmesquita
Copy link
Collaborator

eltonmesquita commented Apr 21, 2020

I don't think it should be ignored @daneden .

/* this */
.animated[class*="Out"] {
}

/* would be transformed into */
.animate__animated[class*="Out"] {
  background-color: red;
}

The selector would still be valid and would be safer as it would consider the current prefix.

@warengonzaga
Copy link
Member Author

@eltonmesquita my branch is updated I just fork a new copy yesterday...

@eltonmesquita
Copy link
Collaborator

eltonmesquita commented Apr 21, 2020

There were some changes today, so it'll probably conflict of you don't update it.

Copy link
Member Author

@warengonzaga warengonzaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eltonmesquita this one?

@warengonzaga
Copy link
Member Author

@eltonmesquita done!

@eltonmesquita
Copy link
Collaborator

Yeah, @warengonzaga and @daneden was right, it's prefixing more than it should. I'll just merge it and fix on my side, ok?

@eltonmesquita eltonmesquita merged commit 70ecc52 into animate-css:dev Apr 21, 2020
eltonmesquita added a commit that referenced this pull request May 7, 2020
* New animations added

* Update

* Update

* Update

* Update

* kill bower

* Turn off animations for print media query (#856)

* Add a feature to turn off animations for printing as requested.
* Add print media type
* Update the builds

* Moved away from gulp to npx + postcss

This PR changes the build system for a simpler one, using only npx as runner and postcss to process all the files.
* Solves #618
* Solves #836
* Also solves #758 just for fun ;P

* Updated travis and removed animate-config.json

* Removed strayed gulpfile and trimmed the header

* Moved prefix config to package.json and updated the tasks

* Updated travis

* Updated dependencies and postcss config

* Now using CSS custom properties

* Add css module file - solves #933

* Updated README for the new build

* Rebulit files

* Updated dependencies + added browserlist

* Fixed small typo on README

* Added imports to Back animations

* Added FadeInTopLeft.css file

Fade in the animation diagonally

* Added fadeInTopRight.css file

Fade in the animation diagonally

* Added fadeInBottomLeft.css

* Added fadeInBottomRight.css

* Added fadeOutTopLeft.css

* Added fadeOutTopRight.css

* Added fadeOutBottomRight.css

* Added fadeOutBottomLeft.css

* Added imports to diagonal fadings

* Aditional formatting

* Added diagonal fadings to README

* Fixes #966

* Animate.css v4 Updates (#1029)

* Update to v4

* Add Iteration-Count CSS utility classes solves #998

* Updated builds

* Update lightSpeed animations

* Update builds

* Fix Invalid CSS Media Query Syntax

* Update build

* Add gitpod support

* Add newline in gitpod file

* Update README

* Revert

* Declare variable

* Update builds

* Remove Gitpod support

Co-authored-by: Waren Gonzaga <[email protected]>

* Improves building process and package.json tidy up

* Improved animations (#901)

* Improved bounce

* Improved pulse

* Improved bounceInDown

* Improved bounceInLeft

* Improved bounceInRight

* Improved bounceInUp

* Improved bounceOutDown

* Improved bounceOuLeft

* Improved bounceOuRight

* Improved bounceOutRight

* Improved fadeInDown

* Improved fadeInDownBig

* Improved fadeInLeft

* Improved fadeInLeftBig

* Improved fadeInRightBig

* Improved fadeInUp

* Improved fadeInUpBig

* Improved fadeInRight

* Reverted fade animations

* Compiled

* Updated prefers-reduced-motion support on README

* Add .delay-1s (#982)

The .delay-1s is missing from the readme

* HTTPS relevant links on README (#972)

prevents HTTP redirects

* Create CONTRIBUTING.md (#1033)

Co-authored-by: Melek REBAI <[email protected]>
Co-authored-by: Christian Oliff <[email protected]>
Co-authored-by: Daniel Eden <[email protected]>

* Updates dependencies

* Updates prettier config

* refactory transform-origin in styles

* animation shake with X and Y options 🔨

* Adds shakeX and shakeY to the build

* Set 0 Opacity to Out animation classes (#1043)

* Update issue templates

* Add 0 opacity to out classes

* Update builds

* Improved implemenation

* Update builds

* Update current readme

* Update builds

Co-authored-by: Elton Mesquita <[email protected]>
Co-authored-by: Waren Gonzaga <[email protected]>

* Removes prefix from att selector

* Feature/new demo site (#1046)

* Simplify & centralize the Animate.css home page. Finally.

* Design tweak

* Fix Lightspeed demos

* Fix Lightspeed demos (cont.)

* Trigger animation on change as well as click

* Correct jQuery example. Fixes #127

* Remove Readme on gh-pages to prevent mistakes like ee75b81

* Use animate.min.css because whatever

* Update demo page with MS animation JS hooks.

* Updating home page with rubberBand animation.

* Reverse hue animation

Red-orange-brown isn’t a great first impression.

* Add readme, use cssmin minified CSS instead of csso

* Update gh-pages

* Remove protocol from urls

Fixes Chrome’s SSL issue

* Remove Square Cash link

Donations are weird, and only US account holders could use this.

* Updating Gh-page animate.css to the current version

This is a simple commit, bringing animate.css up to date with the current master version.

* Updating Gh-page animate.min.css to reflect the current version

This is a simply update to the Animate.min.css file, to reflect the current version

* Update CSS

* Updating Gh-page index.html to the reflect the addition of zooms (in out down etc)

This adds the optgroup "zoom", and associated options of: ZoomIn, zoomOut, zoomInDown, zoomInUp, zoomInLeft, zoomInRight, zoomOutLeft, zoomOutRight, zoomOutUp, and zoomOutDown.

* refactoring index.html to mimic the current optgroup styling

I added zooms, which were absent, but added them in a way that didn't reflect the current optgroup styling and delineation. I fixed that and now exits and entrances are grouped appropriately.

* updated index.html to reflect the standard optgroup styling on sliders, added slideInDown

In addition to adding slider keyframes that were missing, I placed them into the appropriate optgroups to mimic the similar styling of the other animations.

* Merging updated version of animate.min.css

As requested, this is the updated version of animate.min.css that @daneden request I include in the pull request.

* Updated animate.min.css

Made it the new version

* added jello to options

* Update CSS

* Add jackInTheBox to gh-pages (#694)

* New Special - jackInTheBox

* copy min.css from master branch

* fixed the issue of overflow scroll (#740)

for more see this issue #739

* Adds heartBeat animation demo (#893)

* Update animate.min.css to latest version

* Updated CSS for current browsers

* Updated animate.css

* Removed useless test folder

* Added warn about prefers-reduced-motion

* Adds docs compiler

* Adds new base template

* Improves the docs compiler

* Fixes flipOutY animation

* Updates docs template and build

* Reorder docs sections

* Updates docs animation list template

* Updates prettier ignore

* Adds syntax highlight to docs

* Small fixes to docs content

* Updates templates HTML

* Styles the demo website

* Adds functionality to demo website

* Fixes small website demo issue with medium screens

* Adds copy animation to demo site

* Renames loop classes to repeat

* Small adjusts to docs styles

* Updates docs template

* Updates docs  improving copy and adding sections

* Reviews the docs copy

* Fix some issues with demo-site

* Fixes issue with the demo-site playground

* Adjusts tooltip on demo-site

* Fix layout issues on mobile and update “close” button for animations list

Co-authored-by: Daniel Eden <[email protected]>
Co-authored-by: Matt Willis <[email protected]>
Co-authored-by: Gabrielmtn <[email protected]>
Co-authored-by: Indy Prieto <[email protected]>
Co-authored-by: Robert Pemberton <[email protected]>
Co-authored-by: Khaled nuur <[email protected]>
Co-authored-by: Vladimir Jovanović <[email protected]>

* Updates docs folders

* Fix some small documentation issues

* Updates edit on github link

Co-authored-by: Arda Gedik <[email protected]>
Co-authored-by: Arda Gedik <[email protected]>
Co-authored-by: Jabran Rafique <[email protected]>
Co-authored-by: Waren Gonzaga <[email protected]>
Co-authored-by: Jabran Rafique⚡️ <[email protected]>
Co-authored-by: Vaibhav Tandon <[email protected]>
Co-authored-by: Waren Gonzaga <[email protected]>
Co-authored-by: Melek REBAI <[email protected]>
Co-authored-by: Christian Oliff <[email protected]>
Co-authored-by: Daniel Eden <[email protected]>
Co-authored-by: Lucas Ferreira Lima <[email protected]>
Co-authored-by: Matt Willis <[email protected]>
Co-authored-by: Gabrielmtn <[email protected]>
Co-authored-by: Indy Prieto <[email protected]>
Co-authored-by: Robert Pemberton <[email protected]>
Co-authored-by: Khaled nuur <[email protected]>
Co-authored-by: Vladimir Jovanović <[email protected]>
@david-hollifield
Copy link

This PR is breaking some of my pages. I'm using angularjs animations with animate.css and this styling is hiding a bunch of my elements.

I have a button defined as:

<button class="btn btn-primary btn-upload animate__animated animate__fadeInDown enter-fadeInDown exit-fadeOutUp">
  Upload
</button>

In the preferred-reduced-motion scenarios my button has an opacity:0

image (1)

Is the class selector too broad and catching my exit-fadeOutUp?

@warengonzaga
Copy link
Member Author

Hi @david-hollifield sorry for that and yes! it catches your exit-fadeOutUp... it suppose to be for animation we have not for external class... I'll take a look into it and propose a fix thanks for reporting this!

@warengonzaga
Copy link
Member Author

Hi @david-hollifield I made a quick changes in my dev version... please check this out https://github.com/WarenGonzaga/animate.css/tree/dev I add a class called xprm so you can use it as animate__xprm which means "exclude prefer-reduced-motion" so it will basically counter the opacity from the PRM class we setup on this merge. Try to use the animate.css version in my repo and let me know if it fix your end.

What do you think @eltonmesquita about my approach... I guess the user should consider that any "Out" class will be affected by this or countering it with "!important" is a good approach? Let me know! tagging @daneden

@david-hollifield
Copy link

@warengonzaga thanks! I'll take a look.

@david-hollifield
Copy link

@warengonzaga with your tweak as an example, I was able to work around this with:

body {
  @media screen and (prefers-reduced-motion: reduce), (update-frequency: slow) {
    * {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }

    *[class^="exit-"], *[class*=" exit-"] {
      opacity: 1 !important;
    }
  }
}

Thanks for your help. I'm not sure I understand the need for the initial broad selector, but I'm an idiot ;).

.animate__animated[class*='Out'] {
      opacity: 1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants