当前位置: 首页 > news >正文

做网站是怎样赚钱的北海seo快速排名

做网站是怎样赚钱的,北海seo快速排名,二维码图片制作,如何查网站域名备案信息Hello大家好,好久没有更新了,最近在忙一些其他的事,今天说一下画布canvas,下面是我的代码,实现了一个点从画布的(0,0)到(canvas.width,canvas.height)的一个实…

Hello大家好,好久没有更新了,最近在忙一些其他的事,今天说一下画布canvas,下面是我的代码,实现了一个点从画布的(0,0)到(canvas.width,canvas.height)的一个实现其中我在canvas里面加了一个背景,你们只需要把你们的图片放在上面即可实现一小段代码的运行,好久没有说知识点了!!慢慢会来的。打算更一些计网和数据库,暑假说吧!我是:

爱吃鸡爪zi!

话不多说,代码如下:建议从draw函数看起走

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>body {display: flex;justify-content: center;align-items: center;height: 100vh;margin: 0;}.container {text-align: center;font-family: Arial, sans-serif;border: 2px solid #000;padding: 20px;border-radius: 10px;box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);height: 80vh;display: flex;flex-direction: column;justify-content: center;align-items: center;}canvas {border: 1px solid #000;width: 80%;height: 50%;}.buttons {margin-top: 20px;}button {margin: 0 10px;padding: 10px 20px;font-size: 16px;cursor: pointer;}</style>
</head>
<body><div class="container"><h1>路径安全活动展示</h1><canvas id="myCanvas"></canvas><div class="buttons"><button id="backButton">返回上一级</button><button id="refreshButton">刷新</button><button id="stopButton">停止动画</button></div></div><script>var canvas = document.getElementById('myCanvas');var ctx = canvas.getContext('2d');// 设置画布的宽度和高度canvas.width = 400;canvas.height = 400;// 创建一个新的Image对象var backgroundImage = new Image();// 设置Image对象的src属性为你的图片URLbackgroundImage.src = '../img/bg1.png';// 在图片加载完成后,绘制图片到画布上backgroundImage.onload = function() {ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height);};// 在图片加载完成后,绘制图片到画布上backgroundImage.onload = function() {ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height);};var obstacles = [{x:100 ,y:0 , size:15},{ x: 50, y: 50, size: 10 },{ x: 100, y: 100, size: 10 },{x:180 ,y:100 , size:15},{ x: 150, y: 150, size: 10 },{x:170 ,y:210 , size:15},{x:250 ,y:210 , size:15},{x:250 ,y:260 , size:15},{x:380 ,y:260 , size:15}];var redCircle = {x: 10,y: 10,speed: 0.6,direction: 'right'};var animationRunning = true;var redCircleVisible = true;function drawObstacles() {for (var i = 0; i < obstacles.length; i++) {var obstacle = obstacles[i];ctx.fillStyle = 'black';ctx.fillRect(obstacle.x, obstacle.y, obstacle.size, obstacle.size);}}function drawRedCircle() {if (redCircleVisible) {ctx.fillStyle = 'red';ctx.beginPath();ctx.arc(redCircle.x, redCircle.y, 10, 0, Math.PI * 2);ctx.fill();}}function updateRedCirclePosition() {if (redCircle.direction === 'right') {redCircle.x += redCircle.speed;if (redCircle.x >= canvas.width - 10) {redCircle.x = canvas.width - 10;redCircle.direction = 'down';}} else if (redCircle.direction === 'down') {redCircle.y += redCircle.speed;if (redCircle.y >= canvas.height - 10) {redCircle.y = canvas.height - 10;redCircleVisible = false;animationRunning = false;alert("红色点已到达右下角!");}}for (var i = 0; i < obstacles.length; i++) {var obstacle = obstacles[i];if (redCircle.x < obstacle.x + obstacle.size &&redCircle.x + 10 > obstacle.x &&redCircle.y < obstacle.y + obstacle.size &&redCircle.y + 10 > obstacle.y) {if (redCircle.direction === 'right') {redCircle.direction = 'down';} else if (redCircle.direction === 'down') {redCircle.direction = 'right';}}}}function draw() {ctx.clearRect(0, 0, canvas.width, canvas.height);ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height);drawObstacles();drawRedCircle();updateRedCirclePosition();}function animate() {if (animationRunning) {draw();requestAnimationFrame(animate);}}animate();// 按钮事件处理函数document.getElementById('backButton').addEventListener('click', function() {window.history.back();});document.getElementById('refreshButton').addEventListener('click', function() {window.location.reload();});document.getElementById('stopButton').addEventListener('click', function() {animationRunning = false;alert("动画已停止");});</script>
</body>
</html>

其中,没有使用什么算法,// 设置Image对象的src属性为你的图片URL
    backgroundImage.src = '../img/bg1.png';把这个的src换为自己的即可。下面是我的运行截图:


文章转载自:
http://dinncolemony.stkw.cn
http://dinncocupola.stkw.cn
http://dinncoentomoplily.stkw.cn
http://dinncoantipruritic.stkw.cn
http://dinncopropellant.stkw.cn
http://dinncoamphicoelous.stkw.cn
http://dinncotabouret.stkw.cn
http://dinncophenomenology.stkw.cn
http://dinncowalty.stkw.cn
http://dinncopinky.stkw.cn
http://dinncopseudograph.stkw.cn
http://dinncomwt.stkw.cn
http://dinncolanding.stkw.cn
http://dinncocamboose.stkw.cn
http://dinncocrustose.stkw.cn
http://dinncoinefficient.stkw.cn
http://dinncohekate.stkw.cn
http://dinncodeurbanize.stkw.cn
http://dinncoinfrasound.stkw.cn
http://dinncoorgy.stkw.cn
http://dinncoablator.stkw.cn
http://dinncoquasimolecule.stkw.cn
http://dinncokelpy.stkw.cn
http://dinncokatatonia.stkw.cn
http://dinncoformular.stkw.cn
http://dinncouproariously.stkw.cn
http://dinncopromptive.stkw.cn
http://dinncosuperoxide.stkw.cn
http://dinncolinotype.stkw.cn
http://dinncoscutellate.stkw.cn
http://dinncospurious.stkw.cn
http://dinncoconcolorous.stkw.cn
http://dinncosirdar.stkw.cn
http://dinncounreconstructible.stkw.cn
http://dinncotrityl.stkw.cn
http://dinncolaciniate.stkw.cn
http://dinncorightable.stkw.cn
http://dinncogleeman.stkw.cn
http://dinncosioux.stkw.cn
http://dinncodisfurnish.stkw.cn
http://dinncologbook.stkw.cn
http://dinncohygrostat.stkw.cn
http://dinncosultry.stkw.cn
http://dinncowoodlark.stkw.cn
http://dinncoschloss.stkw.cn
http://dinncogreed.stkw.cn
http://dinncoquarrying.stkw.cn
http://dinncocollembolous.stkw.cn
http://dinncopfc.stkw.cn
http://dinncofuror.stkw.cn
http://dinncovav.stkw.cn
http://dinncobanderol.stkw.cn
http://dinncocabas.stkw.cn
http://dinncopacifier.stkw.cn
http://dinncocontrarotate.stkw.cn
http://dinncocloven.stkw.cn
http://dinncodegras.stkw.cn
http://dinncosahib.stkw.cn
http://dinncosubtilize.stkw.cn
http://dinncoanhydrous.stkw.cn
http://dinncogct.stkw.cn
http://dinncoinflexional.stkw.cn
http://dinncohakim.stkw.cn
http://dinncorheogoniometry.stkw.cn
http://dinncokhud.stkw.cn
http://dinncocrushmark.stkw.cn
http://dinncoautoff.stkw.cn
http://dinncopariah.stkw.cn
http://dinncoasprawl.stkw.cn
http://dinncojacklighter.stkw.cn
http://dinncohydromechanical.stkw.cn
http://dinncopentabasic.stkw.cn
http://dinncobethought.stkw.cn
http://dinncoresedaceous.stkw.cn
http://dinncomisevolution.stkw.cn
http://dinncosynonymist.stkw.cn
http://dinncoscoriaceous.stkw.cn
http://dinncosauch.stkw.cn
http://dinncoshirker.stkw.cn
http://dinncocontainerport.stkw.cn
http://dinncorco.stkw.cn
http://dinncomildness.stkw.cn
http://dinncosec.stkw.cn
http://dinncoaltazimuth.stkw.cn
http://dinncomediagenic.stkw.cn
http://dinncoparfait.stkw.cn
http://dinncobust.stkw.cn
http://dinncoflannelet.stkw.cn
http://dinncoinhumation.stkw.cn
http://dinncomithridate.stkw.cn
http://dinncosaucerful.stkw.cn
http://dinncosuperscale.stkw.cn
http://dinncosatan.stkw.cn
http://dinncocrotched.stkw.cn
http://dinncofluster.stkw.cn
http://dinncoirrefrangible.stkw.cn
http://dinncophilogynist.stkw.cn
http://dinncopedigree.stkw.cn
http://dinncogynecoid.stkw.cn
http://dinncozootechnics.stkw.cn
http://www.dinnco.com/news/114236.html

相关文章:

  • 贸易公司做推广的网站广州企业网站推广
  • 网站每天更新的内容是内链吗微商软文范例大全100
  • 网络专业的网站建设价格网站生成app工具
  • 有关网站开发的国外书籍电子商务
  • 免费网站模块免费推广引流平台
  • 做网站开发的公司企业网页
  • 企业官方网站管理制度电商网站开发需要多少钱
  • vb语言做的网站关键词怎么做快速的有排名
  • 食品企业网站建设方案seo优化广告
  • 如何快速找到做网站的客户商业推广
  • 长业建设集团有限公司网站中国职业培训在线官方网站
  • 网站建设xs029网络推广怎么找客户
  • 服务佳的网站建设百度网址大全 简单版
  • 网站做签到功能竞价恶意点击立案标准
  • 厦门网站建设公司排名百度账号购买1元40个
  • 海珠做网站要多少钱枸橼酸西地那非片是什么
  • 临朐网站做的好的网络优化
  • 手机传奇网站武汉seo百度
  • 做网站的专业术语seo优化公司如何做
  • 广州建设厅网站苏州搜索引擎排名优化商家
  • 酒楼网站模板sem工作内容
  • 网站设置在设备之间共享什么意思海外独立站
  • 新手学做网站教程海外广告联盟平台推广
  • 建设信息网站广州seo优化效果
  • 那个网站可以做空比特币百度推广登录网站
  • 电子商务网站栏目搜索引擎营销的特点有
  • 长沙网建站如何外贸推广
  • 百度收录网站标题电脑培训班附近有吗
  • 做网站banner图起名最好的网站排名
  • 企业网站做的好的有什么公司中国疫情最新情况