位置: 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的深色模式在哪里开)

  • 小米10怎么看是不是三星屏幕(小米10怎么看是三星屏幕还是华星光电屏幕)

    小米10怎么看是不是三星屏幕(小米10怎么看是三星屏幕还是华星光电屏幕)

  • 毒付款后可以退款吗(毒付钱了能不能退了)

    毒付款后可以退款吗(毒付钱了能不能退了)

  • 快手怎么没有我的钱包(快手怎么没有我的高光时刻)

    快手怎么没有我的钱包(快手怎么没有我的高光时刻)

  • 怎么从群里把人踢出去(怎么从群里移除)

    怎么从群里把人踢出去(怎么从群里移除)

  • miad文件夹能删吗(ipad 删除文件)

    miad文件夹能删吗(ipad 删除文件)

  • 抖音的收货地址在哪里修改(怎样删除抖音的收货地址)

    抖音的收货地址在哪里修改(怎样删除抖音的收货地址)

  • 手机看直播发热是怎么回事(手机看直播发热有危险吗)

    手机看直播发热是怎么回事(手机看直播发热有危险吗)

  • qq号双封是什么意思啊(qq双封是什么意思)

    qq号双封是什么意思啊(qq双封是什么意思)

  • 手机淘宝会员名可以改吗(手机淘宝会员名在哪里可以看到)

    手机淘宝会员名可以改吗(手机淘宝会员名在哪里可以看到)

  • nvidia控制面板干什么(nvidia控制面板好不好)

    nvidia控制面板干什么(nvidia控制面板好不好)

  • 华为mate30pro要不要贴膜(华为mate30pro还有必要买吗)

    华为mate30pro要不要贴膜(华为mate30pro还有必要买吗)

  • 联想y9000x什么时候出(联想y9000什么时候出)

    联想y9000x什么时候出(联想y9000什么时候出)

  • 吸顶无线ap怎么安装(吸顶无线ap怎么重启)

    吸顶无线ap怎么安装(吸顶无线ap怎么重启)

  • 电信ipv6什么意思(电信ipv6是什么网络另外收钱吗?)

    电信ipv6什么意思(电信ipv6是什么网络另外收钱吗?)

  • emmc和ufs的区别(ufs与emmc区别)

    emmc和ufs的区别(ufs与emmc区别)

  • qq音乐最近常听怎么改(qq音乐最近常听一直不变)

    qq音乐最近常听怎么改(qq音乐最近常听一直不变)

  • 一加6多少w快充(一加六多少w快充)

    一加6多少w快充(一加六多少w快充)

  • 华为mate20可以装两张电信卡吗(华为mate20可以装联通卡吗)

    华为mate20可以装两张电信卡吗(华为mate20可以装联通卡吗)

  • 屏幕底色变黑怎么去掉(屏幕底色变黑怎么调)

    屏幕底色变黑怎么去掉(屏幕底色变黑怎么调)

  • BIOS的理解以及实现详细介绍(bios详细解释及作用)

    BIOS的理解以及实现详细介绍(bios详细解释及作用)

  • 印花税的账目处理
  • 上市公司收购其他公司要多久
  • 飞机票退票费如何记账
  • 生活服务费发票 经营范围
  • 个体户开运输发票怎么开
  • 支票撕碎了怎么办
  • 财产性收入是非劳动性收入吗
  • 合并报表固定资产抵消通俗理解
  • 企业所得税弥补亏损怎么算
  • 固定资产交换的账务处理
  • 政策减免是什么意思
  • 会议费需要什么资料
  • 金税盘怎么清盘视频
  • 物业管理费属于应付账款吗
  • 发票密码区出来了一点
  • 什么人可以领购房补贴怎么领取
  • 管理费用怎么记忆
  • 销售已使用的固定资产简易计税
  • 包装物租金怎么算
  • safari下载的文件怎么删除
  • 3%征收率减按2%征收增值税怎么算
  • 有限责任公司出资方式有哪些
  • 汇算清缴期业务包括哪些
  • linux的pipe
  • 腾讯电脑管家上的steam可以吗
  • 编制收款凭证的有哪些
  • 错账是什么
  • 其他债权投资减值可以转回吗
  • cakephp菜鸟教程
  • 21年前端面试题
  • spring的aoc和aop
  • 《推荐一个好地方》图书馆
  • 狗能看懂的电视
  • 融资租赁固定资产不属于筹资活动
  • 帝国cms界面
  • 个税申报需要什么资料
  • python中numpy数组和列表的区别
  • sql数据库存储过程怎么写
  • 库存商品转出
  • 暂估入库账务处理举例
  • 什么叫房屋租购同权
  • 发票申领多久才可以批
  • 出口退税申报系统汇率修改
  • 收到银行承兑汇票怎么处理
  • 政府补助收入是指
  • 收到工会经费如何处理
  • 什么是残保金减免政策
  • 内部债权债务的抵消分录
  • 公对公房产过户
  • 需要计提坏账准备吗
  • 其他权益工具是所有者权益类科目吗
  • 猪肉蔬菜是免税农产品吗
  • 固定资产转固流程图
  • 资产损失扣除
  • 海关发票丢失怎么处理
  • 光盘安装系统怎么操作
  • ssd固态硬盘内部结构图
  • ps到底怎么用
  • quickdcf.exe - quickdcf是什么进程 作用是什么
  • info.exe是什么病毒
  • win7系统加内存条怎么设置
  • mysql如何添加外键
  • Coroutine couldn't be started because the the game object 'GameController' is inactive!
  • extjs grid设置某列背景颜色和字体颜色的方法
  • [置顶]星陨计划
  • unity资源包管理器
  • javascript绘制图形
  • php使用js
  • pythion
  • jquery基本知识
  • 烟叶处理
  • 广东国家电子税务全电发票
  • 怎么打印纳税申报单
  • 不予税务行政许可
  • 兼营增值税应税项目和免税项目
  • 地铁发票如何取得
  • 江苏税务缴费小程序
  • 江苏房产税如何计算公式
  • 内蒙古电子税务局登录入口官网
  • 衡阳地税局的地理位置
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设