-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
196 lines (195 loc) · 8.99 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Path Editor</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="rohan, bhansali, rohanb10, [email protected], rohan xyz, path, editor, polyline, coordinates, gps, map, vertex, bulk, multiple, delete, edit, add, modify, subtract, tool, strava, run, ride, hike, bike, cycle, line, eraser">
<meta name="description" content="A simple tool to edit your GPS runs and rides. No login required, this website is free to use">
<link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/img/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="96x96" href="/img/favicon/favicon-96x96.png">
<meta name="theme-color" content="#93BF7A">
<link rel="stylesheet" type="text/css" href="styles/style.css">
</head>
<body>
<div class="mobile-container">
<h1><img src="img/logo.png" alt="">Path Editing Tool</h1>
<div>
<div>Everybody loves responsive websites.</div>
<div>But sometimes things are just better on big screens.</div>
<div>There are too many pixels for your teeny display.</div>
<br>
<div>Come back and visit on desktop with the big boys.</div>
</div>
</div>
<div class="container">
<div id="controls">
<h1><img src="img/logo.png" alt="">Path Editing Tool</h1>
<div class="toaster">
<div class="bread"><div></div></div>
</div>
<div class="footer">
<div class="handle">
<a data-label="Map Settings" data-name='preferences' onclick="openDrawer(this)"><img src="img/settings.png"></a>
<a class="reset hidden" data-label="Reset" onclick="resetAll()"><img src="img/reset.png"></a>
<a data-label="Info" data-name='info' onclick="openDrawer(this)"><img src="img/help.png"></a>
</div>
<div class="drawer">
<div id="preferences">
<div>
<label>Path Colour</label>
<div class="color-picker-container">
<div data-color="3" id="path-color" class="color-square"></div>
<div class="color-picker-tooltip">
<div>
<div onclick="changePathColor(this)" data-color="1" class="color-square"></div>
<div onclick="changePathColor(this)" data-color="2" class="color-square"></div>
<div onclick="changePathColor(this)" data-color="3" class="color-square"></div>
</div>
<div>
<div onclick="changePathColor(this)" data-color="4" class="color-square"></div>
<div onclick="changePathColor(this)" data-color="5" class="color-square"></div>
<div onclick="changePathColor(this)" data-color="6" class="color-square"></div>
</div>
<div>
<div onclick="changePathColor(this)" data-color="7" class="color-square"></div>
<div onclick="changePathColor(this)" data-color="8" class="color-square"></div>
<div onclick="changePathColor(this)" data-color="9" class="color-square"></div>
</div>
</div>
</div>
</div>
<div>
<label for="map-type">Map Type</label>
<select id="map-type">
<option value="map_default">Basic</option>
<option value="satellite">Satellite</option>
<option value="hybrid">Hybrid</option>
<option value="terrain">Terrain</option>
<option value="map_bones">Bones</option>
<option value="map_sand">Sand</option>
<option value="map_incognito">Incognito</option>
</select>
</div>
<div>
<label for="cord-precision">Coordinate precision<a target="_blank" href="https://xkcd.com/2170/" class="sup">?</a></label>
<input type="number" id="cord-precision" value="5" min="0" max="7">
</div>
<div>
<label for="min-zoom">Min Zoom</label>
<input type="number" id="min-zoom" value="8" min="0" max="17">
</div>
<div>
<label for="max-zoom">Max Zoom</label>
<input type="number" id="max-zoom" value="18" min="1" max="18">
</div>
<div>
<label for="double-click">Show Zoom Controls</label>
<input type="checkbox" id="zoom-control">
</div>
<div>
<a onclick="updatePrefs()">Save</a>
<a onclick="closeDrawer()">Cancel</a>
</div>
</div>
<div id="info">
<p>Strava didn't let me edit my rides so I did it myself.</p>
<p>Bugs can be reported and feature requests can be made at <a target="_blank" href="https://github.com/rohanb10/path-editor">github</a>.</p>
<p>Made by <a target="_blank" rel="author" href="https://rohan.xyz">rohan</a> in 2020.</p>
<div><a onclick="closeDrawer()">Close</a></div>
</div>
</div>
</div>
<div class="steps">
<div class="step active" data-step="0">
<div class="instructions">
<p>A simple tool to modify paths.</p>
<p>Add, edit or delete an unlimited number of vertices.</p>
<p>This tool does not upload any data anywhere. Your map settings are saved in a cookie, but you can disable that too.</p>
<div class="next"><a onclick="goToStep(1, true)"><span>Start<span></a></div>
</div>
</div>
<div class="step" data-step="1">
<div class="action" onclick="goToStep(1)">1. Upload</div>
<div class="instructions">
<p> </p>
<div class="upload">
<input type="file" id="input-file" onchange="uploaded('file', this)" accept=".txt, .gpx, .csv, .geojson, .json" autocomplete="off">
<label for="input-file"><span></span><span>Upload a text file</span></label>
<p>or add it directly</p>
<div class="input-text-container">
<textarea rows="11" id="input-text" oninput="uploaded('text', this)" autocomplete="off" placeholder="Select a format"></textarea>
<span class="file-type-selected" data-selected="Waiting for input">
<span class="file-type-overlay">
<span onclick="changeFileType(this)" data-file="Coordinates" class="file-type"></span>
<span onclick="changeFileType(this)" data-file="Polyline" class="file-type"></span>
<span onclick="changeFileType(this)" data-file="CSV" class="file-type"></span>
<span onclick="changeFileType(this)" data-file="GPX" class="file-type"></span>
<span onclick="changeFileType(this)" data-file="GeoJSON" class="
file-type"></span>
<!-- <span onclick="changeFileType(this)" data-file="URL" class="file-type"></span> -->
</span>
</span>
</div>
</div>
<div class="next hidden"><a onclick="goToStep(1.5)"><span>Preview</span></a></div>
</div>
</div>
<div class="step" data-step="2">
<div class="action" onclick="goToStep(2)">2. Edit</div>
<div class="instructions">
<ul>
<li>Drag vertices along the map to the correct position.</li>
<li>Drag the translucent vertex between two existing opaque vertices to create a new one</li>
<li>Left click on a vertex you want to remove.</li>
<li>Draw a shape to remove vertices in bulk
<ul>
<li>Right click to begin drawing the shape</li>
<li>Right click a second time to confirm the size of the shape</li>
<li>Left click inside the shape to remove half of the vertices contained in the shape's bounds. Repeat as many times as needed</li>
<li>Right click a third time to delete the shape</li>
</ul>
</li>
</ul>
<div class="next"><a onclick="goToStep(3)"><span>Next</span></a></div>
</div>
</div>
<div class="step" data-step="3">
<div class="action" onclick="goToStep(3)">3. Download</div>
<div class="instructions">
<p>Export the freshly edited polyline in your preferred format</p>
<div class="download">
<div class="download-preferences">
<select id="download-type" onchange="downloadTypeChanged(this)" autocomplete="off">
<option value="polyline" selected>Polyline</option>
<option value="cords">Coordinates</option>
</select>
to
<select id="download-format" onchange="downloadFormatChanged(this)" autocomplete="off">
<option id="option_clipboard" value="clip" selected>Clipboard</option>
<option id="option_csv" value="csv" disabled>CSV</option>
<option id="option_txt" value="txt">Text file</option>
<option id="option_arr" value="arr" disabled>Text file (Array)</option>
<option id="option_obj" value="obj" disabled>Text file (Object)</option>
</select>
</div>
<div id="nl" class="hidden">
<input type="checkbox" id="new_lines" checked=true disabled=true>
<label for="new_lines">Each coordinate on new line?</label>
</div>
<a class="go" onclick="downloadPath()">Go</a>
</div>
<div class="message"> </div>
<div class="clipboard-hidden"></div>
</div>
</div>
</div>
</div>
<div id="map"></div>
</div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBPHbxP-tK9oSQRZb5tSC_vZPzLwnOBsbk"></script>
<script src="js/vendor.js"></script>
<script src="js/script.min.js"></script>
</body>
</html>