Skip to content

Commit 49c0553

Browse files
committed
feat: refactor
1 parent c77807b commit 49c0553

File tree

3 files changed

+157
-104
lines changed

3 files changed

+157
-104
lines changed

gpx-track-splitter/index.html

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,62 +7,42 @@
77
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
88
<meta http-equiv="Pragma" content="no-cache" />
99
<meta http-equiv="Expires" content="0" />
10-
<style>
11-
@font-face {
12-
font-family: Liberation Mono;
13-
src: url("../LiberationMono-Regular.woff2") format("woff2"), url("../LiberationMono-Regular.ttf") format("truetype");
14-
}
15-
16-
html {
17-
height: 100vh;
18-
}
19-
20-
body {
21-
color: #93a1a1;
22-
background-color: #002b36;
23-
font-family: Liberation Mono, SFMono-Regular, Consolas, Menlo, Courier, monospace;
24-
text-align: center;
25-
line-height: 1.19;
26-
height: 100%;
27-
display: flex;
28-
flex-direction: column;
29-
margin: 0px;
30-
}
31-
32-
fieldset {
33-
flex-grow: 1;
34-
margin: 1em;
35-
}
36-
37-
legend {
38-
margin: 0 auto;
39-
padding: 0 1em 0 1em;
40-
}
41-
</style>
10+
<link rel="stylesheet" href="../style.css" />
4211
</head>
4312

4413
<body>
4514
<fieldset>
4615
<legend>nipsufn's GPX track splitter</legend>
4716
<form>
48-
<label for="keepCommonPt">Make split tracks have a common point</label>
49-
<input id="keepCommonPt" type="checkbox" checked />
50-
<br />
51-
<label for="splitSegOnly">Split long segments inside existing tracks instead of creating new tracks</label>
52-
<input id="splitSegOnly" type="checkbox" />
53-
<br />
54-
<label for="splitAt">Make split tracks have a common point</label>
55-
<input id="splitAt" type="number" min="10" max="1000" value="500" required />
56-
<br />
57-
<label for="trkSuffix">Suffix appended to split tracks</label>
58-
<input id="trkSuffix" type="text" value="-part-" required />
59-
<br />
60-
<label for="fileSuffix">Suffix appended to filename</label>
61-
<input id="fileSuffix" type="text" value="split" required />
62-
<br />
63-
<label for="file">File</label>
64-
<input id="file" accept="application/gpx+xml,application/octet-stream,.gpx" type="file" />
17+
<table>
18+
<tr>
19+
<td><label for="keepCommonPt">Make split tracks have a common point</label></td>
20+
<td><input id="keepCommonPt" type="checkbox" checked /></td>
21+
</tr>
22+
<tr>
23+
<td><label for="splitSegOnly">Split long segments inside existing tracks<br />instead of creating
24+
new tracks</label></td>
25+
<td><input id="splitSegOnly" type="checkbox" /></td>
26+
</tr>
27+
<tr>
28+
<td><label for="splitAt">Point count in each track/segment</label></td>
29+
<td><input id="splitAt" type="number" min="10" max="1000" value="500" required /></td>
30+
</tr>
31+
<tr>
32+
<td><label for="trkSuffix">Suffix appended to split tracks</label></td>
33+
<td><input id="trkSuffix" type="text" value="-part-" required /></td>
34+
</tr>
35+
<tr>
36+
<td><label for="fileSuffix">Suffix appended to filename</label></td>
37+
<td><input id="fileSuffix" type="text" value="split" required /></td>
38+
</tr>
39+
<tr>
40+
<td><label for="file">File (selecting will trigger processing)</label></td>
41+
<td><input id="file" accept="application/gpx+xml,application/octet-stream,.gpx" type="file" /></td>
42+
</tr>
43+
</table>
6544
</form>
45+
<a href="../index.html">Go back</a>
6646
</fieldset>
6747
</body>
6848
<script>

index.html

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,16 @@
77
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
88
<meta http-equiv="Pragma" content="no-cache" />
99
<meta http-equiv="Expires" content="0" />
10-
<style>
11-
@font-face {
12-
font-family: Liberation Mono;
13-
src: url("LiberationMono-Regular.woff2") format("woff2"), url("LiberationMono-Regular.ttf") format("truetype");
14-
}
15-
16-
html {
17-
height: 100vh;
18-
}
19-
20-
body {
21-
color: #93a1a1;
22-
background-color: #002b36;
23-
font-family: Liberation Mono, SFMono-Regular, Consolas, Menlo, Courier, monospace;
24-
text-align: center;
25-
line-height: 1.19;
26-
height: 100%;
27-
display: flex;
28-
flex-direction: column;
29-
margin: 0px;
30-
}
31-
32-
fieldset {
33-
flex-grow: 1;
34-
margin: 1em;
35-
}
36-
37-
legend {
38-
margin: 0 auto;
39-
padding: 0 1em 0 1em;
40-
}
41-
42-
#pi {
43-
color: #93a1a1;
44-
text-decoration: none;
45-
position: absolute;
46-
right: 0.4em;
47-
bottom: 0px;
48-
}
49-
50-
a:link {
51-
color: #268bd2;
52-
}
53-
54-
a:hover {
55-
color: #2aa198;
56-
}
57-
58-
a:visited {
59-
color: #6c71c4;
60-
}
61-
</style>
10+
<link rel="stylesheet" href="./style.css" />
6211
</head>
6312

6413
<body>
6514
<fieldset>
6615
<legend>nipsufn's github page</legend>
67-
<a href="./gpx-track-splitter/">GPX track splitter</a> - client-side JavaScript page that splits long tracks in
68-
GPX files. Useful for GPS navigations with track point limit (e.g. 500 for Garmin eTrex®)
16+
<span><a href="./gpx-track-splitter/index.html">GPX track splitter</a> - client-side JavaScript page that splits
17+
long tracks in GPX files. Useful for GPS hardware with track point limit (e.g. 500 for Garmin eTrex®)</span>
6918
</fieldset>
70-
<a href="./journal-dnd-ki/" id="pi">π</a>
19+
<a href="./journal-dnd-ki/index.html" id="pi">π</a>
7120
</body>
7221

7322
</html>

style.css

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
@font-face {
2+
font-family: Liberation Mono;
3+
src: url("LiberationMono-Regular.woff2") format("woff2"), url("LiberationMono-Regular.ttf") format("truetype");
4+
}
5+
6+
html {
7+
height: 100vh;
8+
}
9+
10+
body {
11+
color: #93a1a1;
12+
background-color: #002b36;
13+
font-family: Liberation Mono, SFMono-Regular, Consolas, Menlo, Courier, monospace;
14+
text-align: center;
15+
height: 100%;
16+
display: flex;
17+
flex-direction: column;
18+
margin: 0px;
19+
}
20+
21+
fieldset {
22+
flex-grow: 1;
23+
margin: 1em;
24+
border-color: #586e75;
25+
border-width: medium;
26+
border-style: solid;
27+
display: flex;
28+
flex-direction: column;
29+
}
30+
31+
form {
32+
flex-grow: 1;
33+
}
34+
35+
legend {
36+
margin: 0 auto;
37+
padding: 0 1em 0 1em;
38+
color: #93a1a1;
39+
font-weight: bold;
40+
}
41+
42+
#pi {
43+
color: #93a1a1;
44+
text-decoration: none;
45+
position: absolute;
46+
right: 0.4em;
47+
bottom: 0px;
48+
}
49+
50+
a:link {
51+
color: #268bd2;
52+
}
53+
54+
a:hover {
55+
color: #2aa198;
56+
}
57+
58+
a:visited {
59+
color: #6c71c4;
60+
}
61+
62+
input[type=text],
63+
input[type=number] {
64+
border-color: #eee8d5;
65+
background-color: #fdf6e3;
66+
color: #586e75;
67+
border-style: solid;
68+
font-family: inherit;
69+
margin: 0.1em 0 0.1em 0;
70+
}
71+
72+
input[type="file"] {
73+
color: #93a1a1;
74+
font-family: Liberation Mono, SFMono-Regular, Consolas, Menlo, Courier, monospace;
75+
font-size: initial;
76+
}
77+
78+
input[type="file"]::file-selector-button {
79+
border: 0;
80+
padding: 0;
81+
color: #268bd2;
82+
text-decoration: underline;
83+
background-color: inherit;
84+
font-family: Liberation Mono, SFMono-Regular, Consolas, Menlo, Courier, monospace;
85+
font-size: initial;
86+
}
87+
88+
input[type="file"]::file-selector-button:hover {
89+
border: 0;
90+
padding: 0;
91+
color: #2aa198;
92+
text-decoration: underline;
93+
background-color: inherit;
94+
font-family: Liberation Mono, SFMono-Regular, Consolas, Menlo, Courier, monospace;
95+
font-size: initial;
96+
}
97+
98+
table {
99+
margin: 0 auto;
100+
border-collapse: collapse;
101+
}
102+
103+
td:first-child {
104+
text-align: right;
105+
border-right-color: #586e75;
106+
border-right-width: medium;
107+
border-right-style: solid;
108+
padding-right: 1em;
109+
}
110+
111+
td:last-child {
112+
text-align: left;
113+
padding-left: 1em;
114+
}
115+
116+
tr {
117+
border-bottom-color: #586e75;
118+
border-bottom-width: thin;
119+
border-bottom-style: solid;
120+
}
121+
122+
tr:last-child {
123+
border: none;
124+
}

0 commit comments

Comments
 (0)