位置: IT常识 - 正文

html表白代码(html表白代码动态)

编辑:rootadmin
html表白代码 目录一.引言二.表白效果展示1.惊喜表白2.烟花表白3.玫瑰花表白4.心形表白5.心加文字6.炫酷的特效三.点赞+收藏+评论找我拿源码(24小时之内回复)一.引言

推荐整理分享html表白代码(html表白代码动态),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:html表白代码大全可复制,html表白代码简单,html表白代码大全简单,html表白代码大全可复制免费,html表白代码步骤,html表白代码大全简单,html表白代码大全简单,html表白代码大全可复制免费,内容如对您有帮助,希望把文章链接给更多的朋友!

我们可以用一下好看的网页来表白,下面就有我觉得很有趣的表白代码。评论直接找我要源码也行。

下载整套表白文件

二.表白效果展示1.惊喜表白

2.烟花表白html表白代码(html表白代码动态)

源码:新建一个文本文档,改后缀名为html,直接双击就行了。(修改中间的字,在代码里有注释,是汉字注释),如果你的有问题,那就直接下载我的源码文件就行。

<!DOCTYPE html><html lang="en" ><head><meta charset="UTF-8"><title>surprised</title><link rel="stylesheet" href="css/style.css"><style>body { margin: 0; background: black;}canvas { position: absolute;}</style></head><body><canvas></canvas><canvas></canvas><canvas></canvas><script type="text/javascript">// CLASSESclass Shard { constructor(x, y, hue) { this.x = x; this.y = y; this.hue = hue; this.lightness = 50; this.size = 15 + Math.random() * 10; const angle = Math.random() * 2 * Math.PI; const blastSpeed = 1 + Math.random() * 6; this.xSpeed = Math.cos(angle) * blastSpeed; this.ySpeed = Math.sin(angle) * blastSpeed; this.target = getTarget(); this.ttl = 100; this.timer = 0; } draw() { ctx2.fillStyle = `hsl(${this.hue}, 100%, ${this.lightness}%)`; ctx2.beginPath(); ctx2.arc(this.x, this.y, this.size, 0, 2 * Math.PI); ctx2.closePath(); ctx2.fill(); } update() { if (this.target) { const dx = this.target.x - this.x; const dy = this.target.y - this.y; const dist = Math.sqrt(dx * dx + dy * dy); const a = Math.atan2(dy, dx); const tx = Math.cos(a) * 5; const ty = Math.sin(a) * 5; this.size = lerp(this.size, 1.5, 0.05); if (dist < 5) { this.lightness = lerp(this.lightness, 100, 0.01); this.xSpeed = this.ySpeed = 0; this.x = lerp(this.x, this.target.x + fidelity / 2, 0.05); this.y = lerp(this.y, this.target.y + fidelity / 2, 0.05); this.timer += 1; } else if (dist < 10) { this.lightness = lerp(this.lightness, 100, 0.01); this.xSpeed = lerp(this.xSpeed, tx, 0.1); this.ySpeed = lerp(this.ySpeed, ty, 0.1); this.timer += 1; } else { this.xSpeed = lerp(this.xSpeed, tx, 0.02); this.ySpeed = lerp(this.ySpeed, ty, 0.02); } } else { this.ySpeed += 0.05; //this.xSpeed = lerp(this.xSpeed, 0, 0.1); this.size = lerp(this.size, 1, 0.05); if (this.y > c2.height) { shards.forEach((shard, idx) => { if (shard === this) { shards.splice(idx, 1); } }); } } this.x = this.x + this.xSpeed; this.y = this.y + this.ySpeed; }}class Rocket { constructor() { const quarterW = c2.width / 4; this.x = quarterW + Math.random() * (c2.width - quarterW); this.y = c2.height - 15; this.angle = Math.random() * Math.PI / 4 - Math.PI / 6; this.blastSpeed = 6 + Math.random() * 7; this.shardCount = 15 + Math.floor(Math.random() * 15); this.xSpeed = Math.sin(this.angle) * this.blastSpeed; this.ySpeed = -Math.cos(this.angle) * this.blastSpeed; this.hue = Math.floor(Math.random() * 360); this.trail = []; } draw() { ctx2.save(); ctx2.translate(this.x, this.y); ctx2.rotate(Math.atan2(this.ySpeed, this.xSpeed) + Math.PI / 2); ctx2.fillStyle = `hsl(${this.hue}, 100%, 50%)`; ctx2.fillRect(0, 0, 5, 15); ctx2.restore(); } update() { this.x = this.x + this.xSpeed; this.y = this.y + this.ySpeed; this.ySpeed += 0.1; } explode() { for (let i = 0; i < 70; i++) { shards.push(new Shard(this.x, this.y, this.hue)); } }}// INITIALIZATIONconst [c1, c2, c3] = document.querySelectorAll('canvas');const [ctx1, ctx2, ctx3] = [c1, c2, c3].map(c => c.getContext('2d'));let fontSize = 200;const rockets = [];const shards = [];const targets = [];const fidelity = 3;let counter = 0;c2.width = c3.width = window.innerWidth;c2.height = c3.height = window.innerHeight;ctx1.fillStyle = '#000';//中间的字改这里const text = '鸡你太美'; let textWidth = 99999999;while (textWidth > window.innerWidth) { ctx1.font = `900 ${fontSize--}px Arial`; textWidth = ctx1.measureText(text).width;}c1.width = textWidth;c1.height = fontSize * 1.5;ctx1.font = `900 ${fontSize}px Arial`;ctx1.fillText(text, 0, fontSize);const imgData = ctx1.getImageData(0, 0, c1.width, c1.height);for (let i = 0, max = imgData.data.length; i < max; i += 4) { const alpha = imgData.data[i + 3]; const x = Math.floor(i / 4) % imgData.width; const y = Math.floor(i / 4 / imgData.width); if (alpha && x % fidelity === 0 && y % fidelity === 0) { targets.push({ x, y }); }}//这里是修改字的颜色ctx3.fillStyle = '#FFF';ctx3.shadowColor = '#FFF';ctx3.shadowBlur = 25;// ANIMATION LOOP(function loop() { ctx2.fillStyle = "rgba(0, 0, 0, .1)"; ctx2.fillRect(0, 0, c2.width, c2.height); //ctx2.clearRect(0, 0, c2.width, c2.height); counter += 1; if (counter % 15 === 0) { rockets.push(new Rocket()); } rockets.forEach((r, i) => { r.draw(); r.update(); if (r.ySpeed > 0) { r.explode(); rockets.splice(i, 1); } }); shards.forEach((s, i) => { s.draw(); s.update(); if (s.timer >= s.ttl || s.lightness >= 99) { ctx3.fillRect(s.target.x, s.target.y, fidelity + 1, fidelity + 1); shards.splice(i, 1); } }); requestAnimationFrame(loop);})();// HELPER FUNCTIONSconst lerp = (a, b, t) => Math.abs(b - a) > 0.1 ? a + t * (b - a) : b;function getTarget() { if (targets.length > 0) { const idx = Math.floor(Math.random() * targets.length); let { x, y } = targets[idx]; targets.splice(idx, 1); x += c2.width / 2 - textWidth / 2; y += c2.height / 2 - fontSize / 2; return { x, y }; }}</script></body></html>3.玫瑰花表白

右侧的空地,点击鼠标就会放烟花,下面的都不放源码了,都在在我的 。下载整套表白文件

4.心形表白

每一次刷新颜色都会不一样,包括中间的字

5.心加文字

6.炫酷的特效

三.点赞+收藏+评论找我拿源码(24小时之内回复)
本文链接地址:https://www.jiuchutong.com/zhishi/295871.html 转载请保留说明!

上一篇:YOLOV5更换轻量级的backbone:mobilenetV2(yolov5使用)

下一篇:vue2中无法监听数组和对象的某些变化问题(vue为什么监听不到对象内部属性)

  • vivo手机怎么关闭上滑快捷栏中心(vivo手机怎么关闭自动下载功能)

    vivo手机怎么关闭上滑快捷栏中心(vivo手机怎么关闭自动下载功能)

  • 小米9街拍模式声音怎么关闭(小米街拍模式怎么静音)

    小米9街拍模式声音怎么关闭(小米街拍模式怎么静音)

  • 华为手机自动扣费怎么关闭(华为手机自动扣费微信怎么关闭)

    华为手机自动扣费怎么关闭(华为手机自动扣费微信怎么关闭)

  • 无线鼠标怎么看充满电(无线鼠标怎么看电量)

    无线鼠标怎么看充满电(无线鼠标怎么看电量)

  • airpods充电线和iphone通用吗(airpods充电线和iphone充电速度一样吗)

    airpods充电线和iphone通用吗(airpods充电线和iphone充电速度一样吗)

  • 手机迅雷怎么没有匹配字幕了(手机迅雷怎么没有下载链接选项)

    手机迅雷怎么没有匹配字幕了(手机迅雷怎么没有下载链接选项)

  • 视频源格式错误请重试是什么原因(视频源格式错误怎么办mp4)

    视频源格式错误请重试是什么原因(视频源格式错误怎么办mp4)

  • 11闪光灯在哪里设置(11闪光灯在哪里关)

    11闪光灯在哪里设置(11闪光灯在哪里关)

  • 电信2g卡怎么升级4g(电信2g卡怎么升级4g套餐会变么)

    电信2g卡怎么升级4g(电信2g卡怎么升级4g套餐会变么)

  • 电脑视频通话对方听不到我声音怎么办

    电脑视频通话对方听不到我声音怎么办

  • a1941和c5198功率多大(a1939和c5196功率多大)

    a1941和c5198功率多大(a1939和c5196功率多大)

  • qq自动回复突然不回复了(qq自动回复突然不回复了怎么办)

    qq自动回复突然不回复了(qq自动回复突然不回复了怎么办)

  • 微信vip会员有什么用(微信会员要收费吗)

    微信vip会员有什么用(微信会员要收费吗)

  • 苹果6s16g内存不够用怎么办(16g苹果6sp内存不足)

    苹果6s16g内存不够用怎么办(16g苹果6sp内存不足)

  • 华硕笔记本充不进去电怎么回事(华硕笔记本充不满电是什么问题)

    华硕笔记本充不进去电怎么回事(华硕笔记本充不满电是什么问题)

  • 显示器ss接口作用(显示器ss线有什么用)

    显示器ss接口作用(显示器ss线有什么用)

  • 蜂窝移动数据什么意思(蜂窝移动数据选项是什么意思)

    蜂窝移动数据什么意思(蜂窝移动数据选项是什么意思)

  • 抖音的收货地址在哪里设置(抖音收货地址怎么填)

    抖音的收货地址在哪里设置(抖音收货地址怎么填)

  • 抖音被限流会通知吗(抖音被限流会通知客户吗)

    抖音被限流会通知吗(抖音被限流会通知客户吗)

  • 已发布的抖音能换音乐吗(已发布的抖音能撤回吗)

    已发布的抖音能换音乐吗(已发布的抖音能撤回吗)

  • vivox9s互传在哪里(vivox9互传在哪里)

    vivox9s互传在哪里(vivox9互传在哪里)

  • vivo系统固件怎么删除(vivo固件更新)

    vivo系统固件怎么删除(vivo固件更新)

  • 为什么别人打我电话总是关机(为什么别人打我微信电话没有声音)

    为什么别人打我电话总是关机(为什么别人打我微信电话没有声音)

  • 华为bacal00是什么型号(华为手机bacal00是什么型号)

    华为bacal00是什么型号(华为手机bacal00是什么型号)

  • Windows11怎么删除开始菜单中的推荐文件部分?(windows11怎么删除临时文件)

    Windows11怎么删除开始菜单中的推荐文件部分?(windows11怎么删除临时文件)

  • 【今日清明】哀悼为抗击新冠肺炎牺牲的烈士和逝世的同胞 (© Luca Flor/Shutterstock)(清明 哀思)

    【今日清明】哀悼为抗击新冠肺炎牺牲的烈士和逝世的同胞 (© Luca Flor/Shutterstock)(清明 哀思)

  • 企业所得税负担变动率
  • 出口退税勾选后多久可以申报退税
  • 发票后面附清单明细能导出吗
  • 小企业会计准则和企业会计准则的区别
  • 企业融资租赁是什么意思
  • 报销筹建期间的房租押金怎么做会计分录?
  • 捐赠利得会计分录
  • 最新企业准则
  • 领备用金时会计怎么做分录
  • 银行里的钱没有了怎么办
  • 销售货物并运输增值税
  • 退货后发票还能拿去抵税吗
  • 2018购房契税税率
  • 劳务派遣企业的规上企业认定标准
  • 工会经费申报网址是什么
  • 增值税专用发票抵扣期限
  • 什么是城市维护费
  • 如何解决windows7无法开机
  • 电脑主板上的电池没电了会怎么样
  • win7电脑怎么开
  • windows10如何关闭安全中心防护
  • 税盘的服务费
  • 家具有限公司
  • 跨区域涉税事项报告表报验流程
  • php 面向对象
  • islp2sta.exe - islp2sta是什么进程 有什么作用
  • 应对怯场的方法
  • wordpress简码怎么用
  • 完美解决索尼电视arc无声音
  • 员工餐费需要附什么凭证
  • 加计扣除的增值税,城建税怎么算
  • php数组按照某个字段排序
  • 坏账准备会计科目使用说明
  • Google I/O 2023 大会上发布了一些令人兴奋的技术和产品,让我们一起来看看吧!
  • 讲讲vue3下会造成响应式丢失的情况
  • declare -i
  • 金蝶系统采购发票
  • 不动产进项税额抵扣从什么时候开始
  • 福利费超过多少交税
  • T-SQL语句修改数据表属性
  • mongodb重置密码
  • 个人代人开普票个税怎么算
  • mysql5.5数据库安装教程
  • 计提和实际发放的区别
  • 企业哪些情况下需要交税
  • 企业现金流量表怎么分析
  • 视同销售包括哪些行为?
  • 长期待摊费用在注会哪一章
  • 私车公用费用报销
  • 材料暂估入库需要什么原始凭证
  • 小微企业的认定由哪个部门负责
  • 存货入库无法查明原因的短缺
  • 自查时发现以前的事情
  • 多打的投资款怎么入账
  • 收付转三种凭证的限制类型不同所以限制科目也不同
  • 收到劳务费发票如何申报个税
  • sql server 触发器
  • sql判断是否存在记录
  • window10总更新是怎么回事
  • linux系统故障及解决方法
  • initcause
  • 电脑删除ie后怎么恢复
  • ssd固态硬盘内部结构图
  • 如何把windowsxp换成windows7
  • redhat下载教程
  • 电脑cf截图保存在哪里
  • linux 如何
  • unity ui图层
  • shell脚本-lt
  • 深入理解两个大计重要论断心得体会
  • js原生dialog
  • node.js + socket.io 实现点对点随机匹配聊天
  • python发送短信到手机
  • Javascript Object.extend
  • javascript获取复选框的值
  • bootstrap jumbotron
  • 捐赠收费吗
  • 电子税务网没开通怎么办
  • 福建地税网
  • 政府对国税局的支持
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设