Showing posts with label experimen. Show all posts
Showing posts with label experimen. Show all posts

Monday, February 11, 2013

Counting Till 2012

· 0 comments
ADD GADGET DI LAYOUT  BLOG ANDA :



<style>

.lcdstyle{ /*Example CSS to create LCD countdown look*/
background:#fff;
color:#289728;
font: bold 20px arial;
padding: 15px;

border:5px solid #333333;

border-radius:15px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
box-shadow: 5px 5px 5px #CCCCCC;


}

.lcdstyle sup{ /*Example CSS to create LCD countdown look*/
font-size: 120%
}

</style>

<script type="text/javascript">

function cdtime(container, targetdate){
if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.currentTime=new Date()
this.targetdate=new Date(targetdate)
this.timesup=false
this.updateTime()
}

cdtime.prototype.updateTime=function(){
var thisobj=this
this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

cdtime.prototype.displaycountdown=function(baseunit, functionref){
this.baseunit=baseunit
this.formatresults=functionref
this.showresults()
}

cdtime.prototype.showresults=function(){
var thisobj=this


var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds
if (timediff<0){ //if time is up
this.timesup=true
this.container.innerHTML=this.formatresults()
return
}
var oneMinute=60 //minute unit in seconds
var oneHour=60*60 //hour unit in seconds
var oneDay=60*60*24 //day unit in seconds
var dayfield=Math.floor(timediff/oneDay)
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level
hourfield=dayfield*24+hourfield
dayfield="n/a"
}
else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level
minutefield=dayfield*24*60+hourfield*60+minutefield
dayfield=hourfield="n/a"
}
else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level
var secondfield=timediff
dayfield=hourfield=minutefield="n/a"
}
this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield)
setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
}

/////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////

//Create your own custom format function to pass into cdtime.displaycountdown()
//Use arguments[0] to access "Days" left
//Use arguments[1] to access "Hours" left
//Use arguments[2] to access "Minutes" left
//Use arguments[3] to access "Seconds" left

//The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown()
//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc


function formatresults(){
if (this.timesup==false){//if target date/time not yet met
var displaystring=arguments[0]+" days "+arguments[1]+" hours "+arguments[2]+" minutes "+arguments[3]+" seconds left until December 25, 2011 18:25:00"
}
else{ //else if target date/time met
var displaystring=""
}
return displaystring
}

function formatresults2(){
if (this.timesup==false){ //if target date/time not yet met
var displaystring="<span class='lcdstyle'>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> "
}
else{ //else if target date/time met
var displaystring="" //Don't display any text
alert("HAPPY NEW YEAR EVERYBODY!") //Instead, perform a custom alert
}
return displaystring
}

</script>
<br />
<table><tbody>
<tr>
<td><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZSFAUv0Z2rGUBMJiR7RuOAXpYEUg0oMV40krzXsYl3QsiA5qbcyrSA61j9UaU6qQxSrFktb0OfOHo7fiapcyLjf3hxmbijv24GA4EzjveTlK76utSw0k04ksplH7bbYOrLF8Upn5_p9o/s400/NEW+YEAR.png" style="float: left;" width="125px" />
<br />
<h1 style="color: #289728; padding-top: 40px;">
Counting Till 2012 »»</h1>
<br /></td></tr>
<tr><td><div id="countdowncontainer">
</div>
<br />
<div id="countdowncontainer2">
</div>
<script type="text/javascript">

var futuredate=new cdtime("countdowncontainer", "March 23, 2009 18:25:00")
futuredate.displaycountdown("days", formatresults)

var currentyear=new Date().getFullYear()
//dynamically get this Christmas' year value. If Christmas already passed, then year=current year+1
var thischristmasyear=(new Date().getMonth()>=11 && new Date().getDate()>31)? currentyear+1 : currentyear
var christmas=new cdtime("countdowncontainer2", "December 31, "+thischristmasyear+" 0:0:00")
christmas.displaycountdown("days", formatresults2)

</script>

</td></tr>
</tbody></table>


Saturday, February 9, 2013

Widget Pengatur Ukuran & Warna Text posting

· 0 comments


Masukkan kode di bawah ini diatas kode </head>

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

lalu simpan template....

dan tambahkan ini di layout - gadget anda....

<!-- http://TheUnnecessaryWorld.co.cc -->

<style type="text/css">

/** TUW Font Color and Size Change widget begins **/

#tuw-font-change-widget {width: auto;}

#tuw-font-change-widget h2 {margin: 0 0 8px 0 !important;font: 12px
Tahoma !important;font-weight: normal !important;border: 0 !important;}

#tuw-font-change-widget ul {width: auto; overflow: hidden;margin: 0 0
20px !important;padding: 0 !important;list-style; none !important;}

#tuw-font-change-widget ul li {width: 20px !important;height: 20px
!important;overflow: hidden;margin: 0 10px 0 0 !important;padding: 2px
!important;display: block !important;float: left !important;border: 1px
solid #CCCCCC !important;}

#tuw-font-change-widget ul li a {width: 20px !important;height: 20px
!important;display: block !important;line-height: 18px
!important;text-align: center !important;color: #FFFFFF
!important;font-size: 11px !important;font-family: Tahoma
!important;text-decoration: none !important; outline: 0 !important;}

#fcw-black { background: #000000 !important; } #fcw-white { background:
#088A08 !important; } #fcw-blue { background: #0066CC !important; }
#fcw-gray { background: #666666 !important; }

#fcw-color a { text-indent: -999px !important; }

#fcw-size a { text-indent: 0 !important; background: #333333 !important; }

/** TUW Font Color and Size Change widget begins **/

</style>

<script type="text/javascript">

$(document).ready(function(){

// Change Font Color -- begins

$(" #fcw-color #fcw-black ").click(function() {

$(" .post-body ").css({ color: "#000000" });

return false;

});



$(" #fcw-color #fcw-white ").click(function() {

$(" .post-body ").css({ color: "#088A08" });

return false;

});



$(" #fcw-color #fcw-blue ").click(function() {

$(" .post-body ").css({ color: "#0066CC" });

return false;

});



$(" #fcw-color #fcw-gray ").click(function() {

$(" .post-body ").css({ color: "#666666" });

return false;

});

// Change Font Color -- ends



// Change Font Size -- begins

$(" #fcw-size #fcw-10 ").click(function() {

$(" .post-body ").css({ fontSize: "10px" });

return false;

});



$(" #fcw-size #fcw-12 ").click(function() {

$(" .post-body ").css({ fontSize: "12px" });

return false;

});



$(" #fcw-size #fcw-14 ").click(function() {

$(" .post-body ").css({ fontSize: "14px" });

return false;

});



$(" #fcw-size #fcw-16 ").click(function() {

$(" .post-body ").css({ fontSize: "16px" });

return false;

});

// Change Font Size -- ends

});

</script>

<!-- TUW Blogger Change Font color and size widget begins -->

<div id="tuw-font-change-widget">

<div class="tuw-fcw">

<h2> Ganti warna tulisan </h2>

<ul id="fcw-color">

<li> <a id="fcw-black" href="#">black</a> </li>

<li> <a id="fcw-white" href="#">green</a> </li>

<li> <a id="fcw-blue" href="#">blue</a> </li>

<li> <a id="fcw-gray" href="#">gray</a> </li>

</ul>

</div>



<div class="tuw-fcw">

<h2> Ganti ukuran tulisan </h2>

<ul id="fcw-size">

<li> <a id="fcw-10" href="#">10</a> </li>

<li> <a id="fcw-12" href="#" title="Default Size">12</a> </li>

<li> <a id="fcw-14" href="#">14</a> </li>

<li> <a id="fcw-16" href="#">16</a> </li>

</ul>

</div>

</div>

<!-- TUW Blogger Change Font color and size widget ends -->

<!-- Code ends -->

Tuesday, January 29, 2013

coculator with java

· 0 comments
     <style>
/*----- Calculator By www.widgetgenerators.blogspot.com ------ */

.btnLogin
{
-moz-border-radius:2px;
-webkit-border-radius:2px;
border-radius:15px;
background:#a1d8f0;
background:-moz-linear-gradient(top, #badff3, #7acbed);
background:-webkit-gradient(linear, center top, center bottom, from(#badff3), to(#7acbed));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#badff3', EndColorStr='#7acbed')";
border:1px solid #7db0cc !important;
cursor: pointer;
padding:11px 16px;
font:bold 11px/14px Verdana, Tahomma, Geneva;
text-shadow:rgba(0,0,0,0.2) 0 1px 0px;
color:#fff;
-moz-box-shadow:inset rgba(255,255,255,0.6) 0 1px 1px, rgba(0,0,0,0.1) 0 1px 1px;
-webkit-box-shadow:inset rgba(255,255,255,0.6) 0 1px 1px, rgba(0,0,0,0.1) 0 1px 1px;
box-shadow:inset rgba(255,255,255,0.6) 0 1px 1px, rgba(0,0,0,0.1) 0 1px 1px;
margin-center:12px;
float:center;
padding:7px 21px;
}

.btnLogin:hover,
.btnLogin:focus,
.btnLogin:active{
background:#a1d8f0;
background:-moz-linear-gradient(top, #7acbed, #badff3);
background:-webkit-gradient(linear, center top, center bottom, from(#7acbed), to(#badff3));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#7acbed', EndColorStr='#badff3')";
}
.btnLogin:active
{
text-shadow:rgba(0,0,0,0.3) 0 -1px 0px;
}
/*----- Calculator By www.widgetgenerators.blogspot.com ------ */
</style>



<script language='JavaScript'>
<!--------------------------------------------------------------------
Memory = "0"; // initialise memory variable
Current = "0"; // and value of Display ("current" value)
Operation = 0; // Records code for eg * / etc.
MAXLENGTH = 30; // maximum number of digits before decimal!

function AddDigit(dig) //ADD A DIGIT TO DISPLAY (keep as 'Current')
{ if (Current.indexOf("!") == -1) //if not already an error
{ if ( (eval(Current) == 0)
&& (Current.indexOf(".") == -1)
) { Current = dig;
} else
{ Current = Current + dig;
};
Current = Current.toLowerCase(); //FORCE LOWER CASE
} else
{ Current = "Hint! Press 'AC'"; //Help out, if error present.
};
if (Current.indexOf("e0") != -1)
{ var epos = Current.indexOf("e");
Current = Current.substring(0,epos+1) + Current.substring(epos+2);
};
if (Current.length > MAXLENGTH)
{ Current = "Aargh! Too long"; //don't allow over MAXLENGTH digits before "." ???
};
document.Calculator.Display.value = Current;
}

function Dot() //PUT IN "." if appropriate.
{
if ( Current.length == 0) //no leading ".", use "0."
{ Current = "0.";
} else
{ if ( ( Current.indexOf(".") == -1)
&&( Current.indexOf("e") == -1)
)
{ Current = Current + ".";
}; };
document.Calculator.Display.value = Current;
}

function DoExponent()
{
if ( Current.indexOf("e") == -1 )
{ Current = Current + "e0";
document.Calculator.Display.value = Current;
};
}

function PlusMinus()
{
if (Current.indexOf("e") != -1)
{ var epos = Current.indexOf("e-");
if (epos != -1)
{ Current = Current.substring(0,1+epos) + Current.substring(2+epos); //clip out -ve exponent
} else
{ epos = Current.indexOf("e");
Current = Current.substring(0,1+epos) + "-" + Current.substring(1+epos); //insert -ve exponent
};
} else
{ if ( Current.indexOf("-") == 0 )
{ Current = Current.substring(1);
} else
{ Current = "-" + Current;
};
if ( (eval(Current) == 0)
&& (Current.indexOf(".") == -1 )
) { Current = "0"; };
};
document.Calculator.Display.value = Current;
}

function Clear() //CLEAR ENTRY
{ Current = "0";
document.Calculator.Display.value = Current;
}

function AllClear() //Clear ALL entries!
{ Current = "0";
Operation = 0; //clear operation
Memory = "0"; //clear memory
document.Calculator.Display.value = Current;
}

function Operate(op) //STORE OPERATION e.g. + * / etc.
{
if (Operation != 0) { Calculate(); }; //'Press "=" if pending operation!
// note that design is not good for showing *intermediate* results.

if (op.indexOf("*") > -1) { Operation = 1; }; //codes for *
if (op.indexOf("/") > -1) { Operation = 2; }; // slash (divide)
if (op.indexOf("+") > -1) { Operation = 3; }; // sum
if (op.indexOf("-") > -1) { Operation = 4; }; // difference

Memory = Current; //store value
// note how e.g. Current.value gives neither error nor value! ***
Current = "";
document.Calculator.Display.value = Current;
}

function Calculate() //PERFORM CALCULATION (= button)
{
if (Operation == 1) { Current = eval(Memory) * eval(Current); };
if (Operation == 2)
{ if (eval(Current) != 0)
{ Current = eval(Memory) / eval(Current)
} else
{ Current = "Aargh! Divide by zero"; //don't allow over MAXLENGTH digits before "." ???
}
};
if (Operation == 3) { Current = eval(Memory) + eval(Current); };
if (Operation == 4) { Current = eval(Memory) - eval(Current); };
Operation = 0; //clear operation
Memory = "0"; //clear memory
Current = Current + ""; //FORCE A STRING!
if (Current.indexOf("Infinity") != -1) //eg "1e320" * 1
{ Current = "Aargh! Value too big";
};
if (Current.indexOf("NaN") != -1) //eg "1e320" / "1e320"
{ Current = "Aargh! I don't understand";
};
document.Calculator.Display.value = Current;
// NOTE: if no operation, nothing changes, Current is left the same!
}

function FixCurrent()
{
Current = document.Calculator.Display.value;
Current = "" + parseFloat(Current);
if (Current.indexOf("NaN") != -1)
{ Current = "Aargh! I don't understand";
};
document.Calculator.Display.value = Current;
}

//--------------------------------------------------------------->
</script>

</head>
<body>

<div align="center"><table width="95%"><tr><td> <!-- OUTER MARGIN -->
<font face="Verdana, Arial, Helvetica">

<div align="center"><table border="0"><tr><td width="15%" align="center"><p>&nbsp;</p>
<div align="center">
<FORM name="Calculator">
<table width="30%" border="4" bgcolor="#809FFE"><tr> <!--OUTER MARGIN OF CALCULATOR-->
<td colspan="2" align="center">

<p><b><font face="Verdana, Arial, Helvetica" color="#00000" size="3">Calculator</font></b><b><font face="Verdana, Arial, Helvetica" color="#00000" size="3"><br>
</font>
<font face="Courier" size="5">
<input type="text" maxlength="40" size="25" name="Display" onChange="FixCurrent()">
</font></b> </p>
</td></tr>
<tr><td width="65%" align="center"> <!--left panel------>

<br><table><tr>
<td><input type="button" class="btnLogin" name="seven" value=" 7 " OnClick="AddDigit('7') "></td>
<td><input type="button" class="btnLogin" name="eight" value=" 8 " OnClick="AddDigit('8')"></td>
<td><input type="button" name="nine" class="btnLogin" value=" 9 " OnClick="AddDigit('9')"></td>
</tr><tr>
<td><input type="button" name="four" class="btnLogin" value=" 4 " OnClick="AddDigit('4')"></td>
<td><input type="button" name="five" class="btnLogin" value=" 5 " OnClick="AddDigit('5')"></td>
<td><input type="button" name="six" class="btnLogin" value=" 6 " OnClick="AddDigit('6')"></td>
</tr><tr>
<td><input type="button" name="one" class="btnLogin" value=" 1 " OnClick="AddDigit('1')"></td>
<td><input type="button" name="two" class="btnLogin" value=" 2 " OnClick="AddDigit('2')"></td>
<td><input type="button" name="three" class="btnLogin" value=" 3 " OnClick="AddDigit('3')"></td>
</tr><tr>
<td><input type="button" name="plusmin" class="btnLogin" value=" +/- " OnClick="PlusMinus()"></td>
<td><input type="button" name="one" class="btnLogin" value=" 0 " OnClick="AddDigit('0')"></td>
<td><input type="button" name="two" class="btnLogin" value=" . " OnClick="Dot()"></td>
</tr>
</table><br/>


</td> <!--end left panel-->
<td width="35%" align="center"> <!--right panel----->

<br><table><tr>
<td><input type="button" name="clear" class="btnLogin" value=" C " OnClick="Clear()"></td>
<td><input type="button" name="AC" class="btnLogin" value=" AC " OnClick="AllClear()"></td>
</tr><tr>
<td><input type="button" name="mul" class="btnLogin" value=" * " OnClick="Operate('*')"></td>
<td><input type="button" name="div" class="btnLogin" value=" / " OnClick="Operate('/')"></td>
</tr><tr>
<td><input type="button" name="add" class="btnLogin" value=" + " OnClick="Operate('+')"></td>
<td><input type="button" name="sub" class="btnLogin" value=" - " OnClick="Operate('-')"></td>
</tr><tr>
<td><input type="button" name="result" class="btnLogin" value=" = " OnClick="Calculate()"></td>
<td align="right"><input type="button" name="exp" class="btnLogin" value=" E X P " OnClick="DoExponent()"></td>
</tr></table><br/>


</td> <!--end right panel-->
</tr></table> <!--END OUTER MARGIN CALC------->
</FORM></div>


  DEMO
<!-- OUTER MARGIN

Calculator




-->