-
AuthorPosts
-
August 12, 2014 at 11:07 am #303090
Hi,
Already used Enfold for a site and thinking of using it again for another project.
But for this other project I have a special question regarding colors ->Would it be possible – easily… – to choose a specific “animated changing background color” ? For a color section for example (or anywhere else where you can set a color background) ? see examples >
http://demo.vivathemes.com/themes/advent/
http://files.allbloggertricks.com/colour-changing.htmlAnd also, eventually, this other option -> with “gradient changing color” >
http://www.jqueryscript.net/demo/Create-An-Animated-Radial-Gradient-Background-With-jQuery-CSS3/Thank you very much in advance.
Cheers,Marie
August 13, 2014 at 6:55 pm #303989Hello… ?
Anybody in ? :)August 14, 2014 at 2:00 am #304110Hey Marie,
I’m not support, but I was browsing around and what you’re asking is fairly simple, but you will need some rudimentary CSS3 knowledge. The source for the All Blogger Tricks example gives you everything you need.
First thing you need to do is add a custom ID to your color section, for example, calling it “colorchange”. Don’t set a custom background color in order to keep any specificity conflicts out of play.
Next, you need some custom CSS:
#colorchange { -webkit-animation: colorBackground 20s infinite; animation: colorBackground 20s infinite; } @-webkit-keyframes colorBackground { 0% { background-color: #fbcf61; } 20% { background-color: #6bd57e; } 40% { background-color: #ff6f6f; } 60% { background-color: #57cff4; } 80% { background-color: #0ed4c8; } 100% { background-color: #fbcf61; } } @keyframes colorBackground { 0% { background-color: #fbcf61; } 20% { background-color: #6bd57e; } 40% { background-color: #ff6f6f; } 60% { background-color: #57cff4; } 80% { background-color: #0ed4c8; } 100% { background-color: #fbcf61; } }
And that’s it. I think that should be all you need in terms of browser prefixes, too. I’m not sure what your level of knowledge is, but anything with “-webkit” in front of it should be the same as the unprefixed version. You can add keyframes by adding more in-between percentages (e.g. 0%, 10%, 20%, 30%, and so on), but this gives you five colors (first and last keyframes should be the same). You can change them by changing the background-color hex values. Keep in mind this won’t work in IE8 or IE9.
Gradients are currently not animatable with CSS, so you would need a JavaScript solution like the one you linked. In that one, it looks like you have to set the desired colors as RGB values in an array and target a specific div in jQuery, so you need to know how to do that and enqueue the JavaScript for it in WordPress. I don’t have time for that tutorial, but a freelancer could probably set you up in like 10-20 minutes to be honest.
August 14, 2014 at 2:11 pm #304396August 14, 2014 at 5:59 pm #304515Thank you so much for your help Mayorninja !
I am afraid I won’t be skilled enough to do that by my self but still it’s good to know it’s “feasible” without “breaking” anything.
Thank you again, really.
Cheers !
MarieAugust 15, 2014 at 9:41 am #304769Hi again, I am not a developer at all, just a graphic designer, so my knowledge is quite bad, but reading mayorninja’s explanation again, I think I finally might be able to do this (or try, at least ;) – but I need to know where (in which file) I should add the “colorchange” ID… before adding custom CSS.
Thank you again to both of you !
MarieAugust 15, 2014 at 11:51 am #304845Hey!
You should add it on your Color Section – http://kriesi.at/documentation/enfold/wp-content/uploads/sites/2/2013/12/color-section-ID.png
Best regards,
YigitAugust 15, 2014 at 12:45 pm #304864Thanks Yigit, so that’s direct in theme options through the admin ?
Best regards,
MarieAugust 15, 2014 at 12:51 pm #304867Hi!
You should add Color Section element to your page under Layout Elements in Advanced Layout Builder and click on it to edit and that is where you should find and enter unique ID
Regards,
YigitAugust 15, 2014 at 1:28 pm #304896Ok got it. Thank you !!!
August 15, 2014 at 1:37 pm #304898 -
AuthorPosts
- The topic ‘Animated changing color background’ is closed to new replies.