StealThis .dev

Code Comparison

Side-by-side code diff viewer with syntax-highlighted added and removed lines. Green for additions, red for removals, with line numbers and a dark editor theme.

在 Lab 中打开
css javascript vue svelte
目标: TS JS HTML React Vue Svelte

代码

Code Comparison

A side-by-side code diff viewer that highlights differences between two code strings. Removed lines are shown in red on the left panel, added lines in green on the right panel, with line numbers and a dark editor aesthetic.

How it works

  1. Two code strings (before/after) are parsed line by line.
  2. A simple diff algorithm compares lines and marks them as added, removed, or unchanged.
  3. Lines are rendered into two panels with appropriate background colors and line number gutters.

Features

  • Side-by-side layout with synchronized scrolling
  • Green highlights for additions, red for removals
  • Monospace font with line numbers
  • File name headers on each panel