forked from sokrypton/py2Dmol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
229 lines (188 loc) · 11.8 KB
/
Copy pathindex.html
File metadata and controls
229 lines (188 loc) · 11.8 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>py2Dmol</title>
<script src="https://cdn.tailwindcss.com"></script>
<!-- JSZip library for handling AlphaFold zip outputs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<!-- Numeric.js for Kabsch Alignment (SVD) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" xintegrity="sha512-SnH5WK+bZxgPHs44uWIX+LLMDJd4gYm4zQ6UvE6j3v/3Tf7U7T2Y9p6gJzU0bW5V6f6G6X6b6W6w6+g6w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="web/style.css">
</head>
<body class="bg-gray-50 text-gray-800 font-sans p-8">
<!-- Global Drop Overlay Element -->
<div id="global-drop-overlay">
<p><i class="fa-solid fa-cloud-arrow-up mr-3"></i> Drop File Anywhere to Upload</p>
</div>
<!-- End Global Drop Overlay -->
<!-- Total width (600 + 24 + 324 = 948px) -->
<div class="mx-auto" style="width: 948px;">
<h1 class="text-4xl font-extrabold text-gray-900 mb-2">py2Dmol</h1>
<p class="text-gray-500 mb-8">Upload a PDB/CIF file or fetch from RCSB PDB (4-char ID) / AlphaFold DB (UniProt ID) to visualize protein structures.</p>
<div class="bg-white p-6 rounded-2xl shadow-lg mb-5 border border-gray-100" style="width: 948px;">
<!-- Use table for reliable layout -->
<table style="width: 100%; border-collapse: collapse; table-layout: fixed;">
<tr>
<!-- Left Column: Fetch + Upload -->
<td style="width: 50%; padding-right: 20px; vertical-align: top;">
<!-- Fetch Section -->
<label for="fetch-id" style="display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px;">PDB (4-char) or UniProt ID</label>
<div id="fetch-input-container" style="margin-bottom: 20px;">
<input type="text" id="fetch-id" placeholder="e.g., 4HHB or P0A8I3">
<button id="fetch-btn">Fetch</button>
</div>
<!-- Upload Section -->
<label style="display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px;">Upload PDB / CIF / ZIP</label>
<div id="uploadControlsContainer">
<!-- Upload Button (Triggers hidden input) -->
<button id="upload-button">
<i class="fa-solid fa-file-arrow-up"></i>
<span>Choose Files</span>
</button>
<input type="file" id="file-upload" accept=".pdb,.cif,.ent,.zip,.json" multiple class="hidden">
</div>
</td>
<!-- Separator Column -->
<td style="width: 40px; vertical-align: top;">
<div style="width: 1px; height: 180px; background: linear-gradient(to bottom, transparent, #e5e7eb 10%, #e5e7eb 90%, transparent); margin: 0 auto;"></div>
</td>
<!-- Right Column: All Options -->
<td style="vertical-align: top;">
<label style="display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px;">Options</label>
<div class="upload-options-section" style="margin-bottom: 0;">
<!-- Load as Frames Toggle -->
<div class="upload-toggle-item">
<label class="switch">
<input type="checkbox" id="loadAsFramesCheckbox" checked>
<span class="slider-toggle"></span>
</label>
<label for="loadAsFramesCheckbox" class="upload-toggle-label">Load as Frames</label>
</div>
<!-- Align to First Frame Toggle -->
<div class="upload-toggle-item">
<label class="switch">
<input type="checkbox" id="alignFramesCheckbox" checked>
<span class="slider-toggle"></span>
</label>
<label for="alignFramesCheckbox" class="upload-toggle-label">Align Frames</label>
</div>
<!-- Bioassembly Toggle -->
<div class="upload-toggle-item">
<label class="switch">
<input type="checkbox" id="biounitCheckbox" checked>
<span class="slider-toggle"></span>
</label>
<label for="biounitCheckbox" class="upload-toggle-label">Load Bioassembly (BU1)</label>
</div>
<!-- Ignore Ligands Toggle -->
<div class="upload-toggle-item">
<label class="switch">
<input type="checkbox" id="ignoreLigandsCheckbox" checked>
<span class="slider-toggle"></span>
</label>
<label for="ignoreLigandsCheckbox" class="upload-toggle-label">Ignore Ligands</label>
</div>
</div>
</td>
</tr>
</table>
<!-- Status message below the table with extra margin -->
<div id="status-message"></div>
</div>
<div id="viewer-container" class="py2dmol-viewer-instance" style="display: none;">
<div id="mainContainer">
<div id="viewerColumn">
<div id="canvasContainer">
<canvas id="canvas"></canvas>
</div>
<div id="controlsContainer">
<button id="playButton" class="controlButton"><i class="fa-solid fa-play"></i></button>
<input type="range" id="frameSlider" min="0" max="0" value="0">
<span id="frameCounter">Frame: 0 / 0</span>
<select id="speedSelect">
<option value="100">1x</option>
<option value="50">2x</option>
<option value="25">4x</option>
</select>
</div>
</div>
<div id="rightPanelContainer">
<!-- Toolbar (two rows) -->
<div id="navigationControls" class="toolbar" style="margin-bottom: 12px;">
<div class="toolbar-row">
<button id="orientButton" class="nav-button btn-grey" style="flex: 1;" title="Orient to best view">
Orient
</button>
<!-- Rotate: checkbox styled as a button -->
<label class="btn-toggle" id="rotateToggle" style="flex: 1;" title="Toggle auto-rotation">
<input type="checkbox" id="rotationCheckbox">
<span>Rotate</span>
</label>
<button id="prevObjectButton" class="nav-button btn-grey" style="width: 40px; padding: 0;" title="Previous object">
<
</button>
<button id="nextObjectButton" class="nav-button btn-grey" style="width: 40px; padding: 0;" title="Next object">
>
</button>
</div>
<!-- New second row -->
<div class="toolbar-row">
<label class="btn-toggle" title="Toggle shadow">
<input type="checkbox" id="shadowEnabledCheckbox" checked>
<span>Shadow</span>
</label>
<label class="btn-toggle" title="Toggle outline">
<input type="checkbox" id="outlineEnabledCheckbox" checked>
<span>Outline</span>
</label>
<label class="btn-toggle" title="Colorblind-safe colors">
<input type="checkbox" id="colorblindCheckbox">
<span>Colorblind</span>
</label>
</div>
</div>
<div id="styleAppearanceContainer" class="control-group">
<div class="toggle-item">
<label for="colorSelect" class="font-medium text-gray-700">Color:</label>
<select id="colorSelect">
<option value="auto">Auto</option>
<option value="plddt">pLDDT</option>
<option value="rainbow">Rainbow</option>
<option value="chain">Chain</option>
</select>
</div>
<div class="toggle-item">
<label for="lineWidthSlider" class="font-medium text-gray-700">Width:</label>
<input type="range" id="lineWidthSlider" min="2.0" max="4.7" value="3.0" step="0.1">
</div>
<div class="toggle-item">
<label for="orthoSlider" class="font-medium text-gray-700">Ortho:</label>
<input type="range" id="orthoSlider" min="50" max="200" value="150" step="5">
</div>
</div>
<div id="modelControlContainer" class="control-group" style="padding-top: 0; gap: 8px;">
<div id="objectContainer" class="toggle-item" style="margin-top: 0;">
<label for="objectSelect" class="font-medium text-gray-700">Object:</label>
<select id="objectSelect">
<!-- Initially empty -->
</select>
</div>
</div>
<!-- PAE Container is now centered and aligned with no extra space -->
<div id="paeContainer">
<!-- Canvas size must match the width/height CSS defined above (296px) -->
<canvas id="paeCanvas" width="296" height="296" style="cursor: crosshair; display: block;"></canvas>
</div>
</div>
</div>
</div>
</div>
<!-- Load scripts in order -->
<script src="web/utils.js"></script>
<script id="py2dmol-renderer" src="py2Dmol/resources/py2Dmol.js"></script>
<script src="web/app.js"></script>
</body>
</html>