Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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.html

    And 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

    #303989

    Hello… ?
    Anybody in ? :)

    #304110

    Hey 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.

    #304396

    Hi!


    @mayorninja
    thanks for your help! :)

    Cheers!
    Yigit

    #304515

    Thank 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 !
    Marie

    #304769

    Hi 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 !
    Marie

    #304845

    Hey!

    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,
    Yigit

    #304864

    Thanks Yigit, so that’s direct in theme options through the admin ?
    Best regards,
    Marie

    #304867

    Hi!

    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,
    Yigit

    #304896

    Ok got it. Thank you !!!

    #304898

    Hi!

    You are welcome, glad @mayorninja helped! :)
    Have a great weekend!

    Regards,
    Yigit

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Animated changing color background’ is closed to new replies.