-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathliquid_distortion_imge.html
71 lines (70 loc) · 2.22 KB
/
liquid_distortion_imge.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liquid Distortion Image</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
.container{
position: relative;
width: 900px;
display: flex;
align-items: center;
justify-content: space-between;
}
.container .imgBx{
position: relative;
width: 400px;
height: 400px;
margin: 40px;
}
.container .imgBx img{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
display: none;
}
</style>
</head>
<body>
<div class="container">
<div class="imgBx">
<img src="assets/liquid/img1.jpg" alt="">
<img src="assets/liquid/img2.jpg" alt="">
</div>
<div class="imgBx">
<img src="assets/liquid/img3.jpg" alt="">
<img src="assets/liquid/img4.jpg" alt="">
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r121/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.4/gsap.js" ></script>
<script src="assets/Hover_Master_liquid/dist/hover_recreated.js"></script>
<script>
Array.from(document.querySelectorAll('.imgBx')).forEach((e)=>{
const imgs = Array.from(e.querySelectorAll('img'));
new hoverEffect({
parent: e,
intensity: 0.5, //Change The Intensity For More Better Timing Default 0.3
image1: imgs[0].getAttribute("src"),
image2: imgs[1].getAttribute("src"),
displacementImage: 'assets/Hover_Master_liquid/example/img/displacement/14.jpg'
});
})
</script>
</body>
</html>