• It's the most wonderful time of the year! Make your list and check it twice. The ResetEra Games of the Year 2019 Voting Thread is now live. Voting will be open for the next 7 days, 6 hours, 11 minutes, 7 seconds, and will close on Jan 26, 2020 at 9:00 AM.

Can we have a setting that switches light/dark mode automatically?

Mike Works

Member
Oct 28, 2017
722
i.e. the site switches to dark mode at 7pm local time, light mode at 7am.

Would be neat if the times were customizable too.

That’s all.
 

Jaded Alyx

Member
Oct 25, 2017
12,793
I truly do not want to come across as a dick, but at the risk of doing so...............just do it yourself? I'm not sure this would be a feature many people would use.
 

SnakeXs

Member
Oct 28, 2017
1,351
I truly do not want to come across as a dick, but at the risk of doing so...............just do it yourself? I'm not sure this would be a feature many people would use.
Hot takes, get ya hot takes.

Should have been implemented ages ago, can only revive the original ask thread so many times before giving up hope and getting 0 communication from the staff.
 

Freestyler

Member
Oct 27, 2017
219
The mods should set up this forum to obey the prefers-color-scheme attribute of CSS, so every modern browser/device can serve up the light or dark theme depending on OS settings.

Eg. my iPhone goes into dark mode automatically at sunset, so browsing ResetEra after that time would give me the dark theme.
 

Hella

Member
Oct 27, 2017
16,122
I miss Google's live homepage or w/e, it had this exact feature, matching the time of day in the theme to your local time.

Pretty sure it got #killedbygoogle


Which is to say, it's a cool idea for a theme. Maybe not Light/Dark strictly, but yeah.
 

SoH

Member
Oct 25, 2017
3,205
There is probably a cleaner way to do it but I was too lazy to rip through the stacks of bullshit that is front end forum code (nothing but love, tech team)

JavaScript:
const lookAtTheTime = new Date()
const darknessThemeButton = document.querySelector('.re_styleSwitch--dark');
const lightnessThemeButton = document.querySelector('.re_styleSwitch--light');

if(darknessThemeButton.classList.contains('re_styleSwitch--hide')) {
  if ((lookAtTheTime.getHours() >= 19) && (lookAtTheTime.getHours() < 7)) {darknessThemeButton.querySelector('a').click();}
} else {
  if ((lookAtTheTime.getHours() < 19) && (lookAtTheTime.getHours() > 7)) {lightnessThemeButton.querySelector('a').click();}
}
 
OP
OP
Mike Works

Mike Works

Member
Oct 28, 2017
722
There is probably a cleaner way to do it but I was too lazy to rip through the stacks of bullshit that is front end forum code (nothing but love, tech team)

JavaScript:
const lookAtTheTime = new Date()
const darknessThemeButton = document.querySelector('.re_styleSwitch--dark');
const lightnessThemeButton = document.querySelector('.re_styleSwitch--light');

if(darknessThemeButton.classList.contains('re_styleSwitch--hide')) {
  if ((lookAtTheTime.getHours() >= 19) && (lookAtTheTime.getHours() < 7)) {darknessThemeButton.querySelector('a').click();}
} else {
  if ((lookAtTheTime.getHours() < 19) && (lookAtTheTime.getHours() > 7)) {lightnessThemeButton.querySelector('a').click();}
}
I know absolutely nothing about code, but that's pretty cool you did that so quickly!