/    Sign up×
Community /Pin to ProfileBookmark

Can "transform: translateZ(0)" be used to optimize my Christmas snowfall animation?

Greetings fine people,

I’m developing a Christmas theme CSS for my Reddit sub and I want it to be as optimized as possible.

Several forums, [URL=”http://blog.teamtreehouse.com/increase-your-sites-performance-with-hardware-accelerated-css”]including this one,[/URL] recommend using “transform: translateZ(0);” to encourage the use of video card GPU rather than the CPU, but I’m not entirely sure where to implement that change in my code.

Can someone please help me understand if the “transform: translateZ(0) trick” will help my snowfall animation and where that CSS code should go?

Here’s my Christmas snowfall CSS:

[CODE]/* CHRISTMAS snow animation code segment START. */

body:before {
content: ”;
background-image: url([url]https://imgoat.com/uploads/93f65e080a/58819.png[/url]), url([url]https://imgoat.com/uploads/93f65e080a/58820.png[/url]), url([url]https://imgoat.com/uploads/93f65e080a/58821.png);[/url]
height: 100%;
width: 100%;
position: fixed;
z-index: -1;
opacity: 1!important;
animation: snow 12s linear infinite;
-webkit-animation: snow 12s linear infinite;
}

@keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px; }
100% {background-position: 500px 1000px, 400px 400px, -300px 900px; }
}

@-webkit-keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px; }
100% {background-position: 500px 1000px, 400px 400px, -300px 900px; }
}[/CODE]

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @SarahL spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...