Skip to content

Commit ada29b3

Browse files
author
NaTi Jhon
committed
Project 4 Done
1 parent d35ebd0 commit ada29b3

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Creative img effect</title>
7+
<link rel="shortcut icon" href="assets/icons8-img-96.png" type="image/x-icon">
8+
<link rel="stylesheet" href="style.css">
9+
</head>
10+
<body>
11+
<section class="contianer">
12+
<div class="clip clip1"></div>
13+
<div class="clip clip2"></div>
14+
<div class="clip clip3"></div>
15+
</section>
16+
</body>
17+
</html>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
*{
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
body{
8+
background-color: #555;
9+
height: 100vh;
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
}
14+
15+
.contianer{
16+
position: relative;
17+
width: 800px;
18+
height: 500px;
19+
background: #302c2c;
20+
}
21+
22+
.clip{
23+
position: absolute;
24+
top: 0;
25+
left: 0;
26+
width: 100%;
27+
height: 100%;
28+
transition: all 0.5s;
29+
}
30+
31+
.clip1 {
32+
background: url(https://images.unsplash.com/photo-1509565840034-3c385bbe6451?q=80&w=1632&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D);
33+
background-size: cover;
34+
background-position: center;
35+
clip-path: polygon(0 0, 46% 0, 39% 100%, 0% 100%);
36+
}
37+
38+
.clip2 {
39+
background: url(https://images.unsplash.com/photo-1531512073830-ba890ca4eba2?q=80&w=1579&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D);
40+
background-size: cover;
41+
background-position: center;
42+
clip-path: polygon(19% 0%, 87% 0, 64% 100%, 33% 100%);
43+
}
44+
45+
46+
.clip3 {
47+
background: url(https://images.unsplash.com/photo-1495312040802-a929cd14a6ab?q=80&w=1632&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D);
48+
background-size: cover;
49+
background-position: center;
50+
clip-path: polygon(82% 0%, 100% 0, 100% 100%, 63% 100%);
51+
52+
}
53+
54+
55+
.contianer:hover .clip{
56+
clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
57+
}
58+
59+
.contianer .clip:hover{
60+
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
61+
}

0 commit comments

Comments
 (0)