当前位置:首页 > 编程知识 > 正文内容

黑客炫酷时钟代码(电脑炫酷时钟代码)

hacker2年前 (2022-07-06)编程知识73

本文目录一览:

要个简单一点的小时钟代码~

这个是文字时钟代码:

script

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){

var mydate=new Date()

var year=mydate.getYear()

if (year 1000)

year+=1900

var day=mydate.getDay()

var month=mydate.getMonth()

var daym=mydate.getDate()

if (daym10)

daym="0"+daym

var hours=mydate.getHours()

var minutes=mydate.getMinutes()

var seconds=mydate.getSeconds()

var dn="AM"

if (hours=12)

dn="PM"

if (hours12){

hours=hours-12

}

if (hours==0)

hours=12

if (minutes=9)

minutes="0"+minutes

if (seconds=9)

seconds="0"+seconds

//change font size here

var cdate="smallfont color='000000' face='Arial'b"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn

+"/b/font/small"

if (document.all)

document.all.clock.innerHTML=cdate

else

document.write(cdate)

}

if (!document.all)

getthedate()

function goforit(){

if (document.all)

setInterval("getthedate()",1000)

}

/script

body onload="goforit()"

span id="clock"/span

求助,把时钟特效插入下面这串代码中

把下面的这个放在你上面的程序 body时钟代码放这里面/body你还少了一个/html

!-- cool clock --

SCRIPT language=JavaScriptdCol='000099';//date colour.

fCol='668099';//face colour.

sCol='FF0000';//seconds colour.

mCol='000000';//minutes colour.

hCol='000000';//hours colour.

ClockHeight=40;

ClockWidth=40;

ClockFromMouseY=0;

ClockFromMouseX=100;

//Alter nothing below! Alignments will be lost!

d=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");

m=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");

date=new Date();

day=date.getDate();

year=date.getYear();

if (year 2000) year=year+1900;

TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;

D=TodaysDate.split('');

H='...';

H=H.split('');

M='....';

M=M.split('');

S='.....';

S=S.split('');

Face='1 2 3 4 5 6 7 8 9 10 11 12';

//font='Arial';

font='Verdana';

size=1;

speed=0.6;

ns=(document.layers);

ie=(document.all);

Face=Face.split(' ');

n=Face.length;

a=size*10;

ymouse=0;

xmouse=0;

scrll=0;

props="font face="+font+" size="+size+" color="+fCol+"B";

props2="font face="+font+" size="+size+" color="+dCol+"B";

Split=360/n;

Dsplit=360/D.length;

HandHeight=ClockHeight/4.5

HandWidth=ClockWidth/4.5

HandY=-7;

HandX=-2.5;

scrll=0;

step=0.06;

currStep=0;

y=new Array();x=new Array();Y=new Array();X=new Array();

for (i=0; i n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}

Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();

for (i=0; i D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}

if (ns){

for (i=0; i D.length; i++)

document.write('layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'center'+props2+D[i]+'/font/center/layer');

for (i=0; i n; i++)

document.write('layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'center'+props+Face[i]+'/font/center/layer');

for (i=0; i S.length; i++)

document.write('layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15font face=Arial size=3 color='+sCol+'centerb'+S[i]+'/b/center/font/layer');

for (i=0; i M.length; i++)

document.write('layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15font face=Arial size=3 color='+mCol+'centerb'+M[i]+'/b/center/font/layer');

for (i=0; i H.length; i++)

document.write('layer name=nsHours'+i+' top=0 left=0 width=15 height=15font face=Arial size=3 color='+hCol+'centerb'+H[i]+'/b/center/font/layer');

}

if (ie){

document.write('div id="Od" style="position:absolute;top:0px;left:0px"div style="position:relative"');

for (i=0; i D.length; i++)

document.write('div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center"'+props2+D[i]+'/B/font/div');

document.write('/div/div');

document.write('div id="Of" style="position:absolute;top:0px;left:0px"div style="position:relative"');

for (i=0; i n; i++)

document.write('div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center"'+props+Face[i]+'/B/font/div');

document.write('/div/div');

document.write('div id="Oh" style="position:absolute;top:0px;left:0px"div style="position:relative"');

for (i=0; i H.length; i++)

document.write('div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold"'+H[i]+'/div');

document.write('/div/div');

document.write('div id="Om" style="position:absolute;top:0px;left:0px"div style="position:relative"');

for (i=0; i M.length; i++)

document.write('div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold"'+M[i]+'/div');

document.write('/div/div')

document.write('div id="Os" style="position:absolute;top:0px;left:0px"div style="position:relative"');

for (i=0; i S.length; i++)

document.write('div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold"'+S[i]+'/div');

document.write('/div/div')

}

(ns)?window.captureEvents(Event.MOUSEMOVE):0;

function Mouse(evnt){

ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;

xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;

}

(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

function ClockAndAssign(){

time = new Date ();

secs = time.getSeconds();

sec = -1.57 + Math.PI * secs/30;

mins = time.getMinutes();

min = -1.57 + Math.PI * mins/30;

hr = time.getHours();

hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;

if (ie){

Od.style.top=window.document.body.scrollTop;

Of.style.top=window.document.body.scrollTop;

Oh.style.top=window.document.body.scrollTop;

Om.style.top=window.document.body.scrollTop;

Os.style.top=window.document.body.scrollTop;

}

for (i=0; i n; i++){

var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;

F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;

F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);

}

for (i=0; i H.length; i++){

var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;

HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;

HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);

}

for (i=0; i M.length; i++){

var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;

ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;

ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);

}

for (i=0; i S.length; i++){

var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;

SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;

SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);

}

for (i=0; i D.length; i++){

var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;

DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;

DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);

}

currStep-=step;

}

function Delay(){

scrll=(ns)?window.pageYOffset:0;

Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);

Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);

for (i=1; i D.length; i++){

Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);

Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);

}

y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);

x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);

for (i=1; i n; i++){

y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);

x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);

}

ClockAndAssign();

setTimeout('Delay()',10);

}

if (ns||ie)window.onload=Delay;

/SCRIPT

谁知道一些个性时钟的代码?告诉我几个,拜托!

有一个c 的:

#includemath.h

#includedos.h

#includegraphics.h

#define CENTERX 320 /*表盘中心位置*/

#define CENTERY 175

#define CLICK 100 /*喀嗒声频率*/

#define CLICKDELAY 30 /*喀嗒声延时*/

#define HEBEEP 10000 /*高声频率*/

#define LOWBEEP 500 /*低声频率*/

#define BEEPDELAY 200 /*报时声延时*/

/*表盘刻度形状*/

int Mrk_1[8]={-5,-160,5,-160,5,-130,-5,-130, };

int Mrk_2[8]={-5,-160,5,-160,2,-130,-2-130, };

/*时针形状*/

int HourHand[8]={-3,-100,3,-120,4, 10,-4,10};

/*分针形状*/

int MiHand[8]={-3,-120,3,-120,4, 10,-4,10};

/*秒针形状*/

int SecHand[8]={-2,-150,2,-150,3, 10,-3,10};

/*发出喀嗒声*/

void Click()

{

sound(CLICK);

delay(CLICKDELAY);

nosound();

}

/*高声报时*/

void HighBeep()

{

sound(HEBEEP);

delay(BEEPDELAY);

nosound;

}

/*低声报时*/

void LowBeep()

{

sound(LOWBEEP);

}

/*按任意角度画多边形*/

void DrawPoly(int *data,int angle,int color)

{

int usedata[8];

float sinang,cosang;

int i;

sinang=sin((float)angle/180*3.14);

cosang=cos((float)angle/180*3.14);

for(i=0;i8;i+=2)

{

usedata[i] =CENTERX+ cosang*data[i]-sinang*data[i+1]+.5;

usedata[i+1]=CENTERY+sinang*data[i]+cosang*data[i+1]+.5;

}

setfillstyle(SOLID_FILL,color);

fillpoly(4,usedata);

}

/*画表盘*/

void DrawClock(struct time *cutime)

{

int ang;

float hourrate,minrate,secrate;

setbkcolor(BLUE);

cleardevice();

setcolor(WHITE);

/* 画刻度*/

for(ang=0;ang360;ang+=90)

{

DrawPoly(Mrk_1,ang,WHITE);

DrawPoly(Mrk_2,ang+30,WHITE);

DrawPoly(Mrk_2,ang+60,WHITE);

}

secrate=(float)cutime-ti_sec/60;

minrate=((float)cutime-ti_min+secrate)/60;

hourrate=(((float)cutime-ti_hour/12)+minrate)/12;

ang=hourrate*360;

DrawPoly(HourHand,ang,YELLOW);/*画时针*/

ang=minrate*360;

DrawPoly(MiHand,ang, GREEN);/*画分针*/

ang=secrate*360;

DrawPoly(SecHand,ang, RED);/*画秒针*/

}

main()

{

int gdriver=EGA,

gmode=EGAHI;

int curpage;

struct time curtime ,newtime ;

initgraph(gdriver,gmode,"c:\\tc");

setbkcolor(BLUE);

cleardevice();

gettime(curtime);

curpage=0;

DrawClock(curtime);

while(1)

{

if(kbhit())

break; /*按任意键退出*/

gettime(newtime); /*检测系统时间*/

if(newtime.ti_sec!=curtime.ti_sec)/*每1秒更新一次时间*/

{

if(curpage==0)

curpage=1;

else

curpage=0;

curtime=newtime;

/*设置绘图页*/

setactivepage(curpage);

/*在图页上画表盘*/

DrawClock(curtime);

/*设置绘图页为当前可见页*/

setvisualpage(curpage);

/*0分0秒高声报时*/

if(newtime.ti_min==0newtime.ti_sec==0)

HighBeep();

/* 59分55至秒时低声报时*/

else if(newtime.ti_min==59

newtime.ti_sec=59)

LowBeep();/*其他时间只发出喀嗒声*/

else

Click();

}

}

closegraph();

}

时钟代码

回答:lillianrock

新手

6月21日 14:57 地址 ttp://

代码 BREMBED src="时钟地址" type="application/x-shockwave- fash" width="180" height="180"/EMBEDBR

把以上一个地址复制--粘贴到地址栏中,然后按回车观看效果,看完一个,改变"clock1"中的数字,140个时钟,找到自己喜欢的了,把地址覆盖粘贴在上面代码中"时钟地址"上,然后把整理好的代码粘贴在一个新建立的模块中就好了!

欢迎来我的博客

用c++编写一个时钟的代码

这里是148款精美时钟代码

flash时钟,时钟,qq空间时钟代码,透明flash时钟

以下是flash时钟代码:(博客flash时钟库)

object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="" width="300" height="200"

param name="movie" value="flash时钟地址"

param name="quality" value="high"

embed src="d" quality="high" pluginspage="" type="application/x-shockwave-flash"/embed

/object

说明:(手动插入必看)

1、width=300,height=300为flash文件的宽度和高度,你可以自定修改

2、flash时钟地址,是flash文件地址,复制以下任一地址都行,如:/free/UploadFiles_2504/clock/clock1.swf

flash时钟下载, 下载方法:(请用“右键-目标另存为”方式下载,或是使用下载工具)

下面为您提供一些时钟地址,效果见FLASH栏目里的“时钟样式”专辑,也可以直接点击下面的网址查看效果。您可以对照选择您喜欢的样式。

时钟1:/free/UploadFiles_2504/clock/clock1.swf

时钟2:/free/UploadFiles_2504/clock/clock2.swf

时钟3:/free/UploadFiles_2504/clock/clock3.swf

时钟4:/free/UploadFiles_2504/clock/clock4.swf

时钟5:/free/UploadFiles_2504/clock/clock5.swf

时钟6:/free/UploadFiles_2504/clock/clock6.swf

时钟7:/free/UploadFiles_2504/clock/clock7.swf

时钟8:/free/UploadFiles_2504/clock/clock8.swf

时钟9:/free/UploadFiles_2504/clock/clock9.swf

时钟10:/free/UploadFiles_2504/clock/clock10.swf

时钟11:/free/UploadFiles_2504/clock/clock11.swf

时钟12:/free/UploadFiles_2504/clock/clock12.swf

时钟13:/free/UploadFiles_2504/clock/clock13.swf

时钟14:/free/UploadFiles_2504/clock/clock14.swf

时钟15:/free/UploadFiles_2504/clock/clock15.swf

时钟16:/free/UploadFiles_2504/clock/clock16.swf

时钟17:/free/UploadFiles_2504/clock/clock17.swf

时钟18:/free/UploadFiles_2504/clock/clock18.swf

时钟19:/free/UploadFiles_2504/clock/clock19.swf

时钟20:/free/UploadFiles_2504/clock/clock20.swf

时钟21:/free/UploadFiles_2504/clock/clock21.swf

时钟22:/free/UploadFiles_2504/clock/clock22.swf

时钟23:/free/UploadFiles_2504/clock/clock23.swf

时钟24:/free/UploadFiles_2504/clock/clock24.swf

时钟25:/free/UploadFiles_2504/clock/clock25.swf

时钟26:/free/UploadFiles_2504/clock/clock26.swf

时钟27:/free/UploadFiles_2504/clock/clock27.swf

时钟28:/free/UploadFiles_2504/clock/clock28.swf

时钟29:/free/UploadFiles_2504/clock/clock29.swf

时钟30:/free/UploadFiles_2504/clock/clock30.swf

时钟31:/free/UploadFiles_2504/clock/clock31.swf

时钟32:/free/UploadFiles_2504/clock/clock32.swf

时钟33:/free/UploadFiles_2504/clock/clock33.swf

时钟34:/free/UploadFiles_2504/clock/clock34.swf

时钟35:/free/UploadFiles_2504/clock/clock35.swf

时钟36:/free/UploadFiles_2504/clock/clock36.swf

时钟37:/free/UploadFiles_2504/clock/clock37.swf

时钟38:/free/UploadFiles_2504/clock/clock38.swf

时钟39:/free/UploadFiles_2504/clock/clock39.swf

时钟40:/free/UploadFiles_2504/clock/clock40.swf

扫描二维码推送至手机访问。

版权声明:本文由万物知识分享发布,如需转载请注明出处。

本文链接:http://qmsspa.com/58506.html

分享给朋友:

“黑客炫酷时钟代码(电脑炫酷时钟代码)” 的相关文章

百度有哪些小细节对网站优化有帮助?

百度有哪些小细节对网站优化有帮助?

作搜索引擎优化 的皆 晓得,搜刮 引擎算法更新频仍 ,尤为是baidu搜刮 , 二0 二 二年更新了许多 次。 二0 二 二年去了,没有 晓得会涌现 甚么算法,然则 baidu的产物 愈来愈多。baidu爱买、竞价告白 、百野号、百科、baidu 晓得、baidu小法式 、baidu聚拢等许多 产...

有书声音变现训练营靠谱吗(张驰声音变现训练营是真的吗)

有书声音变现训练营靠谱吗(张驰声音变现训练营是真的吗)

互联网人无处没有正在,尔从开端 作媒体便养成为了一个风俗 。常常 来各类 仄台搜刮 异范畴 做者,相识 他们的经营思绪 。 昨早正在怒马推俗山逛了一圈,搜刮 症结 词后,随机挨谢了一个音频。听到 对于圆的声音,尔赶忙来看他的主页,果真 是嫩城!尔有一个没有是专长 的专长 ,便是尔否以经由过程...

国外调查网赚教程三(技巧篇)

外洋 查询拜访 学程(三)一技能 篇上面总结一点儿多见的筛选题一、平易近 族,正常选西班牙/推丁族,假如 涌现 正在查询拜访 最初的统计外,这便否以随意 选,然则 正在最前里的筛选发起 选西班牙有时刻 出有选西班牙的,以下〇乌人或者非商美国人〇皂色或者下添索人〇亚商或者宁靖 洋岛平易近 〇美洲本居民...

杭州seo网络推广产品服务(杭州seo推广公司有哪些费用)

杭州seo网络推广产品服务(杭州seo推广公司有哪些费用)

杭州网站搜索引擎优化 拉广的感化 有哪些?对付 那个答题,许多 企业没有是很清晰 ,杭州网站搜索引擎优化 拉广的利益 有许多 ,好比 如下几点: 1、取同业 的合作外占领先机 如今 的互联网合作剧烈 ,咱们时刻不克不及 松弛 ,假如...

深圳自考双证本科(深圳自考本科双证)

深圳自考双证本科(深圳自考本科双证)

点击下面的蓝色文字追随 咱们。 px;box-sizing: border-box;max-width:  一00% !important; 八 二 二 一; powered-by= 八 二 二 一;xmyeditor.com 八 二 二 一; data-md 五= 八 二 二 一; 一f 一 ...

今日头条职业认证怎么样才能加v(今日头条实名认证可以认证几个号)

昨天头条私司注册认证运用经营望频学程课程分享,正在微疑民间账号宋九暂开端 。 本日 头条是一个通用的疑息仄台,致力于衔接 人取疑息,使下量质、丰硕 的疑息可以或许 下效、精确 天分领,推进 疑息发明 代价 。也是媒体止业弗成 或者缺的仄台之一,分享做者宋九暂。 望频课程包含 创做技能 、账...

评论列表

森槿纵遇
2年前 (2022-07-06)

,-160,5,-160,5,-130,-5,-130, };int Mrk_2[8]={-5,-160,5,-160,2,-130,-2-130, };/*时针形状*/int HourHand[8]={-3,-100,3,-120,4, 10,-4,10};/*分针形状*/int MiHand[

余安劣戏
2年前 (2022-07-06)

top=window.document.body.scrollTop;Os.style.top=window.document.body.scrollTop;}for (i=0; i n; i++){ var F=(ns

纵遇婳悕
2年前 (2022-07-07)

.write('layer name=nsHours'+i+' top=0 left=0 width=15 height=15font face=Arial size=3 color='+hCol+'centerb'

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。