Pin It
2

The rapid popularity of a website depends on contents as well as design of the site interface. Generally when we open different types of websites, we see various types of animations which can be important message, special offer or headline of news. If we keep it as a normal text in a website, most of the visitors will not see that. But if we use special effects on these texts; it will visitors eyes and that’s what we are up to.

Overview of our project

Our project will show a changeable and scrolling color effect on a text. Let’s see, what we are going to make.


Our project code:

 <html>

<head>
<style>
body{background:#000;

}

h1{text-align:center;}
</style>

<t itle>Text effect</title>
</head>

<body>
<h1><script language=”JavaScript1.2″>
var message=”Welcome to www.flakesfusion.com “
var neonbasecolor=”#0BC3BD”
var neontextcolor=”#B61257″
var neontextcolor2=”#FFFFA8″
var flashspeed=180                        // speed of flashing in milliseconds
var flashingletters=4                        // number of letters flashing in neontextcolor
var flashingletters2=1                        // number of letters flashing in neontextcolor2 (0 to disable)
var flashpause=0                        // the pause between flash-cycles in milliseconds

///No need to edit below this line/////

var n=0
if (document.all||document.getElementById){
document.write(‘<font color=”‘+neonbasecolor+’”>’)
for (m=0;m<message.length;m++)
document.write(‘<span id=”neonlight’+m+’”>’+message.charAt(m)+’</span>’)
document.write(‘</font>’)
}
else
document.write(message)

function crossref(number){
var crossobj=document.all? eval(“document.all.neonlight”+number) : document.getElementById(“neonlight”+number)
return crossobj
}

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
crossref(m).style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
crossref(n).style.color=neontextcolor

if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2
if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor

if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout(“beginneon()”,flashpause)
return
}
}

function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval(“neon()”,flashspeed)
}
beginneon()
</script></h1>
</body>
</html>

First of all open a notepad and write above code. From file menu click on save as and write file name as like index.html. After that select all files from save as type. Finally to save clicks on save button. Now open it by Mozilla Firefox and enjoy the colour effect.

Project analysis

var message=”Welcome to www.flakesfusion.com “ In this area you can change the text (Welcome to www.flakesfusion.com ) as you like.

var neonbasecolor=”#0BC3BD” By this line the main colour of the text has selected.

var neontextcolor=”#B61257″

var neontextcolor2=”#FFFFA8″

By using above two lines a changeable and running two colour effect has been obtained.

var flashspeed=180  By this line the speed of the colour effect has been selected.

<style>

body{background:#000;}

h1{text-align:center;}

</style>

In this area

By body{background:#000;}  background color has been obtained.

By h1{text-align:center;} the text align has been centered.

……………………………………………………………………..

That’s all for today. Part 2 will be publishing soon. Wish you Good luck and be healthy.

Other Posts You May Like

Follow Us on Twitter or Like Us on Facebook

Liked the post? Why Not Subscribing Via RSS Feed or E-mail

Enter Your E-mail

Ashim Kumar is a technology blogger and web designer . He is a student of DUET in Electrical & Electronics Engineering. Follow him on Facebook to be connected.

2 Comments

  1. robert says:

    Superb , color code.

  2. It is at this occasion that these commerce’s need to invest in a suitable website scheming company.thanks for nice post.

Leave a Reply