awacke1 commited on
Commit
d1285e8
·
1 Parent(s): 78ef995

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +55 -16
index.html CHANGED
@@ -1,19 +1,58 @@
1
  <!DOCTYPE html>
2
  <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
  <!DOCTYPE html>
2
  <html>
3
+ <head>
4
+ <title>DNA Sequence</title>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <script src="https://cdn.babylonjs.com/babylon.js"></script>
8
+ <script src="https://cdn.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
9
+ </head>
10
+ <body>
11
+ <canvas id="renderCanvas"></canvas>
12
+ <script>
13
+ var canvas = document.getElementById("renderCanvas");
14
+ var engine = new BABYLON.Engine(canvas, true);
15
+
16
+ var createScene = function () {
17
+ var scene = new BABYLON.Scene(engine);
18
+ var camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 2, Math.PI / 2, 10, BABYLON.Vector3.Zero(), scene);
19
+ camera.attachControl(canvas, true);
20
+
21
+ // Create a DNA strand
22
+ var dnaStrand = BABYLON.MeshBuilder.CreateTorusKnot("dnaStrand", {
23
+ radius: 1.5,
24
+ tube: 0.3,
25
+ radialSegments: 32,
26
+ tubularSegments: 64,
27
+ p: 2,
28
+ q: 3
29
+ }, scene);
30
+
31
+ // Create the material for the DNA strand
32
+ var dnaMaterial = new BABYLON.StandardMaterial("dnaMaterial", scene);
33
+ dnaMaterial.diffuseTexture = new BABYLON.Texture("https://i.imgur.com/06QxEyj.jpg", scene);
34
+ dnaMaterial.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1);
35
+ dnaMaterial.specularColor = new BABYLON.Color3(0.2, 0.2, 0.2);
36
+
37
+ // Apply the material to the DNA strand
38
+ dnaStrand.material = dnaMaterial;
39
+
40
+ // Add some lights to the scene
41
+ var light1 = new BABYLON.PointLight("light1", new BABYLON.Vector3(5, 10, 5), scene);
42
+ var light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(-5, -10, -5), scene);
43
+
44
+ return scene;
45
+ }
46
+
47
+ var scene = createScene();
48
+
49
+ engine.runRenderLoop(function () {
50
+ scene.render();
51
+ });
52
+
53
+ window.addEventListener("resize", function () {
54
+ engine.resize();
55
+ });
56
+ </script>
57
+ </body>
58
  </html>