geo
Alexander Roidl 2 years ago
parent 3cb27d4ea6
commit e139768dc3

@ -250,7 +250,6 @@ margin: 4em 0;
position: fixed; position: fixed;
display: inline-block; display: inline-block;
bottom: 0; bottom: 0;
font-size: 1em;
padding: 1em; padding: 1em;
box-sizing: border-box; box-sizing: border-box;
} }
@ -258,6 +257,7 @@ margin: 4em 0;
#button_group button, #button_group select{ #button_group button, #button_group select{
background-color: black; background-color: black;
color: white; color: white;
font-size: 1em;
border: 1px solid white; border: 1px solid white;
border-radius: 2em; border-radius: 2em;
padding: 0.8em; padding: 0.8em;

@ -20,18 +20,14 @@
{{ form.csrf_token }} {{ form.csrf_token }}
<input type="hidden" name="longitude" value="{{ longitude }}" /> <input type="hidden" name="longitude" value="{{ longitude }}" />
<input type="hidden" name="latitude" value="{{ latitude }}" /> <input type="hidden" name="latitude" value="{{ latitude }}" />
<div id="audio"> <div id="audio">
<div class="record_controls"> <div class="record_controls">
<a class="record_btn audio_btn" id="record_btn" onclick="record_audio()" href="#"><span class="icon"></span>record</a> <a class="record_btn audio_btn" id="record_btn" onclick="record_audio()" href="#"><span class="icon"></span>record</a>
<a class="stop_btn audio_btn" id="stop_btn" onclick="stop_audio()" href="#"><span class="icon"></span>stop</a> <a class="stop_btn audio_btn" id="stop_btn" onclick="stop_audio()" href="#"><span class="icon"></span>stop</a>
<a class="play_btn audio_btn" id="play_btn" onclick="play_audio()" href="#"><span class="progress_bar"></span><span class="icon_p"></span>play</a> <a class="play_btn audio_btn" id="play_btn" onclick="play_audio()" href="#"><span class="progress_bar"></span><span class="icon_p"></span>play</a>
<a class="redo_btn audio_btn" id="redo_btn" onclick="redo_audio()" href="#"></span>redo</a> <a class="redo_btn audio_btn" id="redo_btn" onclick="redo_audio()" href="#"></span>redo</a>
</div> </div>
<div id="audio-player-container"></div>
<ul id="playlist"></ul>
</div> </div>
<input hidden="true" type="file" name="file" id="uploadedFile" accept="audio/*"><br> <input hidden="true" type="file" name="file" id="uploadedFile" accept="audio/*"><br>
@ -41,9 +37,6 @@
</div> </div>
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>
<clear> <clear>
@ -67,33 +60,6 @@ const audioChunks = [];
function record_audio(){ function record_audio(){
if(state == "empty"){ if(state == "empty"){
// navigator.mediaDevices.getUserMedia({ audio: true })
// .then(stream => {
// mediaRecorder = new MediaRecorder(stream, {mimeType: 'audio/webm;codecs=opus'}); // , {mimeType:"audio/ogg"}
// mediaRecorder.start();
// state = "recording";
// document.getElementById('stop_btn').style.display = 'block'
// seconds_int = setInterval(
// function () {
// document.getElementById("record_btn").innerHTML = seconds_rec + " s";
// seconds_rec += 1;
// }, 1000);
// mediaRecorder.addEventListener("dataavailable", event => {
// audioChunks.push(event.data);
// if(mediaRecorder.state == 'inactive') makeLink();
// });
// setTimeout(() => {
// stop_audio()
// }, 1000 * 60);
// });
recorder.start().then(() => { recorder.start().then(() => {
state = "recording"; state = "recording";
@ -169,10 +135,6 @@ function stop_audio(){
const li = document.createElement('li'); const li = document.createElement('li');
var audioUrl = URL.createObjectURL(file) var audioUrl = URL.createObjectURL(file)
// const player = new Audio(audioUrl);
// player.controls = true;
// li.appendChild(player);
// document.querySelector('#playlist').appendChild(li);
let container = new DataTransfer(); let container = new DataTransfer();
container.items.add(file); container.items.add(file);
@ -222,9 +184,6 @@ function play_audio(){
} }
} }
</script> </script>
{% endblock js%} {% endblock js%}

@ -19,8 +19,8 @@
{{ form.csrf_token }} {{ form.csrf_token }}
<input type="hidden" name="longitude" value="{{ longitude }}" /> <input type="hidden" name="longitude" value="{{ longitude }}" />
<input type="hidden" name="latitude" value="{{ latitude }}" /> <input type="hidden" name="latitude" value="{{ latitude }}" />
<div style="width: 40%;"> <div style="width: 100%;">
message: {{ form.message(cols="45", rows="10", class="form-control") }} message: {{ form.message(class="form-control") }}
</div> </div>
<button type="submit">Submit</button> <button type="submit">Submit</button>

@ -151,7 +151,7 @@
x.innerHTML = "Latitude: " + crd.latitude + x.innerHTML = "Latitude: " + crd.latitude +
"<br>Longitude: " + crd.longitude + "<br>Longitude: " + crd.longitude +
"<br>Distance: " + distance(target.longitude, target.latitude, crd.longitude, crd.latitude); "<br>Distance to tent: " + distance(target.longitude, target.latitude, crd.longitude, crd.latitude);
// if we want to clear the watch // if we want to clear the watch
// if (target.latitude === crd.latitude && target.longitude === crd.longitude) { // if (target.latitude === crd.latitude && target.longitude === crd.longitude) {

Loading…
Cancel
Save