Files
OSINT-Framework/public/css/panel.css
T
s0lrayandPaperclip 0e7fdcfdbf Add tool details panel UI and D3 wiring (THE-104, THE-105)
THE-104: Build panel UI component
- New public/css/panel.css using existing design tokens
- Fixed-position slide-in panel (340px desktop, 100vw bottom-sheet on mobile)
- 250ms GPU-accelerated translateX() slide animation with will-change
- All section placeholders: header, breadcrumb, badges, description, usage,
  OPSEC, rating, report link, CTA button
- Dark mode via body.light-mode CSS variable overrides
- Graceful empty states (sections hidden via .empty class)

THE-105: Wire panel to D3 tree interactions
- Leaf-node clicks (nodes with url, no children) open panel instead of navigating
- parseName() for clean title + badge rendering
- Breadcrumb built by walking parent chain to root
- Selected-node ring via _panelSelected flag + stroke style in nodeUpdate
- Close triggers: ✕ button, Escape key, overlay click, canvas click, same-node re-click
- Clicking another leaf swaps panel content in-place
- Session hash via crypto.randomUUID() stored in sessionStorage

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-25 23:00:21 -04:00

256 lines
4.5 KiB
CSS

/* === Tool Details Panel === */
/* Overlay backdrop (mobile) */
#panel-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 199;
}
#panel-overlay.visible {
display: block;
}
/* Panel container */
#tool-panel {
position: fixed;
top: 0;
right: 0;
width: 340px;
height: 100vh;
overflow-y: auto;
background: var(--color-surface);
border-left: 1px solid var(--color-border);
box-shadow: var(--shadow-md);
z-index: 200;
display: flex;
flex-direction: column;
transform: translateX(100%);
transition: transform 250ms ease;
will-change: transform;
}
#tool-panel.open {
transform: translateX(0);
}
/* Header bar */
#panel-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: var(--space-3);
padding: var(--space-4);
border-bottom: 1px solid var(--color-border);
flex-shrink: 0;
}
#panel-title {
font-size: var(--font-size-lg);
font-weight: bold;
color: var(--color-text-primary);
line-height: 1.3;
word-break: break-word;
}
#panel-close {
background: none;
border: none;
color: var(--color-text-secondary);
font-size: 20px;
line-height: 1;
cursor: pointer;
padding: 2px var(--space-1);
border-radius: var(--radius-sm);
flex-shrink: 0;
}
#panel-close:hover {
color: var(--color-text-primary);
background: var(--color-bg);
}
/* Panel body sections */
#panel-body {
flex: 1;
padding: var(--space-4);
display: flex;
flex-direction: column;
gap: var(--space-4);
overflow-y: auto;
}
/* Breadcrumb */
#panel-breadcrumb {
font-size: var(--font-size-sm);
color: var(--color-text-secondary);
line-height: 1.5;
}
#panel-breadcrumb.empty {
display: none;
}
/* Badges */
#panel-badges {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
#panel-badges.empty {
display: none;
}
/* Description */
#panel-description-section {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
#panel-description-section.empty {
display: none;
}
.panel-section-label {
font-size: var(--font-size-sm);
font-weight: bold;
color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
}
#panel-description {
font-size: var(--font-size-base);
color: var(--color-text-primary);
line-height: 1.5;
}
/* Usage context */
#panel-usage-section {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
#panel-usage-section.empty {
display: none;
}
#panel-usage {
font-size: var(--font-size-base);
color: var(--color-text-primary);
line-height: 1.5;
}
/* OPSEC notes */
#panel-opsec-section {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
#panel-opsec-section.empty {
display: none;
}
#panel-opsec {
font-size: var(--font-size-base);
color: var(--color-text-primary);
line-height: 1.5;
border-left: 3px solid var(--badge-T);
padding-left: var(--space-3);
}
/* Rating */
#panel-rating-section {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
#panel-rating-section.empty {
display: none;
}
#panel-rating {
font-size: var(--font-size-base);
color: var(--color-text-primary);
}
/* CTA button */
#panel-cta-section {
margin-top: auto;
padding-top: var(--space-4);
border-top: 1px solid var(--color-border);
flex-shrink: 0;
}
#panel-cta-section.empty {
display: none;
}
#panel-open-tool {
display: block;
width: 100%;
padding: var(--space-3) var(--space-4);
background: var(--color-accent);
color: #fff;
border: none;
border-radius: var(--radius-md);
font-size: var(--font-size-base);
font-family: var(--font-family);
font-weight: bold;
cursor: pointer;
text-align: center;
text-decoration: none;
}
#panel-open-tool:hover {
opacity: 0.88;
}
/* Report link */
#panel-report-section {
text-align: center;
}
#panel-report-link {
font-size: var(--font-size-sm);
color: var(--color-text-secondary);
text-decoration: none;
}
#panel-report-link:hover {
color: var(--color-node-stroke);
}
/* Node selection ring */
.node circle.selected-ring {
stroke: var(--color-accent);
stroke-width: 3px;
}
/* Mobile: bottom-sheet */
@media (max-width: 768px) {
#tool-panel {
width: 100vw;
height: 80vh;
top: auto;
bottom: 0;
right: 0;
border-left: none;
border-top: 1px solid var(--color-border);
border-radius: var(--radius-md) var(--radius-md) 0 0;
transform: translateY(100%);
transition: transform 250ms ease;
}
#tool-panel.open {
transform: translateY(0);
}
}