-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (45 loc) · 1.51 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>livingcolor</title>
<meta charset="utf-8">
<style>
img {
display: none;
}
</style>
<script src="bower_components/three.js/build/three.js"></script>
<script src="bower_components/aquarelle/Aquarelle.js"></script>
<script src="bower_components/three.js/examples/js/postprocessing/EffectComposer.js"></script>
<script src="bower_components/three.js/examples/js/postprocessing/ClearPass.js"></script>
<script src="bower_components/aquarelle/AquarellePass.js"></script>
<script src="bower_components/three.js/examples/js/postprocessing/ShaderPass.js"></script>
<script src="bower_components/three.js/examples/js/shaders/CopyShader.js"></script>
<script src="bower_components/contour.js"></script>
</head>
<body>
<div class="fade">
<img src="img/jimg.jpg">
</div>
<script>
var fade = document.querySelector('.fade');
var image = document.getElementsByTagName('img')[0];
var aquarelle = new Aquarelle(image, 'img/mask.png', {
fromAmplitude: 0,
toAmplitude: 20,
fromFrequency: 8,
toFrequency: 8,
autoplay: true,
loop: true,
fromOffset: -30,
toOffset: 50
});
aquarelle.addEventListener('created', function() {
var canvas = this.getCanvas();
canvas.removeAttribute('style');
image.parentNode.insertBefore(canvas, image.nextSibling);
image.parentNode.removeChild(image);
});
</script>
</body>
</html>