Sunday, July 29, 2012

How to Add a Love Calculator to Your Blog or Website


You may have heard about Love Calculator! It's a very funny Calculator for the Lovers! The Lover calculate their Love by this Love Calculator. Let's see the example of a Love Calculator from example.idhali.com. The Love Calculator is given at the end of the Home Page. Love Calculator is now available for the Blogs or Websites. You may also add Love Calculator to your Blog or Website so that the visitor can calculate their Love. Just follow the steps given below to add a Love Calculator to your Blogger Blog.

 Step 01  Log in to Your Blogger Account
At first you have to log in to your Blogger Account if you want to add the Love Calculator to your Blogger Blog. Log in to your Blogger Account from here if you are not logged in yet.

 Step 02  Go to Layout to Add a Gadget
Now click on Layout from the left side menu of your Blogger Blog Homepage. After clicking on Layout now you have to click on Add a Gadget from the Layout. There you will found two or more Add a Gadget link on the Layout Page depending on your Blog's Layout. However, just click on any of them.

 Step 03  Add a HTML/JavaScript Gadget
After clicking on Add a Gadget, a pop up window will open. There you will found a list of different types of Gadgets. You just find out HTML/JavaScript Gadget from the list and click on that. After clicking on HTML/JavaScript Gadget another new pop up window will open.

 Step 04  Add the Necessary Codes to the Content Box
Look there are two text input box in this new pop up window. You just need to paste the following codes given below into the Content Box (the Second Box).
<center>
<h1>Love Tester</h1>
<script language="JavaScript">
<!-- Begin
function calc() {
first = document.loveform.name1.value.toUpperCase();
firstlength = document.loveform.name1.value.length;
second = document.loveform.name2.value.toUpperCase();
secondlength = document.loveform.name2.value.length;
var LoveCount=0;
for (Count=0; Count < firstlength; Count++) {
letter1=first.substring(Count,Count+1);
if (letter1=='L') LoveCount+=2; 
if (letter1=='O') LoveCount+=2; 
if (letter1=='V') LoveCount+=2; 
if (letter1=='E') LoveCount+=2; 
if (letter1=='Y') LoveCount+=3; 
if (letter1=='O') LoveCount+=1; 
if (letter1=='U') LoveCount+=3;
}
for (Count=0; Count < secondlength; Count++) {
letter2=second.substring(Count,Count+1);
if (letter2=='L') LoveCount+=2;
if (letter2=='O') LoveCount+=2; 
if (letter2=='V') LoveCount+=2; 
if (letter2=='E') LoveCount+=2;
if (letter2=='Y') LoveCount+=3;
if (letter2=='O') LoveCount+=1;
if (letter2=='U') LoveCount+=3; 
}
amount=0;
if (LoveCount> 0) amount=  5-((firstlength+secondlength)/2)
if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2)
if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2)
if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2)
if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2)
if (LoveCount>10) amount= 50-((firstlength+secondlength)/2)
if (LoveCount>12) amount= 60-((firstlength+secondlength)/2)
if (LoveCount>14) amount= 70-((firstlength+secondlength)/2)
if (LoveCount>16) amount= 80-((firstlength+secondlength)/2)
if (LoveCount>18) amount= 90-((firstlength+secondlength)/2)
if (LoveCount>20) amount=100-((firstlength+secondlength)/2)
if (LoveCount>22) amount=110-((firstlength+secondlength)/2)
if (firstlength==0 || secondlength==0) amount= "Err";
if (amount < 0) amount= 0;
if (amount >99) amount=99;
document.loveform.output.value=amount+"%";
}
//  End -->
</script>
<form name=loveform>
<input value="Abhishek Bachchan" name="name1" type="text" size="20" /> + 
<input value="Aishwarya Rai" name="name2" type="text" size="20" /> = 
<input value="" name="output" type="text" size="6" />
<br />
<br />
<input value="Calculate!" name="calculate" type="button" value="calculate" onclick="calc()" />
</form></center>

 Step 05  Where You Can Change
In this step you will learn where you can change the codes. Look at the beginning, there is written Love Tester. This is the Heading of the Love Calculator. You may replace Love Tester with your expected name. It may be Love Calculator, Test Your Love or anything like this.
You can also change Abhishek Bachchan or Aishwarya Rai. These two are the two name of two Bollywood Actors. They both are Husband and Wife now. So I have used their name in two fields. You may use any name.
20 and 6 are just the font size. So you may change the font size as you like. I think you should change the font size according to your blog's or website's font size.

 Step 06  Save Your Work n View the Blog
Now click on  Save  button to save your work. Then place the Gadget where you want to show the Love Calculator and click on  Save Arrangement  to save the new Arrangement.