CSS3 & transition & animation
CSS3 & transition & animation
https://developer.mozilla.org/en-US/docs/Web/CSS/transition-timing-function
.circle-box{
position: relative;
margin: 100px auto;
width: 300px;
height: 300px;
background: #ccc;
border: 1px solid red;
border-radius: 50%;
transform: rotate(var(--defaultAngle));
transition: 1s 0.5s all ease-in-out;
/* animation: autoRotate 1s 1 both ease; */
}
.rotate-angle {
transform: rotate(var(--newAngle));
}
https://developer.mozilla.org/zh-CN/docs/Web/CSS/animation-timing-function
.circle-box{
position: relative;
margin: 100px auto;
width: 300px;
height: 300px;
background: #ccc;
border: 1px solid red;
border-radius: 50%;
transform: rotate(var(--defaultAngle));
/*transition: 1s 0.5s all ease-in-out; */
animation: autoRotate 1s 1 both ease;
}
.rotate-angle {
transform: rotate(var(--newAngle));
}
@keyframes autoRotate {
0% {
transform: rotate3d(0, 0, 1, var(--defaultAngle));
}
to {
transform: rotate3d(0, 0, 1, var(--newAngle));
}
}
@keyframes autoRotate {
0% {
transform: rotate3d(0, 0, 1, var(--beginAngle));
}
to {
transform: rotate3d(0, 0, 1, var(--endAngle));
}
}
full demo
@charset "UTf-8";
/* app.css */
:root{
--beginAngle: 0deg;
--endAngle: 0deg;
/* fixed angle enums */
--defaultAngle: 0deg;
--newAngle: 30deg;
/* positive */
--rotateAngle30: 30deg;
--rotateAngle60: 60deg;
--rotateAngle90: 90deg;
--rotateAngle120: 120deg;
--rotateAngle150: 150deg;
--rotateAngle180: 180deg;
--rotateAngle210: 210deg;
--rotateAngle240: 240deg;
--rotateAngle270: 270deg;
--rotateAngle300: 300deg;
--rotateAngle330: 330deg;
--rotateAngle360: 360deg;
/* negative */
--rotateAngle-30: -30deg;
--rotateAngle-60: -60deg;
--rotateAngle-90: -90deg;
--rotateAngle-120: -120deg;
--rotateAngle-150: -150deg;
--rotateAngle-180: -180deg;
--rotateAngle-210: -210deg;
--rotateAngle-240: -240deg;
--rotateAngle-270: -270deg;
--rotateAngle-300: -300deg;
--rotateAngle-330: -330deg;
--rotateAngle-360: -360deg;
}
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
html, body, div, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, object, code, legend, button, input, textarea, th, td, a, img, video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
.data-btn{
padding: 1px 6px;
border-width: 2px;
border-style: outset;
border-color: buttonface;
border-image: initial;
cursor: default;
}
.circle-box{
position: relative;
margin: 100px auto;
width: 300px;
height: 300px;
background: #ccc;
border: 1px solid red;
border-radius: 50%;
transform: rotate(var(--defaultAngle));
transition: 1s 0.5s all ease-in-out;
/* animation: autoRotate 1s 1 both ease; */
}
.rotate-angle {
transform: rotate(var(--newAngle));
}
@keyframes autoRotate {
0% {
transform: rotate3d(0, 0, 1, var(--defaultAngle));
}
to {
transform: rotate3d(0, 0, 1, var(--newAngle));
}
}
@keyframes autoRotate {
0% {
transform: rotate3d(0, 0, 1, var(--beginAngle));
}
to {
transform: rotate3d(0, 0, 1, var(--endAngle));
}
}
.menus-mask {
position: absolute;
top: 230px;
left: 50%;
transform: translate(-50%);
width: 600px;
height: 400px;
background: rgba(123,123,123,0.5);
z-index: 999;
}
.horizontal-line{
position: absolute;
width: 50vw;
height: 0;
border-top: 1px solid red;
top: calc(100px + 300px / 2);
left: 50%;
transform: translateX(-50%);
}
.vertical-line {
position: absolute;
width: 0;
height: calc(50vh + 300px /2 );
border-left: 1px solid red;
top: calc(100px / 2);
left: 50%;
transform: translateX(-50%);
}
.circle {
/* position: absolute; */
width: 30px;
height: 30px;
line-height: 30px;
background: #f0f;
text-align: center;
vertical-align: middle;
cursor: pointer;
border-radius: 0 0 15px 15px;
}
/*
.circle::before {
content: "";
width: 6px;
height: 6px;
position: absolute;
left: 9px;
top: 0px;
border: 2px solid #FFF;
border-radius: 50%;
z-index: -1;
}
.circle::after {
content: "";
position: absolute;
left: 50%;
top: 100%;
height: 30px;
width: 30px;
background-color: #00c991;
border-radius: 50% 50% 0;
transform: translate(-50%, -50%) rotate(45deg);
z-index: -1;
} */
.circle-highlight::after {
background-color: #f82eb5;
}
.circle1{
transform: rotate(-60deg) translateX(-50px) translateY(35px);
}
.circle2{
transform: rotate(-30deg) translateX(calc(150px - 87px)) translateY(9px);
}
.circle3{
transform: rotate(0deg) translateX(calc(150px - 15px)) translateY(-73px);
}
.circle4{
transform: rotate(30deg) translateX(calc(150px + -13px)) translateY(-175px);
}
.circle5{
transform: rotate(60deg) translateX(80px) translateY(-255px);
}
.circle6{
transform: rotate(90deg) translateX(-15px) translateY(calc(-300px + 15px));
}
.circle7{
transform: rotate(120deg) translateX(calc(-106px)) translateY(-243px);
}
.circle8{
transform: rotate(150deg) translateX(-155px) translateY(-150px);
}
.circle9{
transform: rotate(180deg) translateX(calc(-150px + 15px)) translateY(-45px);
}
.circle10{
transform: rotate(-150deg) translateX(-47px) translateY(35px);
}
.circle11{
transform: rotate(-120deg) translateX(77px) translateY(50px);
}
.circle12{
transform: rotate(-90deg) translateX(calc(195px)) translateY(-15px);
}
.menus {
background: url("./menus.svg")
}
cubic-bezier
cubic-bezier(p1, p2, p3, p4)
An author defined cubic-Bezier curve, where the p1 and p3 values must be in the range of 0 to 1.
.test{
transition-timing-function: cubic-bezier(.29, 1.01, 1, -0.68);
}
.cb {
transition-timing-function: cubic-bezier(0.2,-2,0.8,2);
}
贝塞尔曲线
https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function
https://developer.mozilla.org/zh-CN/docs/Web/CSS/timing-function
https://en.wikipedia.org/wiki/Bézier_curve#Cubic_B.C3.A9zier_curves
repl online
https://cubic-bezier.com/#.17,.67,.83,.67
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
CSS3 & transition & animation的更多相关文章
- css3 transition animation nick
时光转眼即逝,又到周六了,今天写点某部分人看不起的css玩玩! 转换 转换属性transform: 浏览器前缀: -webkit-transform;-o-transform;-moz-transfo ...
- css笔记——区分css3中的transform transition animation
出处:http://blog.csdn.net/dyllove98/article/details/8957232 CSS3中和动画有关的属性有三个 transform. transition ...
- css3动画transition animation
CSS动画简介 transition animation transition过渡:css3通过transitions属性引入时间概念,通过开始.结束状态自动计算中间状态,实现状态改变的过渡效果 ...
- css3 transition属性
最近打算学习css3知识,觉得css3写出来的效果好炫好酷,之前一直想要学习来着.可能之前的决心,毅力,耐心不够,所以想要重整起来,放下浮躁的心态,一步一个脚印,踏踏实实的来学习. 首先学习的是css ...
- Atitti css transition Animation differ区别
Atitti css transition Animation differ区别 1.1. transition的优点在于简单易用,但是它有几个很大的局限. 1 1.2. Transition ...
- Atitti css transition Animation differ区别
Atitti css transition Animation differ区别 1.1. transition的优点在于简单易用,但是它有几个很大的局限. 1 1.2. js 动态改变 st ...
- 【转】CSS3 transition规范的实际使用经验
原文转自:http://blog.jobbole.com/56243/ 本篇文章主要讲述CSS3 transition规范和在不同浏览器之间的使用差异,关于具体解决方法或如何规避问题的意见可以参考另一 ...
- CSS3 transition规范的实际使用经验
本篇文章主要讲述CSS3 transition规范和在不同浏览器之间的使用差异,关于具体解决方法或如何规避问题的意见可以参考另一篇非常有见地的文章,“All You Need to Know Abou ...
- css 动画 transform transition animation
1.transform transform 是通过在浏览器里面让网页元素 移动 旋转 透明 模糊 等方法来实现改变其外观的技术 -webkit-transform : translate(3em,0 ...
随机推荐
- fastjson的deserializer的主要优化算法 漏洞
JSON最佳实践 | kimmking's blog http://kimmking.github.io/2017/06/06/json-best-practice/ Fastjson内幕 Java综 ...
- UI自动化测试实战
前言 前面我们已经搭建好了wordpress网站,如果需要查看运行效果可以看我前面的搭建文章,下面我们来进行自动化测试的练习. 示例 首先我们测试自动登陆 import unittest from s ...
- 九:SpringBoot-整合Mybatis框架,集成分页助手插件
九:SpringBoot-整合Mybatis框架,集成分页助手插件 1.Mybatis框架 1.1 mybatis特点 1.2 适用场景 2.SpringBoot整合MyBatis 2.1 核心依赖 ...
- brew更换国内源
来源:清华大学开源软件镜像站(https://mirror.tuna.tsinghua.edu.cn/help/homebrew/) 替换现有上游 1 # brew 程序本身,Homebrew/Lin ...
- 解决java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/Pattern
明明引入了这个,却提示没有 看下面文章: http://www.maocaoying.com/article/109
- OpenStack (glance 镜像服务)
glance介绍 glance 提供云虚拟机上的服务镜像(Image)功能,该模块可看成车间里的模具生产部门,其功能包括虚拟机镜像的查找.注册和检索等.该模具最基本的使用方式就是在为云虚拟机实例提供安 ...
- 提升NginxTLS/SSL HTTPS 性能的7条优化建议
自2018年7月起,谷歌浏览器开始将" HTTP"网站标记为"不安全".在过去的几年中,互联网已经迅速过渡到HTTPS,Chrome浏览器的流量超过70%,并且 ...
- linux虚拟摄像头vivid配置
总述 最近在看摄像头驱动,需要配置虚拟摄像头的驱动,但是教程里面是linux2.6内核的,实际电脑的是Ubuntu16,内核是linux4.15版本,从2.6到4.15内核好多文件发生了变化,所 ...
- java——API
API定义: 可以网上下载一个jdk_api文档用来查找一些函数. 匿名对象的创建 匿名对象做为返回值和参数实例: Random的使用:
- Codeforces Round #582 (Div. 3) A. Chips Moving
传送门 题解: 给你n个数的坐标,你需要把他们移动到一个位置,有两种移动方式 1.向左或者右移动2 2.向左或者右移动1,但是耗费1 求最小耗费 题解: 很简单就可以想到,看一下偶数坐标多还是奇数坐标 ...