Half-Life 2 Desktop Countdown

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)
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>
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
 
sweet! ...... will do *does*

EDIT: not working...... ima check your variables, make sure you decalred them all
 
I just get a white box in the corner and I can type things in it. :(
 
yea....... ok ....... you probably quoted this from somewhere and forgot a part ....... useless code
 
Odd, When ever I post it back, alot of white spaces show up in the middle of the code.
 
I bet it's something with the whole date thing...
 
Ive figured it out, but it only lets me edit posts once every 15 minutes, so heres the full thing:

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. Go to this URL: http://img91.exs.cx/img91/9168/desktop34.jpg
and save it as somthing.html in the same folder. 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
EDIT: Errors using the
Code:
 bbcode made spaces in the script which stoped it from working. Fixed now, use the pic to html method. If you cant save it just 'View' > 'Source' and save that. Thanks.
 
host the html example or put it in txt file and host it somewhere plz
 
Okay, here, I just zipped it =/
 

Attachments

  • desktop.zip
    816 bytes · Views: 253
Pyrohazard, not to steal any of your thunder........ in case anyone else has any problems , here is an alternative

follow Pyrohazard's same instructions on how to put it on your desktop and just change hte filename to .html from .txt
 
That's really cool. Thanks a lot!

But is there any way to move it to the lower left of the screen instead of the top, so I can still have my icons the way I like them? I'm not too good with html.
 
Wasn't there one last year? With everything included and done, and stylish too. I think I remember having one.
 
Sweet, this is exactly what I was looking for. Thanks, Pyro!

-UnmarkedOne
 
If you guys want, I can add some simple css in to change the colours and stuff. Tomarow, right now, I have to get to bed. Thanks everyone.
 
I'd like to have one where it isn't text, so to speak, but a bunch of gifs, such as 1.gif, 2.gif, etc. It had the HL2 symbol, and was a black background. I'll be damned if I can find it.
 
I found another stylish way of doing the countdown clock.

-> Go to display properties
-> Desktop tab
-> Select Background as None and change the color to light grey
-> Goto Customize Desktop
-> Web Tab
-> Select New
-> Copy and Paste "http://hl2.zjohnwang.com/" (no quotes)
-> It'll make the page available offline
-> Click ok and then close the display window
At this point you'll have a funny shaped box on your desktop
-> Goto the top of the box and click on the top arrow and select "Split Desktop with Items"

You can customize it anyway you want but I thought this way looked best.

NOTE: I know the date is wrong but I'm guessing It'll be changed to new release date.

2nd Note: You need Macromedia

EXAMPLE: EXAMPLE
 
It seems right after I wrote that past the webmaster of the site updated the new release date so you are good to go. If you want to syncronize the web page to be updated just go to the cutomize desktop settings and synchronize it through the page settings. It's pretty straight forward.

NEW EXAMPLE
 
scatr99 said:
I found another stylish way of doing the countdown clock.

-> Go to display properties
-> Desktop tab
-> Select Background as None and change the color to light grey
-> Goto Customize Desktop
-> Web Tab
-> Select New
-> Copy and Paste "http://hl2.zjohnwang.com/" (no quotes)
-> It'll make the page available offline
-> Click ok and then close the display window
At this point you'll have a funny shaped box on your desktop
-> Goto the top of the box and click on the top arrow and select "Split Desktop with Items"

You can customize it anyway you want but I thought this way looked best.

NOTE: I know the date is wrong but I'm guessing It'll be changed to new release date.

2nd Note: You need Macromedia

EXAMPLE: EXAMPLE

Awesome! But I don't know how to customize it...:(
 
wow am i the only one that cant do this???? whenever i try to save it it comes up as a bunch of symbabls and characters wtf?
 
thats not my problem, i can set it up, but when i set it up, theres just a white box with text on my desktop
 
can someone post a screenshot of their desktop so i can see what it looks like ??? pleeeaaaseee
 
That's really weird, take a screenshot of it. Make sure you have macromedia and that your internet secrurity settings let you do it.
 
Back
Top