Created
February 6, 2017 06:22
-
-
Save CodeMyUI/8e2c0d28564d8e83d13a01a1e68de1ef to your computer and use it in GitHub Desktop.
CSS 3D carousel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li>子</li> | |
<li>丑</li> | |
<li>寅</li> | |
<li>卯</li> | |
<li>辰</li> | |
<li>巳</li> | |
<li>午</li> | |
<li>未</li> | |
<li>申</li> | |
<li>酉</li> | |
<li>戌</li> | |
<li>亥</li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
overflow: hidden; | |
} | |
ul { | |
margin: 0; | |
list-style: none; | |
font-size: 4vw; | |
transform-style: preserve-3d; | |
animation: three-dimensions-circle 30s linear infinite; | |
} | |
li { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
} | |
@for $i from 1 through 12 { | |
li:nth-child(#{$i}) { | |
transform: translate(-50%, -50%) rotate(#{$i * 30 - 30}deg) translateY(-260px) rotateX(90deg); | |
} | |
} | |
@keyframes three-dimensions-circle { | |
0% { | |
transform: rotateX(-100deg) rotate(0); | |
} | |
100% { | |
transform: rotateX(-100deg) rotate(-360deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment