
HTML & 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
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.card {
width: 200px;
height: 200px;
border-radius: 10px;
overflow: hidden;
position: relative;
}
.card img {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
transition: all 0.4s;
}
.btn {
position: absolute;
top: 15px;
left: 15px;
width: 30px;
height: 30px;
z-index: 100;
appearance: none;
}
.btn::before {
content: "\f129";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-family: "Font Awesome 5 Free";
font-weight: 700;
display: flex;
justify-content: center;
border-radius: 5px;
align-items: center;
background: #383838;
color: white;
cursor: pointer;
transition: all 0.4s;
}
.btn:checked::before {
content: "\f00d";
transform: translate(20%, 20%);
background: #fff;
color: #383838;
}
.overlay {
position: absolute;
right: -80%;
bottom: -80%;
width: 200px;
height: 200px;
background: rgba(41, 41, 41, 0.991);
border-radius: 5px;
transition: all 0.4s;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.498);
color: white;
padding: 60px 10px 0 25px;
}
.overlay p {
font-size: 12px;
}
.btn:checked ~ .overlay {
bottom: -10px;
right: -10px;
width: 200px;
height: 200px;
}
.btn:checked ~ img {
transform: scale(2);
}
</style>
<div class="card">
<input type="checkbox" name="" class="btn" />
<div class="overlay">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, cumque.
</p>
</div>
<img src="https://images.unsplash.com/photo-1668881233694-1825a663b2a4?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80" alt="" srcset="" />
</div>