Skip to content

Commit a9d30a1

Browse files
committed
fixed renderer location
1 parent 215052e commit a9d30a1

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<link href="assets/dist/css/bootstrap.min.css" rel="stylesheet">
2121

2222
<!-- Custom styles for this template -->
23-
<link href="starter-template.css" rel="stylesheet">
23+
<link href="./starter-template.css" rel="stylesheet">
2424
</head>
2525
<body>
2626

@@ -58,12 +58,13 @@ <h1>TSL API</h1>
5858
<p>Get the code here</p>
5959
<textarea class="input-xlarge" id="codeBox" rows="10" spellcheck="false" style="min-width:100%"></textarea>
6060
</div>
61-
<div class="col-4">
62-
<p>Render the animation here</p>
63-
<span style="min-width:100%; border: 1px solid black" id="synthBox" class="diagram right">
61+
<div class="col-4" id="synthBox">
6462

65-
</span>
66-
<!--textarea class="input-xlarge" id="synthBox" rows="10" spellcheck="false" style="min-width:100%"></textarea-->
63+
<p id = "render">Render the animation here</p>
64+
<!--span style="min-width:100%; border: 1px solid black" id="synthBox" class="diagram right">
65+
66+
</span-->
67+
<!--textarea class="input-xlarge" rows="10" spellcheck="false" style="min-width:100%"></textarea-->
6768
</div>
6869
</div>
6970

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@ function sceneBuild() { //so this is where the thing will animate
133133
//create the renderer
134134
const renderer = new THREE.WebGLRenderer();
135135
// document.body.appendChild( renderer.domElement );
136-
renderer.setSize( window.innerWidth/4, window.innerHeight/4 ); //this changes the size of the renderer
136+
137+
renderer.setSize( window.innerWidth/4, window.innerHeight/4 );
138+
document.getElementById("render").appendChild( renderer.domElement );
139+
//renderer.setSize( document.getElementById('synthBox').style.width, document.getElementById('synthBox').style.height ); //this changes the size of the renderer
137140
//*I believe renderer.setviewPort can change the positioning of the animation
138141
//renderer.setViewport(0, 0, window.innerWidth/4, window.innerHeight/4);
139-
console.log(document.getElementById("synthBox"))
142+
//console.log(document.getElementById("synthBox"))
140143
// document.body.insertBefore(renderer.domElement, document.getElementById("synthBox"));
141-
document.body.appendChild( renderer.domElement );
144+
142145

143146

144147

starter-template.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
content: "";
1717
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23212529' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z'/%3E%3C/svg%3E") no-repeat center center / 100% auto;
1818
}
19-
.diagram {
19+
/*.diagram {
2020
display: inline-block;
2121
width: 7em;
2222
height:17em;
2323
border: 1px solid black;
24-
}
24+
z-index: -1;
25+
}*/

0 commit comments

Comments
 (0)