inherit
211492
0
Feb 24, 2021 8:52:31 GMT -8
Heildgar
124
July 2014
domanda
|
Post by Heildgar on Jun 7, 2015 22:10:11 GMT -8
Is it possible to have a plugin to make the forum theme slightly change from day and night for different users?
Like according to their timezones it would be brighter in the day time and darker at night.
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Jun 8, 2015 11:50:37 GMT -8
Hey Heildgar -- using JavaScript to quickly grab the current hour is a good way to make changes based on what time of day it is for the users in question. Try this in your Headers section or somewhere: <script> $(document).ready(function() { var hr = (new Date()).getHours(); //get hours of the day in 24Hr format (0-23)
if (hr >= 12) {$('body').css('background-color', 'black')} // IT'S BETWEEN NOON AND MIDNIGHT else {$('body').css('background-color', 'white')} // IT'S BETWEEN MIDNIGHT AND NOON }); </script>This will turn the forum's background color black when it's noon (indicating night), and then at midnight it'll switch to white (indicating day). You'd probably want additional code to make it more sophisticated (depending on what exact times of day you'd want) because the sun doesn't really rise at midnight and set at noon.
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jun 8, 2015 23:50:55 GMT -8
if you add 6 it will modify it slightly to change states at 6 am/pm
|
|
inherit
211492
0
Feb 24, 2021 8:52:31 GMT -8
Heildgar
124
July 2014
domanda
|
Post by Heildgar on Jun 10, 2015 11:13:50 GMT -8
Thanks guys, I will definitely try it out.
|
|
inherit
211492
0
Feb 24, 2021 8:52:31 GMT -8
Heildgar
124
July 2014
domanda
|
Post by Heildgar on Jun 13, 2015 10:35:09 GMT -8
Sorry to bump an old thread, but is there a way to make the whole forum, including the containers change?
And is there a slightly smoothers way to do it?
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Jun 13, 2015 11:07:55 GMT -8
While I'm not aware of a more smooth way to do it, any number of CSS declarations can be applied:
<script> $(document).ready(function() { var hr = (new Date()).getHours(); //get hours of the day in 24Hr format (0-23)
if (hr >= 12) { $('body').css('background-color', 'black') $('.container').css('background-color', 'black') //etc //etc
} // IT'S BETWEEN NOON AND MIDNIGHT
else { $('body').css('background-color', 'white') $('.container').css('background-color', 'white') //etc //etc
} // IT'S BETWEEN MIDNIGHT AND NOON
}); </script>
|
|