manual submission redesign phase H - finetuning mobile
This commit is contained in:
Binary file not shown.
@@ -102,9 +102,19 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const showCapturedDirection = (heading, accuracy) => {
|
const showCapturedDirection = (heading, accuracy) => {
|
||||||
const accuracyText = accuracy === null ? (t.accuracyUnavailable || "Accuracy unavailable") : (t.accuracy || "Accuracy") + ": ±" + displayDegrees(accuracy) + "°";
|
|
||||||
const status = directionStatus();
|
const status = directionStatus();
|
||||||
if (status) status.innerHTML = "<strong>" + cardinalDirection(heading) + " · " + displayDegrees(heading) + "°</strong><br>" + accuracyText;
|
if (status) {
|
||||||
|
status.classList.toggle("manual-direction-panel__status--accuracy", accuracy !== null);
|
||||||
|
if (accuracy === null) {
|
||||||
|
status.textContent = t.accuracyUnavailable || "Accuracy unavailable";
|
||||||
|
} else {
|
||||||
|
const label = document.createElement("span");
|
||||||
|
label.textContent = t.accuracy || "Accuracy";
|
||||||
|
const value = document.createElement("strong");
|
||||||
|
value.textContent = `±${displayDegrees(accuracy)}°`;
|
||||||
|
status.replaceChildren(label, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
const button = captureDirectionButton();
|
const button = captureDirectionButton();
|
||||||
if (button) button.textContent = (t.stopCapture || "Stop measuring direction");
|
if (button) button.textContent = (t.stopCapture || "Stop measuring direction");
|
||||||
};
|
};
|
||||||
@@ -150,6 +160,7 @@
|
|||||||
if (directionPanel()) directionPanel().dataset.state = directionDegrees.value ? "captured" : "ready";
|
if (directionPanel()) directionPanel().dataset.state = directionDegrees.value ? "captured" : "ready";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
directionStatus()?.classList.remove("manual-direction-panel__status--accuracy");
|
||||||
if (!window.isSecureContext) {
|
if (!window.isSecureContext) {
|
||||||
directionStatus().textContent = (t.secureCompass || "Compass capture requires a secure HTTPS connection.");
|
directionStatus().textContent = (t.secureCompass || "Compass capture requires a secure HTTPS connection.");
|
||||||
if (directionPanel()) directionPanel().dataset.state = "unavailable";
|
if (directionPanel()) directionPanel().dataset.state = "unavailable";
|
||||||
|
|||||||
@@ -52,6 +52,8 @@
|
|||||||
|
|
||||||
.manual-direction-panel__topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
|
.manual-direction-panel__topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
|
||||||
.manual-direction-panel__summary { margin: .35rem 0 .8rem; color: #f5f0ff; font-weight: 700; }
|
.manual-direction-panel__summary { margin: .35rem 0 .8rem; color: #f5f0ff; font-weight: 700; }
|
||||||
|
.manual-report .manual-direction-panel__status--accuracy { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .75rem 0; padding: .55rem .75rem; border: 1px solid #5d4d92; border-radius: .7rem; color: #d9cfee; background: #191630; font-size: .85rem; }
|
||||||
|
.manual-direction-panel__status--accuracy strong { color: #f5edff; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||||
.manual-direction-panel__open, .manual-direction-panel__close { min-height: 2.75rem; border: 1px solid #8d77d2; border-radius: .7rem; color: #e8dcff; font: inherit; font-weight: 750; background: #302553; cursor: pointer; }
|
.manual-direction-panel__open, .manual-direction-panel__close { min-height: 2.75rem; border: 1px solid #8d77d2; border-radius: .7rem; color: #e8dcff; font: inherit; font-weight: 750; background: #302553; cursor: pointer; }
|
||||||
.manual-direction-panel__open { padding: .5rem .85rem; }
|
.manual-direction-panel__open { padding: .5rem .85rem; }
|
||||||
.manual-direction-panel__close { min-width: 2.75rem; font-size: 1.4rem; }
|
.manual-direction-panel__close { min-width: 2.75rem; font-size: 1.4rem; }
|
||||||
@@ -102,6 +104,8 @@
|
|||||||
:root[data-theme="light"] .manual-direction-panel__open,
|
:root[data-theme="light"] .manual-direction-panel__open,
|
||||||
:root[data-theme="light"] .manual-direction-panel__close { color: #321d42; border-color: #b68bb5; background: #ead2eb; }
|
:root[data-theme="light"] .manual-direction-panel__close { color: #321d42; border-color: #b68bb5; background: #ead2eb; }
|
||||||
:root[data-theme="light"] .manual-direction-panel__summary { color: #321d42; }
|
:root[data-theme="light"] .manual-direction-panel__summary { color: #321d42; }
|
||||||
|
:root[data-theme="light"] .manual-report .manual-direction-panel__status--accuracy { border-color: #cfaad1; color: #694b68; background: #fff8fb; }
|
||||||
|
:root[data-theme="light"] .manual-direction-panel__status--accuracy strong { color: #321d42; }
|
||||||
:root[data-theme="light"] .manual-submission { border-color: #54a67b; color: #164d34; background: #e8fff2; }
|
:root[data-theme="light"] .manual-submission { border-color: #54a67b; color: #164d34; background: #e8fff2; }
|
||||||
:root[data-theme="light"] .manual-submission__icon { color: #fff; }
|
:root[data-theme="light"] .manual-submission__icon { color: #fff; }
|
||||||
:root[data-theme="light"] .manual-submission__summary { color: #2b6b48; }
|
:root[data-theme="light"] .manual-submission__summary { color: #2b6b48; }
|
||||||
@@ -120,6 +124,7 @@
|
|||||||
body:not(.dashboard-page) { padding: max(1rem, env(safe-area-inset-top, 0px)) max(.5rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(.5rem, env(safe-area-inset-left, 0px)); }
|
body:not(.dashboard-page) { padding: max(1rem, env(safe-area-inset-top, 0px)) max(.5rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(.5rem, env(safe-area-inset-left, 0px)); }
|
||||||
.home-grid .manual-report, .dashboard-report, .dashboard-report .manual-report { overflow: visible; }
|
.home-grid .manual-report, .dashboard-report, .dashboard-report .manual-report { overflow: visible; }
|
||||||
.manual-report { padding: 1.25rem; }
|
.manual-report { padding: 1.25rem; }
|
||||||
|
.dashboard-report .manual-report { padding: 0; }
|
||||||
.manual-report__header { padding-right: 2.5rem; }
|
.manual-report__header { padding-right: 2.5rem; }
|
||||||
.manual-report form { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
|
.manual-report form { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
|
||||||
.manual-report #manual-submit {
|
.manual-report #manual-submit {
|
||||||
|
|||||||
@@ -40,17 +40,20 @@ test("compass stays hidden until permission and a heading, then rotates and hide
|
|||||||
assert.equal(compass.hidden, true);
|
assert.equal(compass.hidden, true);
|
||||||
resolvePermission("granted");
|
resolvePermission("granted");
|
||||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
const reading = (heading) => {
|
const reading = (heading, accuracy) => {
|
||||||
const event = new window.Event("deviceorientation");
|
const event = new window.Event("deviceorientation");
|
||||||
Object.defineProperty(event, "webkitCompassHeading", { value: heading });
|
Object.defineProperty(event, "webkitCompassHeading", { value: heading });
|
||||||
|
if (accuracy !== undefined) Object.defineProperty(event, "webkitCompassAccuracy", { value: accuracy });
|
||||||
window.dispatchEvent(event);
|
window.dispatchEvent(event);
|
||||||
};
|
};
|
||||||
reading(359);
|
reading(359);
|
||||||
assert.equal(compass.hidden, false);
|
assert.equal(compass.hidden, false);
|
||||||
assert.equal(rose.style.transform, "rotate(-359deg)");
|
assert.equal(rose.style.transform, "rotate(-359deg)");
|
||||||
reading(1);
|
reading(1, 14.8);
|
||||||
assert.equal(rose.style.transform, "rotate(-361deg)");
|
assert.equal(rose.style.transform, "rotate(-361deg)");
|
||||||
assert.equal(window.document.querySelector("#manual-direction-degrees").value, "1");
|
assert.equal(window.document.querySelector("#manual-direction-degrees").value, "1");
|
||||||
|
assert.equal(window.document.querySelector("#manual-compass-heading").textContent, "1° · North");
|
||||||
|
assert.equal(window.document.querySelector("#manual-direction-status").textContent, "Accuracy±14.8°");
|
||||||
button.click();
|
button.click();
|
||||||
assert.equal(compass.hidden, true);
|
assert.equal(compass.hidden, true);
|
||||||
window.document.querySelector("#manual-increase").click();
|
window.document.querySelector("#manual-increase").click();
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/* empty css */import"./fireworks-home.js-BqdOneRR.js";import"./map.js-BLPiBo7S.js";import"../../../manual-report-bYlgqJxG.js";import"../../../theme-DXAi27ON.js";
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* empty css */import"./fireworks-home.js-BqdOneRR.js";import"./map.js-BLPiBo7S.js";import"../../../manual-report-BzxXipwD.js";import"../../../theme-DXAi27ON.js";
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import"../../../manual-report-BzxXipwD.js";import"../../../theme-DXAi27ON.js";
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import"../../../manual-report-bYlgqJxG.js";import"../../../theme-DXAi27ON.js";
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user