Skip to content

Instantly share code, notes, and snippets.

@discatte
Created July 15, 2022 17:07
Show Gist options
  • Save discatte/738b3158e5e0417dd026e5bd0e2425a7 to your computer and use it in GitHub Desktop.
Save discatte/738b3158e5e0417dd026e5bd0e2425a7 to your computer and use it in GitHub Desktop.
VAIO Active Desktop Time of Day Wallpaper
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script LANGUAGE="JavaScript">
<!--
current = 0;
layName='test';
// Hour * 60 * 60 + Minute * 60 + Sec
time1 = 4 * 60 * 60; // dawn
time2 = 10 * 60 * 60; // daytime
time3 = 16 * 60 * 60; // sunset
time4 = 20 * 60 * 60; // midnight
// current display images Number.
disp = 0;
function setBG() {
now = new Date();
h = now.getHours();
m = now.getMinutes();
s = now.getSeconds();
time = s + m * 60 + h * 60 * 60; // date to sec trans.
if (time > time4) {
if (document.all && disp != 5) {
document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/midnight32bit1024x768.bmp")';
disp = 5;
}
}
else
if (time > time3) {
if (document.all && disp != 4) {
document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/sunset32bit1024x768.bmp")';
disp = 4;
}
} else if (time > time2) {
if (document.all && disp != 3) {
document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/daytime32bit1024x768.bmp")';
disp = 3;
}
} else if (time > time1) {
if (document.all && disp != 2) {
document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/dawn32bit1024x768.bmp")';
disp = 2;
}
}
else {
if (document.all && disp != 5) {
document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/midnight32bit1024x768.bmp")';
disp = 5;
}
}
setTimeout('setBG()', 60000);
}
// -->
</script>
<title>Welcome</title>
</head>
<body onLoad="setBG()" topmargin="0" leftmargin="0" bgcolor="#A6CAF0">
<div ID="test"
STYLE="position:absolute;left:0px;top:0px;
width:1024;height:768;clip:(0,1024,768,0)"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment