Spaces:
Running
Running
Update capabilities.html
Browse files- capabilities.html +36 -26
capabilities.html
CHANGED
|
@@ -404,7 +404,6 @@
|
|
| 404 |
</button>
|
| 405 |
</div>
|
| 406 |
|
| 407 |
-
<!-- Inline feedback (replaces alert) -->
|
| 408 |
<div id="access-feedback"
|
| 409 |
class="hidden mb-4 rounded-lg border border-gray-800 bg-black/25 px-4 py-3 text-sm"
|
| 410 |
role="status" aria-live="polite"></div>
|
|
@@ -530,24 +529,33 @@
|
|
| 530 |
|
| 531 |
<script>
|
| 532 |
/* -------------------------------------------------------------
|
| 533 |
-
VANTA BACKGROUND
|
| 534 |
------------------------------------------------------------- */
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 549 |
});
|
| 550 |
-
window.addEventListener('resize', () => vantaEffect.resize());
|
| 551 |
|
| 552 |
/* -------------------------------------------------------------
|
| 553 |
MODAL HELPERS (focus trap + restore opener focus)
|
|
@@ -580,7 +588,7 @@
|
|
| 580 |
|
| 581 |
const toggleModal = (modal, show) => {
|
| 582 |
if (show) {
|
| 583 |
-
modal._opener = document.activeElement;
|
| 584 |
modal.classList.remove('modal-hidden');
|
| 585 |
modal.classList.add('modal-visible');
|
| 586 |
document.body.style.overflow = 'hidden';
|
|
@@ -598,8 +606,8 @@
|
|
| 598 |
};
|
| 599 |
|
| 600 |
/* -------------------------------------------------------------
|
| 601 |
-
ACCESS MODAL + INLINE FEEDBACK
|
| 602 |
-
|
| 603 |
const accessModal = document.getElementById('access-modal');
|
| 604 |
const accessBtn = document.getElementById('access-btn');
|
| 605 |
const closeAccessModal = document.getElementById('close-access-modal');
|
|
@@ -607,7 +615,6 @@
|
|
| 607 |
const accessFeedback = document.getElementById('access-feedback');
|
| 608 |
|
| 609 |
function setAccessFeedback(kind, text) {
|
| 610 |
-
// kind: 'error' | 'success' | 'info'
|
| 611 |
accessFeedback.classList.remove('hidden');
|
| 612 |
accessFeedback.classList.remove('border-red-500/30', 'bg-red-900/10', 'text-red-200');
|
| 613 |
accessFeedback.classList.remove('border-emerald-500/30', 'bg-emerald-900/10', 'text-emerald-200');
|
|
@@ -698,6 +705,7 @@
|
|
| 698 |
DOSSIERS
|
| 699 |
+ Hash deep-linking (#mcap, #chai, etc.)
|
| 700 |
+ Active-card state (aria-pressed)
|
|
|
|
| 701 |
------------------------------------------------------------- */
|
| 702 |
const DOSSIERS = {
|
| 703 |
mcap: {
|
|
@@ -815,7 +823,6 @@
|
|
| 815 |
const isMatch = btn.getAttribute('data-dossier') === key;
|
| 816 |
btn.classList.toggle('is-active', isMatch);
|
| 817 |
btn.setAttribute('aria-pressed', String(isMatch));
|
| 818 |
-
btn.removeAttribute('aria-current');
|
| 819 |
});
|
| 820 |
}
|
| 821 |
|
|
@@ -866,9 +873,7 @@
|
|
| 866 |
|
| 867 |
if (!opts.replaceHash) {
|
| 868 |
const isSmall = window.matchMedia && window.matchMedia('(max-width: 1023px)').matches;
|
| 869 |
-
if (isSmall) {
|
| 870 |
-
dossierTitle.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| 871 |
-
}
|
| 872 |
}
|
| 873 |
}
|
| 874 |
|
|
@@ -893,8 +898,13 @@
|
|
| 893 |
}
|
| 894 |
});
|
| 895 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 896 |
/* -------------------------------------------------------------
|
| 897 |
-
GLOBAL ESC BEHAVIOR
|
| 898 |
------------------------------------------------------------- */
|
| 899 |
document.addEventListener('keydown', (e) => {
|
| 900 |
if (e.key === 'Escape') {
|
|
|
|
| 404 |
</button>
|
| 405 |
</div>
|
| 406 |
|
|
|
|
| 407 |
<div id="access-feedback"
|
| 408 |
class="hidden mb-4 rounded-lg border border-gray-800 bg-black/25 px-4 py-3 text-sm"
|
| 409 |
role="status" aria-live="polite"></div>
|
|
|
|
| 529 |
|
| 530 |
<script>
|
| 531 |
/* -------------------------------------------------------------
|
| 532 |
+
VANTA BACKGROUND (guarded)
|
| 533 |
------------------------------------------------------------- */
|
| 534 |
+
let vantaEffect = null;
|
| 535 |
+
try {
|
| 536 |
+
if (window.VANTA && typeof VANTA.NET === 'function') {
|
| 537 |
+
vantaEffect = VANTA.NET({
|
| 538 |
+
el: "#vanta-bg",
|
| 539 |
+
mouseControls: true,
|
| 540 |
+
touchControls: true,
|
| 541 |
+
gyroControls: false,
|
| 542 |
+
minHeight: 200.00,
|
| 543 |
+
minWidth: 200.00,
|
| 544 |
+
scale: 1.00,
|
| 545 |
+
scaleMobile: 1.00,
|
| 546 |
+
color: 0x4f46e5,
|
| 547 |
+
backgroundColor: 0x020617,
|
| 548 |
+
points: 12.00,
|
| 549 |
+
maxDistance: 20.00,
|
| 550 |
+
spacing: 15.00
|
| 551 |
+
});
|
| 552 |
+
}
|
| 553 |
+
} catch (_) {
|
| 554 |
+
vantaEffect = null;
|
| 555 |
+
}
|
| 556 |
+
window.addEventListener('resize', () => {
|
| 557 |
+
if (vantaEffect && typeof vantaEffect.resize === 'function') vantaEffect.resize();
|
| 558 |
});
|
|
|
|
| 559 |
|
| 560 |
/* -------------------------------------------------------------
|
| 561 |
MODAL HELPERS (focus trap + restore opener focus)
|
|
|
|
| 588 |
|
| 589 |
const toggleModal = (modal, show) => {
|
| 590 |
if (show) {
|
| 591 |
+
modal._opener = document.activeElement;
|
| 592 |
modal.classList.remove('modal-hidden');
|
| 593 |
modal.classList.add('modal-visible');
|
| 594 |
document.body.style.overflow = 'hidden';
|
|
|
|
| 606 |
};
|
| 607 |
|
| 608 |
/* -------------------------------------------------------------
|
| 609 |
+
ACCESS MODAL + INLINE FEEDBACK
|
| 610 |
+
------------------------------------------------------------- */
|
| 611 |
const accessModal = document.getElementById('access-modal');
|
| 612 |
const accessBtn = document.getElementById('access-btn');
|
| 613 |
const closeAccessModal = document.getElementById('close-access-modal');
|
|
|
|
| 615 |
const accessFeedback = document.getElementById('access-feedback');
|
| 616 |
|
| 617 |
function setAccessFeedback(kind, text) {
|
|
|
|
| 618 |
accessFeedback.classList.remove('hidden');
|
| 619 |
accessFeedback.classList.remove('border-red-500/30', 'bg-red-900/10', 'text-red-200');
|
| 620 |
accessFeedback.classList.remove('border-emerald-500/30', 'bg-emerald-900/10', 'text-emerald-200');
|
|
|
|
| 705 |
DOSSIERS
|
| 706 |
+ Hash deep-linking (#mcap, #chai, etc.)
|
| 707 |
+ Active-card state (aria-pressed)
|
| 708 |
+
+ popstate handling for back/forward reliability
|
| 709 |
------------------------------------------------------------- */
|
| 710 |
const DOSSIERS = {
|
| 711 |
mcap: {
|
|
|
|
| 823 |
const isMatch = btn.getAttribute('data-dossier') === key;
|
| 824 |
btn.classList.toggle('is-active', isMatch);
|
| 825 |
btn.setAttribute('aria-pressed', String(isMatch));
|
|
|
|
| 826 |
});
|
| 827 |
}
|
| 828 |
|
|
|
|
| 873 |
|
| 874 |
if (!opts.replaceHash) {
|
| 875 |
const isSmall = window.matchMedia && window.matchMedia('(max-width: 1023px)').matches;
|
| 876 |
+
if (isSmall) dossierTitle.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
|
|
|
|
|
| 877 |
}
|
| 878 |
}
|
| 879 |
|
|
|
|
| 898 |
}
|
| 899 |
});
|
| 900 |
|
| 901 |
+
window.addEventListener('popstate', () => {
|
| 902 |
+
const keyFromHash = normalizeHashToKey() || 'mcap';
|
| 903 |
+
renderDossier(keyFromHash, { setHash: false, replaceHash: false, setActive: true });
|
| 904 |
+
});
|
| 905 |
+
|
| 906 |
/* -------------------------------------------------------------
|
| 907 |
+
GLOBAL ESC BEHAVIOR
|
| 908 |
------------------------------------------------------------- */
|
| 909 |
document.addEventListener('keydown', (e) => {
|
| 910 |
if (e.key === 'Escape') {
|