【编程游戏】贺岁霓虹灯。(参观265楼KiteGirl的霓虹灯,VBScript编写)

本示例通过VBScript实现了一个动态霓虹灯效果,适用于Firefox浏览器。代码利用数学变换和定时更新来创建类似孔雀之舞的动画效果。

【编程游戏】贺岁霓虹灯。(第一名奖励10000可用分)

效果图

评分

参观 [目前Firefox中好使,其他浏览器需复制到本地,存为html文件看效果] <html> <head> <title>K.G Script3D 3.00 - 霓虹灯(孔雀之舞)</title> </head> <body bgcolor="#000000" text="#FFFFFF"> <p id="idText" style="color:rgb(255,255,255)"></p> <p id="idInsertObject"></p> </body> <script languate="VBScript" type="text/VBScript"> '优快云 KiteGirl 原创 Dim pubS_Pix_x, pubS_Pix_y, pubS_Pix_z Dim pubS_Pix_cr, pubS_Pix_cg, pubS_Pix_cb Dim pubD_Mx, pubD_My, pubD_Mz Dim pubD_Rx, pubD_Ry, pubD_Rz Dim pubD_Mtx_Mx, pubD_Mtx_Mr Dim pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubD_Pix_s Dim pubF_Va, pubF_Vd Dim pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc Dim pubV_Mtx_Mx, pubV_Mtx_Mr Dim pubV_Pix_x, pubV_Pix_y, pubV_Pix_z Dim pubElm, pubElm_Len Dim pubWeb_Tv, pubWeb_Tw Dim pubWeb_WW, pubWeb_WH Dim pubWeb_FontSize Dim pubLg Dim pubR, pubG, pubB Dim pubOR, pubOG, pubOB Sub window_onload() MakeModule With document.body pubWeb_WW = .clientWidth pubWeb_WH = .clientHeight End With pubD_Rz = 0 pubD_Rx = 45 pubD_Ry = 0 pubF_Va = 15 pubF_Vd = 40 pubV_Vx = pubWeb_WW / 2 pubV_Vy = pubWeb_WH * 1.2 / 2 pubV_Vz = 0 pubV_Sc = 10 pubWeb_Tw = 33 pubWeb_FontSize = 4 pubD_Mx = 0 pubD_My = 0 pubD_Mz = 0 MTX_3DMixV pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc, pubV_Mtx_Mx, pubV_Mtx_Mr Web_TimeLoop End Sub Sub MakeModule pubElm_Len = 919 pubElm = ELM_Create(pubElm_Len) ReDim pubS_Pix_x(pubElm_Len), pubS_Pix_y(pubElm_Len), pubS_Pix_z(pubElm_Len) ReDim pubS_Pix_cr(pubElm_Len), pubS_Pix_cg(pubElm_Len), pubS_Pix_cb(pubElm_Len) ReDim pubD_Pix_x(pubElm_Len), pubD_Pix_y(pubElm_Len), pubD_Pix_z(pubElm_Len) ReDim pubD_Pix_s(pubElm_Len), pubLg(pubElm_Len) ReDim pubV_Pix_x(pubElm_Len), pubV_Pix_y(pubElm_Len), pubV_Pix_z(pubElm_Len) tH = 100 tR = 0 For tI = 1 To 1500 Step 15 tR = tR + 0.1 tA = tA + (5 / tR * 2 * 3.14) tH = 30 - 5 * tR '2 * tR tAr = Radian(tA) tX = Sin(tAr) * tR * 3 tY = Cos(tAr) * tR * 3 For tZ = Int(tH) To 0 Step -1 pubLg(tAdd) = tZ / (Int(tH) + 1) pubS_Pix_x(tAdd) = tX * (1 + (tZ * tR) ^ 2 / 1000) pubS_Pix_y(tAdd) = tY * (1 + (tZ * tR) ^ 2 / 1000) pubS_Pix_z(tAdd) = tZ tAdd = tAdd + 1 Next Next End Sub Sub Web_TimeLoop() pubD_Rz = Int(Timer * 100 Mod 6000) * 6 / 100 If pubD_Rx > -45 Then pubD_Rx = pubD_Rx - 0.5 pubD_Ry = 0 MTX_3DMixD pubD_Mx, pubD_My, pubD_Mz, pubD_Rx, pubD_Ry, pubD_Rz, pubD_Mtx_Mx, pubD_Mtx_Mr 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 FIT_PSV pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubF_Va, pubF_Vd, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubD_Pix_s 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 For tI = 0 To 10 For tEi = pubElm_Len To 0 Step -1 If CBool(tEi) Then pubS_Pix_cr(tEi) = pubS_Pix_cr(tEi - 1) pubS_Pix_cg(tEi) = pubS_Pix_cg(tEi - 1) pubS_Pix_cb(tEi) = pubS_Pix_cb(tEi - 1) Else ValueMove pubR, pubOR ValueMove pubG, pubOG ValueMove pubB, pubOB If pubR = pubOR And pubB = pubOB And pubG = pubOG Then pubOR = Int(Rnd * 64) + 63 pubOG = Int(Rnd * 64) + 63 pubOB = Int(Rnd * 64) + 63 End If pubS_Pix_cr(tEi) = pubR * 2 pubS_Pix_cg(tEi) = pubG * 2 pubS_Pix_cb(tEi) = pubB * 2 End If Next Next For tEi = pubElm_Len To 0 Step -1 With pubElm(tEi).style .left = pubV_Pix_x(tEi) .top = pubV_Pix_y(tEi) .backgroundcolor = rgb(pubS_Pix_cr(tEi) * pubLg(tEi), pubS_Pix_cg(tEi) * pubLg(tEi), pubS_Pix_cb(tEi) * pubLg(tEi)) .width = pubD_Pix_s(tEi) * pubWeb_FontSize & "px" .height = .width End With Next pubWeb_Tv = window.setTimeout("Web_TimeLoop", pubWeb_Tw) End Sub Sub ValueMove(pV, pVo) If pV < pVo Then pV = pV + 1 If pV > pVo Then pV = pV - 1 End Sub Function ELM_Create(pEn) ReDim tElms(pEn) For tEi = 0 To pEn With document Set tElms(tEi) = .createElement("DIV") .body.insertAdjacentElement "beForeEnd", tElms(tEi) End With With tElms(tEi) .style.position = "absolute" .style.backgroundcolor = rgb(255,255,255) .style.fontsize = 0 .style.width = 10 .style.height = 10 End With Next ELM_Create = tElms End Function Sub PXE_MTXTram2D(pPx(), pPy(), pM(), pMr, oPx(), oPy()) tPe = UBound(pPx) For tPi = 0 To tPe oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pM(2) oPy(tPi) = pPx(tPi) * pM(3) + pPy(tPi) * pM(4) + pM(5) Next End Sub Sub PXE_MTXTram3D(pPx(), pPy(), pPz(), pM(), pMr(), oPx(), oPy(), oPz()) tPe = UBound(pPx) For tPi = 0 To tPe oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pPz(tPi) * pM(2) + pM(3) oPy(tPi) = pPx(tPi) * pM(4) + pPy(tPi) * pM(5) + pPz(tPi) * pM(6) + pM(7) oPz(tPi) = pPx(tPi) * pM(8) + pPy(tPi) * pM(9) + pPz(tPi) * pM(10) + pM(11) Next End Sub Sub FIT_PSV(iPx, iPy, iPz, iVa, iVd, oPx, oPy, oPz, oPs) tPe = UBound(iPx) For tPi = 0 To tPe tVr = Sin(Radian(iVa)) tZ = iPz(tPi) + iVd oPs(tPi) = tVr * tZ / (tVr * iVd) oPx(tPi) = iPx(tPi) * oPs(tPi) oPy(tPi) = iPy(tPi) * oPs(tPi) oPz(tPi) = iPz(tPi) Next End Sub Sub MTX_3DMixD(iMx, iMy, iMz, iRx, iRy, iRz, oMx, oMr) MTX_3DPixMove tMtx_MV, oMr, iMx, iMy, iMz MTX_3DPixRotZ tMtx_RTz, oMr, iRz MTX_3DPixRotX tMtx_RTx, oMr, iRx MTX_3DPixRotY tMtx_RTy, oMr, iRy MTX_Multi tMtx_MV, oMr, tMtx_RTz, oMr, tMx, oMr oMx = tMx MTX_Multi oMx, oMr, tMtx_RTx, oMr, tMx, oMr oMx = tMx MTX_Multi oMx, oMr, tMtx_RTy, oMr, tMx, oMr oMx = tMx End Sub Sub MTX_3DMixV(iVx, iVy, iVz, iSc, oMx, oMr) MTX_3DPixMulti tMtx_SC, oMr, iSc MTX_3DPixMove tMtx_VM, oMr, iVx, iVy, iVz MTX_Multi tMtx_SC, oMr, tMtx_VM, oMr, tMx, oMr oMx = tMx End Sub Sub MTX_3DPixMulti(oM(), oMr, iSc) oMr = 4 ReDim oM(15) oM = Array(iSc, 0, 0, 0, 0, iSc, 0, 0, 0, 0, iSc, 0, 0, 0, 0, 1) End Sub Sub MTX_3DPixMove(oM(), oMr, iMx, iMy, iMz) oMr = 4 ReDim oM(15) oM = Array(1, 0, 0, iMx, 0, 1, 0, iMy, 0, 0, 1, iMz, 0, 0, 0, 1) End Sub Sub MTX_3DPixRotZ(oM(), oMr, iA) oMr = 4 ReDim oM(15) tR = Radian(iA) : tSin = sin(tR) : tCos = cos(tR) oM = Array(tCos, -tSin, 0, 0, tSin, tCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) End Sub Sub MTX_3DPixRotY(oM(), oMr, iA) oMr = 4 ReDim oM(15) tR = Radian(iA) : tSin = sin(tR) : tCos = cos(tR) oM = Array(tCos, 0, tSin, 0, 0, 1, 0, 0, -tSin, 0, tCos, 0, 0, 0, 0, 1) End Sub Sub MTX_3DPixRotX(oM(), oMr, iA) oMr = 4 tR = Radian(iA) tR = Radian(iA) : tSin = sin(tR) : tCos = cos(tR) oM = Array(1, 0, 0, 0, 0, tCos, tSin, 0, 0, -tSin, tCos, 0, 0, 0, 0, 1) End Sub Sub MTX_Multi(iMa(), iMar, iMb(), iMbr, oMc(), oMcr) tN = (iMar = ((UBound(iMb) / iMbr) + 1)) And (iMar - 1) If CBool(tN) Then tM = Ubound(iMa) / iMar tP = iMbr - 1 oMcr = tP + 1 ReDim oMc(oMcr * (tM + 1) - 1) For tMi = 0 To tM For tPi = 0 To tP For tNi = 0 To tN tMv = MTX_VGet(oMc, oMcr, tMi, tPi) + MTX_VGet(iMa, iMar, tMi, tNi) * MTX_VGet(iMb, iMbr, tNi, tPi) MTX_VSet oMc, oMcr, tMi, tPi, tMv Next Next Next End If End Sub Sub MTX_GetByTxt(iT, oM(), oMr) tLs = Split(iT, "|") tLe = Ubound(tLs) For tLi = 0 To tLe Next End Sub Sub MTX_VSet(pM(), pMr, pX, pY, pMv) tMi = pY * pMr + pX pM(tMi) = pMv End Sub Function MTX_VGet(pM(), pMr, pX, pY) tMi = pY * pMr + pX MTX_VGet = pM(tMi) End Function Function Radian(pA) Radian = pA * 71 / 4068 End Function </script> </html>
参观 [目前Firefox中好使,其他浏览器需复制到本地,存为html文件看效果]

(1)普通用户端(全平台) 音乐播放核心体验: 个性化首页:基于 “听歌历史 + 收藏偏好” 展示 “推荐歌单(每日 30 首)、新歌速递、相似曲风推荐”,支持按 “场景(通勤 / 学习 / 运动)” 切换推荐维度。 播放页功能:支持 “无损音质切换、倍速播放(0.5x-2.0x)、定时关闭、歌词逐句滚动”,提供 “沉浸式全屏模式”(隐藏冗余控件,突出歌词与专辑封面)。 多端同步:自动同步 “播放进度、收藏列表、歌单” 至所有登录设备(如手机暂停后,电脑端打开可继续播放)。 音乐发现与管理: 智能搜索:支持 “歌曲名 / 歌手 / 歌词片段” 搜索,提供 “模糊匹配(如输入‘晴天’联想‘周杰伦 - 晴天’)、热门搜索词推荐”,结果按 “热度 / 匹配度” 排序。 歌单管理:创建 “公开 / 私有 / 加密” 歌单,支持 “批量添加歌曲、拖拽排序、一键分享到社交平台”,系统自动生成 “歌单封面(基于歌曲风格配色)”。 音乐分类浏览:按 “曲风(流行 / 摇滚 / 古典)、语言(国语 / 英语 / 日语)、年代(80 后经典 / 2023 新歌)” 分层浏览,每个分类页展示 “TOP50 榜单”。 社交互动功能: 动态广场:查看 “关注的用户 / 音乐人发布的动态(如‘分享新歌感受’)、好友正在听的歌曲”,支持 “点赞 / 评论 / 转发”,可直接点击动态中的歌曲播放。 听歌排行:个人页展示 “本周听歌 TOP10、累计听歌时长”,平台定期生成 “全球 / 好友榜”(如 “好友中你本周听歌时长排名第 3”)。 音乐圈:加入 “特定曲风圈子(如‘古典音乐爱好者’)”,参与 “话题讨论(如‘你心中最经典的钢琴曲’)、线上歌单共创”。 (2)音乐人端(创作者中心) 作品管理: 音乐上传:支持 “无损音频(FLAC/WAV)+ 歌词文件(LRC)+ 专辑封面” 上传,填写 “歌曲信息
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值