This repository has been archived by the owner on Jul 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
317 lines (278 loc) · 11.7 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rennrad Rheinhessen Event Formular App</title>
<link rel="stylesheet" href="/css/bootstrap.min.css" />
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/forms.js"></script>
<style>
.app {
padding-top: 1em;
}
</style>
</head>
<body>
<div class="app container">
<div class="row">
<div class="col-sm-12 col-md-3"></div>
<div class="col-sm-12 col-md-6">
<h2>Rennrad Rheinhessen Event Textbaustein App</h2>
<h5>
Hier kannst du ganz einfach deinen Text für die Ausfahrt erstellen
lassen. Bitte fülle alle Felder aus, dann wird der Text erstellt.
Diesen dann einfach in die Beschreibung des Strava Events kopieren.
</h5>
<p>
<strong>
Diese App ist keine juristische Beratung,
ersetzt diese, oder erhebt gar den Anspruch
dich als Organisator zu 100 % abzusichern.
</strong>
</p>
<p>
Code auf
<a href="https://github.com/simonneutert/rennrad-rheinhessen-event-formular">
GitHub
</a>
</p>
<hr />
<p><strong>Tipps für Guides:</strong></p>
<ul>
<li>sprecht bei jedem Startpunkt die Gruppe an und erklärt wie es läuft</li>
<li>
wenn sich die Leistungen oder Wünsche nicht in einer Gruppe
sammeln lassen, ernennt einen "Freiwilligen" oder besser gleich 2
und trennt die Gruppen auf
</li>
<li>
nennt euch als "Gravitationszentrum", wer um euch fährt, kommt
auch an. Also achtet auf das Tempo und "pfeift wenn nötig kurz
zurück" und bildet aus dem Kreis der "immer-viel-zu-schnellen Fahrer"
eine eigene Gruppe.
</li>
<li>
ernennt euch Helfer, fragt wer die Route hat und gebt "Befehle für
das Management der Gruppe"
</li>
</ul>
<hr />
<h3>Formular App ausfüllen</h3>
<form id="rrform" class="needs-validation" novalidate>
<div class="mb-3">
<label for="introduction" class="form-label">Einleitung / Idee</label>
<textarea name="introduction" class="form-control" id="introduction" rows="7"></textarea>
</div>
<div class="row">
<div class="mb-3 col-md-6">
<label for="distance" class="form-label">Distanz</label>
<input type="number" class="form-control" id="distance" value="45" min="0"
aria-describedby="distanceHelp" />
<div id="distanceHelp" class="form-text">
Bitte wähle hier die (ungefähre) Distanz
</div>
</div>
<div class="mb-3 col-md-6">
<label for="tempo" class="form-label">Tempo (mindestens)</label>
<input type="number" class="form-control" id="tempo" value="25" min="0" aria-describedby="tempoHelp" />
<div id="tempoHelp" class="form-text">
Bitte wähle hier den mindestens erreichten Schnitt!
</div>
</div>
</div>
<div class="row">
<div class="mb-3 col-md-6">
<label for="elevation" class="form-label">Höhenmeter (erwartet/mindestens)
</label>
<input type="number" class="form-control" id="elevation" value="250" min="100"
aria-describedby="elevationHelp" />
<div id="elevationHelp" class="form-text">
Bitte wähle hier die mindest erwarteten Höhenmeter!
</div>
</div>
<div class="mb-3 col-md-6">
<label for="stopsWhilst" class="form-label">Zwischenstopps (vor Abschluss der Tour)
</label>
<input type="number" class="form-control" id="stopsWhilst" value="0" aria-describedby="stopsWhilstHelp" />
<div id="stopsWhilstHelp" class="form-text">
Bitte wähle hier die mindestens geplanten Stopps (z.B.
Kaffeepause, Tankstelle etc.)!
</div>
</div>
</div>
<div class="mb-3">
<select id="profile" class="form-select" aria-label="Höhenprofil" required>
<option selected disabled value="">
Wähle das erwartete Profil der Tour
</option>
<option value="flat">überwiegend flach</option>
<option value="hilly">etwa 100 Hm je 10 km</option>
<option value="mountain">
überwiegend bergauf oder viele steile Abschnitte
</option>
</select>
<div class="invalid-feedback">Bitte wähle das Höhenprofil</div>
</div>
<div class="mb-3">
<select id="surface" class="form-select" aria-label="Wegbeschaffenheit" required>
<option selected disabled value="">
Wähle die Wegbeschaffenheit
</option>
<option value="road">überwiegend Straße</option>
<option value="cyclepaths">
asphaltierte Fahrradwege und Straße, wenn nötig
</option>
<option value="mixed">
asphaltierte Feldwege, asphaltierte Fahrradwege und etwas
Straße
</option>
<option value="gravel">überwiegend Feld- und Waldwege</option>
</select>
<div class="invalid-feedback">
Bitte wähle die Wegbeschaffenheit
</div>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="" id="bringLights" />
<label class="form-check-label" for="bringLights">
Sind Lichter notwendig?
</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="" id="stopFinished" />
<label class="form-check-label" for="stopFinished">
Gemeinsamer Abschluss mit Essen/Getränk?
</label>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="alwaysEasy" />
<label class="form-check-label" for="alwaysEasy">Gruppe verpflichtet sich stets und uneingeschränkt am
langsamsten Mitglied zu richten?</label>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="ethics" checked />
<label class="form-check-label" for="ethics">Standardhinweise Gruppenfahrt einbinden?</label>
</div>
<div class="mb-3">
<label for="urlGps" class="form-label">URL zur Route (
<a href="https://www.komoot.de/" target="_blank" rel="noopener noreferrer">komoot eignet sich
hervorragend</a>)
</label>
<input type="text" class="form-control" id="urlGps" value="" aria-describedby="urlGpsHelp" />
<div id="urlGpsHelp" class="form-text">
Bitte hier den Link zur Route!
</div>
</div>
<div class="col-12">
<button class="btn btn-primary" type="submit">
Erstelle/Update Text ⇨ in Zwischenablage
</button>
</div>
</form>
<hr />
<h2>Vorformatiertes Ergebnis</h2>
<form>
<div class="mb-3">
<label for="result" class="form-label">Ergebnis</label>
<textarea id="result" class="form-control" id="result" rows="24"></textarea>
</div>
</form>
<div class="position-fixed top-0 end-0 p-3" style="z-index: 11">
<div id="liveToast" class="toast hide bg-primary text-white" role="alert" aria-live="assertive"
aria-atomic="true">
<div class="toast-header">
<strong class="me-auto">Erfolgreich</strong>
<small></small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">Text in Zwischenablage kopiert.</div>
</div>
</div>
</div>
</div>
</div>
<script>
function clearSelection() {
if (window.getSelection) {
window.getSelection().removeAllRanges();
} else if (document.selection) {
document.selection.empty();
}
}
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function () {
"use strict";
var toastElList = [].slice.call(document.querySelectorAll(".toast"));
var toastList = toastElList.map(function (toastEl) {
return new bootstrap.Toast(toastEl);
});
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.querySelectorAll(".needs-validation");
// Loop over them and prevent submission
Array.prototype.slice.call(forms).forEach(function (form) {
form.addEventListener(
"submit",
function (event) {
if (!form.checkValidity()) {
event.preventDefault();
event.stopPropagation();
} else {
event.preventDefault();
event.stopPropagation();
const formData = {};
const introduction =
document.getElementById("introduction").value;
const stopsWhilst = parseInt(
document.getElementById("stopsWhilst").value
);
const distance = parseInt(
document.getElementById("distance").value
);
const tempo = parseInt(document.getElementById("tempo").value);
const elevation = parseInt(
document.getElementById("elevation").value
);
const profile = document.getElementById("profile").value;
const surface = document.getElementById("surface").value;
const stopFinished =
document.getElementById("stopFinished").checked;
const bringLights =
document.getElementById("bringLights").checked;
const alwaysEasy =
document.getElementById("alwaysEasy").checked;
const ethics = document.getElementById("ethics").checked;
const urlGps = document.getElementById("urlGps").value;
formData.introduction = introduction;
formData.stopsWhilst = stopsWhilst;
formData.distance = distance;
formData.tempo = tempo;
formData.elevation = elevation;
formData.profile = profile;
formData.surface = surface;
formData.stopFinished = stopFinished;
formData.bringLights = bringLights;
formData.alwaysEasy = alwaysEasy;
formData.ethics = ethics;
formData.urlGps = urlGps;
console.log(formData);
const c = new DynamicFormText(formData);
const textAreaResult = document.getElementById("result");
textAreaResult.value = c.serialize();
textAreaResult.focus();
textAreaResult.select();
var successful = document.execCommand("copy");
if (successful) toastList[0].show();
document.getElementById("distance").select();
clearSelection();
}
form.classList.add("was-validated");
},
false
);
});
})();
</script>
</body>
</html>