Skip to content
Snippets Groups Projects
Select Git revision
  • b302bb8455cd03d96cb756be107ecbc792c6b491
  • master default protected
  • rednatco-v2
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • servers
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

mol.ts

Blame
  • index.html 3.04 KiB
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8" />
            <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
            <title>Mol* Lighting Demo</title>
            <style>
                * {
                    margin: 0;
                    padding: 0;
                    box-sizing: border-box;
                }
                #app {
                    position: absolute;
                    left: 160px;
                    top: 100px;
                    width: 600px;
                    height: 600px;
                    border: 1px solid #ccc;
                }
    
                #controls {
                    position: absolute;
                    width: 150px;
                    top: 100px;
                    left: 780px;
                }
    
                #controls > button {
                    display: block;
                    width: 100%;
                    text-align: left;
                    margin: 5px 0px;
                }
    
                #controls > input, #controls > select {
                    width: 100%;
                    display: block;
                }
            </style>
            <link rel="stylesheet" type="text/css" href="molstar.css" />
            <script type="text/javascript" src="./index.js"></script>
        </head>
        <body>
            <div id='controls'></div>
            <div id="app"></div>
            <script>
                LightingDemo.init('app')
                LightingDemo.load({ url: 'https://files.rcsb.org/download/1M07.cif', assemblyId: '1' })
    
                addHeader('Example PDB IDs');
                addControl('1M07', () => LightingDemo.load({ url: 'https://files.rcsb.org/download/1M07.cif', assemblyId: '1' }));
                addControl('6HY0', () => LightingDemo.load({ url: 'https://files.rcsb.org/download/6HY0.cif', assemblyId: '1' }));
                addControl('6QVK', () => LightingDemo.load({ url: 'https://files.rcsb.org/download/6QVK.cif', assemblyId: '1' }));
                addControl('1RB8', () => LightingDemo.load({ url: 'https://files.rcsb.org/download/1RB8.cif', assemblyId: '1' }));
    
                addSeparator()
    
                addHeader('Lighting Presets');
                addControl('Illustrative', () => LightingDemo.setPreset('illustrative'));
                addControl('Standard', () => LightingDemo.setPreset('standard'));
                addControl('Ambient Occlusion', () => LightingDemo.setPreset('occlusion'));
    
                ////////////////////////////////////////////////////////
    
                function $(id) { return document.getElementById(id); }
    
                function addControl(label, action) {
                    var btn = document.createElement('button');
                    btn.onclick = action;
                    btn.innerText = label;
                    $('controls').appendChild(btn);
                }
    
                function addSeparator() {
                    var hr = document.createElement('br');
                    $('controls').appendChild(hr);
                }
    
                function addHeader(header) {
                    var h = document.createElement('h3');
                    h.innerText = header;
                    $('controls').appendChild(h);
                }
            </script>
        </body>
    </html>