-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
70 lines (60 loc) · 4.09 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
<!DOCTYPE HTML>
<html>
<head>
<!-- Stylesheet -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- For sites like reddit to get a good thumbnail -->
<meta property="og:image" content="http://mysterydate.github.io/superFormulaGenerator/thumbnail.jpg" />
<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
mixpanel.init("75daca8148b8a1cd664cef2ae1a21ffb");</script><!-- end Mixpanel -->
<link rel="shortcut icon" href="./favicon.ico" />
<title>SUPERFORMULA!</title>
</head>
<body>
<!-- Main screen -->
<div id="container"></div>
<div id="INFO">
<!-- Wiki link -->
<a id="WIKI" href="https://en.wikipedia.org/wiki/Superformula">en.wikipedia.org/wiki/Superformula</a><br>
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.
</div>
<!-- JS Libraries -->
<script type="text/javascript" src="includes/jquery.min.js"></script>
<script type="text/javascript" src="includes/dat.gui.min.js"></script>
<script type="text/javascript" src="includes/Tween.js"></script>
<script type="text/javascript" src="includes/three.js"></script>
<script type="text/javascript" src="includes/orbitControls.js"></script>
<!-- Scripts -->
<script type="text/javascript" src="js/SuperGeometry.js"></script>
<script type="text/javascript" src="js/SUPERFORMULATOR.js"></script>
<script>
$(function() {
SUPERFORMULATOR.init();
mixpanel.track("App Started");
// GUI stuff TODO extract
// ------------------------
var gui = new dat.GUI();
var state = SUPERFORMULATOR.state;
var f1 = gui.addFolder("longitudinal");
var f2 = gui.addFolder("latitudinal");
state.keys.forEach(function(control) {
f1.add(state.goal.longitudinal, control).min(state.bounds[control][0]).max(state.bounds[control][1]).name(state.displayName[control]);
f2.add(state.goal.latitudinal, control).min(state.bounds[control][0]).max(state.bounds[control][1]).name(state.displayName[control]);
});
f1.open();
f2.open();
gui.add(state, "randomize").name("randomize");
// Don't move camera for gui interactions
$(".dg").on("mousedown", function(e) {
e.stopPropagation();
});
// -----------------------
window.setTimeout(function() {
SUPERFORMULATOR.render();
}, 0);
});
</script>
</body>
</html>