div+css实现气候变化时间图表螺旋图效果代码
代码语言:html
所属分类:图表
代码描述:div+css实现气候变化时间图表螺旋图效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@charset "UTF-8";
:root {
--font: Arial, Helvetica, serif;
--scale-green: #00b106;
--scale-yellow: #ffeb3b;
}
* {
transform-style: preserve-3d;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: radial-gradient(#000, #333);
}
.content {
width: 35vmin;
height: 35vmin;
display: flex;
align-items: center;
justify-content: center;
transform: rotateX(0deg) scale3d(1, 1, 1.5);
transition: all 0.5s ease 0s;
animation: view 4s ease 26s 1;
animation-fill-mode: forwards;
overflow: visible;
}
.content div {
position: absolute;
}
@keyframes view {
0% {
transform: rotateX(0deg) scale3d(1, 1, 1.5);
}
100% {
transform: rotateX(90deg) scale3d(1, 1, 1.5);
}
}
[class^=year-] {
--inc: 15;
--sz: 100%;
--bd: #ff0000;
--dl: 0s;
width: var(--sz);
height: var(--sz);
border: 0.5vmin solid var(--bd);
border-radius: 100%;
box-shadow: 0 0 0.5vmin 0 #000, 0 0 0.5vmin 0 #000 inset;
clip-path: polygon(50% 0%, 50% 0, 50% 0%, 50% 0%, 50% 0);
animation: rings 0.2s linear var(--dl) 1;
animation-fill-mode: forwards;
}
[class^=year-]:before, [class^=year-]:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
border-top: 2px solid var(--bd);
transform: translateZ(-1px);
color: var(--bd);
justify-content: center;
display: flex;
align-items: center;
font-family: var(--font);
font-size: 4vmin;
background: radial-gradient(#000, #030303 5vmin, #fff0 6vmin);
animation: hide-scale 0.75s ease 26s 1;
animation-fill-mode: forwards;
}
[class^=year-]:after {
transform: rotateX(90deg) translateZ(-25vmin);
height: 0px;
border-radius: 5px;
animation: lines 2s ease 28s 1;
animation-fill-mode: forwards;
opacity: 0;
}
@keyframes rings {
0% {
clip-path: polygon(50% 0%, 50% 0, 50% 0%, 50% 0%, 50% 0);
}
25% {
clip-path: polygon(50% 0%, 100% 0, 100% 50%, 50% 5%, 50% 0);
}
50% {
clip-path: polygon(50% 0%, 100% 0, 100% 100%, 50% 50%, 50% 0);
}
75% {
clip-path: polygon(50% 0%, 100% 0, 100% 100%, 0 100%, 0 100%);
}
99% {
clip-path: polygon(50% 0%, 100% 0, 100% 100%, 0 100%, 0 0);
}
100% {
clip-path: none;
}
}
@keyframes lines {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/*** Data ***/
.year-1900 {
--sz: calc(100% - calc(0.11vmin * var(--inc)));
transform: translateZ(-100px);
--bd: #c9e6fc;
}
.year-1901 {
--sz: calc(100% - calc(0.09vmin * var(--inc)));
transform: translateZ(-98px);
--bd: #d2eafc;
--dl: 0.2s;
}
.year-1902 {
--sz: calc(100% - calc(0.24vmin * var(--inc)));
transform: translateZ(-96px);
--bd: #88c7f9;
--dl: 0.4s;
}
.year-1903 {
--sz: calc(100% - calc(0.32vmin * var(--inc)));
transform: translateZ(-94px);
--bd: #61b4f6;
--dl: 0.6s;
}
.year-1904 {
--sz: calc(100% - calc(0.44vmin * var(--inc)));
transform: translateZ(-92px);
--bd: #2698f3;
--dl: 0.8s;
}
.year-1905 {
--sz: calc(100% - calc(0.18vmin * var(--inc)));
transform: translateZ(-90px);
--bd: #a7d5fa;
--dl: 1s;
}
.year-1906 {
--sz: calc(100% - calc(0.21vmin * var(--inc)));
transform: translateZ(-88px);
--bd: #98cefa;
--dl: 1.2s;
}
.year-1907 {
--sz: calc(100% - c.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0