P
Pyrohazard
Guest
I thought it was about time to give back to the community, so I have decided to make a little tutorial on how to make a HL² countdown on your desktop. I dont know if this works on all version of Windows, and I only know how to make it on XP, so anyone who uses another version, will have to figure parts out on there own.
An example of what Im talking about can be found here.
First off, find a suitable place to put 2 files that wont always be in your way. I suggest in the My Documents folder, and thats the example I am going to use.
Find the background you want to use and place it in that folder as well. Open up NotePad, and put the following in:
(I have no clue were the countdown code came from, so thanks to whos ever it is)
and save it as somthing.html. Be sure to change background.jpg on line 4 to the file name of your background. On line 8, were it says "Until Half-Life 2!", you can change that to say what ever you want it to after the countdown. On line 9 is what it will say when the day has arrived.
Now to use it as a background go to the desktop (Windows Key + D) and rightclick on the desktop. Rigthclick on the desktop, and select 'Properties'. Click the 'Desktop' tab (go figure =P) and click the 'Customize Desktop' button. Continue to the 'Web' tab, and click 'New'. 'Browse' for the .html document you made, and select it.
Click 'Ok', 'Ok' and 'Ok' again. Almost done now, Now for the easyest part, click the little button that maximizes the little window. The first square one. Done.
How to close it later, is all up to you. =P
An example of what Im talking about can be found here.
First off, find a suitable place to put 2 files that wont always be in your way. I suggest in the My Documents folder, and thats the example I am going to use.
Find the background you want to use and place it in that folder as well. Open up NotePad, and put the following in:
(I have no clue were the countdown code came from, so thanks to whos ever it is)
Code:
<html>
<head>
</head>
<body background="background.jpg[/img]<form name="count">
<input type="text" size="69" name="count2">
</form>
<script>
var before="Until Half-Life2!"
var current="Its Being Released Today! Gotta Play HL²!"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value="Only "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+before
setTimeout("countdown(theyear,themonth,theday)",1000)
}
//enter the count down date using the format year/month/day
countdown(2004,11,16)
</script>
</body>
</html>
Now to use it as a background go to the desktop (Windows Key + D) and rightclick on the desktop. Rigthclick on the desktop, and select 'Properties'. Click the 'Desktop' tab (go figure =P) and click the 'Customize Desktop' button. Continue to the 'Web' tab, and click 'New'. 'Browse' for the .html document you made, and select it.
Click 'Ok', 'Ok' and 'Ok' again. Almost done now, Now for the easyest part, click the little button that maximizes the little window. The first square one. Done.
How to close it later, is all up to you. =P