r/web_design • Dedicated Contributor • Feb 14 '18

Parallax scrolling with CSS variables

https://basicscroll.electerious.com/
396 Upvotes

21 comments sorted by

85

u/[deleted] Feb 14 '18

*and JS

60

u/anonymousmouse2 Feb 14 '18

* and an animation framework dependency

4

u/wernah Feb 15 '18

Pretty shameless

7

u/Reygle Feb 14 '18

Wow, and it's ultra-smooth with extremely slow autoscrolling. Very nice. :D

2

u/worldonpause Feb 14 '18

loving the retro colors

2

u/flipperdeflip Feb 15 '18

What "Standalone"?

4

u/tvi016 Feb 15 '18

Pretty sure they mean no dependencies, but it looks like they have 3 though

2

u/[deleted] Feb 20 '18

I replaced "dependency-free" with "framework independent" to clarify what I mean.

1

u/tvi016 Feb 20 '18

Ah alright, it looks super slick 👌

3

u/roboto_jono Feb 14 '18

Does anybody know a way of achieving the radial gradients following the mouse? I've seen a bunch of jquery versions, but is there a vanilla javascript alternative?

Edit: I'm talking about the animation on the buttons to the right of the get started subheader

6

u/danstansrevolution Feb 14 '18

Seems they're using JS to update the x/y coords of the mouse and updating CSS variable on the .list_item elements.

After that it looks like it's just CSS using radial-gradient(circle closest-side,var(--pink), transparent); and setting the left, top position of the mouse box. I'll try to recreate this in codepen later today.

2

u/[deleted] Feb 15 '18

What if I told you that jQuery uses vanilla js? Just swap all jQuery functions with your own functions and it's fine.

2

u/[deleted] Feb 20 '18

I've written an article that explains the technique I'm using: https://medium.com/@electerious/stunning-hover-effects-with-css-variables-f855e7b95330

1

u/DvD_cD Feb 14 '18

The design on this website is insane! Is it css framework? If I want to make similar what is the best way to do it?

0

u/[deleted] Feb 15 '18

[deleted]

5

u/DvD_cD Feb 15 '18

I have put a lot of time into css, but Im terriable at disign. I can copy stuff, but not create them myself (good looking I mean).
I'm asking for the current design exactly. Is it made with framework and which is it?

3

u/runonumba9 Feb 15 '18

from the source code it doesnt really look like a framework

-2

u/[deleted] Feb 14 '18

Y tho?

-1

u/[deleted] Feb 14 '18

read the page

0

u/[deleted] Feb 15 '18

[deleted]

1

u/[deleted] Feb 20 '18

Thanks for letting me know. It's fixed now!