-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·53 lines (39 loc) · 2.68 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
52
53
<!DOCTYPE html>
<!--[if lt IE 7]><html lang="en" class="no-js ie6 oldie"><![endif]-->
<!--[if IE 7]><html lang="en" class="no-js ie7 oldie"><![endif]-->
<!--[if IE 8]><html lang="en" class="no-js ie8 oldie"><![endif]-->
<!--[if IE 9]><html lang="en" class="no-js ie9"><![endif]-->
<!--[if gt IE 9]><!--><html lang="en" class="no-js"><!--<![endif]-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GetSchwifty.js - an experimental javascript canvas animation thingy mbob</title>
<meta name="description" content="GetSchwifty.js loads in an image in block by block from top left to bottom right, it then disperse the blocks in an inverted pattern to obfuscate the image.">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-83319112-1', 'auto');
ga('send', 'pageview');
</script>
<style>body{margin:0;padding:0;overflow: hidden;}</style>
</head>
<body>
<canvas id="canvas" width="1920" height="1080"></canvas>
<script src="GetSchwifty.js"></script>
<script>
var GetSchwifty = new GetSchwifty({
selector: "#canvas", // using document.querySelector for flexibility
rowPieces: 8, // how many pieces you would like the image to be split into on the x axis
columnPieces: 8, // how many pieces you would like the image to be split into on the y axis
yUpdateSpeed: 50, // This will update the position of the image's pieces by a set pixel value, to be as smooth as possible you would use a value of 1, though this would make the animation very slow
xUpdateSpeed: 50, // This will update the position of the image's pieces by a set pixel value, to be as smooth as possible you would use a value of 1, though this would make the animation very slow
img: "rick-and-morty-get-schwifty.jpg", // Set a path to the image you would like to use
width: window.innerWidth, // The width can be set with JS if you'd like instead of utilising attributes on the canvas element. This means you can use window.innerWidth for example
height: window.innerHeight // The height can be set with JS if you'd like instead of utilising attributes on the canvas element. This means you can use window.innerHeight for example
});
</script>
</body>
</html>