個人引導頁+音樂炫酷播放器
- 效果圖
- 部分源碼
- 完整源碼領取
- 下期更新內容
效果圖
部分源碼
//網站動態標題開始
var OriginTitile = document.title,
titleTime;
document.addEventListener("visibilitychange",
function() {if (document.hidden) {document.title = "你別走吖 Σ(っ °Д °;)っ";clearTimeout(titleTime)} else {document.title = "(/≧▽≦/)你又回來啦! " ;titleTime = setTimeout(function() {document.title = OriginTitile},2000)}
});
//網站動態標題結束var t = null;t = setTimeout(time, 50);function time() {clearTimeout(t);dt = new Date();var y = dt.getFullYear();var mt = dt.getMonth() + 1;var day = dt.getDate();var h = dt.getHours();var m = dt.getMinutes();var s = dt.getSeconds();document.querySelector(".showTime").innerHTML =h + "時" + m + "分" + s + "秒";t = setTimeout(time, 1000);}var stop, staticx;var img = new Image();img.src = "https://p1.xywm.ltd/2022/07/31/62e604b42d4cf.webp";function Sakura(x, y, s, r, fn) {this.x = x;this.y = y;this.s = s;this.r = r;this.fn = fn}Sakura.prototype.draw = function(cxt) {cxt.save();var xc = 20 * this.s / 2;cxt.translate(this.x, this.y);cxt.rotate(this.r);cxt.drawImage(img, 0, 0, 20 * this.s, 20 * this.s);cxt.restore()};Sakura.prototype.update = function() {this.x = this.fn.x(this.x, this.y);this.y = this.fn.y(this.y, this.y);this.r = this.fn.r(this.r);if (this.x > window.innerWidth || this.x < 0 || this.y > window.innerHeight || this.y < 0) {this.r = getRandom("fnr");if (Math.random() > 0.4) {this.x = getRandom("x");this.y = 0;this.s = getRandom("s");this.r = getRandom("r")} else {this.x = window.innerWidth;this.y = getRandom("y");this.s = getRandom("s");this.r = getRandom("r")}}};SakuraList = function() {this.list = []};SakuraList.prototype.push = function(sakura) {this.list.push(sakura)};SakuraList.prototype.update = function() {for (var i = 0, len = this.list.length; i < len; i++) {this.list[i].update()}};SakuraList.prototype.draw = function(cxt) {for (var i = 0, len = this.list.length; i < len; i++) {this.list[i].draw(cxt)}};SakuraList.prototype.get = function(i) {return this.list[i]};SakuraList.prototype.size = function() {return this.list.length};
完整源碼領取
關注微信公眾號祖龍科技工作室回復 Pain主頁即可領取源碼https://www.123pan.com/s/ji8kjv-IjPU3.html
下期更新內容
孤客支付系統
- 📢本人公眾號:祖龍科技工作室
- 📢博客主頁:孤客網絡科技工作室官方賬號
- 📢歡迎點贊👍收藏??留言 📝如有錯誤敬請指正!
- 📢本文由孤客原創,若侵權聯系作者,首發于CSDN博客
- 📢停下休息的時候不要忘了別人還在奔跑,希望大家抓緊時間學習,全力奔赴更好的生活💻