css布局实现三维金币翻转动画效果代码

代码语言:html

所属分类:动画

代码描述:css布局实现三维金币翻转动画效果代码

代码标签: 三维 金币 翻转 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
  
<style>
*, *:after, *:before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
}

body {
  width: 100%;
  background: #000000;
}

.stage {
  perspective: 1000px;
  position: absolute;
  top: 50%;
  left: 50%;
}

.coin {
  transform-style: preserve-3d;
  transform-origin: 10px 10px;
  animation: rotate 4s infinite linear;
}

@keyframes rotate {
  0% {
    transform: rotate3d(0, 1, 0, -179deg) translate3d(0, 0, 0);
  }
  100% {
    transform: rotate3d(0, 1, 0, 180deg) translate3d(0, 0, 0);
  }
}
figure {
  position: absolute;
  height: 33px;
  width: 20px;
  opacity: 1;
}

figure .oFox {
  position: absolute;
  top: calc(50% - 89px);
  left: calc(50% - 24px);
}

figure.coin-top,
figure.coin-bottom {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background-color: #FFC100;
}

figure.coin-bottom {
  transform: translate3d(-130px, -134px, 0) rotateY(90deg) rotateZ(180deg) rotateX(180deg);
}

figure.coin-top {
  transform: translate3d(-150px, -134px, 0) rotateY(90deg) rotateZ(360deg);
}

[class*='coin-s'] {
  background-color: #D19800;
}

.coin-s1 {
  transform: rotateX(0deg) translateZ(149px);
}

.coin-s2 {
  transform: rotateX(12deg) translateZ(149px);
}

.coin-s3 {
  transform: rotateX(24deg) translateZ(149px);
}

.coin-s4 {
  transform: rotateX(36deg) translateZ(149px);
}

.coin-s5 {
  transform: rotateX(48deg) translateZ(149px);
}

.coin-s6 {
  transform: rotateX(60deg) translateZ(149px);
}

.coin-s7 {
  transform: rotateX(72deg) translateZ(149px);
}

.coin-s8 {
  transform: rotateX(84deg) translateZ(149px);
}

.coin-s9 {
  transform: rotateX(96deg) translateZ(149px);
}

.coin-s10 {
  transform: rotateX(108deg) translateZ(149px);
}

.coin-s11 {
  transform: rotateX(120deg) translateZ(149px);
}

.coin-s12 {
  transform: rotateX(132deg) translateZ(149px);
}

.coin-s13 {
  transform: rotateX(144deg) translateZ(149px);
}

.coin-s14 {
  transform: rotateX(156deg) translateZ(149px);
}

.coin-s15 {
  transform: rotateX(168deg) translateZ(149px);
}

.coin-s16 {
  transform: rotateX(180deg) translateZ(149px);
}

.coin-s17 {
  transform: rotateX(192deg) translateZ(149px);
}

.coin-s18 {
  transform: rotateX(204deg) translateZ(149px);
}

.coin-s19 {
  transform: rotateX(216deg) translateZ(149px);
}

.coin-s20 {
  transform: rotateX(228deg) translateZ(149px);
}

.coin-s21 {
  transform: rotateX(240deg) translateZ(149px);
}

.coin-s22 {
  transform: rotateX(252deg) translateZ(149px);
}

.coin-s23 {
  transform: rotateX(264deg) translateZ(149px);
}

.coin-s24 {
  transform: rotateX(276deg) translateZ(149px);
}

.coin-s25 {
  transform: rotateX(288deg) translateZ(149px);
}

.coin-s26 {
  transform: rotateX(300deg) translateZ(149px);
}

.coin-s27 {
  transform: rotateX(312deg) translateZ(149px);
}

.coin-s28 {
  transform: rotateX(324deg) translateZ(149px);
}

.coin-s29 {
  transform: rotateX(336deg) translateZ(149px);
}

.coin-s30 {
  transform: rotateX(348deg) translateZ(149px);
}
</style>


</head>

<body >
  <div class="stage">
  <div class="coin">
    <figure class="coin-s1"></figure>
    <figure class="coin-s2"></figure>
    <figure class="coin-s3"></figure>
    <figure class="coin-s4"></figure>
    <figure class="coin-s5"></figure>
    <figure class="coin-s6"></figure>
    <figure class="coin-s7"></figure>
    <figure class="coin-s8"></figure>
    <figure class="coin-s9"></figure>
    <figure class="coin-s10"></figure>
    <figure class="coin-s11"></figure>
    <figure class="coin-s12"></figure>
    <figure class="coin-s13"></figure>
    <figure class="coin-s14"></figure>
    <figure class="coin-s15"></figure>
    <figure class="coin-s16"></figure>
    <figure class="coin-s17"></figure>
    <figure class="coin-s18"></figure>
    <figure cl.........完整代码请登录后点击上方下载按钮下载查看

网友评论0