-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathportrait.html
76 lines (73 loc) · 2.74 KB
/
portrait.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
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="everything.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="glitch-image.js"></script>
<script type="text/javascript" src="events.js"></script>
<title>Sarah A Weir</title>
</head>
<body>
<div class='nav'>
<div class='nav-title'><a href='index.html'>Sarah Weir</a></div>
<div class='nav-option'><a href='graduation.html'>College</a></div>
<div class='nav-option'><a href='artsy.html'>Work</a></div>
<div class='nav-option'><a href='portrait.html'>Portrait <</a></div>
<div class='left-foot'>
<div class='footer-info'><a href='mailto:[email protected]'>sweir27 at gmail dot com</a></div>
<div class='footer-info'><a href='resume.pdf'>résumé</a></div>
<div class='footer-info'><a href='https://github.com/sweir27'>github</a></div>
<div class='footer-info'><a href='https://www.linkedin.com/in/sweir27'>linkedin</a></div>
<div class='footer-info'><a href='http://instagram.com/sweir27'>instagram</a></div>
</div>
</div>
<div class='main'>
<div class='main-wrap'>
<!-- <div class='arrow-wrap'>
<a id='move-back' href='artsy.html'>
<img class='arrow arrow-back' src='left-arrow.png'></img>
</a>
</div> -->
<div class='main-image'>
<canvas id="canvas" width="427" height="640"></canvas>
</div>
<!-- <div class='arrow-wrap'>
<a id='move-forward' href='graduation.html'>
<img class='arrow arrow-forward' src='right-arrow.png'></img>
</a>
</div> -->
</div>
<div class='control-panel'>
<div class='control-button'>
<a id='glitch-on'>Glitch on</a>
</div>
<div class='control-button'>
<a id='glitch-off'>Glitch off</a>
</div>
</div>
</div>
<script>
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext('2d');
var jpgHeaderLength;
var base64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var base64Map = base64Chars.split("");
var reverseBase64Map = {};
base64Map.forEach(function(val, key) {
reverseBase64Map[val] = key
});
var glitchHistory = [];
var glitchCount = 0;
var glitchMax = 5;
var glitchTime;
var glitchRunning;
var initialImage = new Image();
var imgDataArr;
initialImage.onload = function() {
startGlitch()
};
initialImage.setAttribute('crossOrigin', 'anonymous');
initialImage.src = "sarah.jpg";
</script>
</body>
</html>