当前位置: 首页 > news >正文

web前端之正弦波浪动功能、repeat、calc

MENU

  • 效果图
  • html
  • style
  • calc
  • repeat


效果图

sineWaveMotion01


sineWaveMotion02


html

<div class="grid"><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span>
</div>

style

body {margin: 0;height: 100vh;display: grid;place-items: center;background-color: #050505;
}.grid {height: 230px;display: grid;grid-template-columns: repeat(20, 1fr);grid-column-gap: 14px;
}.line {position: relative;width: 7px;height: 100%;
}.line::before,
.line::after {content: '';position: absolute;width: 100%;height: 7px;border-radius: 7px;background-color: #3b44d1;
}.line::after {bottom: 0;background-color: #dc5245;height: calc(100% - 20px);animation: second-line ease-in-out 4s var(--delay) infinite alternate;
}.line {--delay: -0.1s;
}@keyframes second-line {50% {height: 7px;}100% {background-color: #5d38ee;}
}.line::before {animation: first-line ease-in-out 4s var(--delay) infinite alternate;
}@keyframes first-line {50% {height: calc(100% - 13px);}100% {background-color: #46f443;}
}.line:nth-child(1) {--delay: -0.1s;
}.line:nth-child(2) {--delay: -0.2s;
}.line:nth-child(3) {--delay: -0.3s;
}.line:nth-child(4) {--delay: -0.4s;
}.line:nth-child(5) {--delay: -0.5s;
}.line:nth-child(6) {--delay: -0.6s;
}.line:nth-child(7) {--delay: -0.7s;
}.line:nth-child(8) {--delay: -0.8s;
}.line:nth-child(9) {--delay: -0.9s;
}.line:nth-child(10) {--delay: -1s;
}.line:nth-child(11) {--delay: -1.1s;
}.line:nth-child(12) {--delay: -1.2s;
}.line:nth-child(13) {--delay: -1.3s;
}.line:nth-child(14) {--delay: -1.4s;
}.line:nth-child(15) {--delay: -1.5s;
}.line:nth-child(16) {--delay: -1.6s;
}.line:nth-child(17) {--delay: -1.7s;
}.line:nth-child(18) {--delay: -1.8s;
}.line:nth-child(19) {--delay: -1.9s;
}.line:nth-child(20) {--delay: -2s;
}

calc

MDN

calc()此CSS函数允许在声明CSS属性值时执行一些计算。它可以用在如下场合:<length>、<frequency>、<angle>、<time>、<percentage>、<number>或<integer>。
此calc()函数用一个表达式作为它的参数,用这个表达式的结果作为值。这个表达式可以是任何如下操作符的组合,采用标准操作符处理法则的简单表达式。


W3SCHOOL

calc()函数执行用作属性值的计算。


repeat

W3SCHOOL

background-repeat属性设置是否及如何重复背景图像。
默认地,背景图像在水平和垂直方向上重复。
background-repeat属性定义了图像的平铺模式。
从原图像开始重复,原图像由background-image定义,并根据background-position的值放置。


MDN

CSSrepeat()函数表示轨道列表的重复片段,允许以更紧凑的形式写入大量显示重复模式的列或行。
该函数可以用于CSS Grid属性中grid-template-columns和grid-template-rows。

http://www.lryc.cn/news/260036.html

相关文章:

  • 使用工具 NVM来管理不同版本的 Node.js启动vue项目
  • Xcode编写基于C++的动态连接库(dylib)且用node-ffi-napi测试
  • WPF-UI HandyControl 简单介绍
  • golang学习笔记——数据结构进阶
  • TrustZone之总线请求
  • vue2+Echarts数据可视化 【帕累托图】
  • imazing 2.17.16中文版怎么备份iPhone手机照片
  • 05 python数据容器
  • 相机倾斜棋盘格标定全记录 vs200+opencv安装
  • QT- QT-lximagerEidtor图片编辑器
  • PyQt 如何通过连续点击托盘图标显示隐藏主窗口并且在主窗口隐藏时调整界面到托盘图标附近
  • 什么是纯净IP?如何判断IP地址的纯净度?有哪些干净IP推荐?
  • MySQL和Minio数据备份
  • 在Go中过滤范型集合:性能回顾
  • MATLAB 最小二乘直线拟合方法二 (36)
  • Python 实现:OCR在图片中提取文字(基于Gradio实现)
  • idea插件开发报错: ZipException opening “slf4j.jar“: zip END header not found
  • 【Linux】多线程编程
  • 【Mysql】InnoDB的表空间(九)
  • 【09】ES6:Set 和 Map 数据结构
  • Java通过documents4j和libreoffice把word转为pdf
  • 物联网时代的访问控制研究综述
  • 【产品经理】需求池和版本树
  • Qt图像处理-OpenCv中Mat与QImage互转
  • 构建外卖小程序:技术代码实践
  • IDEA中显示方法、类注释信息
  • 《数据结构、算法与应用C++语言描述》- 堆排序 - 借助priority_queue的C++实现
  • 10.CSS浮动
  • Angular 2 学习笔记
  • xcode 修改 target 中设备朝向崩溃