This is why you should learn CSS Grid

Heres a simple codepen I’m proud of. Maybe when I have more time I’ll add animations!

2 Likes

Thanks @camperextraordinaire! I could use map or reduce, but I’m thinking that performance would be the same since the higher order functions are also nested. Is there something that I’m missing?

Ahh, that makes a lot of sense. I’ve always felt hesitant to use innerHTML.

Pretty neat.

Is there a reason why you are not using the repeat function for your grid-template-columns?

grid-template-columns: repeat(14,1fr);

Also, I guess it doesn’t hurt to be explicit about it, but you don’t actually need the grid-template-rows property.

1 Like

I’ll checkout createDocumentFragment. But I agree with you. innerHTML is powerful. I think when it really comes down to it, I’d probably benefit by using less divs for each ghost and utilizing more CSS grid capabilities.

Anyways, I have some decisions to make.

I always forget how powerful CSS is. Thanks for this.

Hey! Great job, man! I like it.

1 Like