位置: 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为什么监听不到对象内部属性)

  • 黑莓q10小红书(q10 黑莓)(黑莓q10-1版本)

    黑莓q10小红书(q10 黑莓)(黑莓q10-1版本)

  • 苹果xsmax深色模式在哪里(苹果xsmax深色模式省电吗)

    苹果xsmax深色模式在哪里(苹果xsmax深色模式省电吗)

  • 华为nova6上市日期(华为nova6什么时候上市的,上市价格)

    华为nova6上市日期(华为nova6什么时候上市的,上市价格)

  • 动图保存到手机不动了(动图保存到手机不动了怎么办)

    动图保存到手机不动了(动图保存到手机不动了怎么办)

  • 微信xoxo会有表情掉下来怎么办(微信聊天发xoxo会出现表情)

    微信xoxo会有表情掉下来怎么办(微信聊天发xoxo会出现表情)

  • 网易云有没有电视版本(网易云有没有电视版)

    网易云有没有电视版本(网易云有没有电视版)

  • 抖音明明点了关注等下又没了(抖音明明点了关注却找不到对方)

    抖音明明点了关注等下又没了(抖音明明点了关注却找不到对方)

  • 手机如何充电 才能保证电池使用最长久(手机如何充电好)

    手机如何充电 才能保证电池使用最长久(手机如何充电好)

  • 计算机各种部件相互连接的纽带和桥梁是什么(计算机各种部件相互)

    计算机各种部件相互连接的纽带和桥梁是什么(计算机各种部件相互)

  • 苹果7支持蓝牙5.0吗(苹果7支持蓝牙5.1吗)

    苹果7支持蓝牙5.0吗(苹果7支持蓝牙5.1吗)

  • qq空间对其隐身是什么意思(QQ空间对其隐身访问对方能看到吗)

    qq空间对其隐身是什么意思(QQ空间对其隐身访问对方能看到吗)

  • 微信语音电话静音对方能听到吗(微信语音电话静音了会被看出来)

    微信语音电话静音对方能听到吗(微信语音电话静音了会被看出来)

  • 微信好友辅助发送了没反应(微信好友辅助发送什么)

    微信好友辅助发送了没反应(微信好友辅助发送什么)

  • 微信怎么发长视频给好友10分钟以上(微信怎么发长视频一分钟以上的)

    微信怎么发长视频给好友10分钟以上(微信怎么发长视频一分钟以上的)

  • intel至强e5相当于i几(至强e5性能排行)

    intel至强e5相当于i几(至强e5性能排行)

  • 华为手机怎样清理内存释放空间(华为手机怎样清除浏览过的页面)

    华为手机怎样清理内存释放空间(华为手机怎样清除浏览过的页面)

  • 快手的黑名单有什么用处(快手的黑名单有数量限制吗)

    快手的黑名单有什么用处(快手的黑名单有数量限制吗)

  • 发件箱和已发送邮件的区别(发件箱是发出去了吗)

    发件箱和已发送邮件的区别(发件箱是发出去了吗)

  • word兼容模式如何打印(word兼容模式如何转换)

    word兼容模式如何打印(word兼容模式如何转换)

  • 手机单声道在哪设置(手机单音声道设置在哪)

    手机单声道在哪设置(手机单音声道设置在哪)

  • 新苹果平板怎么激活(新苹果平板怎么用)

    新苹果平板怎么激活(新苹果平板怎么用)

  • 搜狗搜索如何卸载(搜狗搜索怎么卸载)

    搜狗搜索如何卸载(搜狗搜索怎么卸载)

  • 税务师考试科目搭配
  • 公司的现金收入可以直接发工资吗
  • 公司一般户需要年检吗
  • 什么是进口增值税率
  • 眼镜所属行业怎么填写
  • 企业赠送礼品是否涉税
  • 个人经营贷款利率是多少
  • 公司制度奖励怎么写
  • 结转折旧费会计分录
  • 对外来发票金额怎么算
  • 代理进口产品需要什么手续
  • 小规模纳税人咨询费税率
  • 违约金的涉税处理
  • 利润分配可以用现金吗
  • 金蝶标准版期末结转过不去
  • 事业收入和经营收入的联系
  • 企业报表里面利润怎么填
  • 外地预缴增值税可以抵本地增值税
  • 罕见病药品进口要求
  • 什么叫经济作物和粮食作物
  • 合同尾款一般多少
  • Win7系统如何创建宽带连接
  • 在mac上安装ios应用
  • 拆迁货币什么意思
  • 尚未支付的货款用什么凭证
  • ghoststarttrayapp.exe是什么进程 有什么作用 ghoststarttrayapp进程查询
  • 在建工程账务核算方法
  • 记账凭证的总账科目是什么
  • python字符串操作作业
  • 韦罗尼卡
  • 对外投资损失是负债吗
  • 红嘴牛文鸟图片
  • laravel框架关键技术解析
  • 产品报废进项税转出
  • vue引入网络js
  • 生育保险断缴后果
  • 开增值税发票需要和收款账户名字一致吗
  • 销售返利的会计分录处理
  • SQL Server 中 RAISERROR 的用法详细介绍
  • 土地租赁费属于什么收入
  • 收到发票并支付货款怎么做账
  • 房屋维修基金是谁交
  • 出口不退税进项税是否可以抵扣
  • 小规模个人所得税税率表2023年
  • 营业税金及附加包括哪些
  • 工会赞助费
  • 律师费能计入办公费吗合法吗
  • 滞纳金一般什么时候交
  • 弃置费用的摊销计算
  • 公司定额征收需要什么
  • 固定资产折旧的会计凭证
  • 审计测试会计分录怎么做
  • fedora内核版本
  • win10玩魔兽争霸卡顿
  • win7如何创建文件夹
  • 如何解决焦虑的心理
  • win10虚拟机无法安装
  • win7系统安装谷歌浏览器
  • win7服务在哪里打开
  • 任务管理器快捷键ctrl+alt+
  • windows7找不到无线
  • win7系统c盘占用空间大
  • win7系统关机很慢什么原因
  • 对用户输入的判断
  • dos批处理实例
  • unity3d webgl
  • python 入门指南
  • node.js详解
  • 怎样设置安卓等比例显示按钮
  • javascript简介和语法
  • unity at
  • Easyui 之 Treegrid 笔记
  • 国税和地税比例
  • 江苏医保给家人用怎么操作
  • 税控系统减免税报表里
  • 庐山坐缆车上去后还要买门票吗?
  • 上海电子税务平台开票不含税怎么改成含税
  • 允许抵扣和不允许抵扣进项税额的发票种类
  • 什么是非行政许可
  • 广东省国税局局长潘
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设