Search /themes/ threads

Name  
Email  
Subject  
Message  
File     
Password  (for post and file deletion)

File 130109167697.jpg - (15.00KB , 200x200 , 130094613341.jpg )
745 No. 745 ID: 116771
Hello!

Since ponychan is having a theming contest, I decided that this little thing I made a long while back may be handy. The way this works is as follows:

On pageload the javascript grabs the client's local time and then adds it to a cookie. that cookie is then read by the php script and, depending on time, can display a specific theme.

My thoughts on this was "fluttershy morning, rainbow dash afternoon, twilight evening, luna night" or something like that, depending on what the contest produces.

This could be added as a theme option perhaps? The way I have it coded is the php file renders css directly, so you could add an @include url() under the time frames.

Thoughts?

https://github.com/karai17/Time-based-CSS
Unspoiler all text  • Expand all images  • Reveal spoilers
>> No. 985 ID: 37e1bc
It's a cool idea, but it would mean that CSS files would no longer be cacheable, which is kind of a deal-breaker for me.

If you had something that worked on the client side instead of the server side, I'd be more willing to look into it.
>> No. 1031 ID: 116771
OP here~

What if instead of generating the css itself via the php, the php simply does an @include url(); that way the actual css files should still be cacheable?

If that won't work, I can look into using JavaScript instead of php (which is probably the best way to go about it anyway, I made this over a year ago so I could probably do it better haha)
>> No. 1057 ID: f02aa4
>>1031
There's really no reason to contact the server for something as trivial as switching styles. You're probably better off making a grease monkey script, then you won't have to deal with cookies for users who do/don't want the functionality.
>> No. 1059 ID: 116771
>>1057

Right. I threw this together very quickly over a year ago as a demo. The cookie was used to transfer client data (local time) to the server. You could omit the server and cookie if I rewrote this with JavaScript.

I might actually do that over the next day or two as I have nothing better to do with my days right now.

Keep an eye for an update, thought I won't be able to put it on github until my pc is set up.
>> No. 1064 ID: 116771
File 130146214566.png - (112.68KB , 475x797 , 130109741703.png )
1064
>>1059

Oh hey look, David Letterman isn't funny so I did this while waiting for Craig Ferguson.

Time Based CSS v2.0
--------------------------------
* Cookies removed
* PHP removed, completely client side
* Depends on jQuery (I'm sure if you really want it to be self sufficient, you could make it so)

Not really sure why but I thought JavaScript didn't have switches... Oh well, it works, haha.

Comments and suggestions are always welcome!

Cheers~

http://www.mediafire.com/?645h5n42qov6za2


Delete post []
Password    
Report post
Reason