Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   A Christmas Present from Juggledad - A liturgical 'background' color script (http://forum.bytesforall.com/showthread.php?t=16192)

juggledad Dec 7, 2011 07:12 PM

A Christmas Present from Juggledad - A liturgical 'background' color script
 
Updated for 2013

Here is a little present for anyone working on a christian church web site (if you're of another religion and your faith uses different colors to represent different times of the year - you could could yuse this too.)

this jscript gets todays date then checks thru a bunch of dates to set the color based on the time of year. It then changes the pages background color to match. Check the dates to make sure they match your liturgical calendar.

HOW TO USE IT
1) go to ato->Body, Text & Links and remove the 'background' and/or 'background-color' statement that might be there
2) add the following to ato->Add HTML/CSS Inserts->HTML Inserts: Body Bottom
HTML Code:

<script type="text/javascript">
        /* Set the colors */
        lc_black  = '#000000';  /* black */       
        lc_blue  = '#336699';  /* lightblue */       
        lc_gold  = 'gold';    /* gold */
        lc_green  = 'green';    /* green */
        lc_orange = '#FBA02A';  /* orange */
        lc_violet = '#7134C3';  /* purple */
        lc_red = '#aa1c10';          /* red */
        lc_white  = '#FFFFFF';  /* white */       

        /* get todays date and put in yyyymmdd format */
        d = new Date();
        lc_dd = d.getDate();
        lc_mm = d.getMonth()+1;
        lc_yyyy = d.getFullYear();
        lc_today = (lc_yyyy*10000) + (lc_mm*100) + lc_dd;

        /* set the color for the general days */
        if (lc_today >= 2012 12 24) { lc_color = lc_white; }  /* 12/24/12 - 01/19 - White (Christmas Eve, Christmas, 1st Sunday after Christmas, 1st Sunday after Epiphany) */
        if (lc_today >= 2013 01 20) { lc_color = lc_green; }  /* 01/20/13 - 02/09 - Green (Ordinary Time) */
        if (lc_today >= 2013 02 10) { lc_color = lc_white; }  /* 02/10/13 - 02/12 - White */
        if (lc_today >= 2013 02 13) { lc_color = lc_violet; } /* 02/13/13 - 03/27 - Violet - can use Violet or Red on 4/1 for Palm Sunday (Lent) */
        if (lc_today >= 2013 03 28) { lc_color = lc_white; }  /* 03/28/12          White (Maundy Thursday) */
        if (lc_today >= 2013 03 29) { lc_color = lc_black; }  /* 03/29/13 - 03/30 - Black (Good Friday/Holy Saturday) */
        if (lc_today >= 2013 03 31) { lc_color = lc_white; }  /* 03/31/13 - 05/18 - White (Easter Season) */
        if (lc_today >= 2013 05 19) { lc_color = lc_green; }  /* 05/19/13 - 05/25 - Red (Pentecost) */
        if (lc_today >= 2013 05 26) { lc_color = lc_green; }  /* 05/26/13 - 10/13 - Green (Ordinary Time) - Red on 10/28 (Reformation Sunday) */
        if (lc_today >= 2013 11 01) { lc_color = lc_white; }  /* 11/01/13 - 11/02 - White (All Saints day) */
        if (lc_today >= 2013 11 03) { lc_color = lc_green; }  /* 11/03/13 - 11/30 - Green (Ordinary Time) - Red on 10/28 (Reformation Sunday) */
        if (lc_today >= 2013 12 01) { lc_color = lc_violet; } /* 12/02/01 - 12/23 - Violet or Blue - can also use Rose on 12/16 for 3rd Sunday of Advent (Advent Season) */
        if (lc_today >= 2013 12 24) { lc_color = lc_white; }  /* 12/24/13 - ???? - White - I'll have to wait for the 2013 calendar!!!! */


        /* set the background color */
        document.bgColor = lc_color;
</script>

That's it you're done. If you want to test it out, you can set lc_today to any date to see the background change

Enjoy and Merry Christmas

ARealpolitik Dec 16, 2011 01:58 PM

Any demo site available?

KatyDigg Dec 16, 2011 03:22 PM

Thank you, Juggledad

I've only just spotted this, and delighted :)

"Happy Christmas"

~ Katy

juggledad Dec 16, 2011 03:35 PM

ARealpolitik - hang on and I'll put it on a site - I'll change the code so it does it checks the seconds and every 5 seconds (on a page refresh) it will change color

might not be till later tonight since the little one is visiting (grandkids are sooo much fun)

kletskater Dec 26, 2012 12:38 AM

hi juggledad,
how to adjust the code for 2012 or 2013?
or is that not nessesary?

juggledad Dec 26, 2012 04:59 AM

I will adjust it, I just have to get the dates (I use it on my church's website :))

kletskater Dec 26, 2012 08:57 AM

oke thanks, want to try make my Ata have a xmas look :-)

juggledad Dec 26, 2012 12:01 PM

It has been updated for 2013


All times are GMT -6. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.