-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (81 loc) · 3.79 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
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
<head>
<title>Epic Circles</title>
<!-- // <script type="text/javascript" src="js/lib/raphael-min.js"></script> -->
<script type="text/javascript" src="js/lib/d3.v3.min.js"></script>
<script type="text/javascript" src="js/lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/lib/xbase-latest-full.js"></script>
<script type="text/javascript" src="js/lib/sylvester.js"></script>
<script type="text/javascript" src="js/geom.js"></script>
<script type="text/javascript" src="js/canvas.js"></script>
<script type="text/javascript" src="js/presets.js"></script>
<script type="text/javascript" src="js/shapes/shape.js"></script>
<script type="text/javascript" src="js/shapes/point.js"></script>
<script type="text/javascript" src="js/shapes/line.js"></script>
<script type="text/javascript" src="js/shapes/polygon.js"></script>
<script type="text/javascript" src="js/shapes/circle.js"></script>
<script type="text/javascript" src="js/shapes/segments.js"></script>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<a href="https://github.com/torpedro/epic-circles" target="_blank"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/82b228a3648bf44fc1163ef44c62fcc60081495e/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png"></a>
<div id="sideMenu">
<div id="settings">
<label><input id="cbShowOriginal" type="checkbox" checked /> Show original shapes</label>
<label><input id="cbShowInverted" type="checkbox" checked /> Show inverted shapes</label>
<label><input id="cbShowInversionCircles" type="checkbox" checked /> Show inversion circles</label>
</div>
<div id="presets">
Presets
</div>
<!-- <button id="btnConvertInvertedShapes">Convert Shapes</button> -->
</div>
<div id="contextMenu">
<div class="contextMenuWrapper">
<a id="btnSpawnInversionCircle">Spawn Inversion Circle</a>
<a id="btnSpawnCircle">Spawn Circle</a>
<a id="btnSpawnLine">Spawn Line</a>
<a id="btnSpawnRectangle">Spawn Rectangle</a>
<a id="btnSpawnTriangle">Spawn Triangle</a>
</div>
</div>
<div class="canvas"></div>
<div class="hint">Hint: Right-click on the canvas to spawn new shapes</div>
<div class="footer">Find the sources at Github: <a href="https://github.com/torpedro/epic-circles" target="_blank">https://github.com/torpedro/epic-circles</a></div>
<script type="text/javascript">
$(function() {
canvas = new Canvas();
// Load the clear preset by default
var hash = window.location.hash;
var preset = (hash && PresetLoader.hasPreset(hash.substring(1))) ? hash.substring(1) : 'clear';
PresetLoader.load(preset, canvas);
// Attach to preset loader links
$.each(PresetLoader.presets, function(key, loader) {
var link = $('<a href="#' + key + '">' + key + '</a>');
link.click(function() {
PresetLoader.load(key, canvas);
});
$('#presets').append(link);
});
// Attach to checkboxes
$('#cbShowOriginal').click(function() {
canvas.setShowOriginalShapes(this.checked);
});
canvas.setShowOriginalShapes($('#cbShowOriginal').is(':checked'));
$('#cbShowInverted').click(function() {
canvas.setShowInvertedShapes(this.checked);
});
canvas.setShowInvertedShapes($('#cbShowInverted').is(':checked'));
$('#cbShowInversionCircles').click(function() {
canvas.setShowInversionCircles(this.checked);
});
canvas.setShowInversionCircles($('#cbShowInversionCircles').is(':checked'));
$('#btnConvertInvertedShapes').click(function() {
canvas.convertInvertedShapes();
});
});
</script>
</body>
</html>