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

Add ability to change speed of animations/transitions. #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

patricknelson
Copy link

@patricknelson patricknelson commented Feb 9, 2019

Thanks for this amazingly useful and flexible library! With the wide selection, I felt just one minor thing was missing: ability to adjust animation speed.

This PR enables a little extra creative freedom with the ability to simply adjust the built-in animation speeds by a scale factor (with the default being 1x). All this does is multiply all of the existing values by a value that you can provide. That way, you aren't digging too deep in the weeds to manually edit every single value in an attempt to scale it evenly so that everything stays coordinated.

Example 1x scale (default):

$hamburger-scale-speed: 1;

scale speed 1x

Example 10x scale:

$hamburger-scale-speed: 10;

scale speed 10x

@mtx-z
Copy link

mtx-z commented Dec 17, 2019

+1 would be a nice setting to have.

@prayaas-a
Copy link

@patricknelson could you post a compiled CSS dist for this change?

@patricknelson
Copy link
Author

patricknelson commented Mar 16, 2020

@prayaas-a unfortunately that's a design decision that's entirely up to you. What you'll have to do instead is maybe clone my fork of the repository until @jonsuh decides to merge this change, checkout the branch for this pull request and then tweak the variables yourself and compile it until you get something you like.

Here's at least a quick way to do this yourself. Note you'll need a SCSS/SASS compiler (I strongly prefer libsass based implementations like node-sass since it's really fast, but see here for more easy instructions on how to install: https://sass-lang.com/install).

git clone [email protected]:patricknelson/hamburgers.git
git checkout feature-scale-speed
cd hamburgers

Edit _sass/hamburgers/hamburgers.scss so it contains the speed you want, in this case you're just speeding up or slowing down, e.g.

// Half speed
$hamburger-scale-speed: 0.5;

Then compile it.

sass _sass/hamburgers/hamburgers.scss > your-output-file.css

Good luck! 😉

@prayaas-a
Copy link

Thanks for the detailed instructions @patricknelson! I didn't realize the property was SCSS level. :) Will do this.

@cfxd
Copy link

cfxd commented Nov 24, 2020

Howdy! I love this library and would love to see this feature merged when you have a chance please 🙏🏻

@patricknelson
Copy link
Author

Yeah, this has languished for so long (almost 2 years now). It affects a lot of files. So, even though it’s not tremendously complex, it’s prone to going stale as other changes get merged.

@jonsuh would you be willing to give this a quick once-over? It looks like other folks are interested in this too. 😊

@MickL
Copy link

MickL commented Aug 23, 2021

Should we fork this project? 2,5 years passed without any response from @jonsuh ...

@patricknelson
Copy link
Author

Yeah I'm considering merging this into my master branch in my fork and just linking people there. However, if you want it right now it should be immediately available at the feature-scale-speed branch here: https://github.com/patricknelson/hamburgers/tree/feature-scale-speed

So, for the lazy, go to #73 (comment) for full instructions (including how to edit the SCSS). I just updated it since I forgot to include checking out the branch name @MickL 😬

@patricknelson
Copy link
Author

Just FYI @jonsuh I've updated this branch to resolve merge conflicts from the math.div() updates 😄 Would you be willing to take a second look at this please? 🙏 Thank you!

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.

None yet

5 participants