-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
71 lines (58 loc) · 1.35 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
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>Etch A Sketch</title>
</head>
<body>
<div class="canvasWrap">
<canvas width="1600" height="1000" id="etch-a-sketch"></canvas>
<div class="buttons">
<button class="shake">Shake!</button>
</div>
</div>
<script src="./etch-a-sketch.js"></script>
<style>
body {
min-height: 100vh;
display: grid;
align-items: center;
justify-items: center;
background: white;
background: url(https://s3.amazonaws.com/media.locally.net/original/HABA_ALT_2017-08-02-13-22-45.jpg);
background-size: cover;
}
canvas {
border: 30px solid #e80000;
border-radius: 10px;
/* Set the width and height to half the actual size so it doesn't look pixelated */
width: 800px;
height: 500px;
background: white;
}
canvas.shake {
animation: shake 0.5s linear 1;
}
@keyframes shake {
10%,
90% {
transform: translate3d(-1px, 0, 0);
}
20%,
80% {
transform: translate3d(2px, 0, 0);
}
30%,
50%,
70% {
transform: translate3d(-4px, 0, 0);
}
40%,
60% {
transform: translate3d(4px, 0, 0);
}
}
</style>
</body>
</html>