Repository navigation
Expand file tree
/
Copy pathdemo.css
More file actions
97 lines (83 loc) · 1.53 KB
/
Copy pathdemo.css
File metadata and controls
97 lines (83 loc) · 1.53 KB
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
.card-container {
display: flex;
justify-content: space-between;
gap: 20px;
flex-wrap: wrap;
}
.card {
position: relative;
width: calc(25% - 15px);
/* Reduced width by 5% */
height: 300px;
overflow: hidden;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
.content {
position: absolute;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
transition: transform 0.5s;
}
.image {
width: 100%;
height: 80%;
object-fit: cover;
border-radius: 10px;
}
.text {
width: 100%;
height: 20%;
background-color: rgba(0, 0, 0, 0.7);
color: #fff;
text-align: center;
padding: 10px;
border-radius: 0 0 10px 10px;
transition: opacity 0.5s;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
top: 100%;
transition: top 0.5s;
border-radius: 10px;
}
.overlay-text {
color: #fff;
text-align: center;
padding: 20px;
opacity: 0;
}
.card:hover .content {
transform: translateY(-100%);
}
.card:hover .text {
opacity: 1;
}
.card:hover .overlay {
top: 0;
}
.card:hover .overlay-text {
opacity: 1;
}
@media screen and (max-width: 1200px) {
.card {
width: calc(33.33% - 20px);
}
}
@media screen and (max-width: 768px) {
.card {
width: calc(50% - 20px);
}
}
@media screen and (max-width: 480px) {
.card {
width: 100%;
}
}