Files
litterbox/app/static/css/style.css
T
BlackSnufkin ce9a926246 Refactor backend into blueprints/services/utils package and frontend into ES6 modules
Backend (Python):
- Split app/routes.py (1,389 lines) into 6 Flask blueprints (upload, analysis,
  results, doppelganger, management, api) under app/blueprints/, plus
  service modules (rendering, summary, tool_check, error_handling) under
  app/services/, and the shared RouteHelpers class in app/helpers.py.
  app/__init__.py wires shared deps via app.extensions['litterbox'].
- Split app/utils.py (1,400 lines) into the app/utils/ package with
  single-concern modules: file_io, validators, path_manager, risk_analyzer,
  forensics, json_helpers, reporting. No facade — every caller migrated.
- Extracted BaseSubprocessAnalyzer in app/analyzers/base.py; refactored 9
  subprocess analyzers (yara/checkplz/stringnalyzer static; yara/pe_sieve/
  moneta/patriot/hsb/hollows_hunter dynamic) as thin subclasses that only
  declare config + implement _parse_output.

Frontend (JS):
- Split results.js (2,060), holygrail.js (1,025), byovd_info.js (1,069),
  and upload.js (974) into per-concern ES6 modules under
  app/static/js/{results,holygrail,byovd,upload}/.
- Added app/static/js/utils/ with shared helpers: escape, formatters,
  severity, fetch, modals, dom (single source of truth for escapeHtml,
  formatBytes, severity-color mapping, etc.).
- Converted base.js, summary.js, blender.js, fuzzy.js to ES6 modules;
  every <script> tag now uses type="module". window.X assignments preserved
  so inline onclick handlers in templates keep resolving.
- Targeted XSS hardening at user-data interpolation sites in results
  renderers (str.data, hex_dump, scan_info.target, list items).

Templates:
- New app/templates/partials/_macros.html with reusable scanner-table
  macros + 3-card status grid; static_info.html and dynamic_info.html
  migrated to use them, eliminating identical-HTML duplication.

CSS:
- Fixed broken @apply in .drag-over (no Tailwind build pipeline → @apply
  was silently ignored, leaving drag-and-drop visual feedback broken).
  Replaced with raw CSS equivalent.
- Dedented stray 8-space-indented block (lines 127-end) for consistency.
- Added header comment documenting the no-build-pipeline constraint.

Gitignore:
- Anchored Results/, Uploads/, DoppelgangerDB/Blender/, and Scanners/*
  patterns to repo root with leading slash so they don't shadow same-
  named directories elsewhere (notably the new app/static/js/results/
  module directory and app/blueprints/results.py).
- Added /Scanners/PE-Sieve/process_*/ for runtime scan artifacts.
2026-04-27 06:41:19 -07:00

366 lines
7.4 KiB
CSS

/* app/static/css/style.css
*
* NOTE: Tailwind in this project is precompiled (tailwind.min.css is shipped
* as a static asset; there is no Node/PostCSS build pipeline). That means
* `@apply` directives DO NOT work here — browsers silently ignore them.
* Always write raw CSS in this file. Use Tailwind utility classes directly
* in templates when you want utility behavior.
*/
/* Base Styles */
body {
background: linear-gradient(to bottom right, #000000, #1a0000);
}
/* Scrollbar Styling */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.2);
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: rgba(220, 38, 38, 0.3);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(220, 38, 38, 0.5);
}
/* Upload Zone Styles
* Equivalent to Tailwind's `border-red-500 bg-red-500/5` plus a subtle scale.
* Written as raw CSS because @apply does not work without a build step.
*/
.drag-over {
border-color: rgb(239 68 68);
background-color: rgb(239 68 68 / 0.05);
transform: scale(1.01);
transition: all 0.2s ease;
}
/* Cards Hover Effect */
.analysis-card {
transition: all 0.2s ease;
}
.analysis-card:hover {
transform: translateY(-2px);
}
/* Monospace Font for Technical Data */
.font-mono {
font-family: 'JetBrains Mono', monospace;
}
/* Animations */
@keyframes pulse-red {
0%, 100% {
background-color: rgba(239, 68, 68, 0.1);
}
50% {
background-color: rgba(239, 68, 68, 0.2);
}
}
.animate-pulse-red {
animation: pulse-red 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
/* Loading Spinner */
.loading-spinner {
border: 3px solid rgba(239, 68, 68, 0.1);
border-top-color: rgb(239, 68, 68);
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Form Controls Dark Theme Override */
select,
input {
background-color: rgb(17 24 39 / 0.3) !important;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
/* Custom Select Dropdown Arrow */
select {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-right: 2.5rem;
}
.logo-wrapper {
display: flex;
cursor: pointer;
text-decoration: none;
transition: opacity 0.2s;
}
.logo-wrapper:hover {
opacity: 0.8;
}
/* Autofill Style Override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-box-shadow: 0 0 0 30px rgb(17 24 39 / 0.3) inset !important;
-webkit-text-fill-color: rgb(209 213 219) !important;
}
/* Simple fade animation for popover */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.fade-in {
animation: fadeIn 0.2s ease-out;
}
/* Sidebar Variables */
:root {
--sidebar-width-expanded: 250px;
--sidebar-width-collapsed: 72px;
--transition-speed: 0.3s;
}
/* Sidebar Base Styles */
.app-sidebar {
width: var(--sidebar-width-expanded);
transition: width var(--transition-speed) ease-in-out;
position: fixed;
top: 0;
left: 0;
height: 100vh;
z-index: 50;
}
.app-sidebar.collapsed {
width: var(--sidebar-width-collapsed);
}
/* Main Content */
.app-content {
margin-left: var(--sidebar-width-expanded);
transition: margin-left var(--transition-speed) ease-in-out;
}
.app-content.sidebar-collapsed {
margin-left: var(--sidebar-width-collapsed);
}
/* Top Bar */
.app-topbar {
left: var(--sidebar-width-expanded);
transition: left var(--transition-speed) ease-in-out;
}
.app-topbar.sidebar-collapsed {
left: var(--sidebar-width-collapsed);
}
/* Sidebar Content Sections */
.sidebar-header {
padding: 1rem 1.25rem 0.5rem;
}
.app-sidebar.collapsed .sidebar-header {
padding: 1rem 0.5rem;
}
.sidebar-nav {
padding: 0 1.5rem;
transition: padding var(--transition-speed) ease-in-out;
}
.app-sidebar.collapsed .sidebar-nav {
padding: 0 0.5rem;
}
.sidebar-footer {
padding: 1rem 1.5rem;
transition: padding var(--transition-speed) ease-in-out;
}
.app-sidebar.collapsed .sidebar-footer {
padding: 1rem 0.5rem;
}
/* Logo Section */
.logo-wrapper {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 0.5rem;
}
.app-sidebar.collapsed .logo-wrapper {
justify-content: center;
gap: 0;
}
.logo-text {
transition: opacity var(--transition-speed) ease-in-out;
}
.app-sidebar.collapsed .logo-text {
opacity: 0;
width: 0;
overflow: hidden;
}
.logo-icon {
flex-shrink: 0;
}
/* Navigation Items */
.nav-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.75rem 1rem;
margin-bottom: 0.5rem;
border-radius: 0.5rem;
transition: all 0.2s ease;
position: relative;
cursor: pointer;
}
.app-sidebar.collapsed .nav-item {
justify-content: center;
padding: 0.75rem;
gap: 0;
}
.nav-icon {
width: 1.25rem;
height: 1.25rem;
flex-shrink: 0;
}
.nav-text {
font-weight: 500;
transition: opacity var(--transition-speed) ease-in-out;
white-space: nowrap;
}
.app-sidebar.collapsed .nav-text {
opacity: 0;
width: 0;
overflow: hidden;
}
/* Tooltips for collapsed state */
.nav-tooltip {
position: absolute;
left: calc(100% + 0.5rem);
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.9);
color: white;
padding: 0.5rem 0.75rem;
border-radius: 0.375rem;
font-size: 0.875rem;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s, visibility 0.2s;
z-index: 1000;
border: 1px solid rgba(55, 65, 81, 0.5);
pointer-events: none;
}
.app-sidebar.collapsed .nav-item:hover .nav-tooltip {
opacity: 1;
visibility: visible;
}
/* Toggle Button */
.sidebar-toggle {
position: absolute;
top: 1rem;
right: -0.75rem;
width: 1.5rem;
height: 1.5rem;
background: rgba(0, 0, 0, 0.8);
border: 1px solid rgba(55, 65, 81, 0.5);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
z-index: 60;
}
.sidebar-toggle:hover {
background: rgba(239, 68, 68, 0.2);
border-color: rgba(239, 68, 68, 0.3);
}
.sidebar-toggle svg {
width: 0.75rem;
height: 0.75rem;
transition: transform var(--transition-speed) ease;
}
.app-sidebar.collapsed .sidebar-toggle svg {
transform: rotate(180deg);
}
/* Status Section */
.status-wrapper {
display: flex;
align-items: center;
gap: 0.75rem;
}
.app-sidebar.collapsed .status-wrapper {
justify-content: center;
gap: 0;
}
.status-indicator {
width: 0.75rem;
height: 0.75rem;
border-radius: 50%;
flex-shrink: 0;
}
.status-text {
font-size: 0.875rem;
transition: opacity var(--transition-speed) ease-in-out;
white-space: nowrap;
}
.app-sidebar.collapsed .status-text {
opacity: 0;
width: 0;
overflow: hidden;
}
/* Hover Effects */
.nav-item:hover {
background-color: rgba(239, 68, 68, 0.1);
color: white;
}
.nav-item:hover .nav-icon {
color: white;
}