導讀:seo建站技術seo建站技術原理:
利用canvas-nest.js腳本實現canvas上繪制的蜂窩狀網站背景,效果可見我的網站,很是有魔性。">
原理:
利用canvas-nest.js腳本實現canvas上繪制的蜂窩狀網站背景,效果可見我的網站,很是有魔性。
特性:
不依賴于 jQuery 和 JavaScript 框架
輕量級,只有 1.66kb 大小
非常容易使用
使用:
1、下載canvas-nest.min.js腳本文件
!?function()?{
????function??o(w,?v,?i)?{
????????return??w.getAttribute(v)?||?i
????}
????function??j(i)?{
????????return??document.getElementsByTagName(i)
????}
????function??l()?{
????????var??i?=?j("script"),
????????????w?=?i.length,
????????????v?=?i[w?-?1];
????????return?{
????????????l:?w,
????????????z:?o(v,?"zIndex",?-1),
????????????o:?o(v,?"opacity",?0.5),
????????????c:?o(v,?"color",?"255,0,0"),
????????????n:?o(v,?"count",?99)
????????}
????}
????function??k()?{
????????r?=?u.width?=?window.innerWidth?||?document.documentElement.clientWidth?||?document.body.clientWidth,?n?=?u.height?=?window.innerHeight?||?document.documentElement.clientHeight?||?document.body.clientHeight
????}
????function??b()?{
????????e.clearRect(0,?0,?r,?n);
????????var??w?=?[f].concat(t);
????????var??x,?v,?A,?B,?z,?y;
????????t.forEach(function(i)?{
????????????i.x?+=?i.xa,?i.y?+=?i.ya,?i.xa?*=?i.x?>?r?||?i.x?<?0???-1?:?1,?i.ya?*=?i.y?>?n?||?i.y?<?0???-1?:?1,?e.fillRect(i.x?-?0.5,?i.y?-?0.5,?1,?1);
????????????for(v?=?0;?v?<?w.length;?v++)?{
????????????????x?=dede5.7模板?w[v];
????????????????if(i?!==?x?&&?null?!==?x.x?&&?null?!==?x.y)?{織夢網站模板
????????????????????B?=?i.x?-?x.x,?z?=?i.y?-?x.y,?y?=?B?*?B?+?z?*?z;
????????????????????y?<?x.max?&&?(x?===?f?&&?y?>=?x.max?/?2?&&?(i.x?-=?0.03?*?B,?i.y?-=?0.03?*?z),?A?=?(x.max?-?y)?/?x.max,?e.beginPath(),?e.lineWidth?=?A?/?2,?e.strokeStyle?=?"rgba("?+?s.c?+?","?+?(A?+?0.2)?+?")",?e.moveTo(i.x,?i.y),?e.lineTo(x.x,?x.y),?e.stroke())
關鍵詞標簽: 網頁 背景 粒子
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-23 ,文章WordPress網頁粒子背景效果分享,seo建站技術主要講述粒子,背景,網頁網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_35669.html