Day / Night mode for webhelp stylesheets
Posted: Mon Sep 19, 2016 7:27 pm
The stylesheets could incorporate code to automatically switch between day/night mode based on the local browser time:
and stylesheets for day vs night mode incorporated into the theme builder. This would be extremely helpful for webhelp and mobile help that is delivered to devices or settings that are light-sensitive, such as driving/flying/boating/security.
Code: Select all
<script>
<!--
function getStylesheet() {
var currentTime = new Date().getHours();
if (0 <= currentTime&¤tTime < 5) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
if (5 <= currentTime&¤tTime < 11) {
document.write("<link rel='stylesheet' href='day.css' type='text/css'>");
}
if (11 <= currentTime&¤tTime < 16) {
document.write("<link rel='stylesheet' href='day.css' type='text/css'>");
}
if (16 <= currentTime&¤tTime < 22) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
if (22 <= currentTime&¤tTime <= 24) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
}
getStylesheet();
-->
</script>
<noscript><link href="main.css" rel="stylesheet" /></noscript>