• An old favorite feature returns: Q&ERA is back! This time we'll be collecting questions for Remedy Entertainment, makers of Max Payne, Alan Wake, Quantum Break, and Control. Members can submit questions for the next 22 hours, 50 minutes, 47 seconds. Submissions will close on Dec 12, 2019 at 12:00 AM.

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

Mike Works

Member
Oct 28, 2017
671
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,235
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,247
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
206
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
15,114
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.
 

SmiteOfHand

Member
Oct 25, 2017
2,863
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
671
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!