-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.js
205 lines (195 loc) · 5.67 KB
/
index.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import React from 'react'
import { connect } from 'react-redux'
import { createSelector } from 'reselect'
import {
selectHasTouch
} from 'containers/App/selectors'
import Button from 'components/Button'
import ExplainScreen from 'containers/ExplainScreen'
const tableCells = {
metadata: [
undefined,
'The title and metadata can give you important information on the geographic location of the image. You can toggle this information by clicking or tapping on the image.'
],
new: [
<Button fake type='new'>New</Button>,
'You can always try a different image by clicking the New button. (You might see the current image again in the future.)'
],
map: [
undefined,
'To geotag the image, move the map so that the location of the marker reflects the location depicted on the image. Once you’ve submitted a location, you can take the optional step of marking the direction and angle of the view of the image.'
],
score: [
undefined,
'Every time you geotag an image, you score increases. To save your score, you can log in using one of the services from the menu.'
],
skip: [
<Button fake type='skip'>Skip</Button>,
'You can skip images that don’t depict a location, or that are too difficult to geotag. (If you skip an image, you will not see this image again.)'
],
submit: [
<Button fake type='submit'>Submit</Button>,
'If you’ve found the correct location, click Submit to send this information to the NYPL.'
],
panes: [
undefined,
'To make the image or the map bigger, you can switch between split pane mode and single pane mode.'
],
toMap: [
undefined,
'To switch between the image and the map, click the small map in the corner'
],
toImage: [
undefined,
'And you can go back to the image by clicking the small image'
]
}
const screens = {
desktop: {
image: require('images/get-started/desktop.jpg'),
dimensions: [760, 525.1],
svgOffset: [330, -212.1],
components: [
{
dimensions: {
x: 366.8, y: -115.3, width: 280.5, height: 116.9
},
tableCells: tableCells.metadata
},
{
dimensions: {
x: 365.7, y: 221.6, width: 75.3, height: 43.4
},
tableCells: tableCells.new
},
{
dimensions: {
x: 836.1, y: 9.6, width: 87.0, height: 79.7
},
tableCells: tableCells.map
},
{
dimensions: {
x: 869.6, y: 221.6, width: 74.4, height: 43.4
},
tableCells: tableCells.skip
},
{
dimensions: {
x: 965.6, y: 221.6, width: 86.4, height: 43.4
},
tableCells: tableCells.submit
},
{
dimensions: {
x: 935.5, y: -150.3, width: 68.9, height: 43.2
},
tableCells: tableCells.panes
},
{
dimensions: {
x: 804.2, y: -150.3, width: 113.2, height: 43.2
},
tableCells: tableCells.score
}
]
},
mobile: {
image: require('images/get-started/mobile.jpg'),
dimensions: [760, 600],
svgOffset: [330, -250],
components: [
{
dimensions: {
x: 374.5, y: -160.0, width: 300.2, height: 123.0
},
tableCells: tableCells.metadata[1]
},
{
dimensions: {
x: 368.5, y: 207, width: 76.5, height: 44
},
tableCells: tableCells.new[1]
},
{
dimensions: {
x: 580, y: 179, width: 100, height: 74
},
tableCells: tableCells.toMap[1]
},
{
dimensions: {
x: 734, y: 179, width: 100, height: 74
},
tableCells: tableCells.toImage[1]
},
{
dimensions: {
x: 843, y: -26, width: 95, height: 85
},
tableCells: tableCells.map[1]
},
{
dimensions: {
x: 857, y: 207, width: 75, height: 44
},
tableCells: tableCells.skip[1]
},
{
dimensions: {
x: 954, y: 207, width: 90, height: 44
},
tableCells: tableCells.submit[1]
},
{
dimensions: {
x: 968, y: -199, width: 76, height: 41
},
tableCells: tableCells.score[1]
}
]
}
}
export class GetStarted extends React.Component {
constructor (props) {
super(props)
this.state = {
mode: this.props.hasTouch ? 'mobile' : 'desktop'
}
}
render () {
const screen = screens[this.state.mode]
return (
<div>
<p>
Use visual clues, as well as information within each item’s metadata, to place images on the map.
If you encounter an image containing multiple places or landmarks, geotag the image based on its most
prominent subject. If an image doesn’t clearly indicate a location, skip it.
</p>
<ExplainScreen {...screen} />
<p>
You might be able to geotag some items almost instantly, while others will require a bit
of investigation. For more information about an item and to see it in high resolution,
view it in Digital Collections. Outside resources such as Wikipedia and Google Maps can
also be helpful in determining locations. If an item ends up being too difficult to
geotag, skip it.
</p>
<p>
There are two guiding principles of geotagging with Surveyor: take your best guess,
and it’s okay to skip! With that in mind, start surveying!
</p>
</div>
)
}
switchMode () {
this.setState({
mode: (this.state.mode === 'mobile' ? 'desktop' : 'mobile')
})
}
}
export default connect(createSelector(
selectHasTouch(),
(hasTouch) => ({
hasTouch
})
))(GetStarted)