Page 1 of 2

possible new style to be in development...

Posted: Mon Mar 07, 2011 8:30 pm
by spaceace
been wanting to make a style that can change colours with the users time of day. this would consist of 2 or more stylesheets. and since i simplified the stylesheet that i'm using in my new styles, i think i can pull this off now. only thing i'm waiting for now is for someone to go over a piece of javascript to see if it will do the job or not. if you know js and would like to have a look and let me know if it will work or not, here it is
Code: Select all
<script type="text/javascript">
var d = new Date()
var time = d.getHours()
if (time<10)
  {
  document.write("<link href="{T_THEME_PATH}/morning.css" rel="stylesheet" type="text/css" media="screen, projection" />");
  }
else if (time>10 && time<16)
  {
  document.write("<link href="{T_THEME_PATH}/day.css" rel="stylesheet" type="text/css" media="screen, projection" />");
  }
else
  {
  document.write("<link href="{T_THEME_PATH}/evening.css" rel="stylesheet" type="text/css" media="screen, projection" />");
  }
</script>
just so everyone knows, it will not be something that i'm going to be doing right now as i have to move and get a few other things sorted before i can start on it. only thing i do know right now is that it will be based off of my Midnightspace style for the first run and then the Concept style for the second. and also, in the future, i could even produce stylesheets of different colours for members to download so they could mix and match their own colours sets :D

Re: possible new style to be in development...

Posted: Mon Mar 07, 2011 8:52 pm
by Gnome!
ohhhhhh I'm gonna love this once you get it all sorted :D

Re: possible new style to be in development...

Posted: Mon Mar 07, 2011 8:53 pm
by spaceace
i think i'm even going to like it as i've never seen anyone do it yet ;)

Re: possible new style to be in development...

Posted: Mon Mar 07, 2011 9:16 pm
by duesmandella
WHo thinks of this stuff lol
Its a great idea im suprised im just hearing of it now

Re: possible new style to be in development...

Posted: Tue Mar 08, 2011 12:50 am
by Gnome!
Space,

I passed this onto a friend in the know and this is what he said.

Kevin ******
That will be cool. I can't think of anyone who has done that with phpbb. He does have an issue with his javascript though. The lines like this one:
Code: Select all
document.write("<link href="{T_THEME_PATH}/morning.css" rel="stylesheet" type="text/css" medi...a="screen, projection" />");

should looks something like this:

document.write('<link href="{T_THEME_PATH}/morning.css" rel="stylesheet" type="text/css" media="screen, projection" />');
Note the difference in quotes before and after the parenthesis. I'll be waiting to see that idea in action :)

Re: possible new style to be in development...

Posted: Tue Mar 08, 2011 7:16 am
by spaceace
Gnome! wrote:Space,

I passed this onto a friend in the know and this is what he said.

Kevin ******
That will be cool. I can't think of anyone who has done that with phpbb. He does have an issue with his javascript though. The lines like this one:
Code: Select all
document.write("<link href="{T_THEME_PATH}/morning.css" rel="stylesheet" type="text/css" medi...a="screen, projection" />");

should looks something like this:

document.write('<link href="{T_THEME_PATH}/morning.css" rel="stylesheet" type="text/css" media="screen, projection" />');
Note the difference in quotes before and after the parenthesis. I'll be waiting to see that idea in action :)
thanks Gnome! :D that's exactly the kind of response i'm looking for :D

Re: possible new style to be in development...

Posted: Tue Mar 08, 2011 7:17 am
by Gnome!
Your welcome Sir :D

I'm trying to convince him to join ;)

Re: possible new style to be in development...

Posted: Tue Mar 08, 2011 7:21 am
by spaceace
sounds like it would be a good addition to the site :D

Re: possible new style to be in development...

Posted: Tue Mar 08, 2011 7:22 am
by Gnome!
I totally agree :D

Re: possible new style to be in development...

Posted: Tue Mar 08, 2011 8:26 am
by spaceace
hopefully, now that this is brought to light, nobody does it and beats me to it :lol: