节日快到,发几个霓虹灯的脚本助助兴!
第一个:
第一个:
1
<script languate="VBScript" type="text/VBScript">
2
Dim pubS_Pix_x
3
Dim pubS_Pix_y
4
Dim pubS_Pix_z
5
Dim pubS_Pix_cr
6
Dim pubS_Pix_cg
7
Dim pubS_Pix_cb
8
Dim pubD_Mx
9
Dim pubD_My
10
Dim pubD_Mz
11
Dim pubD_Rx
12
Dim pubD_Ry
13
Dim pubD_Rz
14
Dim pubD_Mtx_Mx
15
Dim pubD_Mtx_Mr
16
Dim pubD_Pix_x
17
Dim pubD_Pix_y
18
Dim pubD_Pix_z
19
Dim pubF_Va
20
Dim pubF_Vd
21
Dim pubV_Vx
22
Dim pubV_Vy
23
Dim pubV_Vz
24
Dim pubV_Sc
25
Dim pubV_Mtx_Mx
26
Dim pubV_Mtx_Mr
27
Dim pubV_Pix_x
28
Dim pubV_Pix_y
29
Dim pubV_Pix_z
30
Dim pubElm
31
Dim pubElm_Len
32
Dim pubWeb_Tv
33
Dim pubWeb_Tw
34
Dim pubWeb_WW, pubWeb_WH
35
Dim pubR, pubG, pubB
36
Dim pubOR, pubOG, pubOB
37
'Web DHTML 事件函数
38
Sub window_onload()
39
MakeModule
40
41
With document.body
42
pubWeb_WW = .clientWidth
43
pubWeb_WH = .clientHeight
44
End With
45
pubD_Rz = 0
46
pubD_Rx = 0
47
pubD_Ry = 0
48
pubF_Va = 15
49
pubF_Vd = 20
50
51
pubV_Vx = pubWeb_WW \ 2
52
pubV_Vy = pubWeb_WH \ 3
53
pubV_Vz = 0
54
pubV_Sc = 10
55
pubWeb_Tw = 33
56
MTX_3DMixV pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc, pubV_Mtx_Mx, pubV_Mtx_Mr
57
58
Web_TimeLoop
59
60
End Sub
61
Sub MakeModule
62
pubElm_Len = 599
63
pubElm = ELM_Create(pubElm_Len)
64
ReDim pubS_Pix_x(pubElm_Len), pubS_Pix_y(pubElm_Len), pubS_Pix_z(pubElm_Len)
65
ReDim pubD_Pix_x(pubElm_Len), pubD_Pix_y(pubElm_Len), pubD_Pix_z(pubElm_Len)
66
ReDim pubV_Pix_x(pubElm_Len), pubV_Pix_y(pubElm_Len), pubV_Pix_z(pubElm_Len)
67
ReDim pubS_Pix_cr(pubElm_Len), pubS_Pix_cg(pubElm_Len), pubS_Pix_cb(pubElm_Len)
68
tH = 100
69
tR = 0
70
For tI = 1 To 1500 Step 15
71
tR = tI * 15 / 1500 + 5
72
tA = tA + (1000 / (tR * 2 * 3.14))
73
tZ = 30 - tI * 30 / 1500
74
tAr = Radian(tA)
75
For tRd = Int(tR) To Int(tR) - 5 Step -1
76
tX = Sin(tAr) * tRd
77
tY = Cos(tAr) * tRd
78
pubS_Pix_x(tAdd) = tX
79
pubS_Pix_y(tAdd) = tY
80
pubS_Pix_z(tAdd) = tZ
81
tAdd = tAdd + 1
82
Next
83
Next
84
'MsgBox tAdd
85
pubD_Mx = 0
86
pubD_My = 0
87
pubD_Mz = 0
88
End Sub
89
Sub Web_TimeLoop()
90
pubD_Rz = (pubD_Rz + 1) Mod 360
91
pubD_Rx = 45
92
pubD_Ry = 0
93
MTX_3DMixD pubD_Mx, pubD_My, pubD_Mz, pubD_Rx, pubD_Ry, pubD_Rz, pubD_Mtx_Mx, pubD_Mtx_Mr
94
PXE_MTXTram3D pubS_Pix_x, pubS_Pix_y, pubS_Pix_z, pubD_Mtx_Mx, pubD_Mtx_Mr, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z
95
FIT_PSV pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubF_Va, pubF_Vd, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z
96
PXE_MTXTram3D pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubV_Mtx_Mx, pubV_Mtx_Mr, pubV_Pix_x, pubV_Pix_y, pubV_Pix_z
97
98
For tI = 0 To 5
99
For tEi = pubElm_Len To 0 Step -1
100
If CBool(tEi) Then
101
pubS_Pix_cr(tEi) = pubS_Pix_cr(tEi-1)
102
pubS_Pix_cg(tEi) = pubS_Pix_cg(tEi-1)
103
pubS_Pix_cb(tEi) = pubS_Pix_cb(tEi-1)
104
Else
105
If pubR < pubOR Then pubR = pubR + 1
106
If pubR > pubOR Then pubR = pubR - 1
107
If pubG < pubOG Then pubG = pubG + 1
108
If pubG > pubOG Then pubG = pubG - 1
109
If pubB < pubOB Then pubB = pubB + 1
110
If pubB > pubOB Then pubB = pubB - 1
111
If pubR = pubOR And pubB = pubOB And pubG = pubOG Then
112
pubOR = Int(Rnd * 32) + 31
113
pubOG = Int(Rnd * 32) + 31
114
pubOB = Int(Rnd * 32) + 31
115
End If
116
pubS_Pix_cr(tEi) = pubR*4
117
pubS_Pix_cg(tEi) = pubG*4
118
pubS_Pix_cb(tEi) = pubB*4
119
End If
120
Next
121
Next
122
For tEi = pubElm_Len To 0 Step -1
123
With pubElm(tEi).style
124
.left = pubV_Pix_x(tEi)
125
.top = pubV_Pix_y(tEi)
126
tL = tEi Mod 6 + 1
127
.color = rgb(pubS_Pix_cr(tEi)\tL,pubS_Pix_cg(tEi)\tL,pubS_Pix_cb(tEi)\tL)
128
End With
129
Next
130
131
pubWeb_Tv = window.setTimeout("Web_TimeLoop", pubWeb_Tw)
132
End Sub
133
Function ELM_Create(pEn)
134
ReDim tElms(pEn)
135
For tEi = 0 To pEn
136
With document
137
Set tElms(tEi) = .createElement("SPAN")
138
.body.insertAdjacentElement "beForeEnd", tElms(tEi)
139
End With
140
With tElms(tEi)
141
.innerText = "*"
142
.style.position = "absolute"
143
.style.color = rgb(0,0,0)
144
End With
145
Next
146
ELM_Create = tElms
147
End Function
148
Sub PXE_MTXTram2D(pPx(), pPy(), pM(), pMr, oPx(), oPy())
149
tPe = UBound(pPx)
150
For tPi = 0 To tPe
151
oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pM(2)
152
oPy(tPi) = pPx(tPi) * pM(3) + pPy(tPi) * pM(4) + pM(5)
153
Next
154
End Sub
155
Sub PXE_MTXTram3D(pPx(), pPy(), pPz(), pM(), pMr(), oPx(), oPy(), oPz())
156
tPe = UBound(pPx)
157
For tPi = 0 To tPe
158
oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pPz(tPi) * pM(2) + pM(3)
159
oPy(tPi) = pPx(tPi) * pM(4) + pPy(tPi) * pM(5) + pPz(tPi) * pM(6) + pM(7)
160
oPz(tPi) = pPx(tPi) * pM(8) + pPy(tPi) * pM(9) + pPz(tPi) * pM(10) + pM(11)
161
Next
162
End Sub
163
Sub FIT_PSV(iPx, iPy, iPz, iVa, iVd, oPx, oPy, oPz)
164
tPe = UBound(iPx)
165
For tPi = 0 To tPe
166
tVr = Sin(Radian(iVa))
167
tZ = iPz(tPi) + iVd
168
oPx(tPi) = iPx(tPi) * tVr * tZ / (tVr * iVd)
169
oPy(tPi) = iPy(tPi) * tVr * tZ / (tVr * iVd)
170
oPz(tPi)
<script languate="VBScript" type="text/VBScript">2
Dim pubS_Pix_x3
Dim pubS_Pix_y4
Dim pubS_Pix_z5
Dim pubS_Pix_cr6
Dim pubS_Pix_cg7
Dim pubS_Pix_cb8
Dim pubD_Mx9
Dim pubD_My10
Dim pubD_Mz11
Dim pubD_Rx12
Dim pubD_Ry13
Dim pubD_Rz14
Dim pubD_Mtx_Mx15
Dim pubD_Mtx_Mr16
Dim pubD_Pix_x17
Dim pubD_Pix_y18
Dim pubD_Pix_z19
Dim pubF_Va20
Dim pubF_Vd21
Dim pubV_Vx22
Dim pubV_Vy23
Dim pubV_Vz24
Dim pubV_Sc25
Dim pubV_Mtx_Mx26
Dim pubV_Mtx_Mr27
Dim pubV_Pix_x28
Dim pubV_Pix_y29
Dim pubV_Pix_z30
Dim pubElm31
Dim pubElm_Len32
Dim pubWeb_Tv33
Dim pubWeb_Tw34
Dim pubWeb_WW, pubWeb_WH35
Dim pubR, pubG, pubB36
Dim pubOR, pubOG, pubOB37
'Web DHTML 事件函数38
Sub window_onload()39
MakeModule40
41
With document.body42
pubWeb_WW = .clientWidth 43
pubWeb_WH = .clientHeight 44
End With 45
pubD_Rz = 046
pubD_Rx = 047
pubD_Ry = 0 48
pubF_Va = 1549
pubF_Vd = 2050
51
pubV_Vx = pubWeb_WW \ 252
pubV_Vy = pubWeb_WH \ 353
pubV_Vz = 054
pubV_Sc = 1055
pubWeb_Tw = 3356
MTX_3DMixV pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc, pubV_Mtx_Mx, pubV_Mtx_Mr57
58
Web_TimeLoop59
60
End Sub61
Sub MakeModule62
pubElm_Len = 59963
pubElm = ELM_Create(pubElm_Len)64
ReDim pubS_Pix_x(pubElm_Len), pubS_Pix_y(pubElm_Len), pubS_Pix_z(pubElm_Len)65
ReDim pubD_Pix_x(pubElm_Len), pubD_Pix_y(pubElm_Len), pubD_Pix_z(pubElm_Len)66
ReDim pubV_Pix_x(pubElm_Len), pubV_Pix_y(pubElm_Len), pubV_Pix_z(pubElm_Len)67
ReDim pubS_Pix_cr(pubElm_Len), pubS_Pix_cg(pubElm_Len), pubS_Pix_cb(pubElm_Len)68
tH = 10069
tR = 070
For tI = 1 To 1500 Step 1571
tR = tI * 15 / 1500 + 572
tA = tA + (1000 / (tR * 2 * 3.14))73
tZ = 30 - tI * 30 / 150074
tAr = Radian(tA)75
For tRd = Int(tR) To Int(tR) - 5 Step -176
tX = Sin(tAr) * tRd 77
tY = Cos(tAr) * tRd 78
pubS_Pix_x(tAdd) = tX79
pubS_Pix_y(tAdd) = tY80
pubS_Pix_z(tAdd) = tZ81
tAdd = tAdd + 182
Next83
Next84
'MsgBox tAdd85
pubD_Mx = 086
pubD_My = 087
pubD_Mz = 088
End Sub89
Sub Web_TimeLoop()90
pubD_Rz = (pubD_Rz + 1) Mod 36091
pubD_Rx = 4592
pubD_Ry = 093
MTX_3DMixD pubD_Mx, pubD_My, pubD_Mz, pubD_Rx, pubD_Ry, pubD_Rz, pubD_Mtx_Mx, pubD_Mtx_Mr94
PXE_MTXTram3D pubS_Pix_x, pubS_Pix_y, pubS_Pix_z, pubD_Mtx_Mx, pubD_Mtx_Mr, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z95
FIT_PSV pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubF_Va, pubF_Vd, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z96
PXE_MTXTram3D pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubV_Mtx_Mx, pubV_Mtx_Mr, pubV_Pix_x, pubV_Pix_y, pubV_Pix_z97
98
For tI = 0 To 599
For tEi = pubElm_Len To 0 Step -1100
If CBool(tEi) Then101
pubS_Pix_cr(tEi) = pubS_Pix_cr(tEi-1)102
pubS_Pix_cg(tEi) = pubS_Pix_cg(tEi-1)103
pubS_Pix_cb(tEi) = pubS_Pix_cb(tEi-1)104
Else105
If pubR < pubOR Then pubR = pubR + 1106
If pubR > pubOR Then pubR = pubR - 1107
If pubG < pubOG Then pubG = pubG + 1108
If pubG > pubOG Then pubG = pubG - 1109
If pubB < pubOB Then pubB = pubB + 1110
If pubB > pubOB Then pubB = pubB - 1111
If pubR = pubOR And pubB = pubOB And pubG = pubOG Then 112
pubOR = Int(Rnd * 32) + 31113
pubOG = Int(Rnd * 32) + 31114
pubOB = Int(Rnd * 32) + 31115
End If116
pubS_Pix_cr(tEi) = pubR*4117
pubS_Pix_cg(tEi) = pubG*4118
pubS_Pix_cb(tEi) = pubB*4119
End If120
Next121
Next 122
For tEi = pubElm_Len To 0 Step -1123
With pubElm(tEi).style124
.left = pubV_Pix_x(tEi)125
.top = pubV_Pix_y(tEi)126
tL = tEi Mod 6 + 1127
.color = rgb(pubS_Pix_cr(tEi)\tL,pubS_Pix_cg(tEi)\tL,pubS_Pix_cb(tEi)\tL)128
End With129
Next130
131
pubWeb_Tv = window.setTimeout("Web_TimeLoop", pubWeb_Tw)132
End Sub133
Function ELM_Create(pEn)134
ReDim tElms(pEn)135
For tEi = 0 To pEn136
With document137
Set tElms(tEi) = .createElement("SPAN")138
.body.insertAdjacentElement "beForeEnd", tElms(tEi)139
End With140
With tElms(tEi)141
.innerText = "*"142
.style.position = "absolute"143
.style.color = rgb(0,0,0)144
End With145
Next146
ELM_Create = tElms147
End Function148
Sub PXE_MTXTram2D(pPx(), pPy(), pM(), pMr, oPx(), oPy())149
tPe = UBound(pPx)150
For tPi = 0 To tPe151
oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pM(2)152
oPy(tPi) = pPx(tPi) * pM(3) + pPy(tPi) * pM(4) + pM(5)153
Next154
End Sub155
Sub PXE_MTXTram3D(pPx(), pPy(), pPz(), pM(), pMr(), oPx(), oPy(), oPz())156
tPe = UBound(pPx)157
For tPi = 0 To tPe158
oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pPz(tPi) * pM(2) + pM(3)159
oPy(tPi) = pPx(tPi) * pM(4) + pPy(tPi) * pM(5) + pPz(tPi) * pM(6) + pM(7)160
oPz(tPi) = pPx(tPi) * pM(8) + pPy(tPi) * pM(9) + pPz(tPi) * pM(10) + pM(11)161
Next162
End Sub163
Sub FIT_PSV(iPx, iPy, iPz, iVa, iVd, oPx, oPy, oPz)164
tPe = UBound(iPx)165
For tPi = 0 To tPe166
tVr = Sin(Radian(iVa))167
tZ = iPz(tPi) + iVd168
oPx(tPi) = iPx(tPi) * tVr * tZ / (tVr * iVd)169
oPy(tPi) = iPy(tPi) * tVr * tZ / (tVr * iVd)170
oPz(tPi)
1209

被折叠的 条评论
为什么被折叠?



