Script Rainbow

Formatado por Maria Lucia Luz

 

Cole dentro da tag <body>....</body>


<SCRIPT language=JavaScript>

//copyright inoue kengo

//num1&#8218;(c)&#8218;num2&#8218;&#352;&#8218;̐&#8221;&#8217;

l&#8218;&#402;&#8240;&#402;&#8220;&#402;_&#402;&#8364;&#8218;&#8226;

&#8218;&#8221;&#8212;p&#352;֐&#8221;

function rangeRandom(num1,num2) {

if((num1 - num2) > 0) {

var big = num1

var small = num2

} else {

var big = num2

var small = num1

}

var range = big - small + 1

var number = Math.floor(Math.random()*range) + small

return(number)

}

//16i&#8221;&#8226;&#352;&#8212;p&#8218;&#352;֐&#8221;

function toHex(dec) {

hexChar="0123456789ABCDEF"

var i = dec % 16

var j = (dec - i)/16

result = hexChar.charAt(j)

result += hexChar.charAt(i)

return result

}

//&#402;&#8240;&#402;&#8220;&#402;_&#402;&#8364;

&#8218;&#8226;&#381;&#353;

F(#RRGGBB&#8226;\&#8249;L)&#8218;&#8226;&#8218;

&#352;֐&#8221;(&#352;g&#8217;&#8221;)

//F&#8218;&#8226;&#8240;&#8218;&#8218;&#8218;&#710;

&#8221;color&#8218;redAgreenAblueAyellowApinkAwaterAmono&#8218;

&#381;w&#8217;&#8218;&#8218;&#8218;

function randomColor(color) {

var textcolor = "#"

//red&#8218;̏&#8225;

if(color=="red") {

textcolor="ff"

var tmp = toHex(rangeRandom(0,255))

textcolor += tmp

textcolor += tmp

}

//green&#8218;̏&#8225;

else if(color == "green") {

var tmp = toHex(rangeRandom(0,255))

textcolor += tmp

textcolor += "ff"

textcolor += tmp

}

//blue&#8218;̏&#8225;

else if(color == "blue") {

var tmp = toHex(rangeRandom(0,255))

textcolor += tmp

textcolor += tmp

textcolor += "ff"

}

//yellow&#8218;̏&#8225;

else if(color == "yellow") {

textcolor += "ffff"

textcolor += toHex(rangeRandom(0,255))

}

//pink&#8218;̏&#8225;

else if(color == "pink") {

textcolor += "ff"

textcolor += toHex(rangeRandom(0,255))

textcolor += "ff"

}

//water&#8218;̏&#8225;

else if(color == "water") {

textcolor += toHex(rangeRandom(0,255))

textcolor += "ffff"

}

//mono&#8218;̏&#8225;

else if(color == "mono") {

var tmp = toHex(rangeRandom(0,255))

textcolor += tmp + tmp + tmp

}

//&#710;ȏ&#710;&#352;O&#8218;̏&#8225;

else {

for(var i = 0 ; i < 3 ; i++) {

textcolor += toHex(rangeRandom(0,255))

}

}

return textcolor

}

 

function randomText(txt,color) {

var str = ""

for(var i = 0 ; i < txt.length ; i++) {

str += "<FONT COLOR='"

str += randomColor(color) + "'>"

str += txt.substring(i,i+1)

str += "</FONT>"

}

return str

}

var msg = "Ol para todos...beijo maria lucia !"

function chStr() {

clearTimeout(timerID)

var tmp_msg = msg

msg = prompt("&#8226;&#381;&#353;&#8218;

&#8220;&#8212;&#8218;&#8218;&#8218;&#8218;3/4&#8218;&#8218;",msg)

if((msg == null)||(msg == "")) {

msg = tmp_msg

}

makeRainbow()

}

function makeRainbow() {

for(i=0 ; i<form1.length ; i++) {

if(form1.elements[i].checked) {

var color_value = form1.elements[i].value

}

}

var str = randomText(msg,color_value)

moji.innerHTML = str

timerID = setTimeout("makeRainbow()",100)

}

</SCRIPT>

<META content="MSHTML 5.50.4134.100" name=GENERATOR>

<STYLE></STYLE>

</HEAD>

<BODY text=white bgColor=#c0c0c0

background=cid:016201c2f721$6c7fee20$45e9b3c8@rjo.virtua.com.br

onload=makeRainbow()>

<DIV><FONT face="Comic Sans MS" color=#000000 size=2></FONT>&nbsp;</DIV><BGSOUND

balance=0 src="cid:016301c2f721$6c7fee20$45e9b3c8@rjo.virtua.com.br" volume=0

loop=infinite>

<DIV>&nbsp;</DIV>

<DIV><STRONG><FONT face=Tahoma color=#000000 size=2></FONT></STRONG>&nbsp;</DIV>

<DIV><FONT face=Arial color=#000000></FONT><BR>&nbsp;</DIV>

<DIV id=moji

style="FONT-SIZE: 50pt; CURSOR: hand; FONT-FAMILY: Fantasy; TEXT-ALIGN: center"

onclick=chStr()></DIV>

<FORM id=form1 style="TEXT-ALIGN: center">

<DIV align=center>

<HR>

</DIV>

<DIV><FONT color=#000080><INPUT type=radio CHECKED value="" name=colorgroup>all

<INPUT type=radio value=red name=colorgroup>red <INPUT type=radio value=green

name=colorgroup>green <INPUT type=radio value=blue name=colorgroup>blue <INPUT

type=radio value=yellow name=colorgroup>yellow <INPUT type=radio value=water

name=colorgroup>water <INPUT type=radio value=mono name=colorgroup>mono

<BR></FONT></DIV></FORM><BR>


 

 

design by Angela Maria Pereira Glavam

 

  Copyright 2002 by Angela Maria P. Glavam  

Todos os direitos reservados