VB icon

Fading background to reveal hidden text

Email
Submitted on: 1/5/2015 9:10:00 AM
By: Dazfish (from psc cd)  
Level: Beginner
User Rating: By 2 Users
Compatibility: HTML, VbScript (browser/client side)
Views: 748
 
     This code starts with a plain background and when a button is pressed the background fades to another colour revealing text that was the same color as the origional background. Easily adaptable by unexperienced users, passwords can be added easily.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Fading background to reveal hidden text
' Description:This code starts with a plain background and when a button is pressed the background fades to another colour revealing text that was the same color as the origional background.
Easily adaptable by unexperienced users, passwords can be added easily.
' By: Dazfish (from psc cd)
'**************************************

<HTML>
<HEAD>
<SCRIPT language="vbs">
<!--
Dim redstart, redend, redcount, redcounthex
Dim greenstart, greenend, greencount, greencounthex
Dim bluestart, blueend, bluecount, bluecounthex
Dim increments, count
increments=128
redstart=0
greenstart=255
bluestart=0
redend=0
greenend=0
blueend=0
Sub pass()
 change()
' pw=InputBox ("Enter the password")
' If pw="password" then change(): Exit Sub
' MsgBox "Wrong Password"
End Sub
Sub change()
 greencount=greenstart
 redcount=redstart
 bluecount=bluestart
 count=0
 changenext()
End Sub
Sub changenext()
 redcounthex=Hex(redcount)
 greencounthex=Hex(greencount)
 bluecounthex=Hex(bluecount)
 If Len(redcounthex)=1 Then redcounthex="x"&"0"&redcounthex
 If Len(greencounthex)=1 Then greencounthex="x"&"0"&greencounthex&" "
 If Len(bluecounthex)=1 Then bluecounthex="x"&"0"&bluecounthex
 alter.color=right(redcounthex,2)&right(greencounthex,2)&right(bluecounthex,2)
 if redstart>redend then redcount=redcount-((redstart-redend)/increments)
 if redstart<redend then redcount=redcount+((redend-redstart)/increments)
 if greenstart>greenend then greencount=greencount-((greenstart-greenend)/increments)
 if greenstart<greenend then greencount=greencount+((greenend-greenstart)/increments)
 if bluestart>blueend then bluecount=bluecount-((bluestart-blueend)/increments)
 if bluestart<blueend then bluecount=bluecount+((blueend-bluestart)/increments)
 if count=increments*(15/16) then exit sub
 count=count+1
 wait()
End Sub
Sub wait()
 l=setTimeOut("changenext()",50)
End Sub
-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#00ff00" text=lime>
<CENTER><B>
<INPUT type=button value="Click here to view secret information" onClick="pass()">
<FONT id="alter"><P>This is secret information that you cannot see untill you click the button.
<P>Passwords can also be added later if neccessary!
</FONT></B></CENTER>
</BODY>
</HTML>


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.