forked from mattdesl/color-wander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (86 loc) · 2.31 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, shrink-to-fit=0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>Wander</title>
<link href='https://fonts.googleapis.com/css?family=Oxygen:300,700' rel='stylesheet' type='text/css'>
<style type="text/css">
canvas {
cursor: pointer;
}
.seed-container {
cursor: auto;
position: absolute;
left: 10px;
top: 10px;
color: white;
font-weight: 200;
text-transform: uppercase;
font-size: 12.25px;
font-family: 'Oxygen', sans-serif
}
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
not supported by any browser */
}
.seed-text {
font-weight: 700;
}
#save-btn {
position: fixed;
bottom: 15px; right: 15px;
height: 24px; width: 24px;
opacity: 0.6;
}
#save-btn:hover {
opacity: 1;
}
.howto {
font-size: 9px;
}
.palette-opt {
cursor: pointer;
}
#fill, #coverall {
cursor: pointer;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#coverall {
background: #555;
opacity: 0;
}
</style>
</head>
<body>
<div id="fill"></div>
<div id="coverall"></div>
<canvas id="canvas" class="noselect"></canvas>
<header class="seed-container">
<div>seed – <span class="seed-text">12380</span></div>
<div>map – <span class="map-text"> * </span></div>
<div>random palette – <u class="palette-opt"> false </u></div>
<div class="howto">tap to randomize</div>
</header>
<a href='javascript:downloadCanvas()' title="Download result" id="save-btn"> <img alt="save" src="vendor/save.svg"/></a>
<script src="vendor/color-thief.js"></script>
<script src="bundle.js"></script>
<script>
function downloadCanvas() {
const link = document.getElementById('save-btn');
link.href = document.getElementById('canvas').toDataURL();
link.download = new Date() + '.png';
link.click();
}
</script>
</body>
</html>