七夕特效惊艳全场!HTML+CSS带你DIY酷炫表白神器

简介: 七夕特效惊艳全场!HTML+CSS带你DIY酷炫表白神器

效果





部分HTML:

<canvas id="c" style="position: absolute;z-index: -1;text-align: center;height:100vh;top:0;left:0;width:100%"></canvas> 
<div onclick=star() style="position: absolute;top: 200px;width: 100%;cursor: pointer;text-align:center;font-size:20px;font-weight:bold;z-index:9990"><h1 class="svoiceIcon">你知道吗,等待是最长情的告白♥</h1></div>
<div class="wrap">
</div>
<div style="position:absolute;width:100%;left:0;bottom:0">
</div>
<div class="star"><div class="heart animated"></div></div>

CSS部分

body,html{
margin:0;padding:0;
overflow:hidden
}
.svoiceIcon{
  animation-name:colorswitchs;
  animation-duration: 3s; /*动画时间*/
  animation-fill-mode: both; /*播放后的状态*/
  animation-iteration-count: infinite; /*动作循环的次数:infinite 无限循环*/
}
@keyframes colorswitchs {
  0% {
    color: #0087C9
  }
 
  20% {
    color: #EF4A53
  }
  40% {
    color: #804cfa
  }
  60% {
    color: #FFB463
  }
 
  80% {
    color: #33D5D4
  }
  100% {
    color: #0087C9
  }
}
.star{
  width: 100%;
  position: fixed;
  left: 0;
  top: 40vh;
  display:none;
  z-index:9991
}
/*心跳开始 */
.heart{
   width: 200px;
   height: 200px;
   background: #f00;
   position: relative;
   filter:drop-shadow(0px 0px 20px rgb(255,20,20));
   transform: rotate(45deg);
   margin: 20px auto;
}
.heart{
  animation-name:heartbeat;
  animation-duration: 1s; /*动画时间*/
  animation-fill-mode: both; /*播放后的状态*/
  animation-iteration-count: infinite; /*动作循环的次数:infinite 无限循环*/
}
.heart:before, .heart:after{
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: #f00;
    border-radius: 100px;
}
.heart:before{
   left: -100px;
}
.heart:after{
   left: 0;
   top: -100px;
}
@keyframes heartbeat{
    0%{transform: rotate(45deg) scale(0.8,0.8); opacity: 1;}
    25%{transform: rotate(45deg) scale(1,1); opacity: 0.8;}
    100%{transform: rotate(45deg) scale(0.8,0.8); opacity: 1;}
}
/* 心跳结束 */
.music{
  position: fixed;
  right: 4%;
  top: 2%;
  width: 120px;
  height: 120px;
  z-index: 999999;
  opacity:0.5
}
.musicRotate{
  animation-name:musicrotate;
  animation-duration: 4s; /*动画时间*/
  animation-timing-function:linear;
  -webkit-animation-timing-function:linear; /* Safari 和 Chrome */
  animation-fill-mode: both; /*播放后的状态*/
  animation-iteration-count: infinite; /*动作循环的次数:infinite 无限循环*/
}
@keyframes musicrotate{
  0%{-webkit-transform:rotate(0deg);}
 
    25%{-webkit-transform:rotate(90deg);}
 
    50%{-webkit-transform:rotate(180deg);}
 
    75%{-webkit-transform:rotate(270deg);}
 
    100%{-webkit-transform:rotate(360deg);}
}
相关文章
|
存储 人工智能 开发框架
爱数:以开源应对领域认知的普惠价值与百花齐放
爱数:以开源应对领域认知的普惠价值与百花齐放
|
Linux
Linux 设置、查看环境变量,设置代理
export http_proxy=http://172.22.22.22:3128 查看环境变量:env 设置环境变量:set 删除:unset 永久设置:vi /etc/profile export http_proxy=http://172.
5425 0
|
7月前
|
弹性计算 小程序 安全
阿里云服务器199元一年:企业专享,2核4G/5M带宽/80G系统盘,2026年值得买!
阿里云企业专享ECS u1实例,2核4G内存、5M带宽、80G云盘,仅需199元/年,支持Windows/Linux,新老用户同享,续费不涨价。性能稳定,适合官网、电商、小程序等多种企业场景,助力中小企业低成本上云。
|
安全 Unix Linux
【Linux网络服务】Rsync数据同步
【Linux网络服务】Rsync数据同步
|
存储 安全 Android开发
Android安全启动学习(三):AVB校验的内容、怎么校验、AVB的作用
Android安全启动学习(三):AVB校验的内容、怎么校验、AVB的作用
1959 0
|
数据可视化 IDE 开发者
【Python篇】PyQt5 超详细教程——由入门到精通(终篇)
【Python篇】PyQt5 超详细教程——由入门到精通(终篇)
3432 1
|
10月前
|
存储 数据库 索引
RAG检索质量差?这5种分块策略帮你解决70%的问题
RAG效果关键在于文档分块:固定、递归、语义、结构化与延迟分块各有优劣。合理选择能显著提升检索质量,减少幻觉,增强上下文理解,是构建高效RAG系统的核心环节。
1158 4
|
存储 人工智能 缓存
AI变革药物研发:深势科技的云原生实践之路
近日,阿里云助力深势科技推出创新的玻尔Bohrium®科研云平台和Hermite®药物计算设计平台,并持续完善。
AI变革药物研发:深势科技的云原生实践之路
|
Python Windows
怎么将 Python 项目打包成 exe?
这篇内容是一个关于使用Python和相关工具创建GUI应用并打包成Windows安装程序的教程摘要: - **环境**:Python 3.8,Tkinter(内置GUI库),PyInstaller 6.3.0,Inno Setup Compiler(用于创建安装包)。 - **基本流程**:在conda环境中创建一个独立的虚拟环境,编写一个使用Tkinter的GUI应用,添加图标,用PyInstaller将应用打包成单个可执行文件(exe),最后用Inno Setup Compiler将exe和相关文件打包成安装程序。
984 0

热门文章

最新文章