-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.css
85 lines (81 loc) · 2.49 KB
/
styles.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background: #f0f0f0;
perspective: 1000px; /* This defines the 3D perspective */
}
/* Responsive styling for smaller screens */
@media (max-width: 768px) {
.carousel {
width: 200px;
height: 200px;
}
}
.carousel {
position: relative;
width: 300px; /* Width of the carousel */
height: 300px; /* Height of the carousel */
transform-style: preserve-3d; /* Preserve 3D transformations */
animation: spin 15s infinite linear; /* Infinite rotating animation */
transform-origin: center center; /* Ensure rotation occurs from the center */
/* Optional, this ensures the carousel is centered */
display: flex;
align-items: center;
justify-content: center;
}
.carousel .rectangle {
position: absolute;
width: 200px;
height: 200px;
border-radius: 10px;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
font-weight: bold;
box-shadow: 10px 15px 25px rgba(0, 0, 0, 0.3);
/* Calculate angle for each rectangle */
/* Calculate angle for each rectangle */
/* Calculate angle for each rectangle */
/* Calculate angle for each rectangle */
/* Calculate angle for each rectangle */
}
.carousel .rectangle:nth-child(1) {
background-color: rgba(255, 105, 180, 0.75); /* Assign background color */
transform: rotateY(0deg) translateZ(150px); /* Positioning in 3D space */
}
.carousel .rectangle:nth-child(2) {
background-color: rgba(64, 224, 208, 0.75); /* Assign background color */
transform: rotateY(72deg) translateZ(150px); /* Positioning in 3D space */
}
.carousel .rectangle:nth-child(3) {
background-color: rgba(138, 43, 226, 0.75); /* Assign background color */
transform: rotateY(144deg) translateZ(150px); /* Positioning in 3D space */
}
.carousel .rectangle:nth-child(4) {
background-color: rgba(255, 165, 0, 0.75); /* Assign background color */
transform: rotateY(216deg) translateZ(150px); /* Positioning in 3D space */
}
.carousel .rectangle:nth-child(5) {
background-color: rgba(75, 0, 130, 0.75); /* Assign background color */
transform: rotateY(288deg) translateZ(150px); /* Positioning in 3D space */
}
/* Keyframe for the continuous rotating animation */
@keyframes spin {
from {
transform: rotateY(0deg); /* Starts from 0 degrees */
}
to {
transform: rotateY(360deg); /* Rotates to 360 degrees */
}
}
/*# sourceMappingURL=styles.css.map */