-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vr.js
74 lines (70 loc) · 1.74 KB
/
index.vr.js
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
import React from 'react';
import {
AppRegistry,
asset,
Pano,
Text,
View,
} from 'react-vr';
export default class VrEvent961 extends React.Component {
constructor(){
super();
this.state={
image : 'starry-sky.jpg'
}
}
get Teleport(){
var data = [
{
image : "island-garden.jpg",
text : "island"
},
{
image : "winter-outdoor.jpg",
text : "winter"
},
{
image : "chess-world.jpg",
text : "chess"
}
]
return(
<View style={{flex : 1,flexDirection : 'row'}}>
{data.map((data,key)=>{
return(
<View style={{flex : 1}} key={key} onEnter={()=>{
this.setState({image : data.image})}}>
<Text
style={{
fontSize: 0.2,
fontWeight: '400',
margin : 0.2,
padding : 0.2,
color : "#fff",
borderRadius : 0.1,
margin : 0.2,
textAlign: 'center',
backgroundColor : '#aaa',
textAlignVertical: 'center',
}}>
{data.text}
</Text>
</View>
)
})}
</View>
)
}
render() {
console.log(this.state);
return (
<View>
<Pano source={asset(this.state.image)}/>
<View style={{flex : 1,flexDirection : 'column',justifyContent:'center',transform: [{translate: [-2,0, -3]}]}}>
{this.Teleport}
</View>
</View>
);
}
};
AppRegistry.registerComponent('VrEvent2017', () => VrEvent961);