diff --git a/fireworks_detect/__pycache__/tests.cpython-313.pyc b/fireworks_detect/__pycache__/tests.cpython-313.pyc index e438fe9..edd6810 100644 Binary files a/fireworks_detect/__pycache__/tests.cpython-313.pyc and b/fireworks_detect/__pycache__/tests.cpython-313.pyc differ diff --git a/fireworks_detect/__pycache__/urls.cpython-313.pyc b/fireworks_detect/__pycache__/urls.cpython-313.pyc index 28c6b5f..e3de382 100644 Binary files a/fireworks_detect/__pycache__/urls.cpython-313.pyc and b/fireworks_detect/__pycache__/urls.cpython-313.pyc differ diff --git a/fireworks_detect/__pycache__/views.cpython-313.pyc b/fireworks_detect/__pycache__/views.cpython-313.pyc index 6c6dd5a..d457bde 100644 Binary files a/fireworks_detect/__pycache__/views.cpython-313.pyc and b/fireworks_detect/__pycache__/views.cpython-313.pyc differ diff --git a/fireworks_detect/templates/fireworks_detect/dashboard.html b/fireworks_detect/templates/fireworks_detect/dashboard.html new file mode 100644 index 0000000..37566c8 --- /dev/null +++ b/fireworks_detect/templates/fireworks_detect/dashboard.html @@ -0,0 +1,48 @@ +{% load vite %} + + + + + + Report fireworks · Sound Signal + + + {% vite_asset "frontend/src/entries/dashboard.js" %} + + + {% if user.is_authenticated %}{{ user.get_username|first|upper }}{% endif %} +
+ {% include "fireworks_detect/includes/navigation.html" %} + +
+

Community reporting

+

Report what you heard.

+

Quickly log fireworks when they happen. Your optional location is represented as an H3 cell on the map, rather than as precise coordinates.

+
+ +
+
+ {% include "fireworks_detect/includes/manual_report_form.html" %} +
+
+ +
+
+

Recent reports

Activity map

+ Open map controls +
+ {% include "fireworks_detect/includes/map_panel.html" %} +
+ +
+
+

Audio analysis

Classify a recording

+
+
+ {% include "fireworks_detect/includes/audio_upload_form.html" %} +
+
+
+ + + diff --git a/fireworks_detect/templates/fireworks_detect/home.html b/fireworks_detect/templates/fireworks_detect/home.html index eb26d75..c0f8aa7 100644 --- a/fireworks_detect/templates/fireworks_detect/home.html +++ b/fireworks_detect/templates/fireworks_detect/home.html @@ -26,30 +26,8 @@
-
- {% csrf_token %} - - -
-
-

-
+ {% include "fireworks_detect/includes/audio_upload_form.html" %} + diff --git a/fireworks_detect/templates/fireworks_detect/includes/audio_upload_form.html b/fireworks_detect/templates/fireworks_detect/includes/audio_upload_form.html new file mode 100644 index 0000000..5bf444a --- /dev/null +++ b/fireworks_detect/templates/fireworks_detect/includes/audio_upload_form.html @@ -0,0 +1,18 @@ +
+ {% csrf_token %} + + +
+
+

diff --git a/fireworks_detect/templates/fireworks_detect/includes/manual_report_form.html b/fireworks_detect/templates/fireworks_detect/includes/manual_report_form.html new file mode 100644 index 0000000..7fd2733 --- /dev/null +++ b/fireworks_detect/templates/fireworks_detect/includes/manual_report_form.html @@ -0,0 +1,22 @@ +
+

No recording needed

+

Report fireworks now

+

Choose how many times you heard fireworks, then send it straight to Pending. The report is timestamped now.

+
+ {% csrf_token %} + + + + + + + + +
+
+
diff --git a/fireworks_detect/templates/fireworks_detect/includes/map_panel.html b/fireworks_detect/templates/fireworks_detect/includes/map_panel.html new file mode 100644 index 0000000..b15c241 --- /dev/null +++ b/fireworks_detect/templates/fireworks_detect/includes/map_panel.html @@ -0,0 +1,8 @@ +
+
Manual reports · privacy-preserving H3 cells H3 resolution {{ h3_resolution }} · sensor layer disabled
+
+ +
+
+{{ h3_cells|json_script:"h3-cells-data" }} +{{ map_events|json_script:"map-events-data" }} diff --git a/fireworks_detect/templates/fireworks_detect/map.html b/fireworks_detect/templates/fireworks_detect/map.html index c859964..1ab0a00 100644 --- a/fireworks_detect/templates/fireworks_detect/map.html +++ b/fireworks_detect/templates/fireworks_detect/map.html @@ -27,16 +27,8 @@ {{ mapped_event_count }} report{{ mapped_event_count|pluralize }} -
-
Manual reports · privacy-preserving H3 cells H3 resolution {{ h3_resolution }} · sensor layer disabled
-
- -
-
+ {% include "fireworks_detect/includes/map_panel.html" %} - - {{ h3_cells|json_script:"h3-cells-data" }} - {{ map_events|json_script:"map-events-data" }} diff --git a/fireworks_detect/tests.py b/fireworks_detect/tests.py index 81e0109..8f88313 100644 --- a/fireworks_detect/tests.py +++ b/fireworks_detect/tests.py @@ -120,6 +120,17 @@ class ManualPendingEventTests(TestCase): self.assertContains(response, "htmx.min.js") self.assertContains(response, "/static/vite/") self.assertContains(response, 'type="module"') + self.assertContains(response, "Activity map") + self.assertContains(response, "Open map controls") + self.assertContains(response, "Classify a recording") + + def test_old_route_preserves_the_previous_landing_page(self): + response = self.client.get(reverse("old_home")) + + self.assertEqual(response.status_code, 200) + self.assertContains(response, "Welkom Joren") + self.assertContains(response, "Open vuurwerk detector") + def test_manual_event_appears_in_the_normal_event_list_with_its_details(self): event = Event.objects.create( original_filename="Manual fireworks report", diff --git a/fireworks_detect/views.py b/fireworks_detect/views.py index 1fdbe93..25e29c0 100644 --- a/fireworks_detect/views.py +++ b/fireworks_detect/views.py @@ -145,6 +145,22 @@ def fireworks_map_view(request): @never_cache +def dashboard_view(request): + map_events, h3_cells = _events_for_map({ + "date_from": None, + "date_to": None, + "range": "all", + "visual": "all", + }) + return render(request, "fireworks_detect/dashboard.html", { + "h3_resolution": h3_resolution(), + "h3_cells": h3_cells, + "map_events": map_events, + }) + + + + def events_view(request): return render(request, "fireworks_detect/events.html") diff --git a/frontend/src/entries/dashboard.js b/frontend/src/entries/dashboard.js new file mode 100644 index 0000000..cfa9890 --- /dev/null +++ b/frontend/src/entries/dashboard.js @@ -0,0 +1,9 @@ +import "../styles/components/fireworks-navigation.css"; +import "../styles/pages/fireworks-home.css"; +import "../styles/pages/map.css"; +import "../styles/pages/dashboard.css"; +import "../styles/theme.css"; +import "../scripts/theme.js"; +import "../scripts/manual-report.js"; +import "../scripts/audio-upload.js"; +import "../scripts/event-map.js"; diff --git a/frontend/src/scripts/event-map.js b/frontend/src/scripts/event-map.js index d28d4e5..3b339e7 100644 --- a/frontend/src/scripts/event-map.js +++ b/frontend/src/scripts/event-map.js @@ -92,7 +92,9 @@ } const range = document.getElementById("range"); - document.querySelectorAll("#from-date, #to-date").forEach((input) => { - input.addEventListener("change", () => { range.value = "custom"; }); - }); + if (range) { + document.querySelectorAll("#from-date, #to-date").forEach((input) => { + input.addEventListener("change", () => { range.value = "custom"; }); + }); + } \ No newline at end of file diff --git a/frontend/src/styles/pages/dashboard.css b/frontend/src/styles/pages/dashboard.css new file mode 100644 index 0000000..7e9a349 --- /dev/null +++ b/frontend/src/styles/pages/dashboard.css @@ -0,0 +1,52 @@ +:root { + --dashboard-ink: #edf3ff; + --dashboard-muted: #aab9d8; + --dashboard-line: #2b3d68; + --dashboard-surface: #111a31; + --dashboard-surface-raised: #172443; +} +body.dashboard-page { + display: block; + min-width: 320px; + min-height: 100vh; + margin: 0; + color: var(--dashboard-ink); + font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + background: radial-gradient(circle at 8% 0%, #263a76 0, transparent 31rem), radial-gradient(circle at 96% 100%, #512363 0, transparent 29rem), #090e1d; +} +.dashboard-shell { width: min(100% - 2.5rem, 70rem); margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) 0; } +.dashboard-intro { max-width: 44rem; margin-bottom: 2rem; } +.dashboard-kicker { margin: 0 0 .8rem; color: #bfdbfe; font-size: .76rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; } +.dashboard-intro h1 { max-width: 11ch; margin: 0; color: var(--dashboard-ink); font-size: clamp(2.8rem, 7vw, 5.5rem); line-height: .94; letter-spacing: -.065em; } +.dashboard-intro p:last-child { max-width: 42rem; margin: 1.25rem 0 0; color: var(--dashboard-muted); font-size: clamp(1rem, 2vw, 1.16rem); line-height: 1.65; } +.dashboard-section { margin-top: 2.25rem; } +.dashboard-section__header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; } +.dashboard-section__header h2 { margin: .25rem 0 0; color: var(--dashboard-ink); font-size: clamp(1.65rem, 4vw, 2.3rem); letter-spacing: -.045em; } +.dashboard-section__header .dashboard-kicker { margin-bottom: .3rem; } +.dashboard-link { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .7rem 1rem; border: 1px solid #789ed7; border-radius: .7rem; color: #dceaff; font-size: .9rem; font-weight: 800; text-decoration: none; background: #1b2e52; transition: transform .2s ease, background .2s ease; } +.dashboard-link:hover { transform: translateY(-1px); background: #274574; } +.dashboard-report { position: relative; overflow: hidden; padding: clamp(1.35rem, 4vw, 2.4rem); border: 1px solid #b86c2a; border-radius: 1.35rem; background: linear-gradient(135deg, #4a2b16e8, #171225dd); box-shadow: 0 1.5rem 4rem #02061680; } +.dashboard-report::after { content: ""; position: absolute; width: 17rem; height: 17rem; right: -9rem; top: -10rem; border-radius: 50%; background: #ffb4541f; pointer-events: none; } +.dashboard-report > * { position: relative; } +.dashboard-report .eyebrow { margin: 0 0 .7rem; color: #ffd08a; font-size: .76rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; } +.dashboard-report .eyebrow::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; border-radius: 50%; background: #ffbd62; box-shadow: 0 0 0 .25rem #fbbf2430; } +.dashboard-report .manual-report__title { max-width: 14ch; margin: 0 0 .6rem; color: #fff6e7; font-size: clamp(2rem, 5vw, 3.4rem); line-height: .98; letter-spacing: -.06em; } +.dashboard-report .manual-report__intro { max-width: 42rem; margin: 0 0 1.35rem; color: #f3c8a3; line-height: 1.55; } +.dashboard-report .manual-report__label { display: block; margin-bottom: .5rem; color: #fff2df; font-weight: 800; } +.dashboard-report #manual-occurrences { width: min(100%, 36rem); min-height: 3.25rem; display: block; margin-bottom: 1rem; padding: .75rem .9rem; border: 1px solid #e2934a; border-radius: .75rem; color: #edf3ff; font: inherit; font-weight: 800; background: #151b31; } +.dashboard-report .manual-direction-panel { width: min(100%, 36rem); margin: 0 0 1rem; padding: 1rem; border: 1px solid #8d5bb5; border-radius: .75rem; background: #241b38; } +.dashboard-report .manual-direction-panel__heading { display: block; margin-bottom: .35rem; }.dashboard-report .manual-direction-panel__heading span { color: #c7b5eb; font-weight: 600; }.dashboard-report .manual-direction-panel__copy { margin: 0 0 .75rem; color: #d4c6ef; font-size: .88rem; line-height: 1.45; }.dashboard-report .manual-direction-panel__button { min-height: 2.75rem; padding: .65rem .9rem; border: 1px solid #c3a5eb; border-radius: .65rem; color: #211234; font: inherit; font-weight: 850; background: #d8c1fb; cursor: pointer; }.dashboard-report .manual-direction-panel__status { min-height: 1.4rem; margin-top: .7rem; color: #e5dcf7; font-size: .9rem; } +.dashboard-report .manual-report__submit { width: min(100%, 36rem); min-height: 4.5rem; border: 0; border-radius: 1rem; color: #281306; font: inherit; font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 900; background: linear-gradient(135deg, #ffd18c, #ff8f5b); box-shadow: 0 .75rem 1.8rem #d664344d; cursor: pointer; }.dashboard-report .manual-report__submission { min-height: 1.5rem; margin-top: 1rem; color: #ffd18c; } +.dashboard-map .map { height: clamp(22rem, 48vh, 34rem); }.dashboard-map .map-header { background: #121d37; }.dashboard-map .legend { display: none; } +.dashboard-upload { padding: clamp(1rem, 3vw, 1.5rem); } +.dashboard-upload .drop-zone { min-height: 12rem; } +@media (max-width: 42rem) { .dashboard-shell { width: min(100% - 1.25rem, 70rem); }.dashboard-section__header { align-items: flex-start; flex-direction: column; }.dashboard-link { width: 100%; }.dashboard-map .map { height: 23rem; } } +:root[data-theme="light"] body.dashboard-page { --dashboard-ink: #172b50; --dashboard-muted: #596d88; --dashboard-line: #cbd9ed; --dashboard-surface: #fff; --dashboard-surface-raised: #f4f8ff; background: radial-gradient(circle at 8% 0%, #dbeaff 0, transparent 31rem), radial-gradient(circle at 96% 100%, #eee2ff 0, transparent 29rem), #f4f7fc; } +:root[data-theme="light"] .dashboard-intro h1, :root[data-theme="light"] .dashboard-section__header h2 { color: #172b50 !important; } +:root[data-theme="light"] .dashboard-kicker { color: #3f6fa9 !important; } +:root[data-theme="light"] .dashboard-link { border-color: #9fc0e9; color: #234a7b; background: #e6f0ff; }.dashboard-link:hover { background: #d8e8ff; } +:root[data-theme="light"] .dashboard-report { border-color: #eca851; background: linear-gradient(145deg, #fff8ef, #ffe0bb); box-shadow: 0 1.4rem 3.4rem rgba(116, 69, 25, .18); } +:root[data-theme="light"] .dashboard-report .eyebrow { color: #9f4d16 !important; }:root[data-theme="light"] .dashboard-report .manual-report__title { color: #4a2510 !important; }:root[data-theme="light"] .dashboard-report .manual-report__intro { color: #70411d !important; }:root[data-theme="light"] .dashboard-report .manual-report__label { color: #54311b; }:root[data-theme="light"] .dashboard-report #manual-occurrences { border-color: #dfaa68; color: #322014; background: #fffdfa; }:root[data-theme="light"] .dashboard-report .manual-direction-panel { border-color: #d9b4d8; background: #fff5fc; }:root[data-theme="light"] .dashboard-report .manual-direction-panel__heading { color: #492846; }:root[data-theme="light"] .dashboard-report .manual-direction-panel__heading span { color: #70466d; }:root[data-theme="light"] .dashboard-report .manual-direction-panel__copy { color: #694b68; }:root[data-theme="light"] .dashboard-report .manual-direction-panel__button { border-color: #b68bb5; color: #321a34; background: #ead2eb; }:root[data-theme="light"] .dashboard-report .manual-direction-panel__status { color: #6b4267; }:root[data-theme="light"] .dashboard-report .manual-report__submission { color: #87421b; } +:root[data-theme="light"] .dashboard-map .map-header { background: #f2f6fc !important; } + +.dashboard-page .profile-circle { display: grid; width: 3rem; height: 3rem; position: fixed; top: 1.25rem; right: 1.25rem; place-items: center; border: 1px solid #d0c0ff; border-radius: 50%; z-index: 1201; color: #17132b; font-weight: 900; text-decoration: none; background: linear-gradient(135deg, #fcd34d, #c4a5fd); box-shadow: 0 .5rem 1.5rem #01030c66; }.dashboard-page .profile-circle:focus-visible { outline: 3px solid #a5c9ff80; outline-offset: 3px; } diff --git a/hello/templates/home.html b/hello/templates/home.html index c4fa562..f77ddf8 100644 --- a/hello/templates/home.html +++ b/hello/templates/home.html @@ -24,28 +24,7 @@ Audio analysis · Sensor map -
-

No recording needed

-

Report fireworks now

-

Choose how many times you heard fireworks, then send it straight to Pending. The report is timestamped now.

-
- {% csrf_token %} - - - - - - - - -
-
-
+ {% include "fireworks_detect/includes/manual_report_form.html" %} diff --git a/myproject/__pycache__/urls.cpython-313.pyc b/myproject/__pycache__/urls.cpython-313.pyc index 057e8dd..af5a121 100644 Binary files a/myproject/__pycache__/urls.cpython-313.pyc and b/myproject/__pycache__/urls.cpython-313.pyc differ diff --git a/myproject/urls.py b/myproject/urls.py index 2a69a57..2291ca4 100644 --- a/myproject/urls.py +++ b/myproject/urls.py @@ -1,33 +1,23 @@ -""" -URL configuration for myproject project. +"""URL configuration for the project.""" -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/6.1/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" +from django.conf import settings from django.contrib import admin from django.contrib.auth import views as auth_views -from django.conf import settings -from django.urls import path, include, re_path +from django.urls import include, path, re_path from django.views.static import serve +from fireworks_detect.views import dashboard_view +from hello.views import hello_view + urlpatterns = [ - path('admin/', admin.site.urls), - path('login/', auth_views.LoginView.as_view(template_name='members/login.html'), name='login'), - path('classifications/', include('fireworks_detect.classification_urls')), - path('settings/', include('members.settings_urls')), - path('', include('hello.urls')), - path('fireworks/', include('fireworks_detect.urls')), - path('members/', include('members.urls')) + path("admin/", admin.site.urls), + path("login/", auth_views.LoginView.as_view(template_name="members/login.html"), name="login"), + path("classifications/", include("fireworks_detect.classification_urls")), + path("settings/", include("members.settings_urls")), + path("fireworks/", include("fireworks_detect.urls")), + path("members/", include("members.urls")), + path("old/", hello_view, name="old_home"), + path("", dashboard_view, name="hello"), ] urlpatterns += [re_path(r"^static/(?P.*)$", serve, {"document_root": settings.STATIC_ROOT})] diff --git a/staticfiles/vite/assets/dashboard-BLKe9w6Q.css b/staticfiles/vite/assets/dashboard-BLKe9w6Q.css new file mode 100644 index 0000000..69295fa --- /dev/null +++ b/staticfiles/vite/assets/dashboard-BLKe9w6Q.css @@ -0,0 +1 @@ +:root{--dashboard-ink: #edf3ff;--dashboard-muted: #aab9d8;--dashboard-line: #2b3d68;--dashboard-surface: #111a31;--dashboard-surface-raised: #172443}body.dashboard-page{display:block;min-width:320px;min-height:100vh;margin:0;color:var(--dashboard-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:radial-gradient(circle at 8% 0%,#263a76 0,transparent 31rem),radial-gradient(circle at 96% 100%,#512363 0,transparent 29rem),#090e1d}.dashboard-shell{width:min(100% - 2.5rem,70rem);margin:0 auto;padding:clamp(2rem,6vw,5rem) 0}.dashboard-intro{max-width:44rem;margin-bottom:2rem}.dashboard-kicker{margin:0 0 .8rem;color:#bfdbfe;font-size:.76rem;font-weight:850;letter-spacing:.14em;text-transform:uppercase}.dashboard-intro h1{max-width:11ch;margin:0;color:var(--dashboard-ink);font-size:clamp(2.8rem,7vw,5.5rem);line-height:.94;letter-spacing:-.065em}.dashboard-intro p:last-child{max-width:42rem;margin:1.25rem 0 0;color:var(--dashboard-muted);font-size:clamp(1rem,2vw,1.16rem);line-height:1.65}.dashboard-section{margin-top:2.25rem}.dashboard-section__header{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin:0 0 1rem}.dashboard-section__header h2{margin:.25rem 0 0;color:var(--dashboard-ink);font-size:clamp(1.65rem,4vw,2.3rem);letter-spacing:-.045em}.dashboard-section__header .dashboard-kicker{margin-bottom:.3rem}.dashboard-link{display:inline-flex;align-items:center;justify-content:center;min-height:2.75rem;padding:.7rem 1rem;border:1px solid #789ed7;border-radius:.7rem;color:#dceaff;font-size:.9rem;font-weight:800;text-decoration:none;background:#1b2e52;transition:transform .2s ease,background .2s ease}.dashboard-link:hover{transform:translateY(-1px);background:#274574}.dashboard-report{position:relative;overflow:hidden;padding:clamp(1.35rem,4vw,2.4rem);border:1px solid #b86c2a;border-radius:1.35rem;background:linear-gradient(135deg,#4a2b16e8,#171225dd);box-shadow:0 1.5rem 4rem #02061680}.dashboard-report:after{content:"";position:absolute;width:17rem;height:17rem;right:-9rem;top:-10rem;border-radius:50%;background:#ffb4541f;pointer-events:none}.dashboard-report>*{position:relative}.dashboard-report .eyebrow{margin:0 0 .7rem;color:#ffd08a;font-size:.76rem;font-weight:850;letter-spacing:.14em;text-transform:uppercase}.dashboard-report .eyebrow:before{content:"";display:inline-block;width:.5rem;height:.5rem;margin-right:.45rem;border-radius:50%;background:#ffbd62;box-shadow:0 0 0 .25rem #fbbf2430}.dashboard-report .manual-report__title{max-width:14ch;margin:0 0 .6rem;color:#fff6e7;font-size:clamp(2rem,5vw,3.4rem);line-height:.98;letter-spacing:-.06em}.dashboard-report .manual-report__intro{max-width:42rem;margin:0 0 1.35rem;color:#f3c8a3;line-height:1.55}.dashboard-report .manual-report__label{display:block;margin-bottom:.5rem;color:#fff2df;font-weight:800}.dashboard-report #manual-occurrences{width:min(100%,36rem);min-height:3.25rem;display:block;margin-bottom:1rem;padding:.75rem .9rem;border:1px solid #e2934a;border-radius:.75rem;color:#edf3ff;font:inherit;font-weight:800;background:#151b31}.dashboard-report .manual-direction-panel{width:min(100%,36rem);margin:0 0 1rem;padding:1rem;border:1px solid #8d5bb5;border-radius:.75rem;background:#241b38}.dashboard-report .manual-direction-panel__heading{display:block;margin-bottom:.35rem}.dashboard-report .manual-direction-panel__heading span{color:#c7b5eb;font-weight:600}.dashboard-report .manual-direction-panel__copy{margin:0 0 .75rem;color:#d4c6ef;font-size:.88rem;line-height:1.45}.dashboard-report .manual-direction-panel__button{min-height:2.75rem;padding:.65rem .9rem;border:1px solid #c3a5eb;border-radius:.65rem;color:#211234;font:inherit;font-weight:850;background:#d8c1fb;cursor:pointer}.dashboard-report .manual-direction-panel__status{min-height:1.4rem;margin-top:.7rem;color:#e5dcf7;font-size:.9rem}.dashboard-report .manual-report__submit{width:min(100%,36rem);min-height:4.5rem;border:0;border-radius:1rem;color:#281306;font:inherit;font-size:clamp(1.05rem,2vw,1.3rem);font-weight:900;background:linear-gradient(135deg,#ffd18c,#ff8f5b);box-shadow:0 .75rem 1.8rem #d664344d;cursor:pointer}.dashboard-report .manual-report__submission{min-height:1.5rem;margin-top:1rem;color:#ffd18c}.dashboard-map .map{height:clamp(22rem,48vh,34rem)}.dashboard-map .map-header{background:#121d37}.dashboard-map .legend{display:none}.dashboard-upload{padding:clamp(1rem,3vw,1.5rem)}.dashboard-upload .drop-zone{min-height:12rem}@media(max-width:42rem){.dashboard-shell{width:min(100% - 1.25rem,70rem)}.dashboard-section__header{align-items:flex-start;flex-direction:column}.dashboard-link{width:100%}.dashboard-map .map{height:23rem}}:root[data-theme=light] body.dashboard-page{--dashboard-ink: #172b50;--dashboard-muted: #596d88;--dashboard-line: #cbd9ed;--dashboard-surface: #fff;--dashboard-surface-raised: #f4f8ff;background:radial-gradient(circle at 8% 0%,#dbeaff 0,transparent 31rem),radial-gradient(circle at 96% 100%,#eee2ff 0,transparent 29rem),#f4f7fc}:root[data-theme=light] .dashboard-intro h1,:root[data-theme=light] .dashboard-section__header h2{color:#172b50!important}:root[data-theme=light] .dashboard-kicker{color:#3f6fa9!important}:root[data-theme=light] .dashboard-link{border-color:#9fc0e9;color:#234a7b;background:#e6f0ff}.dashboard-link:hover{background:#d8e8ff}:root[data-theme=light] .dashboard-report{border-color:#eca851;background:linear-gradient(145deg,#fff8ef,#ffe0bb);box-shadow:0 1.4rem 3.4rem #7445192e}:root[data-theme=light] .dashboard-report .eyebrow{color:#9f4d16!important}:root[data-theme=light] .dashboard-report .manual-report__title{color:#4a2510!important}:root[data-theme=light] .dashboard-report .manual-report__intro{color:#70411d!important}:root[data-theme=light] .dashboard-report .manual-report__label{color:#54311b}:root[data-theme=light] .dashboard-report #manual-occurrences{border-color:#dfaa68;color:#322014;background:#fffdfa}:root[data-theme=light] .dashboard-report .manual-direction-panel{border-color:#d9b4d8;background:#fff5fc}:root[data-theme=light] .dashboard-report .manual-direction-panel__heading{color:#492846}:root[data-theme=light] .dashboard-report .manual-direction-panel__heading span{color:#70466d}:root[data-theme=light] .dashboard-report .manual-direction-panel__copy{color:#694b68}:root[data-theme=light] .dashboard-report .manual-direction-panel__button{border-color:#b68bb5;color:#321a34;background:#ead2eb}:root[data-theme=light] .dashboard-report .manual-direction-panel__status{color:#6b4267}:root[data-theme=light] .dashboard-report .manual-report__submission{color:#87421b}:root[data-theme=light] .dashboard-map .map-header{background:#f2f6fc!important}.dashboard-page .profile-circle{display:grid;width:3rem;height:3rem;position:fixed;top:1.25rem;right:1.25rem;place-items:center;border:1px solid #d0c0ff;border-radius:50%;z-index:1201;color:#17132b;font-weight:900;text-decoration:none;background:linear-gradient(135deg,#fcd34d,#c4a5fd);box-shadow:0 .5rem 1.5rem #01030c66}.dashboard-page .profile-circle:focus-visible{outline:3px solid #a5c9ff80;outline-offset:3px} diff --git a/staticfiles/vite/assets/dashboard-Bc9nwrME.css b/staticfiles/vite/assets/dashboard-Bc9nwrME.css new file mode 100644 index 0000000..a2dcf34 --- /dev/null +++ b/staticfiles/vite/assets/dashboard-Bc9nwrME.css @@ -0,0 +1 @@ +:root{--dashboard-ink: #edf3ff;--dashboard-muted: #aab9d8;--dashboard-line: #2b3d68;--dashboard-surface: #111a31;--dashboard-surface-raised: #172443}body.dashboard-page{display:block;min-width:320px;min-height:100vh;margin:0;color:var(--dashboard-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:radial-gradient(circle at 8% 0%,#263a76 0,transparent 31rem),radial-gradient(circle at 96% 100%,#512363 0,transparent 29rem),#090e1d}.dashboard-shell{width:min(100% - 2.5rem,70rem);margin:0 auto;padding:clamp(2rem,6vw,5rem) 0}.dashboard-intro{max-width:44rem;margin-bottom:2rem}.dashboard-kicker{margin:0 0 .8rem;color:#bfdbfe;font-size:.76rem;font-weight:850;letter-spacing:.14em;text-transform:uppercase}.dashboard-intro h1{max-width:11ch;margin:0;color:var(--dashboard-ink);font-size:clamp(2.8rem,7vw,5.5rem);line-height:.94;letter-spacing:-.065em}.dashboard-intro p:last-child{max-width:42rem;margin:1.25rem 0 0;color:var(--dashboard-muted);font-size:clamp(1rem,2vw,1.16rem);line-height:1.65}.dashboard-section{margin-top:2.25rem}.dashboard-section__header{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin:0 0 1rem}.dashboard-section__header h2{margin:.25rem 0 0;color:var(--dashboard-ink);font-size:clamp(1.65rem,4vw,2.3rem);letter-spacing:-.045em}.dashboard-section__header .dashboard-kicker{margin-bottom:.3rem}.dashboard-link{display:inline-flex;align-items:center;justify-content:center;min-height:2.75rem;padding:.7rem 1rem;border:1px solid #789ed7;border-radius:.7rem;color:#dceaff;font-size:.9rem;font-weight:800;text-decoration:none;background:#1b2e52;transition:transform .2s ease,background .2s ease}.dashboard-link:hover{transform:translateY(-1px);background:#274574}.dashboard-report{position:relative;overflow:hidden;padding:clamp(1.35rem,4vw,2.4rem);border:1px solid #b86c2a;border-radius:1.35rem;background:linear-gradient(135deg,#4a2b16e8,#171225dd);box-shadow:0 1.5rem 4rem #02061680}.dashboard-report:after{content:"";position:absolute;width:17rem;height:17rem;right:-9rem;top:-10rem;border-radius:50%;background:#ffb4541f;pointer-events:none}.dashboard-report>*{position:relative}.dashboard-report .eyebrow{margin:0 0 .7rem;color:#ffd08a;font-size:.76rem;font-weight:850;letter-spacing:.14em;text-transform:uppercase}.dashboard-report .eyebrow:before{content:"";display:inline-block;width:.5rem;height:.5rem;margin-right:.45rem;border-radius:50%;background:#ffbd62;box-shadow:0 0 0 .25rem #fbbf2430}.dashboard-report .manual-report__title{max-width:14ch;margin:0 0 .6rem;color:#fff6e7;font-size:clamp(2rem,5vw,3.4rem);line-height:.98;letter-spacing:-.06em}.dashboard-report .manual-report__intro{max-width:42rem;margin:0 0 1.35rem;color:#f3c8a3;line-height:1.55}.dashboard-report .manual-report__label{display:block;margin-bottom:.5rem;color:#fff2df;font-weight:800}.dashboard-report #manual-occurrences{width:min(100%,36rem);min-height:3.25rem;display:block;margin-bottom:1rem;padding:.75rem .9rem;border:1px solid #e2934a;border-radius:.75rem;color:#edf3ff;font:inherit;font-weight:800;background:#151b31}.dashboard-report .manual-direction-panel{width:min(100%,36rem);margin:0 0 1rem;padding:1rem;border:1px solid #8d5bb5;border-radius:.75rem;background:#241b38}.dashboard-report .manual-direction-panel__heading{display:block;margin-bottom:.35rem}.dashboard-report .manual-direction-panel__heading span{color:#c7b5eb;font-weight:600}.dashboard-report .manual-direction-panel__copy{margin:0 0 .75rem;color:#d4c6ef;font-size:.88rem;line-height:1.45}.dashboard-report .manual-direction-panel__button{min-height:2.75rem;padding:.65rem .9rem;border:1px solid #c3a5eb;border-radius:.65rem;color:#211234;font:inherit;font-weight:850;background:#d8c1fb;cursor:pointer}.dashboard-report .manual-direction-panel__status{min-height:1.4rem;margin-top:.7rem;color:#e5dcf7;font-size:.9rem}.dashboard-report .manual-report__submit{width:min(100%,36rem);min-height:4.5rem;border:0;border-radius:1rem;color:#281306;font:inherit;font-size:clamp(1.05rem,2vw,1.3rem);font-weight:900;background:linear-gradient(135deg,#ffd18c,#ff8f5b);box-shadow:0 .75rem 1.8rem #d664344d;cursor:pointer}.dashboard-report .manual-report__submission{min-height:1.5rem;margin-top:1rem;color:#ffd18c}.dashboard-map .map{height:clamp(22rem,48vh,34rem)}.dashboard-map .map-header{background:#121d37}.dashboard-map .legend{display:none}.dashboard-upload{padding:clamp(1rem,3vw,1.5rem)}.dashboard-upload .drop-zone{min-height:12rem}@media(max-width:42rem){.dashboard-shell{width:min(100% - 1.25rem,70rem)}.dashboard-section__header{align-items:flex-start;flex-direction:column}.dashboard-link{width:100%}.dashboard-map .map{height:23rem}}:root[data-theme=light] body.dashboard-page{--dashboard-ink: #172b50;--dashboard-muted: #596d88;--dashboard-line: #cbd9ed;--dashboard-surface: #fff;--dashboard-surface-raised: #f4f8ff;background:radial-gradient(circle at 8% 0%,#dbeaff 0,transparent 31rem),radial-gradient(circle at 96% 100%,#eee2ff 0,transparent 29rem),#f4f7fc}:root[data-theme=light] .dashboard-intro h1,:root[data-theme=light] .dashboard-section__header h2{color:#172b50!important}:root[data-theme=light] .dashboard-kicker{color:#3f6fa9!important}:root[data-theme=light] .dashboard-link{border-color:#9fc0e9;color:#234a7b;background:#e6f0ff}.dashboard-link:hover{background:#d8e8ff}:root[data-theme=light] .dashboard-report{border-color:#eca851;background:linear-gradient(145deg,#fff8ef,#ffe0bb);box-shadow:0 1.4rem 3.4rem #7445192e}:root[data-theme=light] .dashboard-report .eyebrow{color:#9f4d16!important}:root[data-theme=light] .dashboard-report .manual-report__title{color:#4a2510!important}:root[data-theme=light] .dashboard-report .manual-report__intro{color:#70411d!important}:root[data-theme=light] .dashboard-report .manual-report__label{color:#54311b}:root[data-theme=light] .dashboard-report #manual-occurrences{border-color:#dfaa68;color:#322014;background:#fffdfa}:root[data-theme=light] .dashboard-report .manual-direction-panel{border-color:#d9b4d8;background:#fff5fc}:root[data-theme=light] .dashboard-report .manual-direction-panel__heading{color:#492846}:root[data-theme=light] .dashboard-report .manual-direction-panel__heading span{color:#70466d}:root[data-theme=light] .dashboard-report .manual-direction-panel__copy{color:#694b68}:root[data-theme=light] .dashboard-report .manual-direction-panel__button{border-color:#b68bb5;color:#321a34;background:#ead2eb}:root[data-theme=light] .dashboard-report .manual-direction-panel__status{color:#6b4267}:root[data-theme=light] .dashboard-report .manual-report__submission{color:#87421b}:root[data-theme=light] .dashboard-map .map-header{background:#f2f6fc!important} diff --git a/staticfiles/vite/assets/frontend/src/entries/dashboard.js-B5QcJpVi.js b/staticfiles/vite/assets/frontend/src/entries/dashboard.js-B5QcJpVi.js new file mode 100644 index 0000000..477fa50 --- /dev/null +++ b/staticfiles/vite/assets/frontend/src/entries/dashboard.js-B5QcJpVi.js @@ -0,0 +1 @@ +/* empty css */import"./fireworks-home.js-BAmW5fGZ.js";import"./map.js-DCafyyWY.js";import"../../../theme-BwRovl8e.js";import"../../../manual-report-BMn4sn8O.js"; diff --git a/staticfiles/vite/assets/frontend/src/entries/dashboard.js-DfFMKYpL.js b/staticfiles/vite/assets/frontend/src/entries/dashboard.js-DfFMKYpL.js new file mode 100644 index 0000000..477fa50 --- /dev/null +++ b/staticfiles/vite/assets/frontend/src/entries/dashboard.js-DfFMKYpL.js @@ -0,0 +1 @@ +/* empty css */import"./fireworks-home.js-BAmW5fGZ.js";import"./map.js-DCafyyWY.js";import"../../../theme-BwRovl8e.js";import"../../../manual-report-BMn4sn8O.js"; diff --git a/staticfiles/vite/assets/frontend/src/entries/home.js-zVeye29i.js b/staticfiles/vite/assets/frontend/src/entries/home.js-zVeye29i.js new file mode 100644 index 0000000..d8c518b --- /dev/null +++ b/staticfiles/vite/assets/frontend/src/entries/home.js-zVeye29i.js @@ -0,0 +1 @@ +import"../../../theme-BwRovl8e.js";import"../../../manual-report-BMn4sn8O.js"; diff --git a/staticfiles/vite/assets/frontend/src/entries/map.js-DCafyyWY.js b/staticfiles/vite/assets/frontend/src/entries/map.js-DCafyyWY.js new file mode 100644 index 0000000..3f598a4 --- /dev/null +++ b/staticfiles/vite/assets/frontend/src/entries/map.js-DCafyyWY.js @@ -0,0 +1 @@ +/* empty css */import"../../../theme-BwRovl8e.js";const p=document.getElementById("event-map"),g=p.dataset.h3Resolution,o=L.map(p,{zoomControl:!1,scrollWheelZoom:!1}).setView([52.1326,5.2913],7);L.control.zoom({position:"bottomleft"}).addTo(o);const u=L.control({position:"topright"});u.onAdd=()=>{const t=L.DomUtil.create("div","map-compass");return t.setAttribute("role","img"),t.setAttribute("aria-label","Map compass: north is up"),t.innerHTML='NESW↑',L.DomEvent.disableClickPropagation(t),t};u.addTo(o);L.tileLayer("https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png",{maxZoom:18,attribution:"© OpenStreetMap contributors"}).addTo(o);const f=JSON.parse(document.getElementById("h3-cells-data").textContent),M=JSON.parse(document.getElementById("map-events-data").textContent),r=L.latLngBounds([]);f.forEach(t=>{L.polygon(t.boundary,{color:"#f59e0b",weight:2,fillColor:"#f59e0b",fillOpacity:.25}).addTo(o).bindPopup('H3 '+t.cell+''+t.reports+" reports · "+t.occurrences+" occurrences · resolution "+g+""),r.extend(L.latLngBounds(t.boundary))});function y(t){return["N","NE","E","SE","S","SW","W","NW"][Math.floor((t+22.5)%360/45)]}function b(t,e,n){const s=e*Math.PI/180,c=t[0]*Math.PI/180,m=t[1]*Math.PI/180,i=n/6378137,d=Math.asin(Math.sin(c)*Math.cos(i)+Math.cos(c)*Math.sin(i)*Math.cos(s)),h=m+Math.atan2(Math.sin(s)*Math.sin(i)*Math.cos(c),Math.cos(i)-Math.sin(c)*Math.sin(d));return[d*180/Math.PI,h*180/Math.PI]}const v=L.divIcon({className:"",html:'
✦
',iconSize:[37,37],iconAnchor:[19,19]});M.forEach(t=>{const e=t.visually_confirmed?"Visually confirmed":"Not visually confirmed";let n=t.occurrences+" occurrence"+(t.occurrences===1?"":"s")+" · "+e+"
Reported "+t.reported_on;if(t.direction_degrees!==null&&(n+="
Compass direction "+Math.round(t.direction_degrees)+"° ("+y(t.direction_degrees)+")",t.direction_accuracy_degrees!==null&&(n+=" (±"+Math.round(t.direction_accuracy_degrees)+"°)")),L.marker(t.center,{icon:v}).addTo(o).bindPopup('Manual report · H3 '+t.cell+''+n+""),t.direction_degrees!==null){const a=b(t.center,t.direction_degrees,900);L.polyline([t.center,a],{color:"#fff7e6",weight:9,opacity:.8}).addTo(o),L.polyline([t.center,a],{color:"#6d45a0",weight:5,opacity:1}).addTo(o);const s=L.divIcon({className:"",html:'
↑
',iconSize:[56,56],iconAnchor:[28,28]});L.marker(a,{icon:s,interactive:!1}).addTo(o)}});r.isValid()&&o.fitBounds(r.pad(.18));const l=document.getElementById("range");l&&document.querySelectorAll("#from-date, #to-date").forEach(t=>{t.addEventListener("change",()=>{l.value="custom"})}); diff --git a/staticfiles/vite/assets/manual-report-BMn4sn8O.js b/staticfiles/vite/assets/manual-report-BMn4sn8O.js new file mode 100644 index 0000000..e632ff7 --- /dev/null +++ b/staticfiles/vite/assets/manual-report-BMn4sn8O.js @@ -0,0 +1 @@ +const a=document.querySelector("#manual-report-form"),m=document.querySelector("#manual-submit"),g=document.querySelector("#manual-submission"),C=document.querySelector("#manual-latitude"),b=document.querySelector("#manual-longitude"),w=document.querySelector("#manual-direction-degrees"),y=document.querySelector("#manual-direction-accuracy"),c=document.querySelector("#manual-capture-direction"),t=document.querySelector("#manual-direction-status"),v=document.querySelector("#manual-direction-panel"),f=/Android|iPhone|iPad|iPod|IEMobile|Opera Mini/.test(navigator.userAgent)||navigator.userAgent.includes("Macintosh")&&navigator.maxTouchPoints>1;f&&(v.hidden=!1);let o,r;const l=e=>Number.isFinite(e),S=e=>["N","NE","E","SE","S","SW","W","NW"][Math.floor((e+22.5)%360/45)],p=e=>Number(e.toFixed(1)).toString(),s=()=>{o&&window.removeEventListener("deviceorientation",o),window.clearTimeout(r),o=null,r=null},x=(e,i)=>{const n=i===null?"Accuracy unavailable":"Accuracy: ±"+p(i)+"°";t.innerHTML=""+p(e)+"° · "+S(e)+"
"+n,c.textContent="Stop direction capture"},h=()=>{s(),t.textContent="Point the top of your phone toward the sound — direction will update live.",o=e=>{const i="webkitCompassHeading"in e,n=l(e.webkitCompassHeading)?e.webkitCompassHeading:!i&&e.absolute&&l(e.alpha)?(360-e.alpha)%360:null;if(n===null||n<0||n>=360)return;const u=l(e.webkitCompassAccuracy)&&e.webkitCompassAccuracy>=0?e.webkitCompassAccuracy:null;w.value=n,y.value=u===null?"":u,x(n,u),window.clearTimeout(r)},window.addEventListener("deviceorientation",o),r=window.setTimeout(()=>{s(),c.textContent="Capture direction",t.textContent="Compass unavailable on this device."},15e3)},q=async()=>{if(o){s(),c.textContent="Capture again";return}if(!window.isSecureContext){t.textContent="Compass capture requires a secure HTTPS connection.";return}if(typeof window.DeviceOrientationEvent>"u"){t.textContent="Compass unavailable on this device.";return}if(typeof DeviceOrientationEvent.requestPermission=="function"){t.textContent="Requesting compass permission…";try{if(await DeviceOrientationEvent.requestPermission(!0)!=="granted"){t.textContent="Compass permission denied.";return}}catch{t.textContent="Compass permission denied.";return}}h()},d=()=>{s(),m.disabled=!0,window.htmx?htmx.ajax("POST",a.action,{source:a,target:"#manual-submission",swap:"outerHTML"}):a.submit()};c.addEventListener("click",q);m.addEventListener("click",()=>{if(!navigator.geolocation){d();return}g.textContent="Requesting your optional location…",navigator.geolocation.getCurrentPosition(e=>{C.value=e.coords.latitude,b.value=e.coords.longitude,d()},()=>d(),{enableHighAccuracy:!1,maximumAge:3e5,timeout:1e4})});document.body.addEventListener("htmx:afterRequest",e=>{e.detail.elt===a&&(m.disabled=!1)});