canvas实现线条发散生长艺术绘画成眼睛效果代码
代码语言:html
所属分类:动画
代码描述:canvas实现线条发散生长艺术绘画成眼睛效果代码
代码标签: canvas 线条 发散 生长 艺术 绘画 眼睛
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html> <html> <head> <meta charset="utf-8"> <style> body { overflow: hidden; } #canvas { position: absolute; top: 0; left: 0; background: black; } </style> </head> <body> <canvas id="canvas"></canvas> <script> const canvas = document.getElementById("canvas"); const ctx = canvas.getContext("2d"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; let centerX = window.innerWidth / 2; let centerY = window.innerHeight / 2; function reportWindowSize() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; let centerX = window.innerWidth / 2; let centerY = window.innerHeight / 2; } window.onresize = reportWindowSize; class Root { constructor(x, y, color, centerX, centerY) { this.x = x; this.y = y; this.color = color; this.speedX = 0; this.speedY = 0;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0