Multi
Multi
Dark layout triggered based on visitor time
Topic Started: Sunday, 13. September 2015, 14:39 (2,129 Views)
JiltedTongue
No Avatar
Level 1
I've seen this over the years but never on a forum. Perhaps some of you have seen it in forum design.

Basically, the javascript code will detect the user/visitor's local time and use the appropriate stylesheet (light or dark). Not everyone cares but at night on my various computers and devices, I always dim the brightness. During the day, I'm not terribly fond of lighter text on dark backgrounds but at night, I really like it. I don't have perfect vision and it is easier on my eyes.

https://css-tricks.com/snippets/javascript/different-stylesheet-pending-the-time-of-day/

I want to try to do this. If members don't like it, it's easy enough to change themselves. I'd actually prefer another kind of implementation. I've seen some sites with a button that will trigger the change from day to night mode and vice-versa.

Some members use dark skins at night anyway but I think it's a good idea.

Your thoughts?
Off
Profile
Quote
Top
 
Aidan
Member Avatar
Level 12
I've seen one theme use a "button" for a light and dark variation of one theme. I also remember someone asking me to code a theme that would change by time of day and season. It's all very interesting and very possible. I'd love to see more themes of thos kind.
Off
Profile
Quote
Top
 
Joe
Member Avatar
Hi.
Would be very simple to implement this.

Have JS that looks at the board clock (`tr#foot_datetime a`), and if it's within a certain period, flip the theme. :geek:
Joe
Off
Profile
Quote
Top
 
Aidan
Member Avatar
Level 12
Joe
Sunday, 13. September 2015, 21:56
Would be very simple to implement this.

Have JS that looks at the board clock (`tr#foot_datetime a`), and if it's within a certain period, flip the theme. :geek:
Or better yet use the Date object in JS.
Off
Profile
Quote
Top
 
Matt
Member Avatar
Level 6
Honestly, it would depend on if you wanted it to change by board time, or by system time of the client pc... Personally, I'd side with Aiden and use the computers time so that the visitor doesn't get the daytime theme at night and vice versa.
Message Me:
Telegram - Twitter - Discord


Projects:
Forum Hosting
Off
Profile
Quote
Top
 
Aidan
Member Avatar
Level 12
Aidan* :r
Off
Profile
Quote
Top
 
Matt
Member Avatar
Level 6
My bad... I typed without looking... at least I got all but one letter right!
Message Me:
Telegram - Twitter - Discord


Projects:
Forum Hosting
Off
Profile
Quote
Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Design Discussion · Next Topic »

Welcome Guest [Log In] [Register]
Outline Live
Loading..
Loading..