forked from clarabstract/factorio-calc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (75 loc) · 2.77 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
<!DOCTYPE html> <html> <head>
<title>Factorio Calc</title>
<script type="text/javascript">
DATALIBS = [
'core-0-15-6',
'core-0-14-22',
'core-0-14-20',
'core-0-12-33',
'core-0-11-3',
'core-0-10-2',
'core-0-9-8',
];
</script>
<script type="text/javascript" src="lua.vm.js"></script>
<script type="text/javascript" src="ffi.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.10.0/react.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.10.0/JSXTransformer.js"></script>
<script src="bower_components/d3/d3.min.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/graphlib/dist/graphlib.core.js"></script>
<script src="bower_components/dagre/dist/dagre.core.js"></script>
<script src="bower_components/dagre-d3/dist/dagre-d3.core.js"></script>
<link rel="stylesheet" href="calc.css">
<script type="text/jsx" src="calc.jsx"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script type="text/lua">
if #window.location.hash == 0 then
window.location.hash = '#'..js.global.DATALIBS[0]
end
datalib = window.location.hash:sub(2)
js.global.CURRENT_LIB = datalib
require('dataloader')
require('data.'..datalib)
require('calc')
require('ffi')
js.global:renderCalc(to_js_val(data.raw.recipe))
function calc_request(recipe, ips, opts)
return to_js_val(request(tostring(recipe), ips, opts))
end
js.global.calcRequest = calc_request
</script>
<style>
/* This sets the color for "TK" nodes to a light blue green. */
g.type-TK > rect {
fill: #00ffd0;
}
text {
font-weight: 300;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serf;
font-size: 14px;
}
.node rect {
stroke: #999;
fill: #fff;
stroke-width: 1.5px;
}
.edgePath path {
stroke: #333;
stroke-width: 1.5px;
}
</style>
</head>
<body>
<a href="https://github.com/rubyruy/factorio-calc"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<div id="calc"></div>
<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-825268-3', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>