3d时钟特效代码(3d数字时钟)
admin 发布:2022-12-19 03:33 113
本篇文章给大家谈谈3d时钟特效代码,以及3d数字时钟对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
Unity3D数字计时器就是每一秒都换一个数字的那种哪位大神帮忙做一个
using UnityEngine;
using System.Collections;
public class clock : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
//在游戏下面的提示栏显示
print("Current time is: " + System.DateTime.Now);
}
void OnGUI()
{
//在游戏界面中显示
GUI.Box(new Rect(Screen.width/2,Screen.height/2-50,150f,100f),"简易时钟");
GUI.Label(new Rect(Screen.width/2+25,Screen.height/2-10,150f,50f),"Current time is: \n"+" "+System.DateTime.Now.ToLongTimeString());
}
完整的C#代码,给满意哦,亲
FLASH时钟代码
(
粉色FLASH可爱时钟
女生专用
MIni款)
(
简洁数字FLASH时钟版
黑白电子表)
(
玩的就是心跳_视觉FLASH时钟代码
黑色款)
空间水晶FLASH时钟代码)
空间黑色FLASH时钟
旋转特效)
(
按住可拖动的QQ空间时钟FLASH代码
个性ING)
求助,把时钟特效插入下面这串代码中
把下面的这个放在你上面的程序 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
要个简单一点的小时钟代码~
这个是文字时钟代码:
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
3d时钟特效代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于3d数字时钟、3d时钟特效代码的信息别忘了在本站进行查找喔。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-06css特效代码大全1(css字体特效代码)[20240506更新]
- 05-06滚动屏代码(数字滚动屏)[20240506更新]
- 05-06表白css特效代码(html520表白代码)[20240506更新]
- 05-06js页面左右滑动特效代码(js滚动特效)[20240506更新]
- 05-05数字货币最新开源代码(数字货币开源代码公布意味着什么)[20240505更新]
- 05-05bootstrap图片特效代码(bootstrap图标怎么用)[20240505更新]
- 05-05网页动画话图片特效代码(网页文字动画)[20240505更新]
- 05-042015qq秀特效代码(特效代码)[20240504更新]
- 05-03动态网站背景特效代码(网页动态背景源代码)[20240503更新]
- 05-03花瓣网页特效代码(花瓣特效素材)[20240503更新]
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接