You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

rotation3D.css 4.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. 椭圆会使内部失真 transform: rotateX(50deg);
  3. */
  4. .rotation3D{
  5. position: relative; width: 800px; height: 600px; user-select: none;
  6. margin: 0 auto;
  7. /* border: 1px solid white; border-radius: 100%; */
  8. /* cursor: move; */
  9. }
  10. .rotation3D .center{
  11. display: none;
  12. position: absolute; left: 50%; top: 50%;
  13. transform: translate(-50%, -50%);
  14. }
  15. .rotation3D .itemList{ position: absolute; width: 100%; height: 100%; z-index: 20; }
  16. .rotation3D .lineList{
  17. position: absolute; width: 100%; height: 100%; z-index: 10;
  18. transform-style: preserve-3d;
  19. }
  20. /*---------------------------点样式---------------------------*/
  21. .rotation3D__item{
  22. position: absolute; display: block; width: 161px; height: 188px;
  23. text-align: center; line-height: 30px; font-size: 16px; color: white;
  24. /*background: #2292ef; border-radius: 4px;*/
  25. /*cursor: pointer; */
  26. }
  27. .rotation3D__item .scale{ position: absolute; top: 0; width: 100%; height: 100%; }
  28. .rotation3D__item .cont{ position: relative; z-index: 2; }
  29. .rotation3D__item .cont .iconfont { font-size: 28px; margin-top: 30px; margin-bottom: 96px; display: block; height: 35px;}
  30. .rotation3D__item .cont p{ color: #101010; }
  31. .lineList .rotation3D__line:nth-child(5n+0) .dot{
  32. }
  33. .lineList .rotation3D__line:nth-child(5n+1) .dot{
  34. animation-delay: 1s;
  35. }
  36. .lineList .rotation3D__line:nth-child(5n+2) .dot{
  37. animation-delay: 3s;
  38. }
  39. .lineList .rotation3D__line:nth-child(5n+3) .dot{
  40. animation-delay: 2s;
  41. }
  42. .lineList .rotation3D__line:nth-child(5n+3) .dot{
  43. animation-delay: 4s;
  44. }
  45. .rotation3D__item.blue{ color: #01e9fc; }
  46. .rotation3D__item.green{ color: #b4b3ca; }
  47. .rotation3D__item.yellow{ color: #ffd200; }
  48. /*底座*/
  49. .rotation3D__item .baseImg{ position: absolute; width: 100%; height: 100%; z-index: 1; }
  50. .rotation3D__item.blue .baseImg{ background: url("img/idc-red.png"); }
  51. .rotation3D__item.green .baseImg{ background: url("img/idc-green.png"); }
  52. .rotation3D__item.yellow .baseImg{ background: url("img/idc-yellow.png"); }
  53. /*---------------------------
  54. 线样式
  55. 线高为总高的一般
  56. ---------------------------*/
  57. .rotation3D__line{
  58. position: absolute; left: 50%; top: 50%;
  59. display: block;
  60. width: 30px;
  61. height: 50%;
  62. padding-top: 60px; color: #fff; font-size: 50px;
  63. /*background: #fff;*/
  64. /*原点设置在中间*/
  65. transform-origin: 50% 0;
  66. transform-style: preserve-3d;
  67. overflow: hidden;
  68. }
  69. .rotation3D__line .pos{ position: absolute; top: 0; left: 15px;}
  70. .rotation3D__line svg { position: absolute; top: 0; }
  71. .rotation3D__line svg path {
  72. stroke: #fff; fill: none;
  73. stroke-width: 2;
  74. animation: path-animation 100s linear 0s infinite normal;
  75. }
  76. @keyframes path-animation {
  77. 0% { stroke-dashoffset:500; }
  78. 100% { stroke-dashoffset:0; }
  79. }
  80. .rotation3D__line .dot {
  81. position: absolute; top: 0; left: 0; text-align: center;
  82. /*width: 35px; height: 35px; font-size: 35px; */
  83. width: 19px; height: 19px; font-size: 19px;
  84. }
  85. .rotation3D__line .dot1,.rotation3D__line .dot3,.rotation3D__line .dot4{
  86. animation: svg-path-animation 6s ease-in-out 0s infinite normal;
  87. }
  88. .rotation3D__line .dot1{
  89. offset-path: path("M0 400, 0 0"); offset-distance: 0%;
  90. }
  91. .rotation3D__line .dot2{
  92. offset-path: path("M0 200, 0 0"); offset-distance: 0%;
  93. background: #ffd200; border-radius: 100%;
  94. font-size: 22px; color: #000;
  95. }
  96. .rotation3D__line .dot3{
  97. offset-path: path("M20 400 S 0 200, 20 0"); offset-distance: 0%;
  98. }
  99. .rotation3D__line .dot4{
  100. position: relative;
  101. offset-path: path("M20 0 S 40 200, 20 400"); offset-distance: 0%;
  102. }
  103. @keyframes svg-path-animation {
  104. from {offset-distance: 100%;}
  105. to {offset-distance: 0%;}
  106. }
  107. .dot1 > span{
  108. position: absolute;
  109. font-size: 12px;
  110. color: #888;
  111. transform:scale(0.80);
  112. transform-origin:left;
  113. white-space: nowrap;
  114. }
  115. /*颜色*/
  116. .rotation3D__line.blue { color: #07b2f9; }
  117. .rotation3D__line.green { color: #ac94ee; }
  118. .rotation3D__line.yellow { color: #ffd500; }
  119. .rotation3D__line.blue svg path { stroke: #07b2f9; }
  120. .rotation3D__line.green svg path { stroke: #ac94ee; }
  121. .rotation3D__line.yellow svg path { stroke: #ffd500; }