Added contextual content to the web app, some aesthetic improvements

This commit is contained in:
Nathan Schneider
2025-12-02 22:28:15 -07:00
parent f123db6faf
commit 912e209b80
8 changed files with 305 additions and 257 deletions

View File

@@ -0,0 +1,146 @@
<script lang="ts">
export let isOpen = false;
function closeModal() {
isOpen = false;
}
function handleKeyDown(e: KeyboardEvent) {
if (e.key === 'Escape') {
closeModal();
}
}
</script>
<svelte:window on:keydown={handleKeyDown} />
{#if isOpen}
<div class="modal-backdrop" on:click={closeModal} on:keydown={() => {}} role="button" tabindex="-1">
<div class="modal-content" on:click|stopPropagation on:keydown={() => {}} role="dialog" aria-modal="true">
<div class="modal-header">
<h2>Help & Instructions</h2>
<button class="close-btn" on:click={closeModal} aria-label="Close help">×</button>
</div>
<div class="modal-body">
<p>The Protocol Bicorder is a diagnostic tool for the study of protocols. It allows a human or machine user to evaluate protocol characteristics along a series of gradients between opposing terms.</p>
<p>The name is a tribute to the tricorder, a fictional device in the Star Trek universe that the characters can use to obtain all manner of empirical data about their surroundings.</p>
<p>To carry out the diagnostic, the analyst should consider the protocol from the perspective of one of the <code>gradients</code> at a time. The gradients invite the analyst to determine where the protocol lies between two terms.</p>
<p>This is inevitably an interpretive exercise, but do your best to identify the most accurate <code>value</code>, with <code>1</code> being closest to <code>term_left</code> and <code>9</code> being closest to <code>term_right</code>.</p>
<p>Choosing a <code>value</code> in the middle, such as <code>5</code>, can mean "a bit of both." Leaving the gradient <code>value</code> as <code>null</code> means "not applicable."</p>
<p>There is a <code>notes</code> field for the analyst to add additional context or explanation.</p>
<p>The <code>shortform</code> option allows the use of an abbreviated version of the bicorder, including only the most salient gradients.</p>
<p>Happy protocol watching!</p>
</div>
</div>
</div>
{/if}
<style>
.modal-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
padding: 1rem;
}
.modal-content {
background-color: var(--bg-color);
border: 2px solid var(--border-color);
max-width: 600px;
width: 100%;
max-height: 80vh;
display: flex;
flex-direction: column;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem;
border-bottom: 2px solid var(--border-color);
}
.modal-header h2 {
margin: 0;
font-size: 1.3rem;
letter-spacing: 0.1rem;
}
.close-btn {
background: none;
border: none;
color: var(--fg-color);
font-size: 2rem;
line-height: 1;
cursor: pointer;
padding: 0;
width: 2rem;
height: 2rem;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.6;
transition: opacity 0.2s;
}
.close-btn:hover {
opacity: 1;
}
.modal-body {
padding: 1.5rem;
overflow-y: auto;
line-height: 1.6;
}
.modal-body h3 {
margin-top: 1.5rem;
margin-bottom: 0.75rem;
font-size: 1.1rem;
letter-spacing: 0.05rem;
}
.modal-body p {
margin-bottom: 1rem;
}
.modal-body code {
font-family: inherit;
font-size: inherit;
background: none;
padding: 0;
color: #888;
}
.modal-body strong {
color: var(--accent-color);
}
@media (max-width: 768px) {
.modal-content {
max-height: 90vh;
}
.modal-header {
padding: 1rem;
}
.modal-header h2 {
font-size: 1.1rem;
}
.modal-body {
padding: 1rem;
}
}
</style>