-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (66 loc) · 2.63 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
<!DOCTYPE HTML>
<html>
<head>
<title>Trixel</title>
<meta charset="UTF-8">
<meta name="author" content="Glen De Cauwsemaecker">
<meta name="description" content="Trixel is an editor that allows you to make trixel art. It is intuitive and simple in design.">
<meta name="keywords" content="trixel, art, 2D, free, triangle, isometric, simple">
<style>
html,head,body { adding:0; margin:0; }
body { font-family: calibri, helvetica, arial, sans-serif; }
</style>
<script src="elm.js"></script>
<script src='thirdparty/jquery-1.11.3.min.js'></script>
<script src='thirdparty/spectrum.js'></script>
<link rel='stylesheet' href='thirdparty/spectrum.css' />
<script>
// Called When Trixel Loads
var onLoad = function() {
var trixelEditor = Elm.fullscreen(Elm.Trixel.Main, {
startEditor: { x: 0, y: 0 },
triggerJSInput : false,
setTrixelColor : { red: 0, green: 0, blue: 0, alpha: 0 },
});
trixelEditor.ports.startEditor.send({x: window.innerWidth, y: window.innerHeight});
// Called when glueState is changed
trixelEditor.ports.updateStateSignalPort.subscribe(function(glueState) {
// showing colorPicker
var colorPickerClass = "." + glueState.cssInfo.colorPicker;
$(colorPickerClass).spectrum({
showAlpha: true,
showButtons: false,
preferredFormat: "rgb",
showInitial: true,
color: glueState.trixelColor,
show: function(tinycolor) {
trixelEditor.ports.triggerJSInput.send(true);
},
hide : function(tinycolor) {
trixelEditor.ports.triggerJSInput.send(false);
},
change: function(color) {
trixelEditor.ports.setTrixelColor.send(
{ red: color._r
, green: color._g
, blue: color._b
, alpha: color._a
});
}
});
});
};
</script>
<link rel="shortcut icon" href="trixel.ico" />
<link rel="stylesheet" href="stylesheet.css" />
</head>
<body onload="onLoad();"></body>
<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','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-64588932-1', 'auto');
ga('send', 'pageview');
</script>
</html>