Jump to content
Robert Wildling

Media breakpoint in JS: "Harvey" alternatives?

Recommended Posts

Hi, dear Greensockers!

My question is actually not totally GSAP-related, but since here are the best JS coders, I dare to ask anyway. I hope this is ok with you!

 

I repeatedly come into the situation, where breakpoints require different parameter settings for a tween. My current solution is a settings object with some parameters for each breakpoint and `Harvey`, https://github.com/harvesthq/harvey, a - IMO - wonderful JS lib that takes care about breakpoints, but which unfortunately not supported anymore.

 

That's why I wanted to ask you, how you approach the breakpoint problem, if you write your own script or if you can recommend another library. 

Thank you!

Share this post


Link to post
Share on other sites

I don't know anything about Harvey, but I generally just write my own breakpoint rules.

 

We've had quite a few discussions about responsive animations that may help. Here are a couple:

Happy tweening.

:)

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

How far back do you need to provide support for browsers?

 

Harvey was adopted from Paul’s matchMedia.js, while Harvey was updated 6 years ago, Pauls was updated 2 years ago … so can you just use Pauls? Certain things work regardless of needing updated solely based upon their intensions, is Harvey beginning to fail for you in some way?

 

Here are some GSAP specific examples you may find interesting:

  • https://codepen.io/osublake/pen/vExQEy
  • https://codepen.io/osublake/pen/jLLqbY
  • https://codepen.io/PointC/pen/RGmdVx
  • etc., (some of those examples may be in the links @PointC mentioned above)

 

  • Like 3

Share this post


Link to post
Share on other sites

For some totally unexplainable reason it just did not at all come to my mind that I actually could search for the topic! **headshake**

Ashamed, but still very grateful I'll hunt down the links you share, @PointC! Thanks a lot!

  • Like 2

Share this post


Link to post
Share on other sites
3 minutes ago, ¯\_(ツ)_/¯ said:

How far back do you need to provide support for browsers?

 

Harvey was adopted from Paul’s matchMedia.js, while Harvey was updated 6 years ago, Pauls was updated 2 years ago … so can you just use Pauls? Certain things work regardless of needing updated solely based upon their intensions, is Harvey beginning to fail for you in some way?

 

Here are some GSAP specific examples you may find interesting:

 


No, Harvey is not failing at all! It works perfectly fine and I really do like the api it provides! 
But unfortunately the developer and also the company he works/ed(?) for, do not respond. Honestly, I have no clue, what could be improved with Harvey, so an update might just simply not be necessary. On the other hand, there is so much going on in the JS universe, that I kind of got accustomed that libraries receive changes on a more or less regular basis...
Anyway, I was just curious, which solutions other people use and therefore shouted out the question.
Thanks a lot [no idea how to cite your name!] for the hint about Paul's update and for the examples! 

Share this post


Link to post
Share on other sites

You're welcome.

 

Yikes why are those pens playing when quoted?

 

Many times when things are created they stand without needing updates or improvement going forward for many years until the actual specification catches up without the need for such libraries. Sometimes things are simple regarding intention that they simply just work from the day of their inception. In which case either Harvey or Paul's implementation (or others) may still serve you well if you need them for support and backwards compatibility.

 

Sorry about my persona quotability. I love that ascii shrug it makes me smile whenever I see it. Plus it gives me a clean greensock-ish green avatar by default.  @¯\_(ツ)_/¯

  • Like 3

Share this post


Link to post
Share on other sites
On 4/10/2019 at 12:55 PM, ¯\_(ツ)_/¯ said:

I love that ascii shrug it makes me smile whenever I see it. Plus it gives me a clean greensock-ish green avatar by default.

 

So much for those smiles, I guess not anymore, now its some sort of diaper poo brown color.

 

Avatar-no-longer-green.jpg.c69ba2f2be7ee987758c38599c18cc16.jpg

 

Yikes, what happened someone put me in da sh!tter?

 

¯\_(ツ)_/¯

  • Haha 1

Share this post


Link to post
Share on other sites

Ha. The colors are randomized, sorry. But with the updated forums software, I think they automatically make it look like poo if they use funky characters in their username ;)

  • Haha 1

Share this post


Link to post
Share on other sites

Hi @¯\_(ツ)_/¯,

 

I can understand that.
Missing words, so ...

 

See the Pen VNgKwg by mikeK (@mikeK) on CodePen

 

But happy tweening ...

Mikel

 

 

  • Haha 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.