Skip to content

Commit 395246f

Browse files
committed
Refilm both modes
The overlay film showed the old whole-line behaviour. Both are shot from the same scene now so they read as a pair: src/git.js from this repo's own history, where root became base on three lines running. typing.gif is a third of its former size at the same palette. Nothing was given up; typing changes one line per frame, so there is almost nothing between frames to encode.
1 parent 5e5e81a commit 395246f

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ some order that made sense to them. `gitdiff3d` plays it back: your diff becomes
1414
a 3d scene where every changed line is a plate floating in space, and a caret
1515
walks through them typing the additions in and erasing the deletions.
1616

17-
![the old version of a hunk showing through behind the new one, as the camera orbits and pushes in](docs/overlay.gif)
17+
![the run of characters that changed lit on both planes, a projection joining them across the depth, as the camera orbits and pushes in](docs/overlay.gif)
1818

1919
## Install
2020

@@ -117,6 +117,31 @@ at him. Nobody finds a moving dot by looking at two plates side by side, because
117117
that turns a preattentive pop-out into a memory task. The `l` key does the same
118118
trick with depth instead of flicker.
119119

120+
A whole old line behind a whole new one still leaves you hunting, though, when
121+
only one word moved. So where a removal and the addition after it are plainly
122+
versions of each other, both lines drop to a whisper except for the run of
123+
characters that actually differs. That run is lit on each plane, and a
124+
projection is run between the two:
125+
126+
```
127+
const chars = Math.max(1, spanOf(line.text).length); the new line, in front
128+
^^^^^^
129+
:====: the projection, across the gap in depth
130+
vvvvvv
131+
const chars = Math.max(1, bodyOf(line.text).length); the old line, behind
132+
```
133+
134+
Head on the projection is a hairline and costs nothing; orbit and it opens into
135+
a ribbon, so you can see which run came from where. A wavefront travels it,
136+
narrowing or widening as the old text becomes the new, and walking the short way
137+
round the colour wheel from the removal red to the addition green.
138+
139+
Lines that were rewritten rather than edited keep the plain behaviour: below
140+
half the characters kept on either side they are not versions of each other,
141+
there is nothing to point at, and both whole lines are spoken. Nothing is
142+
projected where nothing was replaced, so a phrase inserted into a line lights up
143+
in front and leaves only a tick on the line behind.
144+
120145
## Keys
121146

122147
```

‎docs/overlay.gif‎

205 KB
Loading

‎docs/typing.gif‎

-1.37 MB
Loading

0 commit comments

Comments
 (0)