-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhover3.html
More file actions
157 lines (143 loc) · 3.26 KB
/
hover3.html
File metadata and controls
157 lines (143 loc) · 3.26 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap");
/* *,
*::after,
*::before { */
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
body {
width: 100vw;
min-height: 100vh;
background-color: #000;
font-family: 'Poppins', sans-serif;
display: flex;
justify-content: center;
align-items: center;
}
.container {
position: relative;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.container .box {
position: relative;
width: 22rem;
height: 22rem;
margin: 2rem;
}
.container .box:hover .imgBox {
transform: translate(-2.5rem, -2.5rem);
}
.container .box:hover .content {
transform: translate(2.5rem, 2.5rem);
}
.imgBox {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
transition: all 0.5s ease-in-out;
}
.imgBox img {
width: 24rem;
height: 22rem; border-radius: 4px;
object-fit: cover;
resize: both;
}
.content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 1rem;
border-radius: 4px;
display: flex;
justify-content: center;
background-color: #414040;
z-index: 1;
align-items: flex-end;
text-align: center;
transition: 0.5s ease-in-out;
}
.content h3 {
display: block;
font-size: 2rem;
color: #fff;
font-weight: 300;
line-height: 2rem;
letter-spacing: 1px;
}
.content span {
color: #ede6e6;
font-size: 1.2rem;
font-weight: 200;
letter-spacing: 2px;
}
@media (max-width: 600px) {
.container .box:hover .content {
transform: translate(0, 2.5rem);
}
.container .box:hover .imgBox {
transform: translate(0, -2.5rem);
}
}
</style>
</head>
<body>
<div class="container">
<div class="box">
<div class="imgBox">
<img src="pro2 addons/Family-Star-Review.jpg" alt="">
</div>
<div class="content">
<h3>Family Star</br>
<span>a family drama</span></h3>
</div>
</div>
<div class="box">
<div class="imgBox">
<img src="pro2 addons/the-croods-movie-wallpaper-preview.jpg" alt="">
</div>
<div class="content">
<h3>The Croods </br>
<span>Lorem 3d movie</span></h3>
</div>
</div>
<div class="box">
<div class="imgBox">
<img src="pro2 addons/my fault.jpg" alt="">
</div>
<div class="content">
<h3>My Fault</br>
<span>a romcom</span></h3>
</div>
</div>
<div class="box">
<div class="imgBox">
<img src="pro2 addons/rathnam-review-2.jpg" alt="">
</div>
<div class="content">
<h3>Rathnam</br>
<span>Action thriller</span></h3>
</div>
</div>
</div>
</body>
</html>