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

  • iphone12重量(iphone12重量是多少克)

    iphone12重量(iphone12重量是多少克)

  • vivo手机闪充模式怎么开启(vivo手机闪充模式怎么关闭)

    vivo手机闪充模式怎么开启(vivo手机闪充模式怎么关闭)

  • 联通短信查询行程轨迹怎么查(联通短信查询行程卡)

    联通短信查询行程轨迹怎么查(联通短信查询行程卡)

  • 怎么下载抖音里的视频(抖音该怎么下载)

    怎么下载抖音里的视频(抖音该怎么下载)

  • e2未通过实名校验,不允许支付是什么意思

    e2未通过实名校验,不允许支付是什么意思

  • 个人订阅号怎么挣钱(个人订阅号怎么转成企业订阅号)

    个人订阅号怎么挣钱(个人订阅号怎么转成企业订阅号)

  • 苹果id和icloud一样吗(苹果apple id和icloud)

    苹果id和icloud一样吗(苹果apple id和icloud)

  • 什么是大数据(什么是大数据分析)

    什么是大数据(什么是大数据分析)

  • 如何彻底删除手机数据不被恢复(如何彻底删除手机里的照片)

    如何彻底删除手机数据不被恢复(如何彻底删除手机里的照片)

  • 苹果快捷指令中心连不上网络(苹果快捷指令中心无法访问)

    苹果快捷指令中心连不上网络(苹果快捷指令中心无法访问)

  • meshgrid在matlab是什么意思(matlab中meshgrid的用法)

    meshgrid在matlab是什么意思(matlab中meshgrid的用法)

  • 图形元件和影片剪辑元件有什么不同(图形元件和影片剪辑元件各自适应什么样的情况)

    图形元件和影片剪辑元件有什么不同(图形元件和影片剪辑元件各自适应什么样的情况)

  • 陌陌为什么禁止添加新关注(陌陌为什么限制和陌生人打招呼)

    陌陌为什么禁止添加新关注(陌陌为什么限制和陌生人打招呼)

  • 手机一亮一暗怎么回事(手机屏幕一亮一暗)

    手机一亮一暗怎么回事(手机屏幕一亮一暗)

  • oppoa11充电呼吸灯在哪里(oppoa79充电时呼吸灯不亮)

    oppoa11充电呼吸灯在哪里(oppoa79充电时呼吸灯不亮)

  • 快手直播违规怎么举报(快手直播违规怎么写申诉)

    快手直播违规怎么举报(快手直播违规怎么写申诉)

  • 京东上的收货是什么意思(京东收货是做什么的)

    京东上的收货是什么意思(京东收货是做什么的)

  • 怎样观看抖音完整视频(抖音怎么看完整的视频)

    怎样观看抖音完整视频(抖音怎么看完整的视频)

  • 小米6内存不够用怎么扩展(小米6内存不够怎么扩容)

    小米6内存不够用怎么扩展(小米6内存不够怎么扩容)

  • wps格式在哪儿(wps里面的格式在哪里)

    wps格式在哪儿(wps里面的格式在哪里)

  • 收货地址怎么改(快手收货地址怎么改)

    收货地址怎么改(快手收货地址怎么改)

  • oppopbdm00是什么机型(oppopbdm00是什么型号)

    oppopbdm00是什么机型(oppopbdm00是什么型号)

  • 苹果手机自动订阅怎么现在取消不了了(苹果手机自动订阅)

    苹果手机自动订阅怎么现在取消不了了(苹果手机自动订阅)

  • jovi收藏的文件在哪里(vivo手机jovi收藏的东西在哪里找到)

    jovi收藏的文件在哪里(vivo手机jovi收藏的东西在哪里找到)

  • 无法充电请咨询售后是什么意思(无法充电请咨询售后修大概多少钱)

    无法充电请咨询售后是什么意思(无法充电请咨询售后修大概多少钱)

  • pqtray.exe - pqtray 是什么进程 有什么用

    pqtray.exe - pqtray 是什么进程 有什么用

  • 阳光照耀下的火山岩山脊,冰岛埃亚菲亚德拉冰盖 (© Erlend Haarberg/Minden Pictures)(阳光照耀下的人)

    阳光照耀下的火山岩山脊,冰岛埃亚菲亚德拉冰盖 (© Erlend Haarberg/Minden Pictures)(阳光照耀下的人)

  • vue项目中常用解决跨域的方法(vue技术解密)

    vue项目中常用解决跨域的方法(vue技术解密)

  • 所得税月度申报
  • 融资租赁印花税怎么交
  • 个人所得税如何查询工资
  • 红字发票抵扣联丢了怎么办
  • 是否独立核算取决于什么
  • 如何做好服务 服务行业
  • 房地产可抵扣的税有哪些
  • 一般纳税人增值税优惠政策
  • 网络服务费属于什么费用
  • 建筑企业购进免税苗木1000元
  • 取得抵债资产的相关税费计入
  • 企业自产自销的成本怎么核算?
  • 货车挂靠企业需要交增值税吗?
  • 建筑业2019年最新税率表
  • 零报税企业怎么做汇算清缴
  • 税控维护费的分录
  • 公司从事房地产有什么好名字
  • 哪些票据可以冲销
  • 企业交残疾人基金会计分录怎么做
  • 核销外管证需要什么手续
  • 利息怎么算的计算公式举例
  • 汇算清缴时交的税怎么算
  • 企业残疾人保障金的缴纳标准
  • 国际代理运费和港杂费一样吗
  • 收到销项负数发票怎么抵扣
  • 电脑开机无法启动怎么解决
  • 报考中级会计师证的条件
  • 冲销上月多记收入
  • win11打不开英雄连2
  • phpadmin官网
  • 预付款指的是
  • Vant UI 中 van-collapse 下拉折叠面板如何默认展开第一项
  • 戈佐西餐厅
  • 稿酬所得怎么交所得税
  • 企业出售房产土地增值税怎么计算
  • 销项税和进项税抵扣的会计分录
  • 应付职工薪酬会产生暂时性差异吗
  • 直接费用的定义
  • 发票密码区如何调整
  • 跨年度收取的发票怎么开
  • 常见反爬策略
  • raisecom删除命令
  • 工资和社保基数不一致
  • 公司车辆固定资产转移税
  • 售价金额核算法的优点有
  • 哪些费用进项税额要转出
  • mysql命令大小写
  • 利润与利润率之差公式
  • 企业所得税计提的准备金可以扣除吗
  • 对公账户收钱要手续费吗
  • 人工费用和制造费用的约当产量
  • 出差的住宿费能抵扣吗
  • 收款预缴增值税怎么做账
  • 个体工商户的个税起征点
  • 开发成本存货怎么算
  • 个人应如何进行社会实践
  • 应交税金—应交增值税(进项税额)
  • 业务招待费礼品要扣个税吗
  • 技术服务费怎么做分录
  • 上次年检怎么查
  • 财务费用包括哪些费用
  • 建账的基本要求
  • sql server的go
  • Win10一键永久激活数字工具
  • winxp系统安装教程
  • vista ui
  • 电脑关机没反应怎么办出现一个对话框
  • 在windowsxp的应用程序中,经常有一些菜单选项呈暗灰色
  • mac不小心把硬盘删了怎么办
  • vc6.0安装教程win8
  • unity3d入门视频教程
  • node.js的理解
  • 契税减免优惠政策2023年最新
  • 机票的抵扣率是多少
  • 苏州峰谷电怎么申请
  • 税务人的形象
  • 怎么查个税交了多久
  • 医生算是公务员吗?
  • 发票是去国税还是地税
  • 什么是财务舞弊行为
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设