1+ body {
2+ background : linear-gradient (to bottom right, # 18427d, # 5d7ac4 );
3+ height : 100vh ;
4+ display : flex;
5+ align-items : center;
6+ justify-content : center;
7+ margin : 0 ;
8+ box-shadow : 0 20px 20px rgba (0 , 0 , 0 , 0.2 ); /* Updated box-shadow */
9+
10+ }
11+
12+ .container {
13+ perspective : 800px ;
14+
15+ }
16+
17+ .cube {
18+ width : 200px ;
19+ height : 200px ;
20+ position : relative;
21+ transform-style : preserve-3d;
22+ animation : rotate 6s infinite linear;
23+ transform : rotateX (-20deg ) rotateY (-30deg );
24+ background : linear-gradient (to bottom right, # 695c29, # e67e22 );
25+ }
26+
27+ .face {
28+ position : absolute;
29+ width : 200px ;
30+ height : 200px ;
31+ color : rgb (255 , 255 , 255 );
32+ font-size : 24px ;
33+ display : flex;
34+ align-items : center;
35+ justify-content : center;
36+ text-transform : uppercase;
37+ box-shadow : 0 2px 10px rgba (0 , 0 , 0 , 0.2 );
38+ }
39+
40+ .front {
41+ background : linear-gradient (to bottom right, # 477422, # 77f12c ); transform : translateZ (100px );
42+ }
43+
44+ .back {
45+ background : linear-gradient (to bottom right, # 105561, # 0ed7e9 ); transform : translateZ (-100px ) rotateY (180deg );
46+ }
47+
48+ .right {
49+ background : linear-gradient (to bottom right, # b8a249, # e67e22 ); transform : translateX (100px ) rotateY (90deg );
50+ }
51+
52+ .left {
53+ background : linear-gradient (to bottom right, # 3e8575, # 13eca0 ); transform : translateX (-100px ) rotateY (-90deg );
54+ }
55+
56+ .top {
57+ background : linear-gradient (to bottom right, # f1c40f, # e67e22 ); transform : translateY (-100px ) rotateX (90deg );
58+ }
59+
60+ .bottom {
61+ background : linear-gradient (to bottom right, # d16725, # ce905a ); transform : translateY (100px ) rotateX (-90deg );
62+ }
63+
64+
65+ @keyframes rotate {
66+ 0% {
67+ transform : rotateX (-20deg ) rotateY (-30deg );
68+ }
69+ 100% {
70+ transform : rotateX (340deg ) rotateY (330deg );
71+ }
72+ }
73+
0 commit comments