-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MembershipCard.module.css
271 lines (248 loc) · 7.3 KB
/
MembershipCard.module.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
/* MembershipCard.module.css */
/**
* CSS styles for the MembershipCard component.
*
* @class membership-card
* @description Represents the styling for a membership card component.
* @cssprop {number} width - The width of the membership card.
* @cssprop {number} height - The height of the membership card.
* @cssprop {string} background - The background color of the membership card.
* @cssprop {number} border-radius - The border radius of the membership card.
* @cssprop {string} color - The text color of the membership card.
* @cssprop {number} padding - The padding around the content of the membership card.
* @cssprop {string} position - The positioning of the membership card.
* @cssprop {string} display - The display type of the membership card.
* @cssprop {string} flex-direction - The flex direction of the membership card.
* @cssprop {string} justify-content - The alignment of the content along the main axis of the membership card.
* @cssprop {string} box-shadow - The shadow effect of the membership card.
* @cssprop {string} transform - The 3D transformation of the membership card.
* @cssprop {string} transition - The transition effect of the membership card.
* @cssprop {string} background-image - The background image of the membership card.
* @cssprop {string} background-size - The size of the background image of the membership card.
* @cssprop {string} animation - The animation effect of the membership card.
*/
.membership-card {
width: 384px;
height: 224px;
background: #000;
border-radius: 20px;
color: #fff;
padding: 20px;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
box-shadow: 0 0 100px rgba(255, 255, 255, 0.3);
transform: perspective(1000px) rotateY(10deg);
transition:
transform 0.5s,
box-shadow 0.5s,
background 0.5s,
background-color 1s ease-in-out;
background-image: linear-gradient(
45deg,
rgba(255, 255, 255, 0.1),
rgba(255, 255, 255, 0.3),
rgba(255, 255, 255, 0.1)
);
background-size: 200% 200%;
animation: shimmer-effect 8s ease infinite;
}
/**
* CSS styles for the membership card tooltip.
*
* This CSS class defines the styles for the tooltip that appears when hovering over the membership card.
* It positions the tooltip at the bottom of the card, with a background color, text color, padding, and border radius.
* The tooltip is initially hidden and transitions in with opacity and transform effects.
*
* @class membership-card__tooltip
*/
.membership-card__tooltip {
position: absolute;
bottom: 105px;
left: 20%;
transform: translateX(-50%);
background-color: rgba(0, 0, 0, 0.85);
color: #fff;
padding: 8px 16px;
border-radius: 8px;
font-size: 15px;
font-weight: 500;
white-space: nowrap;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
opacity: 0;
visibility: hidden;
transition:
opacity 0.5s ease,
box-shadow 0.3s ease;
}
@media (max-width: 768px) {
.membership-card__tooltip {
bottom: 80px; /* Adjust position for better visibility on smaller screens */
left: 50%; /* Center the tooltip */
transform: translateX(-50%);
font-size: 12px; /* Smaller font size for smaller screens */
}
}
.membership-card__tooltip:hover {
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
}
.membership-card__tooltip:focus {
transform: scale(1.1); /* Slightly larger scale for focus */
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8); /* More pronounced shadow for focus */
}
/**
*
* This CSS code defines the hover effect for the membership card component and its tooltip.
* When the membership card is hovered over, the tooltip becomes visible with a fade-in effect.
* The tooltip is positioned above the membership card and slightly shifted downwards.
*/
.membership-card:hover .membership-card__tooltip {
opacity: 1;
visibility: visible;
transform: translate(-50%, 10px);
}
/**
* Styles for the shimmer effect before the membership card.
*/
.membership-card__shimmer-effect--before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(
to right,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.3) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 2s infinite;
background-repeat: no-repeat;
background-size: 200% 100%;
z-index: 1;
border-radius: 20px;
}
/**
* Styles for the membership card on hover.
*/
.membership-card:hover {
transform: perspective(1000px) rotateY(0deg);
background: linear-gradient(145deg, #640000, #ae0000);
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}
@keyframes shimmer-effect {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.membership-card__spinback-effect {
width: 100px;
height: 100px;
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.5),
rgba(255, 255, 255, 0.1)
);
border-radius: 50%;
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
background-blend-mode: overlay;
backdrop-filter: blur(5px);
}
.membership-card__spinback-effect::before,
.membership-card__spinback-effect::after {
content: '';
position: absolute;
top: 10%;
left: 10%;
right: 10%;
bottom: 10%;
border-radius: 50%;
}
.membership-card__spinback-effect::before {
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.2),
rgba(255, 255, 255, 0)
);
}
/**
* CSS styles for the spinback effect of the membership card.
*
* This CSS code defines the styles for the ::after pseudo-element of the .membership-card__spinback-effect class.
* The pseudo-element is positioned at -50% from the top and left of its container, and has a width and height of 200%.
* It has a background that creates a linear gradient effect using transparent and rgba(255, 255, 255, 0.2) colors.
* The spin-disk animation is applied to the pseudo-element, with a duration of 5 seconds, linear timing function, and infinite repetition.
*/
.membership-card__spinback-effect::after {
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(
0deg,
transparent,
rgba(255, 255, 255, 0.2),
transparent
);
animation: spin-disk 5s linear infinite;
}
@keyframes spin-disk {
100% {
transform: rotate(1turn);
}
}
.membership-card__logo {
width: 60px;
height: 60px;
}
/**
*
* CSS class for the membership card tier.
*
* @class membership-card__tier
* @description Represents the styling for the membership card tier.
* @cssprop position - Specifies the positioning method for the membership card tier.
* @cssprop top - Specifies the distance from the top edge of the positioned element to the top edge of its containing block.
* @cssprop left - Specifies the distance from the left edge of the positioned element to the left edge of its containing block.
* @cssprop transform - Specifies a 2D or 3D transformation to be applied to the membership card tier.
* @cssprop width - Specifies the width of the membership card tier.
*/
.membership-card__tier {
position: absolute;
top: 72.5%;
left: 13.75%;
transform: translate(-50%, -50%);
width: 150px;
}
.membership-card__tier:hover .membership-card__show-mask {
opacity: 0.5;
transition: opacity 300ms;
}
/* Responsive Design */
@media (max-width: 768px) {
.price-toggle {
flex-direction: column;
padding-top: 12px;
align-items: center;
}
.price-toggle .price-label {
margin: 0;
}
.switch {
margin: 10px 0;
}
.membership-card__spinback-effect {
display: none;
}
}