added compass direction finding
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Sign in · Sound Signal</title>
|
||||
<style>body{min-width:320px;min-height:100vh;display:grid;place-items:center;margin:0;padding:1.5rem;color:#eef3ff;font-family:Inter,system-ui,sans-serif;background:radial-gradient(circle at 8% 0,#263a76,transparent 31rem),#090e1d}.card{width:min(100%,27rem);padding:2rem;border:1px solid #2b3d68;border-radius:1.25rem;background:#172443;box-shadow:0 1.75rem 5rem #01030c99}h1{margin:.5rem 0}.intro{color:#aab9d8;line-height:1.5}.error{margin:1rem 0;padding:.75rem;border-radius:.6rem;color:#fee2e2;background:#7f1d1d}label{display:block;margin:1rem 0 .35rem;font-weight:700}input{width:100%;min-height:2.8rem;padding:.65rem;border:1px solid #526b9f;border-radius:.55rem;color:#eef3ff;font:inherit;background:#0a1123}button{width:100%;min-height:2.9rem;margin-top:1.5rem;border:0;border-radius:.65rem;color:#17132b;font:inherit;font-weight:850;background:linear-gradient(135deg,#99c8ff,#c6adff);cursor:pointer}</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="card">
|
||||
<p>✦ Sound Signal</p>
|
||||
<h1>Sign in</h1>
|
||||
<p class="intro">Sign in to manage your notification settings.</p>
|
||||
{% if form.errors %}
|
||||
<div class="error">Your username and password did not match. Please try again.</div>
|
||||
{% endif %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<label for="{{ form.username.id_for_label }}">Username</label>
|
||||
{{ form.username }}
|
||||
<label for="{{ form.password.id_for_label }}">Password</label>
|
||||
{{ form.password }}
|
||||
{% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %}
|
||||
<button type="submit">Sign in</button>
|
||||
</form>
|
||||
<p class="intro">You will return to the page you requested.</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
{% if success %}<div class="alert alert--success">✓ Test notification sent successfully.</div>{% else %}<div class="alert alert--error">Could not send the test notification: {{ error }}</div>{% endif %}
|
||||
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Settings · Sound Signal</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
|
||||
<style>body{min-width:320px;margin:0;padding:2rem;color:#eef3ff;font-family:Inter,system-ui,sans-serif;background:#090e1d}.card{width:min(100%,42rem);margin:auto;padding:2rem;border:1px solid #2b3d68;border-radius:1rem;background:#172443}h1{margin-top:0}h2{margin:0}.intro,.help{color:#aab9d8;line-height:1.5}.section{margin-top:2rem;padding-top:1.5rem;border-top:1px solid #2b3d68}label{display:block;margin:.9rem 0 .35rem;font-weight:700}input[type=url]{width:100%;min-height:2.8rem;padding:.65rem;border:1px solid #526b9f;border-radius:.55rem;color:#eef3ff;font:inherit;background:#0a1123}.check{display:flex;gap:.6rem;align-items:center}.check label{margin:0}.button{min-height:2.8rem;margin-top:1rem;padding:.6rem 1rem;border:0;border-radius:.55rem;color:#17132b;font:inherit;font-weight:800;background:#a6ccff;cursor:pointer}.button--secondary{margin-right:.7rem;background:#d8c1fb}.alert,.errorlist{margin-top:1rem;padding:.75rem;border-radius:.55rem}.alert--success{color:#d1fae5;background:#14532d}.alert--error,.errorlist{color:#fee2e2;background:#7f1d1d}.messages{padding:0;list-style:none}@media(max-width:32rem){body{padding:1rem}.card{padding:1.4rem}}</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="card">
|
||||
<h1>Settings</h1>
|
||||
<p class="intro">Manage personal notification preferences.</p>
|
||||
{% if messages %}<ul class="messages">{% for message in messages %}<li class="alert alert--success">{{ message }}</li>{% endfor %}</ul>{% endif %}
|
||||
<form method="post" action="{% url 'user_settings' %}">
|
||||
{% csrf_token %}
|
||||
<section class="section" aria-labelledby="ntfy-title">
|
||||
<h2 id="ntfy-title">Notifications / ntfy</h2>
|
||||
<p class="help">Use a topic URL from your ntfy server. Test the current URL before saving it.</p>
|
||||
<label for="ntfy-url">Topic URL</label>
|
||||
{{ form.ntfy_url }}
|
||||
{{ form.ntfy_url.errors }}
|
||||
<div class="check">{{ form.ntfy_enabled }}<label for="{{ form.ntfy_enabled.id_for_label }}">Enable ntfy notifications</label></div>
|
||||
<button class="button button--secondary" type="button" hx-post="{% url 'ntfy_test_notification' %}" hx-include="#ntfy-url, [name='csrfmiddlewaretoken']" hx-target="#ntfy-test-result" hx-swap="innerHTML">Test notification</button>
|
||||
<div id="ntfy-test-result" aria-live="polite"></div>
|
||||
</section>
|
||||
<button class="button" type="submit">Save settings</button>
|
||||
</form>
|
||||
</main>
|
||||
<script>document.querySelector("#ntfy-url").addEventListener("input", () => { document.querySelector("#ntfy-test-result").replaceChildren(); });</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user