首页 > 其他分享 >css3几个常用动效

css3几个常用动效

时间:2024-09-20 15:28:35浏览次数:1  
标签:css3 常用 center 100% transform 动效 rem position absolute

1.放大的圈

 

@keyframes zoom3 {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
}

.play {
  position: absolute;
  left: 14.62rem;
  top: 4.12rem;
  margin: 1rem auto;
  width: 0.38rem;
  height: 0.43rem;
  cursor: pointer;
  background: url(./images/play.png) no-repeat center / 100% 100%;

  &::after {
    content: "";
    .size(0.7rem, 0.7rem);
    animation: zoom3 2s ease-in-out infinite;
    border: 1px solid hsla(0, 0%, 100%, 0.6);
    border-radius: 100%;
    position: absolute;
    transform-origin: center;
    right: -0.12rem;
    bottom: -0.12rem;
  }
  &::before {
    content: "";
    .size(0.6rem, 0.6rem);
    animation: zoom3 2s ease-in-out 0.4s infinite;
    right: -0.08rem;
    bottom: -0.08rem;
    border: 1px solid hsla(0, 0%, 100%, 0.6);
    border-radius: 100%;
    position: absolute;
    transform-origin: center;
  }
}

  

2.呼吸(忽大忽小)

 

.play {
  position: absolute;
  left: 14.62rem;
  top: 4.12rem;
  margin: 1rem auto;
  width: 0.38rem;
  height: 0.43rem;
  cursor: pointer;
  background: url(./images/play.png) no-repeat center / 100% 100%;

  animation: zoom2 2s ease-in-out infinite alternate;
}

@keyframes zoom2 {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(0.8);
  }
}

  

3.小圈旋转

 

.play {
  position: absolute;
  left: 14.62rem;
  top: 4.12rem;
  margin: 1rem auto;
  width: 0.38rem;
  height: 0.43rem;
  cursor: pointer;
  background: url(./images/play.png) no-repeat center / 100% 100%;

  &::before {
    content: "";
    .size(0.6rem, 0.6rem);
    background: url(./images/circle2.png) no-repeat center / 100% 100%;
    position: absolute;
    right: -0.08rem;
    bottom: -0.08rem;
    pointer-events: none;
    animation: circle 6s linear infinite;
  }
  &::after {
    content: "";
    .size(0.66rem, 0.66rem);
    background: url(./images/circle2.png) no-repeat center / 100% 100%;
    position: absolute;
    right: -0.11rem;
    bottom: -0.11rem;
    pointer-events: none;
    animation: circle2 6s linear infinite;
  }
}

@keyframes circle {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

@keyframes circle2 {
  0% {
    transform: rotate(-315deg);
  }
  100% {
    transform: rotate(45deg);
  }
}

  

 

标签:css3,常用,center,100%,transform,动效,rem,position,absolute
From: https://www.cnblogs.com/nangras/p/18422553

相关文章

  • centos(linux): logrotate常用功能
    一,测试配置是否正确?-d:打印debug信息-v:显示详细的输出信息[[email protected]]#logrotate-d/etc/logrotate.d/secure-v二,配置/var/log/secure按天分割/etc/logrotate.d/secure/var/log/secure{missingokdailyrotate90notifemptydatee......
  • 常用前端框架对比和选择
    ......
  • 【网络原理】❤️Tcp 常用机制❤️ —— 延时应答,捎带应答, 面向字节流, 异常情况处理。保姆
    本篇会加入个人的所谓鱼式疯言❤️❤️❤️鱼式疯言:❤️❤️❤️此疯言非彼疯言而是理解过并总结出来通俗易懂的大白话,小编会尽可能的在每个概念后插入鱼式疯言,帮助大家理解的.......
  • CAD图纸加密软件哪个好?七款企业常用图纸加密软件排行榜
    在保护CAD图纸的知识产权和敏感信息时,企业需要依赖可靠的图纸加密软件。对于企业来说,选择适合的加密软件既能确保图纸数据的安全,又能提高工作效率。以下是七款常用的CAD图纸加密软件推荐,它们在数据保护、用户友好性和功能性方面表现出色。1.安秉图纸加密软件安秉图纸加密软......
  • 监控服务器资源常用命令
    监控服务器资源通常需要查看CPU使用情况、内存使用情况、磁盘空间、网络流量等信息一.查看CPU使用情况1.top可以使用top实时显示当前系统的进程及资源使用情况2.mpstat报告CPU的统计数据3.ps-aux显示当前系统的所有进程和状态二.内存使用情况1.free-h显示当前内......
  • HTML基础和常用标签
    “合抱之木,生于毫末;九层之台,起于累土;千里之行,始于足下。”文章目录前言文章有误敬请斧正不胜感恩!1.HTML的基本结构解释:2.常见标签的介绍2.1标题和文本2.2链接和图片2.3列表2.4表格2.5表单2.6其他常用标签3.HTML5新标签(语义化标签)4.HTML注释5.查阅文档......
  • Git常用命令介绍
    Git,是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。支持克隆/下载。Git教程:https://git-scm.com/book/zh/v2TortoiseGit 客户端: https://tortoisegit.org/download/SmartGit客户端支持windows/macOS/Linux: https://www.syntevo.c......
  • 【软件测试】自动化测试常用函数 二
    目录......
  • tmux的简便常用项教程
    Tmux是会话(session)与终端窗口(terminalwindow)的解绑工具,可以同时运行多个命令,可以让新窗口"接入"已经存在的会话允许每个会话有多个连接窗口,因此可以多人实时共享会话,支持窗口任意的垂直和水平拆分。创建一个名字为ft的新窗口tmuxnew-sft重新进入名字为ft的窗口tmuxa-tf......
  • MySQL零基础入门教程-1 mysql安装卸载、启动关闭、常用命令、sql语句分类(非常详细),基础
    教程来源:B站视频BV1Vy4y1z7EX001-数据库概述_哔哩哔哩_bilibili我自己听讲收集整理的课程的完整笔记,供大家学习交流吧:夸克网盘分享本文内容为完整笔记的第一篇一、数据库概述1、什么是数据库?什么是数据库管理系统?什么是SQL?他们之间的关系是什么?P1、P2数据库英文单词DataBase,简称DB,......