-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcubeRotate.css
46 lines (41 loc) · 869 Bytes
/
cubeRotate.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Define the container div, the cube div, and a generic face */
body {
margin: 0;
}
.container {
width: 100%;
height: 100%;
position: absolute;
perspective-origin: center;
perspective: 500px;
overflow: hidden;
}
.cube {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
backface-visibility: visible;
transform-style: preserve-3d;
animation: cubeRotate 15s linear infinite;
}
@keyframes cubeRotate {
0% {
transform: translate(-50%, -50%) rotateY(0deg);
}
100% {
transform: translate(-50%, -50%) rotateY(360deg);
}
}
.face {
display: block;
position: absolute;
width: 100%;
height: 100%;
border: none;
font-family: sans-serif;
font-size: 60px;
color: white;
text-align: center;
background: rgba(0, 0, 0, 0.3);
}