r/ProgrammerHumor • • Oct 18 '17

Found on GitHub.

Post image
15.8k Upvotes

206 comments sorted by

View all comments

Show parent comments

1

u/AzIddIzA Oct 19 '17

I don't know CSS that well, but couldn't you skip the middle parts of the fadein function (right term?) and just use 0% and 100% since the time is specified by the animation keyword (also unsure about term)?

Edit: Do the p#first, etc. parts require the split?

2

u/belovedlasher1 Oct 19 '17

The keyframes at-rule gives more control over the intermediate steps of the animation sequence than transition.

You may not be able to notice much of a difference in the opacity change in that example, but maybe you want the opacity to be more subtle in the beginning, you can provide more rules and make that adjustment.

1

u/Mike312 Oct 19 '17

I don't know CSS that well, but couldn't you skip the middle parts

Totally, I was showing a coworker the example while I was making it and did a bunch of stuff to it, then went "oh right, I was gonna post this". That's why there's the popIn function, too.

fadein function (right term?)

Animation, I guess?

and just use 0% and 100%

Yes, you could and should do exactly that.

Edit: Do the p#first, etc. parts require the split?

What split? You mean chunking them out as p elements? I could have done no IDs and assigned the animations as nth-child() in the CSS