latest changes
This commit is contained in:
@@ -9,6 +9,7 @@ import "../styles/components/manual-report-structure.scss";
|
||||
import "../styles/theme.scss";
|
||||
import "../scripts/theme.js";
|
||||
import "../scripts/manual-report.js";
|
||||
import "../scripts/field-notes-dialog.js";
|
||||
import "../scripts/audio-upload.js";
|
||||
import "../scripts/event-map.js";
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
const notesToggle = document.querySelector("#field-notes-toggle");
|
||||
const notesDialog = document.querySelector("#field-notes-dialog");
|
||||
const notesClose = document.querySelector("#field-notes-close");
|
||||
|
||||
if (notesToggle && notesDialog && notesClose) {
|
||||
notesToggle.addEventListener("click", () => notesDialog.showModal());
|
||||
notesClose.addEventListener("click", () => notesDialog.close());
|
||||
notesDialog.addEventListener("close", () => notesToggle.focus());
|
||||
notesDialog.addEventListener("htmx:afterSwap", () => {
|
||||
if (!notesDialog.open) return;
|
||||
const feedback = notesDialog.querySelector(".field-notes .errorlist, .field-notes [role='status']");
|
||||
if (feedback) {
|
||||
feedback.tabIndex = -1;
|
||||
feedback.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -19,3 +19,78 @@
|
||||
.errorlist { color: #f28c96; }
|
||||
@media (max-width: 650px) { &__fields { grid-template-columns: 1fr; } }
|
||||
}
|
||||
|
||||
.field-notes-trigger {
|
||||
position: absolute !important;
|
||||
z-index: 2;
|
||||
top: clamp(1.35rem, 4vw, 2.4rem);
|
||||
right: clamp(1.35rem, 4vw, 2.4rem);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
padding: .55rem;
|
||||
border: 1px solid #a985b5;
|
||||
border-radius: .8rem;
|
||||
color: #f5f0ff;
|
||||
background: #302553;
|
||||
box-shadow: 0 .3rem 1rem #08071766;
|
||||
cursor: pointer;
|
||||
svg { width: 100%; height: 100%; }
|
||||
&:focus-visible { outline: 3px solid #c9b4ff; outline-offset: 3px; }
|
||||
}
|
||||
|
||||
.field-notes-dialog {
|
||||
position: fixed !important;
|
||||
box-sizing: border-box;
|
||||
width: min(42rem, calc(100vw - 2rem));
|
||||
max-width: none;
|
||||
max-height: calc(100dvh - 2rem);
|
||||
margin: auto;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
border: 1px solid var(--theme-line);
|
||||
border-radius: 1rem;
|
||||
color: var(--theme-ink);
|
||||
background: var(--theme-surface);
|
||||
box-shadow: 0 1.5rem 5rem #020616aa;
|
||||
&::backdrop { background: #050a19bb; backdrop-filter: blur(3px); }
|
||||
.field-notes { margin: 0; padding: 0; border: 0; background: transparent; }
|
||||
.field-notes h2 { margin-top: 0; }
|
||||
}
|
||||
|
||||
.field-notes-dialog__toolbar {
|
||||
position: sticky;
|
||||
top: -1rem;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: .25rem;
|
||||
padding: .25rem 0;
|
||||
background: var(--theme-surface);
|
||||
button {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
padding: 0;
|
||||
border: 1px solid var(--theme-line);
|
||||
border-radius: .6rem;
|
||||
color: var(--theme-ink);
|
||||
background: var(--theme-surface-raised);
|
||||
font: inherit;
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
&:focus-visible { outline: 3px solid #789eff; outline-offset: 3px; }
|
||||
}
|
||||
}
|
||||
|
||||
.field-notes-dialog__signin { padding: 0 .25rem .5rem; }
|
||||
.field-notes-dialog__signin h2 { margin: 0 0 .5rem; }
|
||||
.field-notes-dialog__signin a { color: var(--theme-ink); }
|
||||
|
||||
@media (max-width: 30rem) {
|
||||
.field-notes-trigger { top: .8rem; right: .8rem; }
|
||||
.dashboard-report .manual-report__heading-row { margin-top: .75rem; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user