Skip to content

Commit d04f6fb

Browse files
committed
Added 3d viewing to model
1 parent 4dfedca commit d04f6fb

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

components/App.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ function Page4(comp){
125125
ReactDOM.render(
126126
<section>
127127
<h3 className="subtitle">Fact:</h3>
128-
<p>{resp.data.fact}</p>
128+
<p>{resp.data.info.fact}</p>
129129
<div className={styles.buttons}>
130-
<a className={styles.button} href="/app/run/view3d?url=https://wwf-jr.github.io/3D-Data/tarsier.stl" target="_blank">View in 3D</a>
131-
<a className={styles.button} href="/app/run/viewar?url=https://wwf-jr.github.io/3D-Data/tarsier.stl" target="_blank">View in Real Life</a>
130+
<a className={styles.button} href={`/app/run/view3d?url=${resp.data.info["3d"]}`} target="_blank">View in 3D</a>
131+
<a className={styles.button} href={`/app/run/viewar?url=${resp.data.info["3d"]}`} target="_blank">View in Real Life</a>
132132
</div>
133133
</section>
134134
, document.getElementById("main"))

pages/app/run/view3d.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react"
2+
3+
export default class GoTo3D extends React.Component {
4+
query;
5+
constructor(props){
6+
super(props)
7+
console.log(props)
8+
}
9+
render(){
10+
return (<div></div>)
11+
}
12+
componentDidMount(){
13+
document.location.assign(document.location.href.replace("wwf-jr.netlify.app/app/run/view3d", "wwf-3d.netlify.app"))
14+
}
15+
}

pages/app/run/viewar.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react"
2+
3+
export default class GoTo3D extends React.Component {
4+
query;
5+
constructor(props){
6+
super(props)
7+
console.log(props)
8+
}
9+
render(){
10+
return (<div></div>)
11+
}
12+
componentDidMount(){
13+
document.location.assign(document.location.href.replace("wwf-jr.netlify.app/app/run/view3d", "wwf-3d.netlify.app"))
14+
}
15+
}

0 commit comments

Comments
 (0)