السلام عليكم ورحمة الله
{ مـكـتـبـة أكـواد الـجـافـا }
{ الساعات و التاريخ }
ساعة ذات خلفية سوداء
طريقة التركيب
1- انسخ هذا الكود و ضعه في منطقة HEAD
PHP:
<style>
<!--
.styling{
background-color:black;
color:lime;
font: bold 15px MS Sans Serif;
padding: 3px;
}
-->
</style>
PHP:
<div align="center" dir="ltr">
<span id="digitalclock" class="styling"></span>
<script>
/*****************************************
* LCD Clock script- by Javascriptkit
* Translated By www.sakrjava.netfirms.com/
* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use
***********************************************/
<!--
var alternate=0
var standardbrowser=!document.all&&!document.getElementById
if (standardbrowser)
document.write('<form name="tick"><input type="text" name="tock" size="6"></form>')
function show(){
if (!standardbrowser)
var clockobj=document.getElementById? document.getElementById("digitalclock") : document.all.digitalclock
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var dn="AM"
if (hours==12) dn="PM"
if (hours>12){
dn="PM"
hours=hours-12
}
if (hours==0) hours=12
if (hours.toString().length==1)
hours="0"+hours
if (minutes<=9)
minutes="0"+minutes
if (standardbrowser){
if (alternate==0)
document.tick.tock.value=hours+" : "+minutes+" "+dn
else
document.tick.tock.value=hours+" "+minutes+" "+dn
}
else{
if (alternate==0)
clockobj.innerHTML=hours+"<font color='lime'> : </font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"
else
clockobj.innerHTML=hours+"<font color='black'> : </font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"
}
alternate=(alternate==0)? 1 : 0
setTimeout("show()",1000)
}
window.onload=show
//-->
</script></div>
طريقة التركيب
1- أضف هذا المتغير للوسم BODY لتبدو مثل هذه
PHP:
<BODY onLoad="show5()">
PHP:
<span id="liveclock" style="position:absolute;left:0;top:0;">
</span>
<script language="JavaScript">
/* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use */
<!--
function show5(){
if (!document.layers&&!document.all)
return;
var Digital=new Date();
var hours=Digital.getHours();
var minutes=Digital.getMinutes();
var seconds=Digital.getSeconds();
var dn="AM";
if (hours>12){
dn="PM";
hours=hours-12;
}
if (hours==0)
hours=12;
if (minutes<=9)
minutes="0"+minutes;
if (seconds<=9)
seconds="0"+seconds;
//change font size here to your desire
myclock="<font size='5' face='Arial' color= red><b><font size='3'>الساعة تشير إلى</font></br>"+hours+":"+minutes+":"
+seconds+" "+dn+"</b></font>";
if (document.layers){
document.layers.liveclock.document.write(myclock);
document.layers.liveclock.document.close();
}
else if (document.all)
liveclock.innerHTML=myclock;
setTimeout("show5()",1000);
}
//-->
</script>
طريقة التركيب
1- انسخ هذا الكود و ضعه في منطقة HEAD
PHP:
<script language="JavaScript">
/* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use */
<!-- begin script
var ddt1, delay;
function debuteTemps1() {
var hhmmss = " ", mymin, sec;
delay = 1000;
adate = new Date();
hhmmss += adate.getHours();
mymin = adate.getMinutes();
if (mymin < 10) hhmmss += ":0" + mymin;
else hhmmss += ":" + mymin;
sec = adate.getSeconds();
if (sec < 10) hhmmss += ":0" + sec;
else hhmmss += ":" + sec;
hhmmss = " " + hhmmss;
document.Temps11.heure.value = hhmmss;
ddt1 = setTimeout("debuteTemps1(delay)",delay);
}
// end script -->
</script>
PHP:
<BODY onLoad="debuteTemps1()" onUnload="clearTimeout(ddt1)">
PHP:
<form name="Temps11">
<input type="text" name="heure" size="8"><br>
</form>
طريقة التركيب
1- انسخ هذا الكود و ضعه في منطقة HEAD
PHP:
<SCRIPT LANGUAGE="JavaScript">
/* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use */
var timerID = null
var timerRunning = false
function stopclock()
{
if(timerRunning)
clearTimeout(timerID)
timerRunning = false
}
function startclock()
{
stopclock()
showtime()
}
function showtime()
{
var now = new Date()
var hours = now.getHours()
var minutes = now.getMinutes()
var seconds = now.getSeconds()
var timeValue = "" + ((hours > 12) ? hours - 12 : hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? "PM" : "AM"
document.clock.face.value = timeValue
timerID = setTimeout("showtime()",1000)
timerRunning = true
}
//-->
</SCRIPT>
PHP:
<form name="clock" onSubmit="0">
<INPUT TYPE="text" NAME="face" SIZE=11 READONLY VALUE ="....Initializing....">
</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
startclock()
//-->
</SCRIPT>
طريقة التركيب
1- انسخ هذا الكود و ضعه في منطقة BODY
PHP:
<script language="VBScript">
Dim a
Dim min1
Dim hr1
Dim sec1
'Initializes clock and tells it how to behave, when to start animation, etc
Sub window_onload
a = time
min1 = minute(time)
hr1 = hour(time)
if hr1 > 12 then
hr1 = hr1 - 12
end if
sec1 = second(time)
call sgSecondHand.Rotate(0,0,sec1*6 - 90)
call sgMinuteHand.Rotate(0,0,min1*6 - 90)
call sgHourHand.Rotate(0,0,hr1*360/12 - 90)
call seq("Time").Play
end Sub
'Sequencer initilization
Sub Seq_OnInit
Call seq("Time").at(0.000, "SecRot", -1, 1.000, 1)
Call seq("Time").at(60.000, "MinRot", -1, 60.000, 1)
Call seq("Time").at(0.000, "HourRot", -1, 1800.000, 1)
End Sub
'rotates second hand of clock
Sub SecRot
Call sgSecondHand.Rotate(0,0,6)
End Sub
' rotates minute hand of clock
Sub MinRot
Call sgMinuteHand.Rotate(0,0,6)
End Sub
' rotates hour hand of clock
Sub HourRot
Call sgHourHand.Rotate(0,0,15)
End Sub
</script>
<!-- This is the master div, sets over all height, width and positioning-->
<div id="MASTERLAYOUT" STYLE="POSITION:ABSOLUTE;WIDTH:300; HEIGHT:300;TOP:25%;LEFT:25%">
<!-- Div sets positioning of text on clock face, z-index tells it to go in front of background data in master div -->
<div id="divTimeText" STYLE="POSITION:ABSOLUTE; WIDTH:200; HEIGHT:200; TOP:0; LEFT:0;z-index:2">
<br>
<br>
<br>
<p align="center">
<font face="Verdana,Tahoma,Arial" size="5" color="YELLOW">
<BR>
<BR>
</font>
</p>
<!-- Object displays the numbers on the clock face -->
<OBJECT ID="SgNumbers"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE= "POSITION:ABSOLUTE; WIDTH:215; HEIGHT:200; TOP:0; LEFT:0;Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(255, 255, 255)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0004" VALUE="SetFillColor(255,255,255)">
<PARAM NAME="Line0005" VALUE="SetFont('ARIAL',24,650,0,0,0)">
<PARAM NAME="Line0006" VALUE="Text('1',30,-66,0">
<PARAM NAME="Line0007" VALUE="Text('2',60,-36,0">
<PARAM NAME="Line0008" VALUE="Text('3',70,4,0">
<PARAM NAME="Line0009" VALUE="Text('4',60,44,0">
<PARAM NAME="Line0010" VALUE="Text('5',30,74,0">
<PARAM NAME="Line0011" VALUE="Text('6',-10,89,0">
<PARAM NAME="Line0012" VALUE="Text('7',-50,79,0">
<PARAM NAME="Line0013" VALUE="Text('8',-85,44,0">
<PARAM NAME="Line0014" VALUE="Text('9',-95,4,0">
<PARAM NAME="Line0015" VALUE="Text('10',-85,-36,0">
<PARAM NAME="Line0016" VALUE="Text('11',-60,-61,0">
<PARAM NAME="Line0017" VALUE="Text('12',-20,-76,0">
</OBJECT>
</div>
<!-- Creates the clock face , structured graphic-->
<OBJECT ID="sgBackground"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200">
<PARAM NAME="Line0001" VALUE="SetLineStyle(5)">
<PARAM NAME="Line0002" VALUE="SetFillStyle(11)">
<PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0,0,0,255)">
<PARAM NAME="Line0004" VALUE="SetGradientFill(0,0,-100,-100,0)">
<PARAM NAME="Line0005" VALUE="Oval(-100,-100,200,200,0)">
</OBJECT>
<div id="divClock" STYLE="POSITION:ABSOLUTE; WIDTH:200; HEIGHT:200; TOP:0; LEFT:0;">
<!-- Object creates second hand for clock, structured graphic -->
<OBJECT ID="sgSecondHand"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(255, 255, 255)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,255)">
<PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0005" VALUE="Rect(-5,-2,100,4,0)">
</OBJECT>
<!-- Object creates minute hand for clock, structured graphic-->
<OBJECT ID="sgMinuteHand"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(255, 0, 0)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0)">
<PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0005" VALUE="Rect(-5,-3,85,6,0)">
</OBJECT>
<!-- Object creates hour hand for clock, structured graphic -->
<OBJECT ID="sgHourHand"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:ABSOLUTE; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(0, 0, 255)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillColor(0,0,255)">
<PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0005" VALUE="Rect(-5,-3,70,6,0)">
</OBJECT>
</div>
</div>
<!-- Sequencer, controls timing and continuation of clock motion -->
<OBJECT ID="Seq"
CLASSID="CLSID:B0A6BAE2-AAF0-11d0-A152-00A0C908DB96">
</OBJECT>
طريقة التركيب
انسخ هذا الكود و ضعه في المكان الذي تريده في منطقة BODY
PHP:
<form name="where">
<table border="0" width="200" cellspacing="0" cellpadding="3">
<tr>
<td width="100%">
<select name="city" size="1" onchange="updateclock(this);">
<option selected>التوقيت المحلي</option>
<option value="3">السعودية</option>
<option value="4">الإمارات</option>
<option value="3">الكويت</option>
<option value="3">لبنان</option>
<option value="4">عمان</option>
<option value="3">قطر</option>
<option value="3">مصر</option>
<option value="0">المغرب</option>
<option value="1">تونس</option>
<option value="3">السودان</option>
<option value="0">لندن</option>
<option value="1">روما</option>
<option value="7">بانكوك</option>
<option value="8">هونكغ كونغ</option>
<option value="9">طوكيو</option>
<option value="10">سيدني</option>
<option value="12">فوجي</option>
<option value="-10">هاواي</option>
<option value="-8">سان فرانسيسكو</option>
<option value="-5">نيويورك</option>
</select>
</td>
</tr>
<tr>
<td width="100%">
<script language="JavaScript">
/*
Drop Down World Clock- By JavaScript Kit (http://www.javascriptkit.com)
Portions of code by Kurt @ http://www.btinternet.com/~kurt.grigg/javascript
This credit notice must stay intact
Visit our site at http://www.star28.com/ for more code
*/
if (document.all||document.getElementById)
document.write('<span id="worldclock" style="font:bold 16px Arial;"></span><br>')
zone=0;
isitlocal=true;
ampm='';
function updateclock(z){
zone=z.options[z.selectedIndex].value;
isitlocal=(z.options[0].selected)?true:false;
}
function WorldClock(){
now=new Date();
ofst=now.getTimezoneOffset()/60;
secs=now.getSeconds();
sec=-1.57+Math.PI*secs/30;
mins=now.getMinutes();
min=-1.57+Math.PI*mins/30;
hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone);
hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360;
if (hr < 0) hr+=24;
if (hr > 23) hr-=24;
ampm = (hr > 11)?"PM":"AM";
statusampm = ampm.toLowerCase();
hr2 = hr;
if (hr2 == 0) hr2=12;
(hr2 < 13)?hr2:hr2 %= 12;
if (hr2<10) hr2="0"+hr2
var finaltime=hr2+':'+((mins < 10)?"0"+mins:mins)+':'+((secs < 10)?"0"+secs:secs)+' '+statusampm;
if (document.all)
worldclock.innerHTML=finaltime
else if (document.getElementById)
document.getElementById("worldclock").innerHTML=finaltime
else if (document.layers){
document.worldclockns.document.worldclockns2.document.write(finaltime)
document.worldclockns.document.worldclockns2.document.close()
}
setTimeout('WorldClock()',1000);
}
window.onload=WorldClock
//-->
</script>
<!--Place holder for NS4 only-->
<ilayer id="worldclockns" width=100% height=35><layer id="worldclockns2" width=100% height=35 left=0 top=0 style="font:bold 16px Arial;"></layer></ilayer>
</td></tr></table></form>
طريقة التركيب
انسخ هذا الكود و ضعه في المكان الذي تريده في منطقة BODY
PHP:
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
/* Visit our site at http://www.star28.com/ for more code
*********************************************************/
<!-- Begin
Stamp = new Date();
document.write('<font size="2" face="Arial"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '</B></font><BR>');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M ";
}
else {
Time = " A.M ";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>');
// End -->
</SCRIPT>
</CENTER>