initial commit

This commit is contained in:
Joren de Graaf
2026-09-26 20:59:01 +02:00
parent e07f08c791
commit a4f3542e67
210 changed files with 36684 additions and 0 deletions
BIN
View File
Binary file not shown.
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+90
View File
@@ -0,0 +1,90 @@
import json
from django.contrib import admin, messages
from django.utils import timezone
from django.utils.html import format_html
from .models import Event, PendingEvent, Sensor
class ClassificationAdmin(admin.ModelAdmin):
list_display = ("original_filename", "sensor", "primary_label", "primary_score", "duration", "created_at")
list_filter = ("created_at",)
search_fields = ("original_filename",)
readonly_fields = ("audio_file", "sensor", "original_filename", "created_at", "pretty_classifier_response")
fields = ("audio_file", "sensor", "original_filename", "created_at")
change_form_template = "admin/fireworks_detect/classification_audio_change_form.html"
@admin.display(description="Classifier response")
def pretty_classifier_response(self, obj):
return format_html("<pre>{}</pre>", json.dumps(obj.classifier_response, indent=2, sort_keys=True))
@admin.register(PendingEvent)
class PendingEventAdmin(ClassificationAdmin):
actions = ("approve_selected", "deny_selected")
def has_add_permission(self, request):
return False
@admin.action(description="Approve selected samples and move them to Events")
def approve_selected(self, request, queryset):
approved = 0
for pending in queryset:
pending.approve()
approved += 1
self.message_user(request, f"{approved} sample(s) approved and moved to Events.", messages.SUCCESS)
@admin.action(description="Deny selected samples and delete their uploaded audio")
def deny_selected(self, request, queryset):
denied = 0
for pending in queryset:
pending.deny()
denied += 1
self.message_user(request, f"{denied} sample(s) denied and removed.", messages.WARNING)
@admin.register(Event)
class EventAdmin(ClassificationAdmin):
readonly_fields = ClassificationAdmin.readonly_fields + ("approved_at",)
fields = ClassificationAdmin.fields + ("approved_at",)
def has_add_permission(self, request):
return False
@admin.register(Sensor)
class SensorAdmin(admin.ModelAdmin):
list_display = ("name", "is_active", "heartbeat_light", "last_heartbeat", "last_submission", "token_prefix")
list_filter = ("is_active",)
search_fields = ("name", "token_prefix")
readonly_fields = ("token_prefix", "last_heartbeat", "last_submission", "created_at")
actions = ("issue_api_token",)
fieldsets = (
("Sensor", {"fields": ("name", "is_active", "created_at")}),
("API token", {"fields": ("token_prefix",), "description": "Save the sensor first, select it in the list, then choose ‘Issue or rotate API token’. The complete token is shown once only; its salted hash is the only value stored."}),
("Heartbeat", {"fields": ("last_heartbeat", "last_submission"), "description": "Devices should POST to /fireworks/heartbeat/ with Authorization: Bearer <token>. Green means seen within 5 minutes; amber within 15; red is older or never seen."}),
)
@admin.display(description="Heartbeat")
def heartbeat_light(self, obj):
if not obj.last_heartbeat:
colour, label = "#ef4444", "Never seen"
else:
age = timezone.now() - obj.last_heartbeat
if age.total_seconds() <= 300:
colour, label = "#22c55e", "Online"
elif age.total_seconds() <= 900:
colour, label = "#f59e0b", "Delayed"
else:
colour, label = "#ef4444", "Offline"
return format_html('<span style="display:inline-flex;align-items:center;gap:6px"><span style="width:10px;height:10px;border-radius:50%;background:{}"></span>{}</span>', colour, label)
@admin.action(description="Issue or rotate API token (shown once)")
def issue_api_token(self, request, queryset):
if queryset.count() != 1:
self.message_user(request, "Select exactly one sensor to issue a token.", messages.ERROR)
return
sensor = queryset.get()
token = sensor.issue_token()
self.message_user(request, format_html('Copy this token now; it is not stored and will not be shown again: <code>{}</code>', token), messages.WARNING)
+52
View File
@@ -0,0 +1,52 @@
import json
from django.contrib import admin, messages
from django.utils.html import format_html
from .models import Event, PendingEvent
class ClassificationAdmin(admin.ModelAdmin):
list_display = ("original_filename", "primary_label", "primary_score", "duration", "created_at")
list_filter = ("created_at",)
search_fields = ("original_filename",)
readonly_fields = ("audio_file", "original_filename", "created_at", "pretty_classifier_response")
fields = ("audio_file", "original_filename", "created_at")
change_form_template = "admin/fireworks_detect/classification_change_form.html"
@admin.display(description="Classifier response")
def pretty_classifier_response(self, obj):
return format_html("<pre>{}</pre>", json.dumps(obj.classifier_response, indent=2, sort_keys=True))
@admin.register(PendingEvent)
class PendingEventAdmin(ClassificationAdmin):
actions = ("approve_selected", "deny_selected")
def has_add_permission(self, request):
return False
@admin.action(description="Approve selected samples and move them to Events")
def approve_selected(self, request, queryset):
approved = 0
for pending in queryset:
pending.approve()
approved += 1
self.message_user(request, f"{approved} sample(s) approved and moved to Events.", messages.SUCCESS)
@admin.action(description="Deny selected samples and delete their uploaded audio")
def deny_selected(self, request, queryset):
denied = 0
for pending in queryset:
pending.deny()
denied += 1
self.message_user(request, f"{denied} sample(s) denied and removed.", messages.WARNING)
@admin.register(Event)
class EventAdmin(ClassificationAdmin):
readonly_fields = ClassificationAdmin.readonly_fields + ("approved_at",)
fields = ClassificationAdmin.fields + ("approved_at",)
def has_add_permission(self, request):
return False
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class FireworksDetectConfig(AppConfig):
name = 'fireworks_detect'
@@ -0,0 +1,47 @@
# Generated by Django 6.1.1 on 2026-09-26 13:34
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('audio_file', models.FileField(upload_to='fireworks_audio/%Y/%m/%d')),
('original_filename', models.CharField(max_length=255)),
('classifier_response', models.JSONField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('approved_at', models.DateTimeField(auto_now_add=True)),
],
options={
'verbose_name': 'Event',
'verbose_name_plural': 'Events',
'ordering': ['-created_at'],
'abstract': False,
},
),
migrations.CreateModel(
name='PendingEvent',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('audio_file', models.FileField(upload_to='fireworks_audio/%Y/%m/%d')),
('original_filename', models.CharField(max_length=255)),
('classifier_response', models.JSONField()),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'verbose_name': 'Pending event',
'verbose_name_plural': 'Pending',
'ordering': ['-created_at'],
'abstract': False,
},
),
]
@@ -0,0 +1,40 @@
# Generated by Django 6.1.1 on 2026-09-26 14:16
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fireworks_detect', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Sensor',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='A recognisable device name, e.g. Garden ESP32.', max_length=100, unique=True)),
('is_active', models.BooleanField(default=True)),
('token_prefix', models.CharField(blank=True, editable=False, max_length=15)),
('token_hash', models.CharField(blank=True, editable=False, max_length=256)),
('last_heartbeat', models.DateTimeField(blank=True, editable=False, null=True)),
('last_submission', models.DateTimeField(blank=True, editable=False, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'ordering': ['name'],
},
),
migrations.AddField(
model_name='event',
name='sensor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_records', to='fireworks_detect.sensor'),
),
migrations.AddField(
model_name='pendingevent',
name='sensor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_records', to='fireworks_detect.sensor'),
),
]
+141
View File
@@ -0,0 +1,141 @@
import secrets
from django.contrib.auth.hashers import check_password, make_password
from django.core.files.storage import default_storage
from django.db import models, transaction
from django.utils import timezone
class Sensor(models.Model):
"""A physical recorder authorised to submit audio to the device API."""
name = models.CharField(max_length=100, unique=True, help_text="A recognisable device name, e.g. Garden ESP32.")
is_active = models.BooleanField(default=True)
token_prefix = models.CharField(max_length=15, blank=True, editable=False)
token_hash = models.CharField(max_length=256, blank=True, editable=False)
last_heartbeat = models.DateTimeField(null=True, blank=True, editable=False)
last_submission = models.DateTimeField(null=True, blank=True, editable=False)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
def issue_token(self):
"""Return a secret once; only a salted password hash is persisted."""
token = f"ss_{secrets.token_urlsafe(32)}"
self.token_prefix = token[:15]
self.token_hash = make_password(token)
self.save(update_fields=["token_prefix", "token_hash"])
return token
def token_matches(self, token):
return bool(self.token_hash) and check_password(token, self.token_hash)
def record_heartbeat(self, submission=False):
now = timezone.now()
self.last_heartbeat = now
fields = ["last_heartbeat"]
if submission:
self.last_submission = now
fields.append("last_submission")
self.save(update_fields=fields)
class ClassifiedAudio(models.Model):
"""Shared fields for a classifier response and its original audio upload."""
audio_file = models.FileField(upload_to="fireworks_audio/%Y/%m/%d")
sensor = models.ForeignKey(Sensor, null=True, blank=True, on_delete=models.SET_NULL, related_name="%(class)s_records")
original_filename = models.CharField(max_length=255)
classifier_response = models.JSONField()
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
abstract = True
ordering = ["-created_at"]
def __str__(self):
return self.original_filename
@property
def predictions(self):
predictions = self.classifier_response.get("predictions", [])
return predictions if isinstance(predictions, list) else []
@property
def primary_prediction(self):
return self.predictions[0] if self.predictions else {}
@property
def primary_label(self):
return self.primary_prediction.get("class", "No prediction")
@property
def primary_score(self):
try:
return f"{float(self.primary_prediction.get('score', 0)) * 100:.1f}%"
except (TypeError, ValueError):
return "—"
@property
def duration(self):
return self.classifier_response.get("duration_seconds", "—")
def _preview_items(self, key):
preview = []
for item in self.classifier_response.get(key, []):
label = str(item.get("class", "Unknown"))
lowered = label.lower()
kind = "speech" if any(term in lowered for term in ("speech", "conversation", "narration", "monologue", "whisper")) else "firework" if any(term in lowered for term in ("firework", "firecracker", "explosion", "bang", "boom", "hiss", "crackle")) else "default"
preview.append({**item, "label": label, "kind": kind, "score_display": f"{float(item.get('score', 0)) * 100:.1f}%"})
return preview
@property
def admin_predictions(self):
return self._preview_items("predictions")
@property
def admin_peaks(self):
return self._preview_items("peak_predictions")
@property
def admin_audio_route(self):
return "fireworks_detect:pending_audio" if self._meta.model_name == "pendingevent" else "fireworks_detect:event_audio"
class PendingEvent(ClassifiedAudio):
"""A submitted classification awaiting a human review in Django admin."""
class Meta(ClassifiedAudio.Meta):
verbose_name = "Pending event"
verbose_name_plural = "Pending"
@transaction.atomic
def approve(self):
event = Event.objects.create(
audio_file=self.audio_file.name,
sensor=self.sensor,
original_filename=self.original_filename,
classifier_response=self.classifier_response,
)
self.delete()
return event
def deny(self):
file_name = self.audio_file.name
self.delete()
if file_name:
default_storage.delete(file_name)
class Event(ClassifiedAudio):
"""A reviewed classification that is safe to appear in the event feed."""
approved_at = models.DateTimeField(auto_now_add=True)
class Meta(ClassifiedAudio.Meta):
verbose_name = "Event"
verbose_name_plural = "Events"
+93
View File
@@ -0,0 +1,93 @@
from django.core.files.storage import default_storage
from django.db import models, transaction
class ClassifiedAudio(models.Model):
"""Shared fields for a classifier response and its original audio upload."""
audio_file = models.FileField(upload_to="fireworks_audio/%Y/%m/%d")
original_filename = models.CharField(max_length=255)
classifier_response = models.JSONField()
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
abstract = True
ordering = ["-created_at"]
def __str__(self):
return self.original_filename
@property
def predictions(self):
predictions = self.classifier_response.get("predictions", [])
return predictions if isinstance(predictions, list) else []
@property
def primary_prediction(self):
return self.predictions[0] if self.predictions else {}
@property
def primary_label(self):
return self.primary_prediction.get("class", "No prediction")
@property
def primary_score(self):
try:
return f"{float(self.primary_prediction.get('score', 0)) * 100:.1f}%"
except (TypeError, ValueError):
return "—"
@property
def duration(self):
return self.classifier_response.get("duration_seconds", "—")
def _preview_items(self, key):
preview = []
for item in self.classifier_response.get(key, []):
label = str(item.get("class", "Unknown"))
lowered = label.lower()
kind = "speech" if any(term in lowered for term in ("speech", "conversation", "narration", "monologue", "whisper")) else "firework" if any(term in lowered for term in ("firework", "firecracker", "explosion", "bang", "boom", "hiss", "crackle")) else "default"
preview.append({**item, "label": label, "kind": kind, "score_display": f"{float(item.get('score', 0)) * 100:.1f}%"})
return preview
@property
def admin_predictions(self):
return self._preview_items("predictions")
@property
def admin_peaks(self):
return self._preview_items("peak_predictions")
class PendingEvent(ClassifiedAudio):
"""A submitted classification awaiting a human review in Django admin."""
class Meta(ClassifiedAudio.Meta):
verbose_name = "Pending event"
verbose_name_plural = "Pending"
@transaction.atomic
def approve(self):
event = Event.objects.create(
audio_file=self.audio_file.name,
original_filename=self.original_filename,
classifier_response=self.classifier_response,
)
self.delete()
return event
def deny(self):
file_name = self.audio_file.name
self.delete()
if file_name:
default_storage.delete(file_name)
class Event(ClassifiedAudio):
"""A reviewed classification that is safe to appear in the event feed."""
approved_at = models.DateTimeField(auto_now_add=True)
class Meta(ClassifiedAudio.Meta):
verbose_name = "Event"
verbose_name_plural = "Events"
@@ -0,0 +1,69 @@
{% if error %}
<section class="results-card error-card" role="alert">
<h2>Analysis unavailable</h2>
<p>{{ error }}</p>
</section>
{% else %}
<section class="results-card" tabindex="-1">
<div class="result-heading">
<div>
<h2>Analysis complete</h2>
<p>{{ result.filename|default:"Audio file" }}</p>
</div>
<span class="result-status">Ready</span>
</div>
<div class="meta">
<span>{{ result.duration_seconds|default:"—" }} seconds</span>
<span>{{ result.frames_analysed|default:"—" }} frames analysed</span>
<span>{{ result.yamnet_sample_rate|default:"—" }} Hz model rate</span>
</div>
<div class="legend" aria-label="Result legend">
{% if firework_count %}<span class="firework">✦ {{ firework_count }} firework-related signal{{ firework_count|pluralize }}</span>{% endif %}
{% if speech_count %}<span class="speech">● {{ speech_count }} speech/privacy signal{{ speech_count|pluralize }}</span>{% endif %}
</div>
<div class="result-grid">
<section class="result-group" aria-labelledby="top-predictions">
<h3 id="top-predictions">Top sound classes</h3>
{% if predictions %}
<ul class="prediction-list">
{% for prediction in predictions %}
<li class="prediction prediction--{{ prediction.kind }}" style="--score: {{ prediction.score_width }}">
<span class="prediction-label">{{ prediction.label }}</span>
<span class="prediction-score">{{ prediction.score_display }}</span>
<span class="score-bar" aria-hidden="true"><i></i></span>
</li>
{% endfor %}
</ul>
{% else %}<p class="empty">No overall predictions were returned.</p>{% endif %}
</section>
<section class="result-group" aria-labelledby="peak-predictions">
<h3 id="peak-predictions">Notable moments</h3>
{% if peak_predictions %}
<div class="peak-list">
{% for prediction in peak_predictions %}
<article class="peak-item">
<span class="peak-time">{{ prediction.time_seconds|default:"—" }}s · frame {{ prediction.frame|default:"—" }}</span>
<div class="prediction prediction--{{ prediction.kind }}" style="--score: {{ prediction.score_width }}">
<span class="prediction-label">{{ prediction.label }}</span>
<span class="prediction-score">{{ prediction.score_display }}</span>
<span class="score-bar" aria-hidden="true"><i></i></span>
</div>
</article>
{% endfor %}
</div>
{% else %}<p class="empty">No peak events were returned.</p>{% endif %}
</section>
</div>
{% if submission_token %}
<div class="review-submission" id="review-submission">
<input type="hidden" name="classification_token" value="{{ submission_token }}">
<div><strong>Submit this sample for review</strong><p>The audio and signed classifier response will be added to Pending.</p></div>
<button type="button" hx-post="{% url 'fireworks_detect:submit_pending' %}" hx-target="#review-submission" hx-swap="outerHTML" hx-encoding="multipart/form-data">Send to Pending →</button>
</div>
{% endif %}
</section>
{% endif %}
@@ -0,0 +1 @@
<h2>{{ event.original_filename }}</h2><p class="meta">Approved {{ event.approved_at|date:"j M Y, H:i" }} · {{ result.duration_seconds|default:"—" }} seconds · {{ result.frames_analysed|default:"—" }} frames</p><h3>Top sound classes</h3>{% for prediction in predictions %}<div class="prediction prediction--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.score_display }}</span></div>{% empty %}<p class="empty">No predictions returned.</p>{% endfor %}<h3>Notable moments</h3>{% for prediction in peak_predictions %}<div class="prediction prediction--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.time_seconds|default:"—" }}s · {{ prediction.score_display }}</span></div>{% empty %}<p class="empty">No peak events returned.</p>{% endfor %}
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Events · Sound Signal</title><script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script><style>:root{--i:#edf3ff;--m:#aab9d8;--l:#2b3d68}*{box-sizing:border-box}body{margin:0;min-height:100vh;padding:2rem;color:var(--i);font-family:system-ui;background:radial-gradient(circle at 8% 0,#263a76,transparent 31rem),#090e1d}.shell{width:min(100%,70rem);margin:auto}.top{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin-bottom:3rem}.brand,a{color:inherit}.brand{text-decoration:none;font-weight:900;letter-spacing:.1em;text-transform:uppercase}.top a:not(.brand){padding:.6rem .8rem;border:1px solid var(--l);border-radius:.6rem;text-decoration:none}.eyebrow{color:#bcd4ff;font-size:.76rem;letter-spacing:.15em;text-transform:uppercase;font-weight:800}h1{font-size:clamp(2.5rem,6vw,4.5rem);letter-spacing:-.06em;margin:.4rem 0}.lede{color:var(--m);max-width:38rem;line-height:1.6}.grid{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:1rem;margin-top:2rem}.panel{border:1px solid var(--l);border-radius:1rem;padding:1rem;background:#111a31d9}.event{width:100%;display:flex;justify-content:space-between;gap:.6rem;text-align:left;margin:.6rem 0;padding:.85rem;border:1px solid #374e7e;border-radius:.7rem;color:var(--i);background:#15223f;cursor:pointer}.event:hover{background:#20345f}.event small,.empty{color:var(--m)}.badge{color:#ffd08a}.detail h2{margin-top:0}.prediction{display:flex;justify-content:space-between;gap:1rem;padding:.65rem;margin:.45rem 0;border-left:3px solid #78a4f0;background:#111c34}.prediction--firework{border-color:#f5aa44}.prediction--speech{border-color:#fb7185}.meta{color:var(--m);font-size:.9rem}@media(max-width:42rem){body{padding:1rem}.grid{grid-template-columns:1fr}}</style></head><body><main class="shell"><header class="top"><a class="brand" href="{% url 'fireworks_detect:fireworks' %}">✦ Sound Signal</a><a href="{% url 'fireworks_detect:map' %}">Map</a></header><p class="eyebrow">Reviewed signal archive</p><h1>Approved events.</h1><p class="lede">This feed refreshes automatically every three seconds after a pending sample is approved in admin.</p><div class="grid"><section class="panel"><h2>Latest events</h2><div id="events-feed" hx-get="{% url 'fireworks_detect:events_list' %}" hx-trigger="load, every 3s" hx-swap="innerHTML"><p class="empty">Loading events…</p></div></section><section class="panel detail" id="event-detail"><h2>Select an event</h2><p class="empty">Choose an approved event to inspect its classification details.</p></section></div></main></body></html>
@@ -0,0 +1 @@
{% if events %}{% for event in events %}<button class="event" hx-get="{% url 'fireworks_detect:event_detail' event.id %}" hx-target="#event-detail" hx-swap="innerHTML"><span><strong>{{ event.primary_label }}</strong><br><small>{{ event.original_filename }} · {{ event.duration }}s</small></span><span class="badge">{{ event.primary_score }} →</span></button>{% endfor %}{% else %}<p class="empty">No approved events yet. Submit a classification, then approve it from the Pending page in admin.</p>{% endif %}
@@ -0,0 +1,571 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sound Signal · Fireworks detection</title>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
<style>
:root {
--ink: #eaf0ff;
--muted: #9caed1;
--surface: #111a31;
--surface-2: #17223e;
--line: #2a3a61;
--blue: #6aa8ff;
--violet: #a78bfa;
--fire: #ffb454;
--danger: #ff727c;
--success: #6ee7b7;
}
* {
box-sizing: border-box;
}
body {
min-width: 320px;
min-height: 100vh;
margin: 0;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: radial-gradient(circle at 10% 0%, #263a76 0, transparent 30rem), radial-gradient(circle at 90% 20%, #4d236c 0, transparent 28rem), #090e1d;
}
.shell {
width: min(100% - 2.5rem, 70rem);
margin: 0 auto;
padding: clamp(2rem, 6vw, 5rem) 0;
}
.brand {
display: flex;
align-items: center;
gap: .75rem;
/* margin-bottom: clamp(2.5rem, 6vw, 5rem); */
font-size: .9rem;
font-weight: 800;
letter-spacing: .11em;
text-transform: uppercase;
}
.brand-mark {
display: grid;
width: 2.25rem;
aspect-ratio: 1;
place-items: center;
border-radius: .75rem;
color: #141022;
background: linear-gradient(135deg, #fcd34d, #fb7185);
box-shadow: 0 .5rem 1.5rem #fb718550;
}
.intro {
max-width: 45rem;
}
.kicker {
margin: 0 0 .8rem;
color: #bfdbfe;
font-size: .78rem;
font-weight: 800;
letter-spacing: .15em;
text-transform: uppercase;
}
h1 {
max-width: 12ch;
margin: 0;
font-size: clamp(2.6rem, 7vw, 5.75rem);
line-height: .96;
letter-spacing: -.065em;
}
.lede {
max-width: 38rem;
margin: 1.5rem 0 2.5rem;
color: var(--muted);
font-size: clamp(1rem, 2vw, 1.18rem);
line-height: 1.65;
}
.upload-card,
.results-card {
border: 1px solid var(--line);
border-radius: 1.5rem;
background: linear-gradient(145deg, #162240d9, #0e162bdd);
box-shadow: 0 1.5rem 4rem #02061680;
backdrop-filter: blur(16px);
}
.upload-card {
padding: clamp(1rem, 3vw, 1.5rem);
}
.drop-zone {
display: grid;
min-height: 16rem;
place-items: center;
padding: 2rem;
border: 1.5px dashed #5d75aa;
border-radius: 1rem;
cursor: pointer;
text-align: center;
background: linear-gradient(135deg, #1b2a4e80, #291c4b66);
transition: .2s ease;
}
.drop-zone:hover,
.drop-zone.dragging {
border-color: var(--blue);
transform: translateY(-2px);
background: #203360a8;
}
.drop-zone:focus-within {
outline: 3px solid #6aa8ff66;
outline-offset: 3px;
}
.file-input {
width: .1px;
height: .1px;
position: absolute;
opacity: 0;
overflow: hidden;
}
.upload-icon {
display: grid;
width: 4rem;
aspect-ratio: 1;
place-items: center;
margin: 0 auto 1rem;
border-radius: 50%;
color: #dbeafe;
font-size: 1.8rem;
background: #4777c94d;
}
.drop-zone strong {
display: block;
font-size: 1.15rem;
}
.drop-zone span {
display: block;
margin-top: .4rem;
color: var(--muted);
font-size: .92rem;
}
.file-name {
min-height: 1.3rem;
margin: 1rem 0 0;
color: #c7d2fe;
font-size: .9rem;
overflow-wrap: anywhere;
}
.form-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: .9rem .25rem 0;
}
.file-note {
margin: 0;
color: var(--muted);
font-size: .8rem;
}
button,
.button {
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
gap: .6rem;
border: 0;
border-radius: .8rem;
padding: .85rem 1.15rem;
cursor: pointer;
color: #10172c;
font: inherit;
font-weight: 800;
background: linear-gradient(135deg, #93c5fd, #c4b5fd);
box-shadow: 0 .5rem 1.25rem #8b5cf640;
transition: transform .2s ease, filter .2s ease;
}
button:hover,
.button:hover {
transform: translateY(-1px);
filter: brightness(1.08);
}
button:disabled {
cursor: wait;
filter: saturate(.4);
transform: none;
}
.spinner {
width: 1rem;
height: 1rem;
border: 2px solid #263253;
border-top-color: currentColor;
border-radius: 50%;
animation: spin .75s linear infinite;
}
.htmx-indicator {
display: none;
}
.htmx-request.htmx-indicator {
display: inline-block;
}
.upload-form.htmx-request button {
pointer-events: none;
}
#upload-status {
min-height: 1.4rem;
margin: 1rem .25rem 0;
color: #c7d2fe;
font-size: .9rem;
}
.upload-form.htmx-request+#upload-status {
color: #fcd34d;
}
#classification-results {
margin-top: 1.5rem;
}
.results-card {
padding: clamp(1.25rem, 3vw, 2rem);
animation: reveal .35s ease-out;
}
.result-heading {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
}
.result-heading h2 {
margin: 0;
font-size: clamp(1.4rem, 3vw, 2rem);
letter-spacing: -.04em;
}
.result-heading p {
margin: .3rem 0 0;
color: var(--muted);
}
.result-status {
padding: .4rem .65rem;
border-radius: 999px;
color: #a7f3d0;
font-size: .75rem;
font-weight: 800;
white-space: nowrap;
background: #065f464d;
}
.meta {
display: flex;
flex-wrap: wrap;
gap: .6rem;
margin: 1.5rem 0;
}
.meta span,
.legend span {
padding: .4rem .65rem;
border: 1px solid var(--line);
border-radius: 999px;
color: #bdc9e5;
font-size: .8rem;
background: #101a31;
}
.legend {
display: flex;
flex-wrap: wrap;
gap: .5rem;
margin: 0 0 1.25rem;
}
.legend .firework {
color: #ffd18c;
border-color: #c7721e80;
}
.legend .speech {
color: #ffadb4;
border-color: #d5485880;
}
.topbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:3.5rem; }.brand { display:flex; align-items:center; gap:.7rem; color:var(--ink); font-size:.9rem; font-weight:800; letter-spacing:.1em; text-decoration:none; text-transform:uppercase; }.brand-mark { display:grid; width:2.25rem; aspect-ratio:1; place-items:center; border-radius:.75rem; color:#141022; background:linear-gradient(135deg,#fcd34d,#fb7185); box-shadow:0 .5rem 1.5rem #fb718550; }.nav { display:flex; gap:.35rem; padding:.25rem; border:1px solid var(--line); border-radius:.75rem; background:#111a31a6; }.nav a { padding:.5rem .75rem; border-radius:.5rem; color:var(--muted); font-size:.86rem; font-weight:700; text-decoration:none; }.nav a[aria-current="page"] { color:var(--ink); background:#2a3b67; }
.result-grid {
display: grid;
grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr);
gap: 1.25rem;
}
.result-group {
padding: 1.1rem;
border: 1px solid var(--line);
border-radius: 1rem;
background: #0b1225a8;
}
.result-group h3 {
margin: 0 0 1rem;
font-size: 1rem;
}
.prediction-list {
display: grid;
gap: .75rem;
margin: 0;
padding: 0;
list-style: none;
}
.prediction {
--accent-color: #7799dd;
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: .45rem .75rem;
align-items: center;
padding: .7rem .75rem;
overflow: hidden;
border: 1px solid #26365b;
border-left: 3px solid var(--accent-color);
border-radius: .7rem;
background: #121c34;
}
.prediction--firework {
--accent-color: var(--fire);
background: linear-gradient(90deg, #7a421d55, #121c34);
}
.prediction--speech {
--accent-color: var(--danger);
background: linear-gradient(90deg, #6c213055, #121c34);
}
.prediction-label {
min-width: 0;
font-weight: 700;
overflow-wrap: anywhere;
}
.prediction-score {
color: #c4d1ed;
font-size: .85rem;
font-variant-numeric: tabular-nums;
}
.score-bar {
grid-column: 1/-1;
height: .3rem;
overflow: hidden;
border-radius: 999px;
background: #263657;
}
.score-bar i {
display: block;
width: calc(var(--score) * 1%);
height: 100%;
border-radius: inherit;
background: var(--accent-color);
}
.peak-list {
display: grid;
gap: .7rem;
}
.peak-item {
padding-bottom: .7rem;
border-bottom: 1px solid #253453;
}
.peak-item:last-child {
padding-bottom: 0;
border-bottom: 0;
}
.peak-time {
color: #a9bce0;
font-size: .78rem;
}
.peak-item .prediction {
margin-top: .35rem;
}
.empty {
margin: 0;
color: var(--muted);
}
.error-card {
border-color: #a43d4d;
background: linear-gradient(135deg, #4b1724dd, #1a1427dd);
}
.error-card h2 {
color: #fecdd3;
}
.error-card p {
color: #fecdd3;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@keyframes reveal {
from {
opacity: 0;
transform: translateY(.75rem);
}
}
@media (max-width:42rem) {
.shell {
width: min(100% - 1.25rem, 70rem);
}
.form-footer,
.result-heading {
align-items: stretch;
flex-direction: column;
}
.form-footer button {
width: 100%;
}
.result-grid {
grid-template-columns: 1fr;
}
.result-status {
align-self: flex-start;
}
}
@media (prefers-reduced-motion:reduce) {
*,
::before,
::after {
scroll-behavior: auto !important;
animation-duration: .01ms !important;
transition-duration: .01ms !important;
}
}
</style>
</head>
<body>
<main class="shell">
<header class="topbar" style="display: flex">
<a class="brand" href="{% url 'fireworks_detect:fireworks' %}"><span class="brand-mark">✦</span> Sound
Signal</a>
<nav class="nav" aria-label="Fireworks navigation">
<a href="{% url 'fireworks_detect:fireworks' %}" aria-current="page">Analyse</a>
<a href="{% url 'fireworks_detect:map' %}" >Map</a>
</nav>
</header>
<section class="intro" aria-labelledby="page-title">
<p class="kicker">Audio event analysis</p>
<h1 id="page-title">See what your audio heard.</h1>
<p class="lede">Drop a recording to identify its most likely sounds. Firework-related signals are
highlighted in amber; speech-related signals are marked in red for future privacy filtering.</p>
<a href="https://pixabay.com/sound-effects/search/fireworks/" class="button" target="_blank">Here's some
samples to test with</a>
<br /><br />
</section>
<section class="upload-card" aria-label="Upload audio for classification">
<form class="upload-form" action="{% url 'fireworks_detect:classify_upload' %}" method="post"
enctype="multipart/form-data" hx-post="{% url 'fireworks_detect:classify_upload' %}"
hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data"
hx-indicator="#upload-indicator">
{% csrf_token %}
<label class="drop-zone" id="drop-zone">
<input class="file-input" id="audio-file" type="file" name="audio"
accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac,.aac,.opus" required>
<span>
<span class="upload-icon">↑</span>
<strong>Drop an audio file here</strong>
<span>or click to browse your device</span>
</span>
<span class="file-name" id="file-name">No file selected</span>
</label>
<div class="form-footer">
<p class="file-note">WAV, MP3, M4A, OGG and more · 25 MiB maximum</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator"
aria-hidden="true"></span>Analyse audio</button>
</div>
<section id="classification-results" aria-live="polite" aria-label="Classification results"></section>
</form>
<p id="upload-status" role="status" aria-live="polite"></p>
</section>
</main>
<script>
const form = document.querySelector('.upload-form');
const dropZone = document.querySelector('#drop-zone');
const fileInput = document.querySelector('#audio-file');
const fileName = document.querySelector('#file-name');
const status = document.querySelector('#upload-status');
const showFile = (file) => { fileName.textContent = file ? file.name : 'No file selected'; };
fileInput.addEventListener('change', () => showFile(fileInput.files[0]));
['dragenter', 'dragover'].forEach((eventName) => dropZone.addEventListener(eventName, (event) => { event.preventDefault(); dropZone.classList.add('dragging'); }));
['dragleave', 'drop'].forEach((eventName) => dropZone.addEventListener(eventName, (event) => { event.preventDefault(); dropZone.classList.remove('dragging'); }));
dropZone.addEventListener('drop', (event) => { const [file] = event.dataTransfer.files; if (!file) return; fileInput.files = event.dataTransfer.files; showFile(file); });
form.addEventListener('htmx:beforeRequest', () => { status.textContent = 'Analysing your recording…'; form.setAttribute('aria-busy', 'true'); });
form.addEventListener('htmx:afterRequest', () => { status.textContent = ''; form.removeAttribute('aria-busy'); });
form.addEventListener('htmx:responseError', () => { status.textContent = 'Analysis could not be completed.'; });
document.body.addEventListener('htmx:beforeSwap', (event) => {
if (event.detail.xhr.status >= 400) {
event.detail.shouldSwap = true;
event.detail.isError = false;
}
});
window.addEventListener('pageshow', (event) => {
if (event.persisted) {
fileInput.value = '';
showFile();
status.textContent = '';
document.querySelector('#classification-results').replaceChildren();
}
});
</script>
</body>
</html>
@@ -0,0 +1,572 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sound Signal · Fireworks detection</title>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
<style>
:root {
--ink: #eaf0ff;
--muted: #9caed1;
--surface: #111a31;
--surface-2: #17223e;
--line: #2a3a61;
--blue: #6aa8ff;
--violet: #a78bfa;
--fire: #ffb454;
--danger: #ff727c;
--success: #6ee7b7;
}
* {
box-sizing: border-box;
}
body {
min-width: 320px;
min-height: 100vh;
margin: 0;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: radial-gradient(circle at 10% 0%, #263a76 0, transparent 30rem), radial-gradient(circle at 90% 20%, #4d236c 0, transparent 28rem), #090e1d;
}
.shell {
width: min(100% - 2.5rem, 70rem);
margin: 0 auto;
padding: clamp(2rem, 6vw, 5rem) 0;
}
.brand {
display: flex;
align-items: center;
gap: .75rem;
/* margin-bottom: clamp(2.5rem, 6vw, 5rem); */
font-size: .9rem;
font-weight: 800;
letter-spacing: .11em;
text-transform: uppercase;
}
.brand-mark {
display: grid;
width: 2.25rem;
aspect-ratio: 1;
place-items: center;
border-radius: .75rem;
color: #141022;
background: linear-gradient(135deg, #fcd34d, #fb7185);
box-shadow: 0 .5rem 1.5rem #fb718550;
}
.intro {
max-width: 45rem;
}
.kicker {
margin: 0 0 .8rem;
color: #bfdbfe;
font-size: .78rem;
font-weight: 800;
letter-spacing: .15em;
text-transform: uppercase;
}
h1 {
max-width: 12ch;
margin: 0;
font-size: clamp(2.6rem, 7vw, 5.75rem);
line-height: .96;
letter-spacing: -.065em;
}
.lede {
max-width: 38rem;
margin: 1.5rem 0 2.5rem;
color: var(--muted);
font-size: clamp(1rem, 2vw, 1.18rem);
line-height: 1.65;
}
.upload-card,
.results-card {
border: 1px solid var(--line);
border-radius: 1.5rem;
background: linear-gradient(145deg, #162240d9, #0e162bdd);
box-shadow: 0 1.5rem 4rem #02061680;
backdrop-filter: blur(16px);
}
.upload-card {
padding: clamp(1rem, 3vw, 1.5rem);
}
.drop-zone {
display: grid;
min-height: 16rem;
place-items: center;
padding: 2rem;
border: 1.5px dashed #5d75aa;
border-radius: 1rem;
cursor: pointer;
text-align: center;
background: linear-gradient(135deg, #1b2a4e80, #291c4b66);
transition: .2s ease;
}
.drop-zone:hover,
.drop-zone.dragging {
border-color: var(--blue);
transform: translateY(-2px);
background: #203360a8;
}
.drop-zone:focus-within {
outline: 3px solid #6aa8ff66;
outline-offset: 3px;
}
.file-input {
width: .1px;
height: .1px;
position: absolute;
opacity: 0;
overflow: hidden;
}
.upload-icon {
display: grid;
width: 4rem;
aspect-ratio: 1;
place-items: center;
margin: 0 auto 1rem;
border-radius: 50%;
color: #dbeafe;
font-size: 1.8rem;
background: #4777c94d;
}
.drop-zone strong {
display: block;
font-size: 1.15rem;
}
.drop-zone span {
display: block;
margin-top: .4rem;
color: var(--muted);
font-size: .92rem;
}
.file-name {
min-height: 1.3rem;
margin: 1rem 0 0;
color: #c7d2fe;
font-size: .9rem;
overflow-wrap: anywhere;
}
.form-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: .9rem .25rem 0;
}
.file-note {
margin: 0;
color: var(--muted);
font-size: .8rem;
}
button,
.button {
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
gap: .6rem;
border: 0;
border-radius: .8rem;
padding: .85rem 1.15rem;
cursor: pointer;
color: #10172c;
font: inherit;
font-weight: 800;
background: linear-gradient(135deg, #93c5fd, #c4b5fd);
box-shadow: 0 .5rem 1.25rem #8b5cf640;
transition: transform .2s ease, filter .2s ease;
}
button:hover,
.button:hover {
transform: translateY(-1px);
filter: brightness(1.08);
}
button:disabled {
cursor: wait;
filter: saturate(.4);
transform: none;
}
.spinner {
width: 1rem;
height: 1rem;
border: 2px solid #263253;
border-top-color: currentColor;
border-radius: 50%;
animation: spin .75s linear infinite;
}
.htmx-indicator {
display: none;
}
.htmx-request.htmx-indicator {
display: inline-block;
}
.upload-form.htmx-request button {
pointer-events: none;
}
#upload-status {
min-height: 1.4rem;
margin: 1rem .25rem 0;
color: #c7d2fe;
font-size: .9rem;
}
.upload-form.htmx-request+#upload-status {
color: #fcd34d;
}
#classification-results {
margin-top: 1.5rem;
}
.results-card {
padding: clamp(1.25rem, 3vw, 2rem);
animation: reveal .35s ease-out;
}
.result-heading {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
}
.result-heading h2 {
margin: 0;
font-size: clamp(1.4rem, 3vw, 2rem);
letter-spacing: -.04em;
}
.result-heading p {
margin: .3rem 0 0;
color: var(--muted);
}
.result-status {
padding: .4rem .65rem;
border-radius: 999px;
color: #a7f3d0;
font-size: .75rem;
font-weight: 800;
white-space: nowrap;
background: #065f464d;
}
.meta {
display: flex;
flex-wrap: wrap;
gap: .6rem;
margin: 1.5rem 0;
}
.meta span,
.legend span {
padding: .4rem .65rem;
border: 1px solid var(--line);
border-radius: 999px;
color: #bdc9e5;
font-size: .8rem;
background: #101a31;
}
.legend {
display: flex;
flex-wrap: wrap;
gap: .5rem;
margin: 0 0 1.25rem;
}
.legend .firework {
color: #ffd18c;
border-color: #c7721e80;
}
.legend .speech {
color: #ffadb4;
border-color: #d5485880;
}
.topbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:3.5rem; }.brand { display:flex; align-items:center; gap:.7rem; color:var(--ink); font-size:.9rem; font-weight:800; letter-spacing:.1em; text-decoration:none; text-transform:uppercase; }.brand-mark { display:grid; width:2.25rem; aspect-ratio:1; place-items:center; border-radius:.75rem; color:#141022; background:linear-gradient(135deg,#fcd34d,#fb7185); box-shadow:0 .5rem 1.5rem #fb718550; }.nav { display:flex; gap:.35rem; padding:.25rem; border:1px solid var(--line); border-radius:.75rem; background:#111a31a6; }.nav a { padding:.5rem .75rem; border-radius:.5rem; color:var(--muted); font-size:.86rem; font-weight:700; text-decoration:none; }.nav a[aria-current="page"] { color:var(--ink); background:#2a3b67; }
.result-grid {
display: grid;
grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr);
gap: 1.25rem;
}
.result-group {
padding: 1.1rem;
border: 1px solid var(--line);
border-radius: 1rem;
background: #0b1225a8;
}
.result-group h3 {
margin: 0 0 1rem;
font-size: 1rem;
}
.prediction-list {
display: grid;
gap: .75rem;
margin: 0;
padding: 0;
list-style: none;
}
.prediction {
--accent-color: #7799dd;
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: .45rem .75rem;
align-items: center;
padding: .7rem .75rem;
overflow: hidden;
border: 1px solid #26365b;
border-left: 3px solid var(--accent-color);
border-radius: .7rem;
background: #121c34;
}
.prediction--firework {
--accent-color: var(--fire);
background: linear-gradient(90deg, #7a421d55, #121c34);
}
.prediction--speech {
--accent-color: var(--danger);
background: linear-gradient(90deg, #6c213055, #121c34);
}
.prediction-label {
min-width: 0;
font-weight: 700;
overflow-wrap: anywhere;
}
.prediction-score {
color: #c4d1ed;
font-size: .85rem;
font-variant-numeric: tabular-nums;
}
.score-bar {
grid-column: 1/-1;
height: .3rem;
overflow: hidden;
border-radius: 999px;
background: #263657;
}
.score-bar i {
display: block;
width: calc(var(--score) * 1%);
height: 100%;
border-radius: inherit;
background: var(--accent-color);
}
.peak-list {
display: grid;
gap: .7rem;
}
.peak-item {
padding-bottom: .7rem;
border-bottom: 1px solid #253453;
}
.peak-item:last-child {
padding-bottom: 0;
border-bottom: 0;
}
.peak-time {
color: #a9bce0;
font-size: .78rem;
}
.peak-item .prediction {
margin-top: .35rem;
}
.empty {
margin: 0;
color: var(--muted);
}
.error-card {
border-color: #a43d4d;
background: linear-gradient(135deg, #4b1724dd, #1a1427dd);
}
.error-card h2 {
color: #fecdd3;
}
.error-card p {
color: #fecdd3;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@keyframes reveal {
from {
opacity: 0;
transform: translateY(.75rem);
}
}
@media (max-width:42rem) {
.shell {
width: min(100% - 1.25rem, 70rem);
}
.form-footer,
.result-heading {
align-items: stretch;
flex-direction: column;
}
.form-footer button {
width: 100%;
}
.result-grid {
grid-template-columns: 1fr;
}
.result-status {
align-self: flex-start;
}
}
@media (prefers-reduced-motion:reduce) {
*,
::before,
::after {
scroll-behavior: auto !important;
animation-duration: .01ms !important;
transition-duration: .01ms !important;
}
}
</style>
</head>
<body>
<main class="shell">
<header class="topbar" style="display: flex">
<a class="brand" href="{% url 'fireworks_detect:fireworks' %}"><span class="brand-mark">✦</span> Sound
Signal</a>
<nav class="nav" aria-label="Fireworks navigation">
<a href="{% url 'fireworks_detect:fireworks' %}" aria-current="page">Analyse</a>
<a href="{% url 'fireworks_detect:map' %}" >Map</a>
</nav>
</header>
<section class="intro" aria-labelledby="page-title">
<p class="kicker">Audio event analysis</p>
<h1 id="page-title">See what your audio heard.</h1>
<p class="lede">Drop a recording to identify its most likely sounds. Firework-related signals are
highlighted in amber; speech-related signals are marked in red for future privacy filtering.</p>
<a href="https://pixabay.com/sound-effects/search/fireworks/" class="button" target="_blank">Here's some
samples to test with</a>
<br /><br />
</section>
<section class="upload-card" aria-label="Upload audio for classification">
<form class="upload-form" action="{% url 'fireworks_detect:classify' %}" method="post"
enctype="multipart/form-data" hx-post="{% url 'fireworks_detect:classify' %}"
hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data"
hx-indicator="#upload-indicator">
{% csrf_token %}
<label class="drop-zone" id="drop-zone">
<input class="file-input" id="audio-file" type="file" name="audio"
accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac,.aac,.opus" required>
<span>
<span class="upload-icon">↑</span>
<strong>Drop an audio file here</strong>
<span>or click to browse your device</span>
</span>
<span class="file-name" id="file-name">No file selected</span>
</label>
<div class="form-footer">
<p class="file-note">WAV, MP3, M4A, OGG and more · 25 MiB maximum</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator"
aria-hidden="true"></span>Analyse audio</button>
</div>
</form>
<p id="upload-status" role="status" aria-live="polite"></p>
</section>
<section id="classification-results" aria-live="polite" aria-label="Classification results"></section>
</main>
<script>
const form = document.querySelector('.upload-form');
const dropZone = document.querySelector('#drop-zone');
const fileInput = document.querySelector('#audio-file');
const fileName = document.querySelector('#file-name');
const status = document.querySelector('#upload-status');
const showFile = (file) => { fileName.textContent = file ? file.name : 'No file selected'; };
fileInput.addEventListener('change', () => showFile(fileInput.files[0]));
['dragenter', 'dragover'].forEach((eventName) => dropZone.addEventListener(eventName, (event) => { event.preventDefault(); dropZone.classList.add('dragging'); }));
['dragleave', 'drop'].forEach((eventName) => dropZone.addEventListener(eventName, (event) => { event.preventDefault(); dropZone.classList.remove('dragging'); }));
dropZone.addEventListener('drop', (event) => { const [file] = event.dataTransfer.files; if (!file) return; fileInput.files = event.dataTransfer.files; showFile(file); });
form.addEventListener('htmx:beforeRequest', () => { status.textContent = 'Analysing your recording…'; form.setAttribute('aria-busy', 'true'); });
form.addEventListener('htmx:afterRequest', () => { status.textContent = ''; form.removeAttribute('aria-busy'); });
form.addEventListener('htmx:responseError', () => { status.textContent = 'Analysis could not be completed.'; });
document.body.addEventListener('htmx:beforeSwap', (event) => {
if (event.detail.xhr.status >= 400) {
event.detail.shouldSwap = true;
event.detail.isError = false;
}
});
window.addEventListener('pageshow', (event) => {
if (event.persisted) {
fileInput.value = '';
showFile();
status.textContent = '';
document.querySelector('#classification-results').replaceChildren();
}
});
</script>
</body>
</html>
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signal map · Sound Signal</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
<style>
:root { --ink:#eef3ff; --muted:#a9b9d8; --surface:#111a31; --line:#2a3a61; --blue:#83b7ff; --violet:#b69cff; --amber:#ffbc61; --green:#6ee7b7; }
* { box-sizing:border-box; }
body { min-width:320px; min-height:100vh; margin:0; color:var(--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 32rem),radial-gradient(circle at 95% 0%,#492064 0,transparent 27rem),#090e1d; }
.shell {
width: min(100% - 2.5rem, 70rem);
margin: 0 auto;
padding: clamp(2rem, 6vw, 5rem) 0;
}
.topbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:3.5rem; }.brand { display:flex; align-items:center; gap:.7rem; color:var(--ink); font-size:.9rem; font-weight:800; letter-spacing:.1em; text-decoration:none; text-transform:uppercase; }.brand-mark { display:grid; width:2.25rem; aspect-ratio:1; place-items:center; border-radius:.75rem; color:#141022; background:linear-gradient(135deg,#fcd34d,#fb7185); box-shadow:0 .5rem 1.5rem #fb718550; }.nav { display:flex; gap:.35rem; padding:.25rem; border:1px solid var(--line); border-radius:.75rem; background:#111a31a6; }.nav a { padding:.5rem .75rem; border-radius:.5rem; color:var(--muted); font-size:.86rem; font-weight:700; text-decoration:none; }.nav a[aria-current="page"] { color:var(--ink); background:#2a3b67; }
.kicker { margin:0 0 .65rem; color:#bfdbfe; font-size:.76rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }.headline { display:flex; align-items:end; justify-content:space-between; gap:2rem; margin-bottom:2rem; }.headline h1 { margin:0; font-size:clamp(2.3rem,5vw,4.5rem); line-height:.98; letter-spacing:-.06em; }.headline p { max-width:30rem; margin:0; color:var(--muted); line-height:1.6; }
.filters { display:grid; grid-template-columns:1.3fr repeat(3,minmax(8rem,1fr)) auto; gap:.75rem; align-items:end; margin-bottom:1rem; padding:1rem; border:1px solid var(--line); border-radius:1.1rem; background:#121d37d9; box-shadow:0 1rem 3rem #03071466; }.filter { display:grid; gap:.35rem; }.filter label { color:#9fb1d5; font-size:.7rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }.filter select,.filter input { width:100%; min-height:2.65rem; border:1px solid #354a77; border-radius:.65rem; padding:0 .75rem; color:var(--ink); font:inherit; background:#0c1428; }.filter select:focus,.filter input:focus { outline:2px solid #82b5ff; outline-offset:2px; }.mock-tag { align-self:center; padding:.46rem .65rem; border:1px solid #4a5f8e; border-radius:999px; color:#c9d8f6; font-size:.75rem; font-weight:700; white-space:nowrap; background:#1d2b4e; }
.map-panel { overflow:hidden; border:1px solid var(--line); border-radius:1.25rem; background:var(--surface); box-shadow:0 1.5rem 4rem #0206168a; }.map-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.2rem; border-bottom:1px solid var(--line); }.map-header strong { font-size:.95rem; }.live { display:flex; align-items:center; gap:.45rem; color:#a7f3d0; font-size:.8rem; }.live i { width:.5rem; height:.5rem; border-radius:50%; background:var(--green); box-shadow:0 0 0 .25rem #34d3992e; }.map-wrap { position:relative; }.map { height:clamp(30rem,65vh,45rem); background:#dce4cf; }.legend { position:absolute; z-index:600; right:1rem; bottom:1rem; width:min(15rem,calc(100% - 2rem)); padding:.85rem; border:1px solid #344973; border-radius:.8rem; color:#dce7fe; font-size:.78rem; background:#101a31e8; box-shadow:0 .75rem 2rem #05091480; backdrop-filter:blur(10px); }.legend h2 { margin:0 0 .6rem; font-size:.82rem; }.legend div { display:flex; align-items:center; gap:.5rem; margin-top:.4rem; }.legend-dot { width:.7rem; height:.7rem; border:2px solid #f2c56b; border-radius:50%; background:#ed8e2e88; }.legend-ring { width:.85rem; height:.85rem; border:2px solid #a98af7; border-radius:50%; background:#8b5cf633; }.legend-line { width:1.1rem; border-top:2px dashed #644b9c; }.sensor-icon { display:grid; width:2.1rem; height:2.1rem; place-items:center; border:2px solid #e6edff; border-radius:50%; color:#14203b; font-size:.72rem; font-weight:900; background:linear-gradient(135deg,#a5c8ff,#c4b5fd); box-shadow:0 .2rem .8rem #18275080; }.source-icon { display:grid; width:2.45rem; height:2.45rem; place-items:center; border:2px solid #fff3d5; border-radius:50% 50% 50% 0; color:#452000; font-size:1.15rem; background:#f7a52f; box-shadow:0 .3rem 1rem #a84f2670; transform:rotate(-45deg); }.source-icon span { transform:rotate(45deg); }.direction-arrow { display:block; color:#5c408d; font-size:1.5rem; font-weight:900; line-height:1; text-shadow:0 .1rem .4rem #fff8; }
.leaflet-control-zoom a { color:#243456!important; }.leaflet-popup-content-wrapper,.leaflet-popup-tip { color:#e9f1ff; background:#14203a; }.leaflet-popup-content { margin:.75rem .9rem; font-family:inherit; }.popup-title { display:block; margin-bottom:.2rem; font-weight:800; }.popup-meta { color:#a9b9d8; font-size:.78rem; }
@media (max-width:52rem) { .shell { width:min(100% - 1.25rem,80rem); }.topbar { margin-bottom:2.5rem; }.headline { align-items:start; flex-direction:column; gap:1rem; }.filters { grid-template-columns:1fr 1fr; }.filters .filter:first-child { grid-column:1/-1; }.mock-tag { justify-self:start; }.map { height:32rem; } }
@media (max-width:30rem) { .nav a { padding:.5rem; }.filters { grid-template-columns:1fr; }.filters .filter:first-child { grid-column:auto; } }
</style>
</head>
<body>
<main class="shell">
<header class="topbar">
<a class="brand" href="{% url 'fireworks_detect:fireworks' %}"><span class="brand-mark">✦</span> Sound Signal</a>
<nav class="nav" aria-label="Fireworks navigation">
<a href="{% url 'fireworks_detect:fireworks' %}">Analyse</a>
<a href="{% url 'fireworks_detect:map' %}" aria-current="page">Map</a>
</nav>
</header>
<section class="headline" aria-labelledby="map-title">
<div><p class="kicker">Future event intelligence</p><h1 id="map-title">Sound activity map.</h1></div>
<p>A concept view of sensors triangulating a likely source. This uses entirely mock data for Heerenveen, ready for future incoming event records.</p>
</section>
<section class="filters" aria-label="Mock event filters">
<div class="filter"><label for="event-type">Event type</label><select id="event-type"><option>All sound events</option><option>Possible fireworks</option><option>Privacy-filtered speech</option></select></div>
<div class="filter"><label for="from-date">From</label><input id="from-date" type="date" value="2026-09-19"></div>
<div class="filter"><label for="range">Range</label><select id="range"><option>This week</option><option>Today</option><option>Last 30 days</option></select></div>
<div class="filter"><label for="confidence">Confidence</label><select id="confidence"><option>Any confidence</option><option>High confidence</option><option>Review needed</option></select></div>
<span class="mock-tag">Mock data</span>
</section>
<section class="map-panel" aria-label="Mock sound event map of Heerenveen">
<div class="map-header"><strong>Heerenveen, Netherlands</strong><span class="live"><i></i> 3 sensors simulated</span></div>
<div class="map-wrap"><div id="event-map" class="map" aria-label="Interactive map centered on Heerenveen"></div>
<aside class="legend" aria-label="Map legend"><h2>Triangulation estimate</h2><div><span class="legend-dot"></span> Higher-confidence source area</div><div><span class="legend-ring"></span> Broader possible area</div><div><span class="legend-line"></span> Simulated direction of arrival</div></aside>
</div>
</section>
</main>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script>
const map = L.map('event-map', { zoomControl: false, scrollWheelZoom: false }).setView([52.9512478, 5.943674], 14);
L.control.zoom({ position: 'bottomleft' }).addTo(map);
L.tileLayer('https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; OpenStreetMap contributors',
}).addTo(map);
const estimatedSource = [52.9501, 5.9466];
const sensors = [
{ name: 'Sensor 1', position: [52.9570, 5.9335], confidence: '91% direction confidence' },
{ name: 'Sensor 2', position: [52.9586, 5.9508], confidence: '86% direction confidence' },
{ name: 'Sensor 3', position: [52.9458, 5.9370], confidence: '78% direction confidence' },
];
L.circle(estimatedSource, { radius: 1020, color: '#8b5cf6', weight: 1.5, fillColor: '#8b5cf6', fillOpacity: 0.10, dashArray: '5 8' }).addTo(map);
L.circle(estimatedSource, { radius: 370, color: '#f59e0b', weight: 2, fillColor: '#f59e0b', fillOpacity: 0.28 }).addTo(map);
const sourceIcon = L.divIcon({ className: '', html: '<div class="source-icon"><span>✦</span></div>', iconSize: [39, 39], iconAnchor: [20, 32] });
L.marker(estimatedSource, { icon: sourceIcon }).addTo(map).bindPopup('<span class="popup-title">Estimated sound source</span><span class="popup-meta">High-confidence area · mock event</span>');
function bearing(from, to) {
const lat = ((from[0] + to[0]) / 2) * Math.PI / 180;
return Math.atan2((to[1] - from[1]) * Math.cos(lat), to[0] - from[0]) * 180 / Math.PI;
}
sensors.forEach((sensor, index) => {
const line = L.polyline([sensor.position, estimatedSource], { color: '#60438f', weight: 2, opacity: 0.85, dashArray: '8 9' }).addTo(map);
line.bindTooltip('Direction of arrival', { sticky: true });
const arrowPosition = [sensor.position[0] + (estimatedSource[0] - sensor.position[0]) * 0.58, sensor.position[1] + (estimatedSource[1] - sensor.position[1]) * 0.58];
const arrowIcon = L.divIcon({ className: '', html: `<span class="direction-arrow" style="transform:rotate(${bearing(sensor.position, estimatedSource)}deg)">↑</span>`, iconSize: [22, 22], iconAnchor: [11, 11] });
L.marker(arrowPosition, { icon: arrowIcon, interactive: false }).addTo(map);
const sensorIcon = L.divIcon({ className: '', html: `<div class="sensor-icon">${index + 1}</div>`, iconSize: [34, 34], iconAnchor: [17, 17] });
L.marker(sensor.position, { icon: sensorIcon }).addTo(map).bindPopup(`<span class="popup-title">${sensor.name}</span><span class="popup-meta">${sensor.confidence}<br>Mock microphone node</span>`);
});
</script>
</body>
</html>
@@ -0,0 +1,3 @@
<div class="review-submission" id="review-submission" role="status">
{% if error %}<div><strong>Could not submit this sample</strong><p>{{ error }}</p></div>{% else %}<div><strong>Sent to Pending</strong><p>{{ pending.original_filename }} is ready for administrator review.</p></div><a href="{% url 'fireworks_detect:events' %}">View events</a>{% endif %}
</div>
+95
View File
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sound Signal · Fireworks detection</title>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
<style>
:root { --ink:#eaf0ff; --muted:#9caed1; --surface:#111a31; --surface-2:#17223e; --line:#2a3a61; --blue:#6aa8ff; --violet:#a78bfa; --fire:#ffb454; --danger:#ff727c; --success:#6ee7b7; }
* { box-sizing:border-box; }
body { min-width:320px; min-height:100vh; margin:0; color:var(--ink); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:radial-gradient(circle at 10% 0%,#263a76 0,transparent 30rem),radial-gradient(circle at 90% 20%,#4d236c 0,transparent 28rem),#090e1d; }
.shell { width:min(100% - 2.5rem,70rem); margin:0 auto; padding:clamp(2rem,6vw,5rem) 0; }
.brand { display:flex; align-items:center; gap:.75rem; margin-bottom:clamp(2.5rem,6vw,5rem); font-size:.9rem; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
.brand-mark { display:grid; width:2.25rem; aspect-ratio:1; place-items:center; border-radius:.75rem; color:#141022; background:linear-gradient(135deg,#fcd34d,#fb7185); box-shadow:0 .5rem 1.5rem #fb718550; }
.intro { max-width:45rem; }
.kicker { margin:0 0 .8rem; color:#bfdbfe; font-size:.78rem; font-weight:800; letter-spacing:.15em; text-transform:uppercase; }
h1 { max-width:12ch; margin:0; font-size:clamp(2.6rem,7vw,5.75rem); line-height:.96; letter-spacing:-.065em; }
.lede { max-width:38rem; margin:1.5rem 0 2.5rem; color:var(--muted); font-size:clamp(1rem,2vw,1.18rem); line-height:1.65; }
.upload-card,.results-card { border:1px solid var(--line); border-radius:1.5rem; background:linear-gradient(145deg,#162240d9,#0e162bdd); box-shadow:0 1.5rem 4rem #02061680; backdrop-filter:blur(16px); }
.upload-card { padding:clamp(1rem,3vw,1.5rem); }
.drop-zone { display:grid; min-height:16rem; place-items:center; padding:2rem; border:1.5px dashed #5d75aa; border-radius:1rem; cursor:pointer; text-align:center; background:linear-gradient(135deg,#1b2a4e80,#291c4b66); transition:.2s ease; }
.drop-zone:hover,.drop-zone.dragging { border-color:var(--blue); transform:translateY(-2px); background:#203360a8; }
.drop-zone:focus-within { outline:3px solid #6aa8ff66; outline-offset:3px; }
.file-input { width:.1px; height:.1px; position:absolute; opacity:0; overflow:hidden; }
.upload-icon { display:grid; width:4rem; aspect-ratio:1; place-items:center; margin:0 auto 1rem; border-radius:50%; color:#dbeafe; font-size:1.8rem; background:#4777c94d; }
.drop-zone strong { display:block; font-size:1.15rem; }
.drop-zone span { display:block; margin-top:.4rem; color:var(--muted); font-size:.92rem; }
.file-name { min-height:1.3rem; margin:1rem 0 0; color:#c7d2fe; font-size:.9rem; overflow-wrap:anywhere; }
.form-footer { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.9rem .25rem 0; }
.file-note { margin:0; color:var(--muted); font-size:.8rem; }
button { display:inline-flex; align-items:center; justify-content:center; gap:.6rem; border:0; border-radius:.8rem; padding:.85rem 1.15rem; cursor:pointer; color:#10172c; font:inherit; font-weight:800; background:linear-gradient(135deg,#93c5fd,#c4b5fd); box-shadow:0 .5rem 1.25rem #8b5cf640; transition:transform .2s ease,filter .2s ease; }
button:hover { transform:translateY(-1px); filter:brightness(1.08); } button:disabled { cursor:wait; filter:saturate(.4); transform:none; }
.spinner { width:1rem; height:1rem; border:2px solid #263253; border-top-color:currentColor; border-radius:50%; animation:spin .75s linear infinite; }
.htmx-indicator { display:none; }.htmx-request.htmx-indicator { display:inline-block; }.upload-form.htmx-request button { pointer-events:none; }
#upload-status { min-height:1.4rem; margin:1rem .25rem 0; color:#c7d2fe; font-size:.9rem; } .upload-form.htmx-request + #upload-status { color:#fcd34d; }
#classification-results { margin-top:1.5rem; }
.results-card { padding:clamp(1.25rem,3vw,2rem); animation:reveal .35s ease-out; }
.result-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; } .result-heading h2 { margin:0; font-size:clamp(1.4rem,3vw,2rem); letter-spacing:-.04em; }.result-heading p { margin:.3rem 0 0; color:var(--muted); }
.result-status { padding:.4rem .65rem; border-radius:999px; color:#a7f3d0; font-size:.75rem; font-weight:800; white-space:nowrap; background:#065f464d; }
.meta { display:flex; flex-wrap:wrap; gap:.6rem; margin:1.5rem 0; }.meta span,.legend span { padding:.4rem .65rem; border:1px solid var(--line); border-radius:999px; color:#bdc9e5; font-size:.8rem; background:#101a31; }.legend { display:flex; flex-wrap:wrap; gap:.5rem; margin:0 0 1.25rem; }.legend .firework { color:#ffd18c; border-color:#c7721e80; }.legend .speech { color:#ffadb4; border-color:#d5485880; }
.result-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(18rem,.75fr); gap:1.25rem; }.result-group { padding:1.1rem; border:1px solid var(--line); border-radius:1rem; background:#0b1225a8; }.result-group h3 { margin:0 0 1rem; font-size:1rem; }.prediction-list { display:grid; gap:.75rem; margin:0; padding:0; list-style:none; }.prediction { --accent-color:#7799dd; position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.45rem .75rem; align-items:center; padding:.7rem .75rem; overflow:hidden; border:1px solid #26365b; border-left:3px solid var(--accent-color); border-radius:.7rem; background:#121c34; }.prediction--firework { --accent-color:var(--fire); background:linear-gradient(90deg,#7a421d55,#121c34); }.prediction--speech { --accent-color:var(--danger); background:linear-gradient(90deg,#6c213055,#121c34); }.prediction-label { min-width:0; font-weight:700; overflow-wrap:anywhere; }.prediction-score { color:#c4d1ed; font-size:.85rem; font-variant-numeric:tabular-nums; }.score-bar { grid-column:1/-1; height:.3rem; overflow:hidden; border-radius:999px; background:#263657; }.score-bar i { display:block; width:calc(var(--score) * 1%); height:100%; border-radius:inherit; background:var(--accent-color); }.peak-list { display:grid; gap:.7rem; }.peak-item { padding-bottom:.7rem; border-bottom:1px solid #253453; }.peak-item:last-child { padding-bottom:0; border-bottom:0; }.peak-time { color:#a9bce0; font-size:.78rem; }.peak-item .prediction { margin-top:.35rem; }.empty { margin:0; color:var(--muted); }.error-card { border-color:#a43d4d; background:linear-gradient(135deg,#4b1724dd,#1a1427dd); }.error-card h2 { color:#fecdd3; }.error-card p { color:#fecdd3; }
@keyframes spin { to { transform:rotate(360deg); } } @keyframes reveal { from { opacity:0; transform:translateY(.75rem); } }
@media (max-width:42rem) { .shell { width:min(100% - 1.25rem,70rem); }.form-footer,.result-heading { align-items:stretch; flex-direction:column; }.form-footer button { width:100%; }.result-grid { grid-template-columns:1fr; }.result-status { align-self:flex-start; } }
@media (prefers-reduced-motion:reduce) { *,::before,::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; } }
</style>
</head>
<body>
<main class="shell">
<div class="brand"><span class="brand-mark">✦</span> Sound Signal</div>
<section class="intro" aria-labelledby="page-title">
<p class="kicker">Audio event analysis</p>
<h1 id="page-title">See what your audio heard.</h1>
<p class="lede">Drop a recording to identify its most likely sounds. Firework-related signals are highlighted in amber; speech-related signals are marked in red for future privacy filtering.</p>
</section>
<section class="upload-card" aria-label="Upload audio for classification">
<form class="upload-form" action="{% url 'fireworks_detect:classify' %}" method="post" enctype="multipart/form-data" hx-post="{% url 'fireworks_detect:classify' %}" hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data" hx-indicator="#upload-indicator">
{% csrf_token %}
<label class="drop-zone" id="drop-zone">
<input class="file-input" id="audio-file" type="file" name="audio" accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac,.aac,.opus" required>
<span>
<span class="upload-icon">↑</span>
<strong>Drop an audio file here</strong>
<span>or click to browse your device</span>
</span>
<span class="file-name" id="file-name">No file selected</span>
</label>
<div class="form-footer">
<p class="file-note">WAV, MP3, M4A, OGG and more · 25 MiB maximum</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator" aria-hidden="true"></span>Analyse audio</button>
</div>
</form>
<p id="upload-status" role="status" aria-live="polite"></p>
</section>
<section id="classification-results" aria-live="polite" aria-label="Classification results"></section>
</main>
<script>
const form = document.querySelector('.upload-form');
const dropZone = document.querySelector('#drop-zone');
const fileInput = document.querySelector('#audio-file');
const fileName = document.querySelector('#file-name');
const status = document.querySelector('#upload-status');
const showFile = (file) => { fileName.textContent = file ? file.name : 'No file selected'; };
fileInput.addEventListener('change', () => showFile(fileInput.files[0]));
['dragenter', 'dragover'].forEach((eventName) => dropZone.addEventListener(eventName, (event) => { event.preventDefault(); dropZone.classList.add('dragging'); }));
['dragleave', 'drop'].forEach((eventName) => dropZone.addEventListener(eventName, (event) => { event.preventDefault(); dropZone.classList.remove('dragging'); }));
dropZone.addEventListener('drop', (event) => { const [file] = event.dataTransfer.files; if (!file) return; fileInput.files = event.dataTransfer.files; showFile(file); });
form.addEventListener('htmx:beforeRequest', () => { status.textContent = 'Analysing your recording…'; form.setAttribute('aria-busy', 'true'); });
form.addEventListener('htmx:afterRequest', () => { status.textContent = ''; form.removeAttribute('aria-busy'); });
form.addEventListener('htmx:responseError', () => { status.textContent = 'Analysis could not be completed.'; });
</script>
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+31
View File
@@ -0,0 +1,31 @@
from django.urls import path
from .views import (
classify_audio,
classify_upload,
event_audio,
event_detail,
events_list,
events_view,
fireworks_map_view,
fireworks_view,
pending_audio,
submit_pending_event,
sensor_heartbeat,
)
app_name = "fireworks_detect"
urlpatterns = [
path("", fireworks_view, name="fireworks"),
path("map/", fireworks_map_view, name="map"),
path("classify/", classify_audio, name="classify"),
path("classify/upload/", classify_upload, name="classify_upload"),
path("heartbeat/", sensor_heartbeat, name="sensor_heartbeat"),
path("submit-pending/", submit_pending_event, name="submit_pending"),
path("events/", events_view, name="events"),
path("events/list/", events_list, name="events_list"),
path("admin-audio/pending/<int:event_id>/", pending_audio, name="pending_audio"),
path("admin-audio/events/<int:event_id>/", event_audio, name="event_audio"),
path("events/<int:event_id>/", event_detail, name="event_detail"),
]
+25
View File
@@ -0,0 +1,25 @@
from django.urls import path
from .views import (
classify_audio,
event_audio,
event_detail,
events_list,
events_view,
fireworks_map_view,
fireworks_view,
pending_audio,
submit_pending_event,
)
app_name = "fireworks_detect"
urlpatterns = [
path("", fireworks_view, name="fireworks"),
path("map/", fireworks_map_view, name="map"),
path("classify/", classify_audio, name="classify"),
path("submit-pending/", submit_pending_event, name="submit_pending"),
path("events/", events_view, name="events"),
path("events/list/", events_list, name="events_list"),
path("events/<int:event_id>/", event_detail, name="event_detail"),
]
+266
View File
@@ -0,0 +1,266 @@
import json
import mimetypes
import uuid
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
from django.contrib.admin.views.decorators import staff_member_required
from django.http import FileResponse, Http404, JsonResponse
from django.core import signing
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
from .models import Event, PendingEvent, Sensor
CLASSIFIER_URL = "http://192.168.1.122:5000/classify"
MAX_AUDIO_SIZE = 25 * 1024 * 1024 # 25 MiB: enough for this demo, and avoids accidental large uploads.
FIREWORK_TERMS = (
"firework", "firecracker", "explosion", "explosive", "bang", "boom",
"hiss", "crackle", "burst", "gunshot", "artillery", "cannon", "rocket",
)
SPEECH_TERMS = (
"speech", "conversation", "narration", "monologue", "babbling", "whisper",
"speaking", "speech synthesizer",
)
AUDIO_EXTENSIONS = {".aac", ".aif", ".aiff", ".flac", ".m4a", ".mp3", ".ogg", ".opus", ".wav", ".weba"}
@never_cache
def fireworks_view(request):
return render(request, "fireworks_detect/home.html")
@never_cache
def fireworks_map_view(request):
return render(request, "fireworks_detect/map.html")
@never_cache
def events_view(request):
return render(request, "fireworks_detect/events.html")
def _classification_context(payload):
predictions = _decorate_predictions(payload.get("predictions"))
peak_predictions = _decorate_predictions(payload.get("peak_predictions"))
return {
"result": payload,
"predictions": predictions,
"peak_predictions": peak_predictions,
"firework_count": sum(item["kind"] == "firework" for item in predictions + peak_predictions),
"speech_count": sum(item["kind"] == "speech" for item in predictions + peak_predictions),
}
def _label_kind(label):
lowered = label.lower()
if any(term in lowered for term in SPEECH_TERMS):
return "speech"
if any(term in lowered for term in FIREWORK_TERMS):
return "firework"
return "default"
def _score_details(score):
try:
percentage = max(0, min(float(score) * 100, 100))
except (TypeError, ValueError):
return "—", 0
return f"{percentage:.1f}%", round(percentage, 1)
def _decorate_predictions(predictions):
decorated = []
for prediction in predictions if isinstance(predictions, list) else []:
if not isinstance(prediction, dict):
continue
label = str(prediction.get("class", "Unknown"))
score, score_width = _score_details(prediction.get("score"))
decorated.append({
**prediction,
"label": label,
"kind": _label_kind(label),
"score_display": score,
"score_width": score_width,
})
return decorated
def _encode_audio_multipart(uploaded_file):
"""Build the multipart request expected by the classifier without a third-party HTTP client."""
boundary = f"----DjangoAudioUpload{uuid.uuid4().hex}"
filename = Path(uploaded_file.name).name.replace('"', "")
content_type = uploaded_file.content_type or mimetypes.guess_type(filename)[0] or "application/octet-stream"
header = (
f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="file"; filename="{filename}"\r\n'
f"Content-Type: {content_type}\r\n\r\n"
).encode()
body = header + uploaded_file.read() + f"\r\n--{boundary}--\r\n".encode()
return body, f"multipart/form-data; boundary={boundary}"
def _render_error(request, message, status=400):
return render(request, "fireworks_detect/classification_result.html", {"error": message}, status=status)
@require_http_methods(["GET", "POST"])
@never_cache
def classify_upload(request):
# Opening this endpoint in a browser should return the upload screen rather
# than a 405 page. Only POST requests perform classification.
if request.method == "GET":
return redirect("fireworks_detect:fireworks")
uploaded_file = request.FILES.get("audio")
if not uploaded_file:
return _render_error(request, "Choose an audio file before starting the analysis.")
extension = Path(uploaded_file.name).suffix.lower()
if not (uploaded_file.content_type or "").startswith("audio/") and extension not in AUDIO_EXTENSIONS:
return _render_error(request, "Please upload a supported audio file (such as WAV, MP3, M4A, or OGG).")
if uploaded_file.size > MAX_AUDIO_SIZE:
return _render_error(request, "This demo accepts audio files up to 25 MiB.")
body, content_type = _encode_audio_multipart(uploaded_file)
classifier_request = Request(
CLASSIFIER_URL,
data=body,
headers={"Content-Type": content_type, "Accept": "application/json"},
method="POST",
)
try:
with urlopen(classifier_request, timeout=60) as response:
payload = json.loads(response.read().decode("utf-8"))
except HTTPError as error:
return _render_error(request, f"The classifier returned an error (HTTP {error.code}).", status=502)
except (URLError, TimeoutError):
return _render_error(request, "The classifier could not be reached. Please try again shortly.", status=502)
except json.JSONDecodeError:
return _render_error(request, "The classifier returned an unreadable response.", status=502)
if not isinstance(payload, dict):
return _render_error(request, "The classifier returned an unexpected response.", status=502)
# Keep the raw payload in this request flow; this is the future hand-off point
# for saving the upload and its classification to a database or queue.
context = _classification_context(payload)
context["submission_token"] = signing.dumps(payload, salt="fireworks_detect.classification")
return render(request, "fireworks_detect/classification_result.html", context)
@require_http_methods(["POST"])
@never_cache
def submit_pending_event(request):
uploaded_file = request.FILES.get("audio")
token = request.POST.get("classification_token")
if not uploaded_file:
return render(request, "fireworks_detect/pending_submission.html", {"error": "Keep the analysed audio file selected before submitting it for review."}, status=400)
if not token:
return render(request, "fireworks_detect/pending_submission.html", {"error": "Analyse the file before submitting it for review."}, status=400)
try:
payload = signing.loads(token, salt="fireworks_detect.classification", max_age=60 * 60)
except signing.BadSignature:
return render(request, "fireworks_detect/pending_submission.html", {"error": "This analysis has expired. Please analyse the audio again."}, status=400)
if not isinstance(payload, dict):
return render(request, "fireworks_detect/pending_submission.html", {"error": "The saved analysis is not valid."}, status=400)
pending = PendingEvent.objects.create(
audio_file=uploaded_file,
original_filename=uploaded_file.name,
classifier_response=payload,
)
return render(request, "fireworks_detect/pending_submission.html", {"pending": pending})
@never_cache
def events_list(request):
return render(request, "fireworks_detect/events_list.html", {"events": Event.objects.all()[:30]})
@never_cache
def event_detail(request, event_id):
event = get_object_or_404(Event, pk=event_id)
context = _classification_context(event.classifier_response)
context["event"] = event
return render(request, "fireworks_detect/event_detail.html", context)
def _audio_response(record):
if not record.audio_file:
raise Http404("No audio is attached to this record.")
content_type = mimetypes.guess_type(record.audio_file.name)[0] or "application/octet-stream"
return FileResponse(record.audio_file.open("rb"), content_type=content_type)
@staff_member_required
def pending_audio(request, event_id):
return _audio_response(get_object_or_404(PendingEvent, pk=event_id))
@staff_member_required
def event_audio(request, event_id):
return _audio_response(get_object_or_404(Event, pk=event_id))
def _sensor_from_request(request):
authorization = request.headers.get("Authorization", "")
token = authorization.removeprefix("Bearer ").strip() if authorization.startswith("Bearer ") else request.headers.get("X-Sensor-Token", "").strip()
if not token:
return None
sensor = Sensor.objects.filter(is_active=True, token_prefix=token[:15]).first()
return sensor if sensor and sensor.token_matches(token) else None
def _sensor_error(message, status=400):
return JsonResponse({"detail": message}, status=status)
@csrf_exempt
@require_http_methods(["POST"])
def classify_audio(request):
"""Token-authenticated device API. Browser uploads use classify_upload instead."""
sensor = _sensor_from_request(request)
if not sensor:
return _sensor_error("A valid sensor API token is required.", 401)
uploaded_file = request.FILES.get("file") or request.FILES.get("audio")
if not uploaded_file:
return _sensor_error("Attach audio as multipart field 'file'.")
extension = Path(uploaded_file.name).suffix.lower()
if not (uploaded_file.content_type or "").startswith("audio/") and extension not in AUDIO_EXTENSIONS:
return _sensor_error("Unsupported audio file.")
if uploaded_file.size > MAX_AUDIO_SIZE:
return _sensor_error("Audio exceeds the 25 MiB limit.")
body, content_type = _encode_audio_multipart(uploaded_file)
classifier_request = Request(CLASSIFIER_URL, data=body, headers={"Content-Type": content_type, "Accept": "application/json"}, method="POST")
try:
with urlopen(classifier_request, timeout=60) as response:
payload = json.loads(response.read().decode("utf-8"))
except HTTPError as error:
return _sensor_error(f"Classifier returned HTTP {error.code}.", 502)
except (URLError, TimeoutError, json.JSONDecodeError):
return _sensor_error("Classifier is unavailable or returned invalid JSON.", 502)
if not isinstance(payload, dict):
return _sensor_error("Classifier returned an unexpected response.", 502)
uploaded_file.seek(0)
pending = PendingEvent.objects.create(audio_file=uploaded_file, sensor=sensor, original_filename=uploaded_file.name, classifier_response=payload)
sensor.record_heartbeat(submission=True)
return JsonResponse({**payload, "pending_event_id": pending.pk, "sensor": sensor.name}, status=201)
@csrf_exempt
@require_http_methods(["POST"])
def sensor_heartbeat(request):
sensor = _sensor_from_request(request)
if not sensor:
return _sensor_error("A valid sensor API token is required.", 401)
sensor.record_heartbeat()
return JsonResponse({"ok": True, "sensor": sensor.name, "heartbeat_at": sensor.last_heartbeat.isoformat()})
+193
View File
@@ -0,0 +1,193 @@
import json
import mimetypes
import uuid
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
from django.contrib.admin.views.decorators import staff_member_required
from django.http import FileResponse, Http404
from django.core import signing
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.cache import never_cache
from django.views.decorators.http import require_http_methods
from .models import Event, PendingEvent
CLASSIFIER_URL = "http://192.168.1.122:5000/classify"
MAX_AUDIO_SIZE = 25 * 1024 * 1024 # 25 MiB: enough for this demo, and avoids accidental large uploads.
FIREWORK_TERMS = (
"firework", "firecracker", "explosion", "explosive", "bang", "boom",
"hiss", "crackle", "burst", "gunshot", "artillery", "cannon", "rocket",
)
SPEECH_TERMS = (
"speech", "conversation", "narration", "monologue", "babbling", "whisper",
"speaking", "speech synthesizer",
)
AUDIO_EXTENSIONS = {".aac", ".aif", ".aiff", ".flac", ".m4a", ".mp3", ".ogg", ".opus", ".wav", ".weba"}
@never_cache
def fireworks_view(request):
return render(request, "fireworks_detect/home.html")
@never_cache
def fireworks_map_view(request):
return render(request, "fireworks_detect/map.html")
@never_cache
def events_view(request):
return render(request, "fireworks_detect/events.html")
def _classification_context(payload):
predictions = _decorate_predictions(payload.get("predictions"))
peak_predictions = _decorate_predictions(payload.get("peak_predictions"))
return {
"result": payload,
"predictions": predictions,
"peak_predictions": peak_predictions,
"firework_count": sum(item["kind"] == "firework" for item in predictions + peak_predictions),
"speech_count": sum(item["kind"] == "speech" for item in predictions + peak_predictions),
}
def _label_kind(label):
lowered = label.lower()
if any(term in lowered for term in SPEECH_TERMS):
return "speech"
if any(term in lowered for term in FIREWORK_TERMS):
return "firework"
return "default"
def _score_details(score):
try:
percentage = max(0, min(float(score) * 100, 100))
except (TypeError, ValueError):
return "—", 0
return f"{percentage:.1f}%", round(percentage, 1)
def _decorate_predictions(predictions):
decorated = []
for prediction in predictions if isinstance(predictions, list) else []:
if not isinstance(prediction, dict):
continue
label = str(prediction.get("class", "Unknown"))
score, score_width = _score_details(prediction.get("score"))
decorated.append({
**prediction,
"label": label,
"kind": _label_kind(label),
"score_display": score,
"score_width": score_width,
})
return decorated
def _encode_audio_multipart(uploaded_file):
"""Build the multipart request expected by the classifier without a third-party HTTP client."""
boundary = f"----DjangoAudioUpload{uuid.uuid4().hex}"
filename = Path(uploaded_file.name).name.replace('"', "")
content_type = uploaded_file.content_type or mimetypes.guess_type(filename)[0] or "application/octet-stream"
header = (
f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="file"; filename="{filename}"\r\n'
f"Content-Type: {content_type}\r\n\r\n"
).encode()
body = header + uploaded_file.read() + f"\r\n--{boundary}--\r\n".encode()
return body, f"multipart/form-data; boundary={boundary}"
def _render_error(request, message, status=400):
return render(request, "fireworks_detect/classification_result.html", {"error": message}, status=status)
@require_http_methods(["GET", "POST"])
@never_cache
def classify_audio(request):
# Opening this endpoint in a browser should return the upload screen rather
# than a 405 page. Only POST requests perform classification.
if request.method == "GET":
return redirect("fireworks_detect:fireworks")
uploaded_file = request.FILES.get("audio")
if not uploaded_file:
return _render_error(request, "Choose an audio file before starting the analysis.")
extension = Path(uploaded_file.name).suffix.lower()
if not (uploaded_file.content_type or "").startswith("audio/") and extension not in AUDIO_EXTENSIONS:
return _render_error(request, "Please upload a supported audio file (such as WAV, MP3, M4A, or OGG).")
if uploaded_file.size > MAX_AUDIO_SIZE:
return _render_error(request, "This demo accepts audio files up to 25 MiB.")
body, content_type = _encode_audio_multipart(uploaded_file)
classifier_request = Request(
CLASSIFIER_URL,
data=body,
headers={"Content-Type": content_type, "Accept": "application/json"},
method="POST",
)
try:
with urlopen(classifier_request, timeout=60) as response:
payload = json.loads(response.read().decode("utf-8"))
except HTTPError as error:
return _render_error(request, f"The classifier returned an error (HTTP {error.code}).", status=502)
except (URLError, TimeoutError):
return _render_error(request, "The classifier could not be reached. Please try again shortly.", status=502)
except json.JSONDecodeError:
return _render_error(request, "The classifier returned an unreadable response.", status=502)
if not isinstance(payload, dict):
return _render_error(request, "The classifier returned an unexpected response.", status=502)
# Keep the raw payload in this request flow; this is the future hand-off point
# for saving the upload and its classification to a database or queue.
context = _classification_context(payload)
context["submission_token"] = signing.dumps(payload, salt="fireworks_detect.classification")
return render(request, "fireworks_detect/classification_result.html", context)
@require_http_methods(["POST"])
@never_cache
def submit_pending_event(request):
uploaded_file = request.FILES.get("audio")
token = request.POST.get("classification_token")
if not uploaded_file:
return render(request, "fireworks_detect/pending_submission.html", {"error": "Keep the analysed audio file selected before submitting it for review."}, status=400)
if not token:
return render(request, "fireworks_detect/pending_submission.html", {"error": "Analyse the file before submitting it for review."}, status=400)
try:
payload = signing.loads(token, salt="fireworks_detect.classification", max_age=60 * 60)
except signing.BadSignature:
return render(request, "fireworks_detect/pending_submission.html", {"error": "This analysis has expired. Please analyse the audio again."}, status=400)
if not isinstance(payload, dict):
return render(request, "fireworks_detect/pending_submission.html", {"error": "The saved analysis is not valid."}, status=400)
pending = PendingEvent.objects.create(
audio_file=uploaded_file,
original_filename=uploaded_file.name,
classifier_response=payload,
)
return render(request, "fireworks_detect/pending_submission.html", {"pending": pending})
@never_cache
def events_list(request):
return render(request, "fireworks_detect/events_list.html", {"events": Event.objects.all()[:30]})
@never_cache
def event_detail(request, event_id):
event = get_object_or_404(Event, pk=event_id)
context = _classification_context(event.classifier_response)
context["event"] = event
return render(request, "fireworks_detect/event_detail.html", context)
BIN
View File
Binary file not shown.
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class HelloConfig(AppConfig):
name = 'hello'
View File
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+150
View File
@@ -0,0 +1,150 @@
:root {
color-scheme: light;
--ink: #172554;
--muted: #64748b;
--card: rgba(255, 255, 255, 0.88);
--accent: #7c3aed;
--accent-light: #ddd6fe;
}
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
margin: 0;
display: grid;
place-items: center;
padding: 2rem;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: var(--ink);
background:
radial-gradient(circle at top left, #bfdbfe 0, transparent 32rem),
radial-gradient(circle at bottom right, #ddd6fe 0, transparent 30rem),
#f8fafc;
}
.welcome-card {
width: min(100%, 42rem);
position: relative;
overflow: hidden;
padding: clamp(2rem, 7vw, 4.5rem);
border: 1px solid rgba(255, 255, 255, 0.8);
border-radius: 1.5rem;
background: var(--card);
box-shadow: 0 1.5rem 4rem rgba(30, 41, 59, 0.16);
backdrop-filter: blur(12px);
}
.welcome-card::before {
content: "";
width: 11rem;
height: 11rem;
position: absolute;
top: -5.5rem;
right: -4rem;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-light), #93c5fd);
opacity: 0.75;
}
.eyebrow {
margin: 0 0 0.75rem;
color: var(--accent);
font-size: 0.8rem;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
}
h1 {
max-width: 26rem;
margin: 0;
font-size: clamp(2.25rem, 7vw, 4.25rem);
line-height: 1.05;
letter-spacing: -0.055em;
}
.subject {
display: inline-flex;
align-items: center;
gap: 0.55rem;
margin: 1.5rem 0 0;
padding: 0.8rem 1rem;
border-radius: 0.85rem;
color: var(--muted);
font-size: 1.1rem;
background: #f8fafc;
}
.subject strong {
color: var(--ink);
}
.sparkle {
color: var(--accent);
font-size: 1.25rem;
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
padding: 0.8rem 1.25rem;
border: 1px solid transparent;
border-radius: 12px;
background: #7c3aed;
color: #fff;
font: inherit;
font-weight: 600;
line-height: 1;
text-decoration: none;
cursor: pointer;
box-shadow:
0 4px 10px rgba(124, 58, 237, 0.18),
0 1px 2px rgba(15, 23, 42, 0.08);
transition:
background-color 150ms ease,
box-shadow 150ms ease,
transform 150ms ease;
}
.button:hover {
background: #6d28d9;
color: #fff;
box-shadow:
0 6px 16px rgba(124, 58, 237, 0.24),
0 2px 4px rgba(15, 23, 42, 0.08);
transform: translateY(-1px);
}
.button:active {
background: #5b21b6;
transform: translateY(0);
box-shadow:
0 2px 6px rgba(124, 58, 237, 0.18);
}
.button:focus-visible {
outline: 3px solid rgba(124, 58, 237, 0.25);
outline-offset: 3px;
}
.button:disabled,
.button[aria-disabled="true"] {
opacity: 0.5;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
+34
View File
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welkom · Sound Signal</title>
<style>
:root { --ink:#eef3ff; --muted:#aab9d8; --line:#2b3d68; --blue:#8abaff; --violet:#b69cff; --amber:#ffbd62; }
* { box-sizing:border-box; }
body { min-width:320px; min-height:100vh; display:grid; place-items:center; margin:0; padding:1.5rem; color:var(--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; }
.welcome-card { width:min(100%,44rem); position:relative; overflow:hidden; padding:clamp(2rem,7vw,4.75rem); border:1px solid var(--line); border-radius:1.5rem; background:linear-gradient(145deg,#172443e8,#10182ddd); box-shadow:0 1.75rem 5rem #01030c99; backdrop-filter:blur(16px); }
.welcome-card::before { content:""; width:15rem; height:15rem; position:absolute; top:-8rem; right:-6rem; border-radius:50%; background:linear-gradient(135deg,#609df177,#b27be266); filter:blur(1px); }.welcome-card::after { content:""; width:10rem; height:10rem; position:absolute; bottom:-6rem; left:-4rem; border-radius:50%; background:#f4a74225; }
.brand { display:flex; align-items:center; gap:.65rem; margin-bottom:clamp(2rem,5vw,4rem); color:#d9e5ff; font-size:.78rem; font-weight:900; letter-spacing:.14em; text-transform:uppercase; }.brand-mark { display:grid; width:2.2rem; aspect-ratio:1; place-items:center; border-radius:.7rem; color:#17132b; font-size:1.1rem; background:linear-gradient(135deg,#fcd34d,#fb7185); box-shadow:0 .5rem 1.5rem #fb718550; }
.eyebrow { margin:0 0 .8rem; color:#bad3ff; font-size:.76rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }.eyebrow::before { content:""; display:inline-block; width:.55rem; height:.55rem; margin-right:.45rem; border-radius:50%; background:var(--amber); box-shadow:0 0 0 .25rem #fbbf2430; }
h1 { max-width:10ch; margin:0; font-size:clamp(2.8rem,8vw,5.75rem); line-height:.96; letter-spacing:-.065em; }.subject { max-width:33rem; margin:1.35rem 0 0; color:var(--muted); font-size:clamp(1rem,2vw,1.15rem); line-height:1.65; }.subject strong { color:#e8efff; }.sparkle { color:var(--violet); font-size:1.2em; }
.actions { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; margin-top:2.25rem; }.button { display:inline-flex; align-items:center; justify-content:center; gap:.6rem; min-height:2.9rem; padding:.75rem 1.05rem; border:1px solid #b3c9ff; border-radius:.8rem; color:#121a34; font:inherit; font-size:.93rem; font-weight:850; text-decoration:none; background:linear-gradient(135deg,#99c8ff,#c6adff); box-shadow:0 .65rem 1.75rem #7058dd50; transition:transform .2s ease,filter .2s ease; }.button:hover { transform:translateY(-2px); filter:brightness(1.08); }.button:focus-visible { outline:3px solid #a5c9ff80; outline-offset:3px; }.hint { color:#99add2; font-size:.82rem; }
@media (max-width:30rem) { .welcome-card { padding:2rem 1.5rem; }.actions { align-items:stretch; flex-direction:column; }.button { width:100%; }.hint { text-align:center; } }
@media (prefers-reduced-motion:reduce) { .button { transition:none; } }
</style>
</head>
<body>
<main class="welcome-card">
<div class="brand"><span class="brand-mark">✦</span> Sound Signal</div>
<p class="eyebrow">Control room</p>
<h1>Welkom {{ naam }}</h1>
<p class="subject"><span class="sparkle">✦</span> Je leert <strong>{{ vak }}</strong>. Explore the prototype for live audio classification and future sensor mapping.</p>
<div class="actions">
<a href="{% url 'fireworks_detect:fireworks' %}" class="button">Open vuurwerk detector <span aria-hidden="true">→</span></a>
<a href="{% url 'fireworks_detect:map' %}" class="button">Open kaart concept <span aria-hidden="true">→</span></a>
<span class="hint">Audio analysis · Sensor map</span>
</div>
</main>
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+6
View File
@@ -0,0 +1,6 @@
from django.urls import path
from .views import hello_view
urlpatterns = [
path('', hello_view, name='hello')
]
+7
View File
@@ -0,0 +1,7 @@
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def hello_view(request):
context = {"naam" :"Joren", "vak": "django"}
return render(request, "home.html", context)
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
"""
ASGI config for myproject project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/6.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
application = get_asgi_application()
View File
+139
View File
@@ -0,0 +1,139 @@
"""
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 6.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/6.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/6.1/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-ns7)y4#8-@6zqfb+kkw4q%r@w$t!8*c1gq(+3=i!(f3sbcspl6'
# Public visitors should receive the branded error pages rather than Django's
# technical diagnostics.
DEBUG = False
ALLOWED_HOSTS = ["django.jorendegraaf.eu", "100.91.62.59"]
# The public HTTPS origin is terminated by Caddy before traffic reaches this
# Django process on the laptop. Trust it for POSTs that include a CSRF token.
CSRF_TRUSTED_ORIGINS = ["https://django.jorendegraaf.eu"]
# Caddy supplies this header for proxied HTTPS requests.
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'hello',
'fireworks_detect'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'myproject.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'myproject.wsgi.application'
# Database
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/6.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/6.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/6.1/howto/static-files/
STATICFILES_DIRS = [BASE_DIR / 'project_admin' / 'static']
STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / 'staticfiles'
MEDIA_URL = 'media/'
MEDIA_ROOT = BASE_DIR / 'media'
# Email
# https://docs.djangoproject.com/en/6.1/topics/email/#topic-email-configuration
MAILERS = {
'default': {
'BACKEND': 'django.core.mail.backends.console.EmailBackend',
},
}
+138
View File
@@ -0,0 +1,138 @@
"""
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 6.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/6.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/6.1/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-ns7)y4#8-@6zqfb+kkw4q%r@w$t!8*c1gq(+3=i!(f3sbcspl6'
# Public visitors should receive the branded error pages rather than Django's
# technical diagnostics.
DEBUG = False
ALLOWED_HOSTS = ["django.jorendegraaf.eu", "100.91.62.59"]
# The public HTTPS origin is terminated by Caddy before traffic reaches this
# Django process on the laptop. Trust it for POSTs that include a CSRF token.
CSRF_TRUSTED_ORIGINS = ["https://django.jorendegraaf.eu"]
# Caddy supplies this header for proxied HTTPS requests.
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'hello',
'fireworks_detect'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'myproject.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'myproject.wsgi.application'
# Database
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/6.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/6.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/6.1/howto/static-files/
STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / 'staticfiles'
MEDIA_URL = 'media/'
MEDIA_ROOT = BASE_DIR / 'media'
# Email
# https://docs.djangoproject.com/en/6.1/topics/email/#topic-email-configuration
MAILERS = {
'default': {
'BACKEND': 'django.core.mail.backends.console.EmailBackend',
},
}
+28
View File
@@ -0,0 +1,28 @@
"""
URL configuration for myproject 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.contrib import admin
from django.conf import settings
from django.urls import path, include, re_path
from django.views.static import serve
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('hello.urls')),
path('fireworks/', include('fireworks_detect.urls')),
]
urlpatterns += [re_path(r"^static/(?P<path>.*)$", serve, {"document_root": settings.STATIC_ROOT})]
+28
View File
@@ -0,0 +1,28 @@
"""
URL configuration for myproject 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.contrib import admin
from django.conf import settings
from django.urls import path, include, re_path
from django.views.static import serve
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('hello.urls')),
path('fireworks/', include('fireworks_detect.urls')),
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
+16
View File
@@ -0,0 +1,16 @@
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/6.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
application = get_wsgi_application()
@@ -0,0 +1 @@
:root{--primary:#8abaff;--secondary:#263a76;--accent:#b69cff;--primary-fg:#10182d;--body-fg:#edf3ff;--body-bg:#090e1d;--body-quiet-color:#aab9d8;--body-loud-color:#fff;--header-color:#edf3ff;--header-branding-color:#edf3ff;--header-bg:#111a31;--header-link-color:#dbe8ff;--breadcrumbs-fg:#c8d7f5;--breadcrumbs-link-fg:#fff;--breadcrumbs-bg:#192848;--link-fg:#9ec8ff;--link-hover-color:#d1bdff;--link-selected-fg:#fff;--hairline-color:#2b3d68;--border-color:#30446f;--error-fg:#ff9ea8;--message-success-bg:#104a40;--message-warning-bg:#5a431c;--darkened-bg:#13203b;--selected-bg:#283c68;--selected-row:#1a2b4e;--button-fg:#121a34;--button-bg:#9ac8ff;--button-hover-bg:#c6adff}body{background:radial-gradient(circle at 8% 0,#263a76 0,transparent 31rem),#090e1d}#header{padding:18px 32px;background:linear-gradient(135deg,#172443,#10182d);border-bottom:1px solid #2b3d68}#site-name a{font-weight:900;letter-spacing:.06em}#site-name span{margin-left:.45rem;color:#aab9d8;font-size:.58em;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.module,div.breadcrumbs,#changelist-filter,.inline-group,.submit-row{border-color:#2b3d68!important;background:#111a31!important;box-shadow:0 1rem 3rem #01030c55}.module caption,.module h2,#changelist-filter h2{background:#1a2b4e!important;color:#edf3ff!important}#content{padding:28px 32px}input,textarea,select{color:#edf3ff!important;border-color:#3d5487!important;background:#0a1123!important}input:focus,textarea:focus,select:focus{border-color:#9ac8ff!important;box-shadow:0 0 0 2px #9ac8ff55!important}.button,button,input[type=submit],input[type=button],.submit-row input{border-radius:7px!important;background:linear-gradient(135deg,#99c8ff,#c6adff)!important;color:#121a34!important;font-weight:800!important}#changelist table thead th{background:#172443}#changelist table tbody tr:nth-child(odd){background:#101a31}#changelist table tbody tr:nth-child(even){background:#14203a}.messagelist li{border-radius:8px}a:link,a:visited{color:#9ec8ff}a:hover{color:#d1bdff}.classification-preview{margin:24px 0;padding:20px;border:1px solid #2b3d68;border-radius:10px;background:#101a31}.classification-preview h2{margin-top:0}.preview-meta{color:#aab9d8}.preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.preview-row{display:flex;justify-content:space-between;gap:12px;margin:8px 0;padding:10px;border-left:3px solid #78a4f0;background:#162441}.preview-row--firework{border-color:#f5aa44}.preview-row--speech{border-color:#fb7185}.raw-json{margin-top:18px;border-top:1px solid #2b3d68;padding-top:14px}.raw-json summary{cursor:pointer;color:#9ec8ff;font-weight:800}.raw-json pre{overflow:auto;max-height:28rem;padding:12px;color:#dce7ff;background:#090f20}@media(max-width:700px){.preview-grid{grid-template-columns:1fr}}
+381
View File
@@ -0,0 +1,381 @@
select.admin-autocomplete {
width: 20em;
}
.select2-container--admin-autocomplete.select2-container {
min-height: 30px;
}
.select2-container--admin-autocomplete .select2-selection--single,
.select2-container--admin-autocomplete .select2-selection--multiple {
min-height: 30px;
padding: 0;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection,
.select2-container--admin-autocomplete.select2-container--open
.select2-selection {
border-color: var(--body-quiet-color);
min-height: 30px;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection.select2-selection--single,
.select2-container--admin-autocomplete.select2-container--open
.select2-selection.select2-selection--single {
padding: 0;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection.select2-selection--multiple,
.select2-container--admin-autocomplete.select2-container--open
.select2-selection.select2-selection--multiple {
padding: 0;
}
.select2-container--admin-autocomplete .select2-selection--single {
background-color: var(--body-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__rendered {
color: var(--body-fg);
line-height: 30px;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__placeholder {
color: var(--body-quiet-color);
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__arrow
b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--single
.select2-selection__clear {
float: left;
}
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--single
.select2-selection__arrow {
left: 1px;
right: auto;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection--single {
background-color: var(--darkened-bg);
cursor: default;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection--single
.select2-selection__clear {
display: none;
}
.select2-container--admin-autocomplete.select2-container--open
.select2-selection--single
.select2-selection__arrow
b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px;
}
.select2-container--admin-autocomplete .select2-selection--multiple {
background-color: var(--body-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: text;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 10px 5px 5px;
width: 100%;
display: flex;
flex-wrap: wrap;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__rendered
li {
list-style: none;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__placeholder {
color: var(--body-quiet-color);
margin-top: 5px;
float: left;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin: 5px;
position: absolute;
right: 0;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__choice {
background-color: var(--darkened-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__choice__remove {
color: var(--body-quiet-color);
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__choice__remove:hover {
color: var(--body-fg);
}
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--multiple
.select2-selection__choice,
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--multiple
.select2-selection__placeholder,
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--multiple
.select2-search--inline {
float: right;
}
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--multiple
.select2-selection__choice {
margin-left: 5px;
margin-right: auto;
}
.select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--multiple
.select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection--multiple {
border: solid var(--body-quiet-color) 1px;
outline: 0;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection--multiple {
background-color: var(--darkened-bg);
cursor: default;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection__choice__remove {
display: none;
}
.select2-container--admin-autocomplete.select2-container--open.select2-container--above
.select2-selection--single,
.select2-container--admin-autocomplete.select2-container--open.select2-container--above
.select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-container--admin-autocomplete.select2-container--open.select2-container--below
.select2-selection--single,
.select2-container--admin-autocomplete.select2-container--open.select2-container--below
.select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--admin-autocomplete .select2-search--dropdown {
background: var(--darkened-bg);
}
.select2-container--admin-autocomplete
.select2-search--dropdown
.select2-search__field {
background: var(--body-bg);
color: var(--body-fg);
border: 1px solid var(--border-color);
border-radius: 4px;
}
.select2-container--admin-autocomplete
.select2-search--inline
.select2-search__field {
background: transparent;
color: var(--body-fg);
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield;
}
.select2-container--admin-autocomplete
.select2-results
> .select2-results__options {
max-height: 200px;
overflow-y: auto;
color: var(--body-fg);
background: var(--body-bg);
}
.select2-container--admin-autocomplete .select2-results__option[role="group"] {
padding: 0;
}
.select2-container--admin-autocomplete
.select2-results__option[aria-disabled="true"] {
color: var(--body-quiet-color);
}
.select2-container--admin-autocomplete
.select2-results__option[aria-selected="true"] {
background-color: var(--selected-bg);
color: var(--body-fg);
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option {
padding-left: 1em;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__group {
padding-left: 0;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option {
margin-left: -1em;
padding-left: 2em;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option {
margin-left: -2em;
padding-left: 3em;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option {
margin-left: -3em;
padding-left: 4em;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option {
margin-left: -4em;
padding-left: 5em;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option {
margin-left: -5em;
padding-left: 6em;
}
.select2-container--admin-autocomplete
.select2-results__option--highlighted[aria-selected] {
background-color: var(--primary);
color: var(--primary-fg);
}
.select2-container--admin-autocomplete .select2-results__group {
cursor: default;
display: block;
padding: 6px;
}
.errors .select2-selection {
border: 1px solid var(--error-fg);
}
File diff suppressed because it is too large Load Diff
+318
View File
@@ -0,0 +1,318 @@
/* CHANGELISTS */
#changelist .changelist-form-container {
display: flex;
align-items: flex-start;
width: 100%;
}
#changelist .changelist-form-container > div {
flex: 1 1 auto;
}
#changelist .changelist-form-container:not(:has(#changelist-filter)) > div {
width: 100%;
}
#changelist .changelist-form-container:has(#changelist-filter) > div {
min-width: 0;
max-width: calc(100% - 270px);
}
#changelist table {
width: 100%;
}
.change-list .hiddenfields {
display: none;
}
.change-list .filtered table {
border-right: none;
}
.change-list .filtered {
min-height: 400px;
}
.change-list .filtered .results,
.filtered #toolbar,
.filtered div.xfull {
width: auto;
}
.change-list .filtered table tbody th {
padding-right: 1em;
}
#changelist-form .results {
overflow-x: auto;
width: 100%;
}
#changelist .toplinks {
border-bottom: 1px solid var(--hairline-color);
}
#changelist .changelist-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color);
}
#changelist .changelist-footer .paginator {
color: var(--body-quiet-color);
background: var(--body-bg);
border: none;
padding: 0;
}
#changelist .paginator {
color: var(--body-quiet-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--body-bg);
}
#changelist .paginator ul {
padding: 0;
white-space: nowrap;
}
/* CHANGELIST TABLES */
#changelist table thead th {
padding: 0;
white-space: nowrap;
vertical-align: middle;
}
#changelist table thead th.action-checkbox-column {
width: 1.5em;
text-align: center;
}
#changelist table tbody td.action-checkbox {
text-align: center;
}
#changelist table tfoot {
color: var(--body-quiet-color);
}
/* TOOLBAR */
#toolbar {
padding: 8px 10px;
margin-bottom: 15px;
border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--darkened-bg);
color: var(--body-quiet-color);
}
#toolbar form input {
border-radius: 4px;
font-size: 0.875rem;
padding: 5px;
color: var(--body-fg);
}
#toolbar #searchbar {
height: 1.1875rem;
border: 1px solid var(--border-color);
padding: 2px 5px;
margin: 0;
vertical-align: top;
font-size: 0.8125rem;
max-width: 100%;
}
#toolbar #searchbar:focus {
border-color: var(--body-quiet-color);
}
#toolbar form input[type="submit"] {
border: 1px solid var(--border-color);
font-size: 0.8125rem;
padding: 4px 8px;
margin: 0;
vertical-align: middle;
background: var(--body-bg);
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer;
color: var(--body-fg);
}
#toolbar form input[type="submit"]:focus,
#toolbar form input[type="submit"]:hover {
border-color: var(--body-quiet-color);
}
#changelist-search img {
vertical-align: middle;
margin-right: 4px;
}
#changelist-search .help {
word-break: break-word;
}
/* FILTER COLUMN */
#changelist-filter {
flex: 0 0 240px;
order: 1;
background: var(--darkened-bg);
border-left: none;
margin: 0 0 0 30px;
}
@media (forced-colors: active) {
#changelist-filter {
border: 1px solid;
}
}
#changelist-filter h2 {
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 5px 15px;
margin-bottom: 12px;
border-bottom: none;
}
#changelist-filter h3,
#changelist-filter details summary {
font-weight: 400;
padding: 0 15px;
margin-bottom: 10px;
}
#changelist-filter details summary > * {
display: inline;
}
#changelist-filter details > summary {
list-style-type: none;
}
#changelist-filter details > summary::-webkit-details-marker {
display: none;
}
#changelist-filter details > summary::before {
content: "→";
font-weight: bold;
color: var(--link-hover-color);
}
#changelist-filter details[open] > summary::before {
content: "↓";
}
#changelist-filter ul {
margin: 5px 0;
padding: 0 15px 15px;
border-bottom: 1px solid var(--hairline-color);
}
#changelist-filter ul:last-child {
border-bottom: none;
}
#changelist-filter li {
list-style-type: none;
margin-left: 0;
padding-left: 0;
}
#changelist-filter a {
display: block;
color: var(--body-quiet-color);
}
#changelist-filter summary,
#changelist-filter a {
word-break: break-word;
}
#changelist-filter li.selected {
border-left: 5px solid var(--hairline-color);
padding-left: 10px;
margin-left: -15px;
}
#changelist-filter li.selected a {
color: var(--link-selected-fg);
}
#changelist-filter a:focus,
#changelist-filter a:hover,
#changelist-filter li.selected a:focus,
#changelist-filter li.selected a:hover {
color: var(--link-hover-color);
}
#changelist-filter #changelist-filter-extra-actions {
font-size: 0.8125rem;
margin-bottom: 10px;
border-bottom: 1px solid var(--hairline-color);
}
/* DATE DRILLDOWN */
.change-list .toplinks {
display: flex;
padding-bottom: 5px;
flex-wrap: wrap;
gap: 3px 17px;
font-weight: bold;
}
.change-list .toplinks a,
.change-list .toplinks span {
font-size: 0.8125rem;
}
.change-list .toplinks .date-back {
color: var(--body-quiet-color);
}
.change-list .toplinks .date-back:focus,
.change-list .toplinks .date-back:hover {
color: var(--link-hover-color);
}
/* ACTIONS */
.filtered .actions {
border-right: none;
}
#changelist table input {
margin: 0;
vertical-align: baseline;
}
/* Once the :has() pseudo-class is supported by all browsers, the tr.selected
selector and the JS adding the class can be removed. */
#changelist tbody tr.selected {
background-color: var(--selected-row);
}
#changelist tbody tr:has(.action-select:checked) {
background-color: var(--selected-row);
}
@media (forced-colors: active) {
#changelist tbody tr.selected {
background-color: SelectedItem;
}
#changelist tbody tr:has(.action-select:checked) {
background-color: SelectedItem;
}
}
+145
View File
@@ -0,0 +1,145 @@
@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #f7f7f7;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #d0d0d0;
--body-medium-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-debug-bg: #4e4e4e;
--message-debug-icon: url(../img/icon-debug-dark.svg);
--message-info-bg: #265895;
--message-info-icon: url(../img/icon-info-dark.svg);
--message-success-bg: #006b1b;
--message-success-icon: url(../img/icon-yes-dark.svg);
--message-warning-bg: #583305;
--message-warning-icon: url(../img/icon-alert-dark.svg);
--message-error-bg: #570808;
--message-error-icon: url(../img/icon-no-dark.svg);
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
color-scheme: dark;
}
}
html[data-theme="dark"] {
--primary: #264b5d;
--primary-fg: #f7f7f7;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #d0d0d0;
--body-medium-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-debug-bg: #4e4e4e;
--message-debug-icon: url(../img/icon-debug-dark.svg);
--message-info-bg: #265895;
--message-info-icon: url(../img/icon-info-dark.svg);
--message-success-bg: #006b1b;
--message-success-icon: url(../img/icon-yes-dark.svg);
--message-warning-bg: #583305;
--message-warning-icon: url(../img/icon-alert-dark.svg);
--message-error-bg: #570808;
--message-error-icon: url(../img/icon-no-dark.svg);
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
color-scheme: dark;
}
/* THEME SWITCH */
.theme-toggle {
cursor: pointer;
border: none;
padding: 0;
background: transparent;
vertical-align: middle;
margin-inline-start: 5px;
margin-top: -1px;
}
.theme-toggle svg {
vertical-align: middle;
height: 1.5rem;
width: 1.5rem;
display: none;
}
/*
Fully hide screen reader text so we only show the one matching the current
theme.
*/
.theme-toggle .visually-hidden {
display: none;
}
html[data-theme="auto"] .theme-toggle .theme-label-when-auto {
display: block;
}
html[data-theme="dark"] .theme-toggle .theme-label-when-dark {
display: block;
}
html[data-theme="light"] .theme-toggle .theme-label-when-light {
display: block;
}
/* ICONS */
.theme-toggle svg.theme-icon-when-auto,
.theme-toggle svg.theme-icon-when-dark,
.theme-toggle svg.theme-icon-when-light {
fill: var(--header-link-color);
color: var(--header-bg);
}
html[data-theme="auto"] .theme-toggle svg.theme-icon-when-auto {
display: block;
}
html[data-theme="dark"] .theme-toggle svg.theme-icon-when-dark {
display: block;
}
html[data-theme="light"] .theme-toggle svg.theme-icon-when-light {
display: block;
}
+30
View File
@@ -0,0 +1,30 @@
/* DASHBOARD */
.dashboard td,
.dashboard th {
word-break: break-word;
}
.dashboard .module table th {
width: 100%;
}
.dashboard .module table td {
white-space: nowrap;
}
.dashboard .module table td a {
display: block;
padding-right: 0.6em;
}
/* RECENT ACTIONS MODULE */
.module ul.actionlist {
margin-left: 0;
}
ul.actionlist li {
list-style-type: none;
overflow: hidden;
text-overflow: ellipsis;
}
+482
View File
@@ -0,0 +1,482 @@
/* FORM ROWS */
.form-row {
overflow: hidden;
padding: 10px;
font-size: 0.8125rem;
border-bottom: 1px solid var(--hairline-color);
}
.form-row img,
.form-row input {
vertical-align: middle;
}
.form-row label input[type="checkbox"] {
margin-top: 0;
vertical-align: 0;
}
.form-row select option:checked {
background-color: var(--selected-row);
color: var(--body-fg);
}
form .form-row p {
padding-left: 0;
}
.flex-container {
display: flex;
gap: 10px;
flex-direction: column;
align-items: flex-start;
}
.flex-container div.checkbox {
display: flex;
}
.form-multiline {
flex-wrap: wrap;
flex-direction: row;
}
/* FORM LABELS */
legend,
label {
font-weight: normal;
color: var(--body-quiet-color);
font-size: 0.8125rem;
padding: 0;
}
.required legend,
legend.required,
.required label,
label.required {
font-weight: bold;
}
/* RADIO BUTTONS */
form div.radiolist div {
padding-right: 7px;
}
form div.radiolist.inline div {
display: inline-block;
}
form div.radiolist label {
display: inline-block;
padding: 4px 10px 0 0;
}
form div.radiolist input[type="radio"] {
margin: -2px 4px 0 0;
padding: 0;
}
form ul.inline {
margin-left: 0;
padding: 0;
}
form ul.inline li {
float: left;
padding-right: 7px;
}
/* FIELDSETS */
fieldset .fieldset-heading,
fieldset .inline-heading,
:not(.inline-related) .collapse summary {
border: 1px solid var(--header-bg);
margin: 0;
padding: 8px;
font-weight: 400;
font-size: 0.8125rem;
background: var(--header-bg);
color: var(--header-link-color);
}
/* ALIGNED FIELDSETS */
.aligned fieldset {
border-top: none;
}
.aligned fieldset > div {
width: 100%;
}
.aligned legend {
float: inline-start;
padding: 0.5rem 0;
}
.aligned label + p,
.aligned .checkbox-row + div.help,
.aligned label + div.readonly {
padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
overflow-wrap: break-word;
}
.aligned ul label {
display: inline;
float: none;
width: auto;
}
.aligned .form-row input {
margin-bottom: 0;
}
.colMS .aligned .vLargeTextField,
.colMS .aligned .vXMLLargeTextField {
width: 350px;
}
form .aligned div.radiolist {
display: block;
margin: 0;
padding: 0;
}
form .aligned fieldset div.help {
margin-left: 0;
}
form .aligned p.help:last-child,
form .aligned div.help:last-child {
margin-bottom: 0;
padding-bottom: 0;
}
form .aligned ul li {
list-style: none;
}
form .aligned div.help ul {
padding-left: 0;
margin-left: 0;
}
form .aligned table p {
margin-left: 0;
padding-left: 0;
}
.aligned .vCheckboxLabel {
padding: 1px 0 0 5px;
}
.aligned .vCheckboxLabel + p.help,
.aligned .vCheckboxLabel + div.help {
margin-top: -4px;
}
.colM .aligned .vLargeTextField,
.colM .aligned .vXMLLargeTextField {
width: 610px;
}
/* COLLAPSIBLE FIELDSETS */
.collapse summary .fieldset-heading,
.collapse summary .inline-heading {
background: transparent;
border: none;
color: currentColor;
display: inline;
margin: 0;
padding: 0;
}
/* MONOSPACE TEXTAREAS */
fieldset.monospace textarea {
font-family: var(--font-family-monospace);
}
/* SUBMIT ROW */
.submit-row {
padding: 12px 14px 12px;
margin: 0 0 20px;
background: var(--darkened-bg);
border: 1px solid var(--hairline-color);
border-radius: 4px;
overflow: hidden;
display: flex;
gap: 10px;
flex-wrap: wrap;
}
body.popup .submit-row {
overflow: auto;
}
.submit-row input {
height: 2.1875rem;
line-height: 0.9375rem;
}
.submit-row input,
.submit-row a {
margin: 0;
}
.submit-row input.default {
text-transform: uppercase;
}
.submit-row a.deletelink {
margin-left: auto;
}
.submit-row a.deletelink {
display: block;
background: var(--delete-button-bg);
border-radius: 4px;
padding: 0.625rem 0.9375rem;
height: 0.9375rem;
line-height: 0.9375rem;
color: var(--button-fg);
}
.submit-row a.closelink {
display: inline-block;
background: var(--close-button-bg);
border-radius: 4px;
padding: 10px 15px;
height: 0.9375rem;
line-height: 0.9375rem;
color: var(--button-fg);
}
.submit-row a.deletelink:focus,
.submit-row a.deletelink:hover,
.submit-row a.deletelink:active {
background: var(--delete-button-hover-bg);
text-decoration: none;
}
.submit-row a.closelink:focus,
.submit-row a.closelink:hover,
.submit-row a.closelink:active {
background: var(--close-button-hover-bg);
text-decoration: none;
}
/* CUSTOM FORM FIELDS */
.vSelectMultipleField {
vertical-align: top;
}
.vCheckboxField {
border: none;
}
.vDateField,
.vTimeField {
margin-right: 2px;
margin-bottom: 4px;
}
.vDateField {
min-width: 6.85em;
}
.vTimeField {
min-width: 4.7em;
}
.vURLField {
width: 30em;
}
.vLargeTextField,
.vXMLLargeTextField {
width: 48em;
}
.app-flatpages.model-flatpage #id_content {
height: 40.2em;
}
.module table .vPositiveSmallIntegerField {
width: 2.2em;
}
.vIntegerField {
width: 5em;
}
.vBigIntegerField {
width: 10em;
}
.vForeignKeyRawIdAdminField {
width: 5em;
}
.vTextField,
.vUUIDField {
width: 20em;
}
/* INLINES */
.inline-group {
padding: 0;
margin: 0 0 30px;
}
.inline-group thead th {
padding: 8px 10px;
}
.inline-group .aligned label {
width: 160px;
}
.inline-related {
position: relative;
}
.inline-related h4,
.inline-related:not(.tabular) .collapse summary {
margin: 0;
color: var(--body-medium-color);
padding: 5px;
font-size: 0.8125rem;
background: var(--darkened-bg);
border: 1px solid var(--hairline-color);
border-left-color: var(--darkened-bg);
border-right-color: var(--darkened-bg);
}
.inline-related h3 span.delete {
float: right;
}
.inline-related h3 span.delete label {
margin-left: 2px;
font-size: 0.6875rem;
}
.inline-related fieldset {
margin: 0;
background: var(--body-bg);
border: none;
width: 100%;
}
.inline-group .tabular fieldset.module {
border: none;
}
.inline-related.tabular div.wrapper {
overflow-x: auto;
}
.inline-related.tabular fieldset.module table {
width: 100%;
}
.last-related fieldset {
border: none;
}
.inline-group .tabular tr.has_original td {
padding-top: 2em;
}
.inline-group .tabular tr td.original {
padding: 2px 0 0 0;
width: 0;
}
.inline-group .tabular th.original {
width: 0px;
padding: 0;
}
.inline-group .tabular td {
font-size: 1rem;
}
.inline-group .tabular td.original p {
position: absolute;
left: 0;
height: 1.2em;
padding: 2px 9px;
overflow: hidden;
font-size: 0.875rem;
font-weight: bold;
color: var(--body-quiet-color);
}
.inline-group div.add-row,
.inline-group .tabular tr.add-row td {
color: var(--body-quiet-color);
background: var(--darkened-bg);
padding: 8px 10px;
border-bottom: 1px solid var(--hairline-color);
}
.inline-group .tabular tr.add-row td {
padding: 8px 10px;
border-bottom: 1px solid var(--hairline-color);
}
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
font-size: 0.75rem;
}
.empty-form {
display: none;
}
/* RELATED FIELD ADD ONE / LOOKUP */
.related-lookup {
margin-left: 5px;
display: inline-block;
vertical-align: middle;
background-repeat: no-repeat;
background-size: 14px;
}
.related-lookup {
width: 1rem;
height: 1rem;
background-image: url(../img/search.svg);
}
form .related-widget-wrapper ul {
display: inline-block;
margin-left: 0;
padding-left: 0;
}
form .related-widget-wrapper a.change-related img {
transform: scale(0.85);
}
form .related-widget-wrapper a.view-related img {
transform: scale(0.95);
}
.clearable-file-input input {
margin-top: 0;
}
+62
View File
@@ -0,0 +1,62 @@
/* LOGIN FORM */
.login {
background: var(--darkened-bg);
height: auto;
}
.login #header {
height: auto;
padding: 15px 16px;
justify-content: center;
}
.login #header h1 {
font-size: 1.125rem;
margin: 0;
}
.login #header h1 a {
color: var(--header-link-color);
}
.login #content {
padding: 20px;
}
.login #container {
background: var(--body-bg);
border: 1px solid var(--hairline-color);
border-radius: 4px;
overflow: hidden;
width: 28em;
min-width: 300px;
margin: 100px auto;
height: auto;
}
.login .form-row {
padding: 4px 0;
}
.login .form-row label {
display: block;
line-height: 2em;
}
.login .form-row #id_username,
.login .form-row #id_password {
padding: 8px;
width: 100%;
box-sizing: border-box;
}
.login .submit-row {
padding: 1em 0 0 0;
margin: 0;
text-align: center;
}
.login .password-reset-link {
text-align: center;
}
+151
View File
@@ -0,0 +1,151 @@
.sticky {
position: sticky;
top: 0;
max-height: 100vh;
}
.toggle-nav-sidebar {
z-index: 20;
left: 0;
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 23px;
width: 23px;
border: 0;
border-right: 1px solid var(--hairline-color);
background-color: var(--body-bg);
cursor: pointer;
font-size: 1.25rem;
color: var(--link-fg);
padding: 0;
}
[dir="rtl"] .toggle-nav-sidebar {
border-left: 1px solid var(--hairline-color);
border-right: 0;
}
.toggle-nav-sidebar:hover,
.toggle-nav-sidebar:focus {
background-color: var(--darkened-bg);
}
#nav-sidebar {
z-index: 15;
flex: 0 0 275px;
left: -276px;
margin-left: -276px;
border-top: 1px solid transparent;
border-right: 1px solid var(--hairline-color);
background-color: var(--body-bg);
overflow: auto;
}
[dir="rtl"] #nav-sidebar {
border-left: 1px solid var(--hairline-color);
border-right: 0;
left: 0;
margin-left: 0;
right: -276px;
margin-right: -276px;
}
.toggle-nav-sidebar::before {
content: "\00BB";
}
.main.shifted .toggle-nav-sidebar::before {
content: "\00AB";
}
.main > #nav-sidebar {
visibility: hidden;
}
.main.shifted > #nav-sidebar {
margin-left: 0;
visibility: visible;
}
[dir="rtl"] .main.shifted > #nav-sidebar {
margin-right: 0;
}
#nav-sidebar .module th {
width: 100%;
overflow-wrap: anywhere;
}
#nav-sidebar .module th,
#nav-sidebar .module caption {
padding-left: 16px;
}
#nav-sidebar .module td {
white-space: nowrap;
}
[dir="rtl"] #nav-sidebar .module th,
[dir="rtl"] #nav-sidebar .module caption {
padding-left: 8px;
padding-right: 16px;
}
#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
color: var(--header-color);
font-weight: bold;
}
#nav-sidebar .current-model {
background: var(--selected-row);
}
@media (forced-colors: active) {
#nav-sidebar .current-model {
background-color: SelectedItem;
}
}
.main > #nav-sidebar + .content {
max-width: calc(100% - 23px);
}
.main.shifted > #nav-sidebar + .content {
max-width: calc(100% - 299px);
}
@media (max-width: 767px) {
#nav-sidebar,
#toggle-nav-sidebar {
display: none;
}
.main > #nav-sidebar + .content,
.main.shifted > #nav-sidebar + .content {
max-width: 100%;
}
}
#nav-filter {
width: 100%;
box-sizing: border-box;
padding: 2px 5px;
margin: 5px 0;
border: 1px solid var(--border-color);
background-color: var(--darkened-bg);
color: var(--body-fg);
}
#nav-filter:focus {
border-color: var(--body-quiet-color);
}
#nav-filter.no-results {
background: var(--message-error-bg);
}
#nav-sidebar table {
width: 100%;
}
+857
View File
@@ -0,0 +1,857 @@
/* Tablets */
input[type="submit"],
button {
-webkit-appearance: none;
appearance: none;
}
@media (max-width: 1024px) {
/* Basic */
html {
-webkit-text-size-adjust: 100%;
}
td,
th {
padding: 10px;
font-size: 0.875rem;
}
.small {
font-size: 0.75rem;
}
/* Layout */
#container {
min-width: 0;
}
#content {
padding: 15px 20px 20px;
}
div.breadcrumbs {
padding: 10px 30px;
}
/* Header */
#header {
flex-direction: column;
padding: 15px 30px;
justify-content: flex-start;
}
#site-name {
margin: 0 0 8px;
line-height: 1.2;
}
#user-tools {
margin: 0;
font-weight: 400;
line-height: 1.85;
text-align: left;
}
#user-tools a {
display: inline-block;
line-height: 1.4;
}
/* Dashboard */
.dashboard #content {
width: auto;
}
#content-related {
margin-right: -290px;
}
.colSM #content-related {
margin-left: -290px;
}
.colMS {
margin-right: 290px;
}
.colSM {
margin-left: 290px;
}
.dashboard .module table td a {
padding-right: 0;
}
td .changelink,
td .addlink {
font-size: 0.8125rem;
}
/* Changelist */
#toolbar {
border: none;
padding: 15px;
}
#changelist-search > div {
display: flex;
flex-wrap: nowrap;
max-width: 480px;
}
#changelist-search label {
line-height: 1.375rem;
}
#toolbar form #searchbar {
flex: 1 0 auto;
width: 0;
height: 1.375rem;
margin: 0 10px 0 6px;
}
#toolbar form input[type="submit"] {
flex: 0 1 auto;
}
#changelist-search .quiet {
width: 0;
flex: 1 0 auto;
margin: 5px 0 0 25px;
}
.actions {
display: flex;
flex-wrap: wrap;
padding: 15px 0;
}
.actions label {
display: flex;
}
.actions select {
background: var(--body-bg);
}
.actions .button {
min-width: 48px;
margin: 0 10px;
}
.actions span.all,
.actions span.clear,
.actions span.question,
.actions span.action-counter {
font-size: 0.6875rem;
margin: 0 10px 0 0;
}
#changelist-filter {
flex-basis: 200px;
}
.change-list .filtered .results,
.change-list .filtered .paginator,
.filtered #toolbar,
.filtered .actions,
#changelist .paginator {
border-top-color: var(--hairline-color); /* XXX Is this used at all? */
}
#changelist .results + .paginator {
border-top: none;
}
/* Forms */
legend,
label {
font-size: 1rem;
}
/*
Minifiers remove the default (text) "type" attribute from "input" HTML
tags. Add input:not([type]) to make the CSS stylesheet work the same.
*/
.form-row input:not([type]),
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row input[type="url"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row textarea,
.form-row select,
.form-row .vTextField {
box-sizing: border-box;
margin: 0;
padding: 6px 8px;
min-height: 2.25rem;
font-size: 1rem;
}
.form-row select {
height: 2.25rem;
}
.form-row select[multiple] {
height: auto;
min-height: 0;
}
textarea {
max-width: 100%;
max-height: 120px;
}
.aligned label {
padding-top: 6px;
}
.aligned .related-lookup,
.aligned .datetimeshortcuts,
.aligned .related-lookup + strong {
align-self: center;
margin-left: 0.5rem;
}
form .aligned div.radiolist {
margin-left: 2px;
}
.submit-row {
padding: 8px;
}
.submit-row a.deletelink {
padding: 10px 7px;
}
.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
padding: 7px;
}
/* Selector */
.selector {
display: flex;
width: 100%;
}
.selector .selector-filter {
display: flex;
align-items: center;
}
.selector .selector-filter input {
width: 100%;
min-height: 0;
flex: 1 1;
}
.selector-available,
.selector-chosen {
width: auto;
flex: 1 1;
display: flex;
flex-direction: column;
}
.selector select {
width: 100%;
flex: 1 0 auto;
margin-bottom: 5px;
}
.selector-chooseall,
.selector-clearall {
align-self: center;
}
.stacked {
flex-direction: column;
max-width: 480px;
}
.stacked > * {
flex: 0 1 auto;
}
.stacked select {
margin-bottom: 0;
}
.stacked .selector-available,
.stacked .selector-chosen {
width: auto;
}
.stacked ul.selector-chooser {
padding: 0 2px;
transform: none;
}
.stacked .selector-chooser li {
padding: 3px;
}
.help-tooltip,
.selector .help-icon {
display: none;
}
.datetime input {
width: 50%;
max-width: 120px;
}
.datetime span {
font-size: 0.8125rem;
}
.datetime .timezonewarning {
display: block;
font-size: 0.6875rem;
color: var(--body-quiet-color);
}
.datetimeshortcuts {
color: var(
--border-color
); /* XXX Redundant, .datetime span also sets #ccc */
}
.form-row .datetime input.vDateField,
.form-row .datetime input.vTimeField {
width: 75%;
}
.inline-group {
overflow: auto;
}
/* Messages */
ul.messagelist li {
padding: 10px 10px 10px 55px;
background-position-x: 30px;
}
/* Login */
.login #header {
padding: 15px 20px;
}
.login #site-name {
margin: 0;
}
/* GIS */
div.olMap {
max-width: calc(100vw - 30px);
max-height: 300px;
}
.olMap + .clear_features {
display: block;
margin-top: 10px;
}
/* Docs */
.module table.xfull {
width: 100%;
}
pre.literal-block {
overflow: auto;
}
}
/* Mobile */
@media (max-width: 767px) {
/* Layout */
#header,
#content {
padding: 15px;
}
div.breadcrumbs {
padding: 10px 15px;
}
/* Dashboard */
.colMS,
.colSM {
margin: 0;
}
#content-related,
.colSM #content-related {
width: 100%;
margin: 0;
}
#content-related .module {
margin-bottom: 0;
}
#content-related .module h2 {
padding: 10px 15px;
font-size: 1rem;
}
/* Changelist */
#changelist .changelist-form-container {
flex-direction: column;
}
#changelist .changelist-form-container:has(#changelist-filter) > div {
max-width: 100%;
width: 100%;
}
#toolbar {
padding: 10px;
}
#changelist-filter {
margin-left: 0;
}
.actions label {
flex: 1 1;
}
.actions select {
flex: 1 0;
width: 100%;
}
.actions span {
flex: 1 0 100%;
}
#changelist-filter {
width: 100%;
margin-top: 30px;
}
/* Forms */
.titles-and-tools {
flex-direction: column;
}
.object-tools {
margin-bottom: 10px;
}
.form-row {
padding: 15px 0;
}
.aligned .form-row,
.aligned .form-row > div {
max-width: 100vw;
}
.aligned .form-row > div {
width: calc(100vw - 30px);
}
.flex-container {
align-items: stretch;
}
textarea {
max-width: none;
}
.vURLField {
width: auto;
}
.aligned .form-row input,
.aligned .form-row select,
.aligned .form-row textarea {
flex: 1 1 auto;
max-width: 100%;
}
.aligned .checkbox-row input {
flex: 0 1 auto;
margin: 0;
}
.aligned .vCheckboxLabel {
flex: 1 0;
padding: 1px 0 0 5px;
}
.aligned p.file-upload {
font-size: 0.8125rem;
}
span.clearable-file-input {
margin-left: 15px;
}
span.clearable-file-input label {
font-size: 0.8125rem;
padding-bottom: 0;
}
form .aligned div.radiolist:not(.inline) div + div {
margin-top: 5px;
}
/* Related widget */
.related-widget-wrapper {
width: 100%;
display: flex;
align-items: flex-start;
}
.related-widget-wrapper .selector {
order: 1;
flex: 1 0 auto;
}
.related-widget-wrapper > a {
order: 2;
}
.related-widget-wrapper .radiolist ~ a {
align-self: flex-end;
}
.related-widget-wrapper > select ~ a {
align-self: center;
}
/* Selector */
.selector {
flex-direction: column;
gap: 10px 0;
}
.selector-available,
.selector-chosen {
flex: 1 1 auto;
}
.selector select {
max-height: 96px;
}
.selector ul.selector-chooser {
display: flex;
width: 60px;
height: 30px;
padding: 0 2px;
transform: none;
}
.selector ul.selector-chooser li {
float: left;
}
.selector-remove {
background-position: 0 0;
}
:enabled.selector-remove:focus,
:enabled.selector-remove:hover {
background-position: 0 -24px;
}
.selector-add {
background-position: 0 -48px;
}
:enabled.selector-add:focus,
:enabled.selector-add:hover {
background-position: 0 -72px;
}
/* Inlines */
.inline-group[data-inline-type="stacked"] .inline-related {
border: 1px solid var(--hairline-color);
border-radius: 4px;
margin-top: 15px;
overflow: auto;
}
.inline-group[data-inline-type="stacked"] .inline-related > * {
box-sizing: border-box;
}
.inline-group[data-inline-type="stacked"] .inline-related .module {
padding: 0 10px;
}
.inline-group[data-inline-type="stacked"]
.inline-related
.module
.form-row {
border-top: 1px solid var(--hairline-color);
border-bottom: none;
}
.inline-group[data-inline-type="stacked"]
.inline-related
.module
.form-row:first-child {
border-top: none;
}
.inline-group[data-inline-type="stacked"] .inline-related h3 {
padding: 10px;
border-top-width: 0;
border-bottom-width: 2px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.inline-group[data-inline-type="stacked"] .inline-related h3 .inline_label {
margin-right: auto;
}
.inline-group[data-inline-type="stacked"] .inline-related h3 span.delete {
float: none;
flex: 1 1 100%;
margin-top: 5px;
}
.inline-group[data-inline-type="stacked"]
.aligned
.form-row
> div:not([class]) {
width: 100%;
}
.inline-group[data-inline-type="stacked"] .aligned label {
width: 100%;
}
.inline-group[data-inline-type="stacked"] div.add-row {
margin-top: 15px;
border: 1px solid var(--hairline-color);
border-radius: 4px;
}
.inline-group div.add-row,
.inline-group .tabular tr.add-row td {
padding: 0;
}
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
display: block;
padding: 8px 10px 8px 26px;
background-position: 8px 9px;
}
/* Submit row */
.submit-row {
padding: 10px;
margin: 0 0 15px;
flex-direction: column;
gap: 8px;
}
.submit-row input,
.submit-row input.default,
.submit-row a {
text-align: center;
}
.submit-row a.closelink {
padding: 10px 0;
text-align: center;
}
.submit-row a.deletelink {
margin: 0;
}
/* Messages */
ul.messagelist li {
padding: 10px 10px 10px 40px;
background-position-x: 15px;
}
/* Paginator */
.paginator .this-page,
.paginator a:link,
.paginator a:visited {
padding: 4px 10px;
}
/* Login */
body.login {
padding: 0 15px;
}
.login #container {
width: auto;
max-width: 480px;
margin: 50px auto;
}
.login #header,
.login #content {
padding: 15px;
}
.login #content-main {
float: none;
}
.login .form-row {
padding: 0;
}
.login .form-row + .form-row {
margin-top: 15px;
}
.login .form-row label {
margin: 0 0 5px;
line-height: 1.2;
}
.login .submit-row {
padding: 15px 0 0;
}
.login br {
display: none;
}
.login .submit-row input {
margin: 0;
text-transform: uppercase;
}
.errornote {
margin: 0 0 20px;
padding: 8px 12px;
font-size: 0.8125rem;
}
/* Calendar and clock */
.calendarbox,
.clockbox {
position: fixed !important;
top: 50% !important;
left: 50% !important;
transform: translate(-50%, -50%);
margin: 0;
border: none;
overflow: visible;
}
.calendarbox > *,
.clockbox > * {
position: relative;
z-index: 1;
}
.calendarbox > div:first-child {
z-index: 2;
}
.calendarbox .calendar,
.clockbox h2 {
border-radius: 4px 4px 0 0;
overflow: hidden;
}
.calendarbox .calendar-cancel,
.clockbox .calendar-cancel {
border-radius: 0 0 4px 4px;
overflow: hidden;
}
.calendar-shortcuts {
padding: 10px 0;
font-size: 0.75rem;
line-height: 0.75rem;
}
.calendar-shortcuts a {
margin: 0 4px;
}
.timelist a {
background: var(--body-bg);
padding: 4px;
}
.calendar-cancel {
padding: 8px 10px;
}
.clockbox h2 {
padding: 8px 15px;
}
.calendar caption {
padding: 10px;
}
.calendarbox .calendarnav-previous,
.calendarbox .calendarnav-next {
z-index: 1;
top: 10px;
}
/* History */
table#change-history tbody th,
table#change-history tbody td {
font-size: 0.8125rem;
word-break: break-word;
}
table#change-history tbody th {
width: auto;
}
/* Docs */
table.model tbody th,
table.model tbody td {
font-size: 0.8125rem;
word-break: break-word;
}
}
+82
View File
@@ -0,0 +1,82 @@
/* TABLETS */
@media (max-width: 1024px) {
[dir="rtl"] .colMS {
margin-right: 0;
}
[dir="rtl"] #user-tools {
text-align: right;
}
[dir="rtl"] .actions label {
padding-left: 10px;
padding-right: 0;
}
[dir="rtl"] .actions select {
margin-left: 0;
margin-right: 15px;
}
[dir="rtl"] .change-list .filtered .results,
[dir="rtl"] .change-list .filtered .paginator,
[dir="rtl"] .filtered #toolbar,
[dir="rtl"] .filtered div.xfull,
[dir="rtl"] .filtered .actions,
[dir="rtl"] #changelist-filter {
margin-left: 0;
}
[dir="rtl"] .inline-group div.add-row a,
[dir="rtl"] .inline-group .tabular tr.add-row td a {
padding: 8px 26px 8px 10px;
background-position: calc(100% - 8px) 9px;
}
[dir="rtl"] .dashboard .module table td a {
padding-left: 0;
padding-right: 16px;
}
[dir="rtl"] ul.messagelist li {
padding: 10px 55px 10px 10px;
background-position-x: calc(100% - 30px);
}
}
/* MOBILE */
@media (max-width: 767px) {
[dir="rtl"] #changelist-filter {
margin-left: 0;
margin-right: 0;
}
[dir="rtl"] .aligned .vCheckboxLabel {
padding: 1px 5px 0 0;
}
[dir="rtl"] .selector-remove {
background-position: 0 0;
}
[dir="rtl"] :enabled.selector-remove:focus,
:enabled.selector-remove:hover {
background-position: 0 -24px;
}
[dir="rtl"] .selector-add {
background-position: 0 -48px;
}
[dir="rtl"] :enabled.selector-add:focus,
:enabled.selector-add:hover {
background-position: 0 -72px;
}
[dir="rtl"] ul.messagelist li {
padding: 10px 40px 10px 10px;
background-position-x: calc(100% - 15px);
}
}
+245
View File
@@ -0,0 +1,245 @@
/* GLOBAL */
th {
text-align: right;
}
.module h2,
.module caption {
text-align: right;
}
.module ul,
.module ol {
margin-left: 0;
margin-right: 1.5em;
}
.viewlink,
.addlink,
.changelink,
.hidelink {
padding-left: 0;
padding-right: 16px;
background-position-x: 100%;
}
.deletelink {
padding-left: 0;
padding-right: 16px;
background-position: 100% 1px;
}
.object-tools li + li {
margin-right: 15px;
margin-left: 0;
}
thead th:first-child,
tfoot td:first-child {
border-left: none;
}
/* LAYOUT */
#user-tools {
right: auto;
left: 0;
text-align: left;
}
div.breadcrumbs {
text-align: right;
}
#content-main {
float: right;
}
#content-related {
float: left;
margin-left: -300px;
margin-right: auto;
}
.colMS {
margin-left: 300px;
margin-right: 0;
}
/* SORTABLE TABLES */
table thead th.sorted .sortoptions {
float: left;
}
thead th.sorted .text {
padding-right: 0;
padding-left: 42px;
}
/* dashboard styles */
.dashboard .module table td a {
padding-left: 0.6em;
padding-right: 16px;
}
/* changelists styles */
.change-list .filtered table {
border-left: none;
border-right: 0px none;
}
#changelist-filter {
border-left: none;
border-right: none;
margin-left: 0;
margin-right: 30px;
}
#changelist-filter li.selected {
border-left: none;
padding-left: 10px;
margin-left: 0;
border-right: 5px solid var(--hairline-color);
padding-right: 10px;
margin-right: -15px;
}
#changelist table tbody td:first-child,
#changelist table tbody th:first-child {
border-right: none;
border-left: none;
}
.paginator ul {
margin-left: 6px;
margin-right: 0;
}
.paginator input {
margin-left: 0;
margin-right: auto;
}
/* FORMS */
form .aligned ul {
margin: 0;
}
form ul.inline li {
float: right;
padding-right: 0;
padding-left: 7px;
}
.submit-row {
text-align: right;
}
/* WIDGETS */
.calendarnav-previous {
top: 0;
left: auto;
right: 10px;
background: url(../img/calendar-icons.svg) 0 -15px no-repeat;
}
.calendarnav-next {
top: 0;
right: auto;
left: 10px;
background: url(../img/calendar-icons.svg) 0 0 no-repeat;
}
.calendar caption,
.calendarbox h2 {
text-align: center;
}
.selector {
float: right;
}
.selector .selector-filter {
text-align: right;
}
.selector-add {
background: url(../img/selector-icons.svg) 0 -96px no-repeat;
background-size: 24px auto;
}
:enabled.selector-add:focus,
:enabled.selector-add:hover {
background-position: 0 -120px;
}
.selector-remove {
background: url(../img/selector-icons.svg) 0 -144px no-repeat;
background-size: 24px auto;
}
:enabled.selector-remove:focus,
:enabled.selector-remove:hover {
background-position: 0 -168px;
}
:enabled.selector-chooseall:focus,
:enabled.selector-chooseall:hover {
background-position: 100% -144px;
}
:enabled.selector-clearall:focus,
:enabled.selector-clearall:hover {
background-position: 0 -176px;
}
.inline-deletelink {
float: left;
}
form .form-row p.datetime {
overflow: hidden;
}
.related-widget-wrapper {
float: right;
}
/* MISC */
.inline-related h2,
.inline-group h2 {
text-align: right;
}
.inline-related h3 span.delete {
padding-right: 20px;
padding-left: inherit;
left: 10px;
right: inherit;
float: left;
}
.inline-related h3 span.delete label {
margin-left: inherit;
margin-right: 2px;
}
.inline-group .tabular td.original p {
right: 0;
}
.selector .selector-chooser {
margin: 0;
}
ul.messagelist li {
padding: 10px 65px 10px 10px;
background-position-x: calc(100% - 40px);
}
@@ -0,0 +1,21 @@
/* Hide warnings fields if usable password is selected */
form:has(#id_usable_password input[value="true"]:checked) .messagelist {
display: none;
}
/* Hide password fields if unusable password is selected */
form:has(#id_usable_password input[value="false"]:checked) .field-password1,
form:has(#id_usable_password input[value="false"]:checked) .field-password2 {
display: none;
}
/* Select appropriate submit button */
form:has(#id_usable_password input[value="true"]:checked)
input[type="submit"].unset-password {
display: none;
}
form:has(#id_usable_password input[value="false"]:checked)
input[type="submit"].set-password {
display: none;
}
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+481
View File
@@ -0,0 +1,481 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle; }
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-search--inline {
float: left; }
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051; }
.select2-results {
display: block; }
.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }
.select2-container--open .select2-dropdown {
left: 0; }
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important; }
.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px;
padding: 1px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa; }
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
outline: 0; }
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right;
margin-left: 5px;
margin-right: auto; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none; }
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
.select2-container--classic .select2-dropdown--below {
border-top: none; }
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }
File diff suppressed because one or more lines are too long
+654
View File
@@ -0,0 +1,654 @@
/* SELECTOR (FILTER INTERFACE) */
.selector {
display: flex;
flex: 1;
gap: 0 10px;
}
.selector select {
height: 17.2em;
flex: 1 0 auto;
overflow: scroll;
width: 100%;
}
.selector-available,
.selector-chosen {
display: flex;
flex-direction: column;
flex: 1 1;
}
.selector-available-title,
.selector-chosen-title {
border: 1px solid var(--border-color);
border-radius: 4px 4px 0 0;
}
.selector .helptext {
font-size: 0.6875rem;
}
.selector-chosen .list-footer-display {
border: 1px solid var(--border-color);
border-top: none;
border-radius: 0 0 4px 4px;
margin: 0 0 10px;
padding: 8px;
text-align: center;
background: var(--primary);
color: var(--header-link-color);
cursor: pointer;
}
.selector-chosen .list-footer-display__clear {
color: var(--breadcrumbs-fg);
}
.selector-chosen-title {
background: var(--secondary);
color: var(--header-link-color);
padding: 8px;
}
.selector-chosen-title label {
color: var(--header-link-color);
width: 100%;
}
.selector-available-title {
background: var(--darkened-bg);
color: var(--body-quiet-color);
padding: 8px;
}
.selector-available-title label {
width: 100%;
}
.selector .selector-filter {
border: 1px solid var(--border-color);
border-width: 0 1px;
padding: 8px;
color: var(--body-quiet-color);
font-size: 0.625rem;
margin: 0;
text-align: left;
display: flex;
gap: 8px;
}
.selector .selector-filter label,
.inline-group .aligned .selector .selector-filter label {
float: left;
margin: 7px 0 0;
width: 18px;
height: 18px;
padding: 0;
overflow: hidden;
line-height: 1;
min-width: auto;
}
.selector-filter input {
flex-grow: 1;
}
.selector ul.selector-chooser {
align-self: center;
width: 30px;
background-color: var(--selected-bg);
border-radius: 10px;
margin: 0;
padding: 0;
transform: translateY(-17px);
}
.selector-chooser li {
margin: 0;
padding: 3px;
list-style-type: none;
}
.selector select {
padding: 0 10px;
margin: 0 0 10px;
border-radius: 0 0 4px 4px;
}
.selector .selector-chosen--with-filtered select {
margin: 0;
border-radius: 0;
height: 14em;
}
.selector
.selector-chosen:not(.selector-chosen--with-filtered)
.list-footer-display {
display: none;
}
.selector-add,
.selector-remove {
width: 24px;
height: 24px;
display: block;
text-indent: -3000px;
overflow: hidden;
cursor: default;
opacity: 0.55;
border: none;
}
:enabled.selector-add,
:enabled.selector-remove {
opacity: 1;
}
:enabled.selector-add:hover,
:enabled.selector-remove:hover {
cursor: pointer;
}
.selector-add {
background: url(../img/selector-icons.svg) 0 -144px no-repeat;
background-size: 24px auto;
}
:enabled.selector-add:focus,
:enabled.selector-add:hover {
background-position: 0 -168px;
}
.selector-remove {
background: url(../img/selector-icons.svg) 0 -96px no-repeat;
background-size: 24px auto;
}
:enabled.selector-remove:focus,
:enabled.selector-remove:hover {
background-position: 0 -120px;
}
.selector-chooseall,
.selector-clearall {
display: inline-block;
text-align: left;
padding: 4px 5px;
margin: 0 auto;
overflow: hidden;
color: var(--button-fg);
background-color: var(--button-bg);
text-decoration: none;
opacity: 0.55;
border: none;
border-radius: 4px;
}
:enabled.selector-chooseall:focus,
:enabled.selector-clearall:focus,
:enabled.selector-chooseall:hover,
:enabled.selector-clearall:hover {
background-color: var(--button-hover-bg);
}
:enabled.selector-chooseall,
:enabled.selector-clearall {
opacity: 1;
}
:enabled.selector-chooseall:hover,
:enabled.selector-clearall:hover {
cursor: pointer;
}
:enabled.selector-chooseall:focus,
:enabled.selector-chooseall:hover {
background-position: 100% -176px;
}
:enabled.selector-clearall:focus,
:enabled.selector-clearall:hover {
background-position: 0 -144px;
}
/* STACKED SELECTORS */
.stacked {
float: left;
width: 490px;
display: block;
}
.stacked select {
width: 480px;
height: 10.1em;
}
.stacked .selector-available,
.stacked .selector-chosen {
width: 480px;
}
.stacked .selector-available {
margin-bottom: 0;
}
.stacked .selector-available input {
width: 422px;
}
.stacked ul.selector-chooser {
display: flex;
height: 30px;
width: 64px;
margin: 0 0 10px 40%;
background-color: #eee;
border-radius: 10px;
transform: none;
}
.stacked .selector-chooser li {
float: left;
padding: 3px 3px 3px 5px;
}
.stacked .selector-chooseall,
.stacked .selector-clearall {
display: none;
}
.stacked .selector-add {
background: url(../img/selector-icons.svg) 0 -48px no-repeat;
background-size: 24px auto;
cursor: default;
}
.stacked :enabled.selector-add {
background-position: 0 -48px;
cursor: pointer;
}
.stacked :enabled.selector-add:focus,
.stacked :enabled.selector-add:hover {
background-position: 0 -72px;
cursor: pointer;
}
.stacked .selector-remove {
background: url(../img/selector-icons.svg) 0 0 no-repeat;
background-size: 24px auto;
cursor: default;
}
.stacked :enabled.selector-remove {
background-position: 0 0px;
cursor: pointer;
}
.stacked :enabled.selector-remove:focus,
.stacked :enabled.selector-remove:hover {
background-position: 0 -24px;
cursor: pointer;
}
.selector .help-icon {
background: url(../img/icon-unknown.svg) 0 0 no-repeat;
display: inline-block;
vertical-align: middle;
margin: -2px 0 0 2px;
width: 13px;
height: 13px;
}
.selector .selector-chosen .help-icon {
background: url(../img/icon-unknown-alt.svg) 0 0 no-repeat;
}
.selector .search-label-icon {
background: url(../img/search.svg) 0 0 no-repeat;
display: inline-block;
height: 1.125rem;
width: 1.125rem;
}
/* DATE AND TIME */
p.datetime {
line-height: 20px;
margin: 0;
padding: 0;
color: var(--body-quiet-color);
font-weight: bold;
}
p.datetime label {
display: block;
padding: 0.5rem 0;
}
.datetime span {
white-space: nowrap;
font-weight: normal;
font-size: 0.6875rem;
color: var(--body-quiet-color);
}
.datetime input,
.form-row .datetime input.vDateField,
.form-row .datetime input.vTimeField {
margin-bottom: 4px;
}
table p.datetime {
font-size: 0.6875rem;
margin-left: 0;
padding-left: 0;
}
.datetimeshortcuts button {
border: none;
background: none;
padding: 0;
cursor: pointer;
}
.datetimeshortcuts .clock-icon,
.datetimeshortcuts .date-icon {
position: relative;
display: inline-block;
vertical-align: middle;
height: 24px;
width: 24px;
overflow: hidden;
}
.datetimeshortcuts .clock-icon {
background: url(../img/icon-clock.svg) 0 0 no-repeat;
background-size: 24px auto;
}
.datetimeshortcuts button:focus .clock-icon,
.datetimeshortcuts button:hover .clock-icon {
background-position: 0 -24px;
}
.datetimeshortcuts .date-icon {
background: url(../img/icon-calendar.svg) 0 0 no-repeat;
background-size: 24px auto;
top: -1px;
}
.datetimeshortcuts button:focus .date-icon,
.datetimeshortcuts button:hover .date-icon {
background-position: 0 -24px;
}
.timezonewarning {
font-size: 0.6875rem;
color: var(--body-quiet-color);
}
/* URL */
p.url {
line-height: 20px;
margin: 0;
padding: 0;
color: var(--body-quiet-color);
font-size: 0.6875rem;
font-weight: bold;
}
.url a {
font-weight: normal;
}
/* FILE UPLOADS */
p.file-upload {
line-height: 20px;
margin: 0;
padding: 0;
color: var(--body-quiet-color);
font-size: 0.6875rem;
font-weight: bold;
}
.file-upload a {
font-weight: normal;
}
.file-upload .deletelink {
margin-left: 5px;
}
span.clearable-file-input label {
color: var(--body-fg);
font-size: 0.6875rem;
display: inline;
float: none;
}
/* CALENDARS & CLOCKS */
.calendarbox,
.clockbox {
margin: 0;
padding: 0;
font-size: 0.75rem;
width: 19em;
text-align: center;
background: var(--body-bg);
color: var(--body-fg);
border: 1px solid var(--hairline-color);
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
overflow: hidden;
position: absolute;
}
.calendarbox::backdrop,
.clockbox::backdrop {
background: rgba(0, 0, 0, 0.75);
}
.calendar {
margin: 0;
padding: 0;
}
.calendar table {
margin: 0;
padding: 0;
border-collapse: collapse;
background: white;
width: 100%;
}
.calendar caption,
.calendarbox h2 {
margin: 0;
text-align: center;
border-top: none;
font-weight: 700;
font-size: 0.75rem;
color: #333;
background: var(--accent);
}
.calendar th {
padding: 8px 5px;
background: var(--darkened-bg);
border-bottom: 1px solid var(--border-color);
font-weight: 400;
font-size: 0.75rem;
text-align: center;
color: var(--body-quiet-color);
}
.calendar td {
font-weight: 400;
font-size: 0.75rem;
text-align: center;
padding: 0;
border-top: 1px solid var(--hairline-color);
border-bottom: none;
}
.calendar td.selected a {
background: var(--secondary);
color: var(--button-fg);
}
.calendar td.nonday {
background: var(--darkened-bg);
}
.calendar td.today a {
font-weight: 700;
}
.calendar td a,
.timelist a {
display: block;
font-weight: 400;
padding: 6px;
text-decoration: none;
color: var(--body-quiet-color);
}
.calendar td a:focus,
.timelist a:focus,
.calendar td a:hover,
.timelist a:hover {
background: var(--primary);
color: white;
}
.calendar td a:active,
.timelist a:active {
background: var(--header-bg);
color: white;
}
.calendarnav {
font-size: 0.625rem;
text-align: center;
color: #ccc;
margin: 0;
padding: 1px 3px;
}
.calendarnav a:link,
#calendarnav a:visited,
#calendarnav a:focus,
#calendarnav a:hover {
color: var(--body-quiet-color);
}
.calendar-shortcuts {
background: var(--body-bg);
color: var(--body-quiet-color);
font-size: 0.6875rem;
line-height: 0.6875rem;
border-top: 1px solid var(--hairline-color);
padding: 8px 0;
}
.calendarbox .calendarnav-previous,
.calendarbox .calendarnav-next {
display: block;
position: absolute;
top: 8px;
width: 15px;
height: 15px;
text-indent: -9999px;
padding: 0;
}
.calendarnav-previous {
left: 10px;
background: url(../img/calendar-icons.svg) 0 0 no-repeat;
}
.calendarnav-next {
right: 10px;
background: url(../img/calendar-icons.svg) 0 -15px no-repeat;
}
.calendar-cancel {
margin: 0;
padding: 4px 0;
font-size: 0.75rem;
background: var(--close-button-bg);
border-top: 1px solid var(--border-color);
color: var(--button-fg);
}
.calendar-cancel:focus,
.calendar-cancel:hover {
background: var(--close-button-hover-bg);
}
.calendar-cancel a {
color: var(--button-fg);
display: block;
}
ul.timelist,
.timelist li {
list-style-type: none;
margin: 0;
padding: 0;
}
.timelist a {
padding: 2px;
}
/* EDIT INLINE */
.inline-deletelink {
float: right;
text-indent: -9999px;
background: url(../img/inline-delete.svg) center center no-repeat;
background-size: contain;
width: 1.5rem;
height: 1.5rem;
border: 0px none;
margin-bottom: 0.25rem;
}
.inline-deletelink:focus,
.inline-deletelink:hover {
cursor: pointer;
}
/* RELATED WIDGET WRAPPER */
.related-widget-wrapper {
display: flex;
gap: 0 10px;
flex-grow: 1;
flex-wrap: wrap;
margin-bottom: 5px;
}
.related-widget-wrapper:has(select:not([multiple])) {
align-items: center;
}
.related-widget-wrapper-link {
opacity: 0.6;
filter: grayscale(1);
}
.related-widget-wrapper-link:link {
opacity: 1;
filter: grayscale(0);
}
/* GIS MAPS */
.dj_map {
width: 600px;
height: 400px;
}
+80
View File
@@ -0,0 +1,80 @@
# Information about icons in this directory
## License
All icons in this directory are provided by
[Font Awesome Free](https://fontawesome.com), version 6.7.2.
- The icons are licensed under the [Creative Commons Attribution 4.0
International (CC-BY-4.0)](https://creativecommons.org/licenses/by/4.0/)
license.
- This license allows you to use, modify, and distribute the icons, provided
proper attribution is given.
## Usage
- You may use, modify, and distribute the icons in this repository in
compliance with the [Creative Commons Attribution 4.0 International
(CC-BY-4.0)](https://creativecommons.org/licenses/by/4.0/) license.
## Modifications
- These icons have been resized, recolored, or otherwise modified to fit the
requirements of this project.
- These modifications alter the appearance of the original icons but remain
covered under the terms of the
[CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license.
## Contributing SVG Icons
To ensure visual consistency, traceability, and proper license attribution,
follow these guidelines. This applies when adding or modifying icons.
## ⚠️ Important: Changing Font Awesome Version
If you update to a different Font Awesome version, you must **update all SVG
files** and **comments inside the files** to reflect the new version number and
licensing URL accordingly. For example:
* Original:
```xml
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
```
* Updated:
```xml
<!--!Font Awesome Free X.Y.Z by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright YYYY Fonticons, Inc.-->
```
## Adding a new icon
1. Use only [Font Awesome Free Icons](https://fontawesome.com/icons).
2. Save the icon as an .svg file in this directory.
3. Include the following attribution comment at the top of the file (do not
change it):
```xml
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
```
4. Right before the `<path>` element, add the following metadata comment with
the appropriate values:
```xml
<!--
Icon Name: [icon-name]
Icon Family: [classic | sharp | brands | etc.]
Icon Style: [solid | regular | light | thin | duotone | etc.]
-->
```
### Example SVG Structure
```xml
<svg width="13" height="13" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<!--
Icon Name: plus
Icon Family: classic
Icon Style: solid
-->
<path fill="#5fa225" stroke="#5fa225" stroke-width="30" d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/>
</svg>
```
+44
View File
@@ -0,0 +1,44 @@
<svg
width="15"
height="30"
viewBox="0 0 512 1024"
version="1.1"
id="svg5"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<defs id="defs2">
<g id="previous">
<!--
Icon Name: circle-chevron-left
Icon Family: classic
Icon Style: solid
-->
<path
d="M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"
id="path2" />
</g>
<g id="next">
<!--
Icon Name: circle-chevron-right
Icon Family: classic
Icon Style: solid
-->
<path
d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"
id="path1" />
</g>
</defs>
<use
xlink:href="#next"
x="0"
y="512"
fill="#000000"
id="use5" />
<use
xlink:href="#previous"
x="0"
y="0"
fill="#333333"
id="use2" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

+9
View File
@@ -0,0 +1,9 @@
<svg width="13" height="13" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<!--
Icon Name: plus
Icon Family: classic
Icon Style: solid
-->
<path fill="#5fa225" stroke="#5fa225" stroke-width="30" d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/>
</svg>

After

Width:  |  Height:  |  Size: 593 B

@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="14" height="14">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<!--
Icon Name: triangle-exclamation
Icon Family: classic
Icon Style: solid
-->
<path fill="#efb80b" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/>
</svg>

After

Width:  |  Height:  |  Size: 684 B

+9
View File
@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="14" height="14">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<!--
Icon Name: triangle-exclamation
Icon Family: classic
Icon Style: solid
-->
<path fill="#b78b02" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/>
</svg>

After

Width:  |  Height:  |  Size: 684 B

+15
View File
@@ -0,0 +1,15 @@
<svg width="16" height="32" viewBox="0 0 448 1024" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<defs>
<g id="icon">
<!--
Icon Name: calendar-days
Icon Family: classic
Icon Style: regular
-->
<path d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L64 64C28.7 64 0 92.7 0 128l0 16 0 48L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256 0-48 0-16c0-35.3-28.7-64-64-64l-40 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM48 192l80 0 0 56-80 0 0-56zm0 104l80 0 0 64-80 0 0-64zm128 0l96 0 0 64-96 0 0-64zm144 0l80 0 0 64-80 0 0-64zm80-48l-80 0 0-56 80 0 0 56zm0 160l0 40c0 8.8-7.2 16-16 16l-64 0 0-56 80 0zm-128 0l0 56-96 0 0-56 96 0zm-144 0l0 56-64 0c-8.8 0-16-7.2-16-16l0-40 80 0zM272 248l-96 0 0-56 96 0 0 56z"/>
</g>
</defs>
<use xlink:href="#icon" x="0" y="0" fill="#447e9b" />
<use xlink:href="#icon" x="0" y="512" fill="#003366" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,9 @@
<svg width="13" height="13" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<!--
Icon Name: pencil
Icon Family: classic
Icon Style: solid
-->
<path fill="#b48c08" d="M410.3 231l11.3-11.3-33.9-33.9-62.1-62.1L291.7 89.8l-11.3 11.3-22.6 22.6L58.6 322.9c-10.4 10.4-18 23.3-22.2 37.4L1 480.7c-2.5 8.4-.2 17.5 6.1 23.7s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L387.7 253.7 410.3 231zM160 399.4l-9.1 22.7c-4 3.1-8.5 5.4-13.3 6.9L59.4 452l23-78.1c1.4-4.9 3.8-9.4 6.9-13.3l22.7-9.1 0 32c0 8.8 7.2 16 16 16l32 0zM362.7 18.7L348.3 33.2 325.7 55.8 314.3 67.1l33.9 33.9 62.1 62.1 33.9 33.9 11.3-11.3 22.6-22.6 14.5-14.5c25-25 25-65.5 0-90.5L453.3 18.7c-25-25-65.5-25-90.5 0zm-47.4 168l-144 144c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l144-144c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"/>
</svg>

After

Width:  |  Height:  |  Size: 978 B

+15
View File
@@ -0,0 +1,15 @@
<svg width="16" height="32" viewBox="0 0 512 1024" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<defs>
<g id="icon">
<!--
Icon Name: clock
Icon Family: classic
Icon Style: regular
-->
<path d="M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/>
</g>
</defs>
<use xlink:href="#icon" x="0" y="0" fill="#447e9b"/>
<use xlink:href="#icon" x="0" y="512" fill="#003366" />
</svg>

After

Width:  |  Height:  |  Size: 805 B

@@ -0,0 +1,9 @@
<svg width="13" height="13" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. -->
<!--
Icon Name: bug
Icon Family: classic
Icon Style: solid
-->
<path fill="#bfbfbf" d="M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+9
View File
@@ -0,0 +1,9 @@
<svg width="13" height="13" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. -->
<!--
Icon Name: bug
Icon Family: classic
Icon Style: solid
-->
<path fill="#808080" d="M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+11
View File
@@ -0,0 +1,11 @@
<svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<g>
<!--
Icon Name: xmark
Icon Family: classic
Icon Style: solid
-->
<path fill="#dd4646" stroke="#dd4646" stroke-width="30" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 707 B

Some files were not shown because too many files have changed in this diff Show More