Skip to content

Commit

Permalink
make everything fluffy
Browse files Browse the repository at this point in the history
  • Loading branch information
biran4454 committed Mar 21, 2024
1 parent bc417e1 commit 5e3baef
Showing 1 changed file with 11 additions and 43 deletions.
54 changes: 11 additions & 43 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,16 @@
{% extends "base.html" %}
{% block title %}Map{% endblock %}
{% block content %}
<a target="_blank" href="{{ url_for('map_view') }}" class="btn btn-primary">Open in new tab</a>
<button class="btn btn-primary" id="scan">Scan</button>
<button class="btn btn-danger" id="regen">Regenerate</button>
<div class="map_embed">
<iframe src="{{ url_for('map_view') }}" width="100%" height="100%" frameborder="0"></iframe>
</div>
<style>
.blink {
animation: blinker 1s linear infinite;
}

<script>
document.getElementById('scan').addEventListener('click', function() {
fetch('{{ url_for("scan") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({})
}).then(function(response) {
if (response.ok) {
location.reload();
return response.json();
} else {
alert('Scan failed.');
}
throw new Error('Request failed.');
});
});
document.getElementById('regen').addEventListener('click', function() {
fetch('{{ url_for("regen") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({})
}).then(function(response) {
if (response.ok) {
alert('Regeneration completed.');
location.reload();
return response.json();
} else {
alert('Regeneration failed.');
}
throw new Error('Request failed.');
});
});
</script>
@keyframes blinker {
50% {
opacity: 0;
}
}
</style>
<h1 class="blink">UWU</h1>
{% endblock %}

0 comments on commit 5e3baef

Please sign in to comment.