rust-bash 0.3.0

A sandboxed bash interpreter for AI Agents with a virtual filesystem
Documentation
@import "tailwindcss";

/* ── Base ──────────────────────────────────────────────────────────── */

:root {
  --bg: #0a0a0a;
  --fg: #b0ffb0;
  --green: #00ff41;
  --cyan: #00d4ff;
  --red: #ff4444;
  --yellow: #ffcc00;
  --blue: #5af;
  --dim: #555;
  --font-mono: 'Fira Mono', 'JetBrains Mono', 'Cascadia Code', 'SF Mono', Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f0;
    --fg: #1a1a2e;
    --green: #16a34a;
    --cyan: #0891b2;
    --red: #dc2626;
    --yellow: #ca8a04;
    --blue: #2563eb;
    --dim: #9ca3af;
  }
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #222;
  color: var(--fg);
  font-family: var(--font-mono);
}

/* ── CRT Monitor Bezel ────────────────────────────────────────────── */

#crt-bezel {
  position: fixed;
  inset: 8px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    170deg,
    #e8e4dc 0%,
    #d5d0c8 40%,
    #c8c3ba 100%
  );
  border-radius: 18px;
  box-shadow:
    /* outer drop shadow */
    0 4px 30px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(0, 0, 0, 0.3),
    /* 3-D highlight on top/left */
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    /* 3-D shadow on bottom/right */
    inset -2px -2px 4px rgba(0, 0, 0, 0.25);
  border: 1px solid #aaa;
}

/* Bezel model label (top-left) */
.bezel-label {
  position: absolute;
  top: 10px;
  left: 20px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #888;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

/* Bezel bottom strip with power LED */
.bezel-bottom {
  flex-shrink: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.power-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00cc44;
  box-shadow: 0 0 6px #00ff41, 0 0 12px rgba(0, 255, 65, 0.3);
}

/* ── Screen (recessed glass area) ─────────────────────────────────── */

#crt-screen {
  flex: 1;
  position: relative;
  margin: 28px 24px 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow:
    /* deep recess */
    inset 0 0 20px 6px rgba(0, 0, 0, 0.8),
    inset 0 4px 12px rgba(0, 0, 0, 0.6),
    /* subtle bevel around the glass edge */
    0 0 0 2px #555,
    0 0 0 3px #333;
  /* CRT glass bulge */
  perspective: 900px;
  transform-style: preserve-3d;
}

/* Subtle barrel-like curvature on all screen contents */
#crt-screen > * {
  transform: perspective(900px) translateZ(4px);
  transform-origin: center center;
}

/* ── CRT Overlay Effects (inside screen) ──────────────────────────── */

#crt-frame {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  border-radius: 10px;
  box-shadow:
    /* inner vignette */
    inset 0 0 120px 40px rgba(0, 0, 0, 0.45),
    inset 0 0 30px rgba(0, 0, 0, 0.25);
}

/* Scanline overlay */
#crt-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.2) 1px,
    rgba(0, 0, 0, 0.2) 2px
  );
}

/* Screen curvature highlight */
#crt-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(255, 255, 255, 0.04) 0%,
    transparent 60%
  );
}

/* ── Intro ("Wake up, Neo...") ────────────────────────────────────── */

#intro {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  transition: opacity 0.4s ease-out;
}

#intro.fade-out {
  opacity: 0;
  pointer-events: none;
}

#intro-text {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--green);
  white-space: pre;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

#intro-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ── App Layout ───────────────────────────────────────────────────── */

#app {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  background: var(--bg);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  overflow: hidden;
}

#app.visible {
  opacity: 1;
}

.hidden {
  visibility: hidden;
}

/* ── Header ───────────────────────────────────────────────────────── */

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--dim) 30%, transparent);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo {
  font-size: 1.2rem;
}

.header-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green);
}

.header-github {
  color: var(--dim);
  transition: color 0.2s;
}

.header-github:hover {
  color: var(--fg);
}

/* ── Terminal Container ───────────────────────────────────────────── */

#terminal-container {
  flex: 1;
  padding: 0.5rem;
  overflow: hidden;
  min-height: 0;
}

#terminal {
  height: 100%;
  width: 100%;
}

/* xterm.js overrides for theme consistency */
.xterm {
  padding: 0.25rem;
}

/* Scrollbar — green thumb, no track background */
.xterm .xterm-viewport::-webkit-scrollbar {
  width: 8px;
}
.xterm .xterm-viewport::-webkit-scrollbar-track {
  background: transparent;
}
.xterm .xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 65, 0.35);
  border-radius: 4px;
}
.xterm .xterm-viewport::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 65, 0.55);
}
/* Firefox */
.xterm .xterm-viewport {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 65, 0.35) transparent;
  /* Inertial / momentum scrolling on iOS Safari */
  -webkit-overflow-scrolling: touch;
}

/* Prevent double-tap zoom on the terminal */
#terminal-container,
#terminal {
  touch-action: manipulation;
}

/* ── Footer ───────────────────────────────────────────────────────── */

#footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--dim);
  border-top: 1px solid color-mix(in srgb, var(--dim) 30%, transparent);
}

.footer-sep {
  opacity: 0.5;
}

/* ── Mobile responsiveness ────────────────────────────────────────── */

@media (max-width: 480px) {
  #crt-bezel {
    inset: 2px;
    border-radius: 10px;
  }

  #crt-screen {
    margin: 16px 10px 0;
    border-radius: 6px;
  }

  #crt-frame,
  #crt-frame::before,
  #crt-frame::after {
    border-radius: 6px;
  }

  #intro {
    border-radius: 6px;
  }

  #app {
    border-radius: 6px;
  }

  .bezel-bottom {
    height: 18px;
  }

  .bezel-label {
    font-size: 0.55rem;
    top: 6px;
    left: 10px;
  }

  #header {
    padding: 0.3rem 0.6rem;
  }

  .header-logo {
    font-size: 1rem;
  }

  .header-title {
    font-size: 0.8rem;
  }

  #footer {
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
    gap: 0.35rem;
  }

  #terminal-container {
    padding: 0.25rem;
  }
}