forked from baoilleach/twirlymol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
twirlymol.html
executable file
·38 lines (37 loc) · 1.56 KB
/
twirlymol.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
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript"></script>
<!-- <script type="text/javascript" src="dojo-release-1.3.3/dojo/dojo.js"></script> -->
<script src="twirlymol.js"></script>
<script src="250.js"></script>
<link rel="stylesheet" href="style.css"/></head>
<body><h1>TwirlyMol</h1>
<h2>A minimal molecular viewer</h2>
<p>Click and drag to rotate (left mouse button), zoom/twist (right button) or translate (middle button). The scroll wheel can also be used to zoom.</p>
<p>Developed by <a href="http://baoilleach.blogspot.com">Noel O'Boyle</a> (Github repository <a href="http://github.com/baoilleach/twirlymol">here</a>). To include a twirlymol in your own web page or blog post, please see this <a href="http://baoilleach.blogspot.com/2009/11/ann-chemical-structure-resolver-with.html">blog post</a> or the HTML and Javascript source of this webpage.</p>
<div id="bigmol" style="width:400px;height:400px;">
</div>
<script type="text/javascript">
var MOLID=0;
function mysetup() {
var sdfs = sdf.split("$$$$\n");
var bigmol = dojo.byId("bigmol");
var mol = parseSD(sdfs[3]);
twirlyMol("bigmol", mol.atoms, mol.bonds, mol.elements);
}
function switchMol() {
if(MOLID==0)
MOLID=1;
else
MOLID=0;
var sdfs = sdf.split("$$$$\n");
var bigmol = dojo.byId("bigmol");
var mol = parseSD(sdfs[MOLID]);
twirlyMol("bigmol", mol.atoms, mol.bonds, mol.elements);
}
dojo.addOnLoad( mysetup);
</script></p>
<input type="button" value="SWAP MOLE" onclick="switchMol()">
</body>
</html>