Skip to content

Commit 86c0a34

Browse files
committed
Improve UX by marking changed lines
1 parent 651dd00 commit 86c0a34

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/slide.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ function getLine(line, i, { styles }) {
3737
);
3838
}
3939

40+
function getStyleWithMark(styles) {
41+
return styles.map((item) => {
42+
if(item.opacity && item.opacity === 1) {
43+
item.borderLeft = "2px solid rgb(255 190 0 / 71%)";
44+
item.paddingLeft = "6px";
45+
}
46+
return item
47+
})
48+
}
49+
4050
function Slide({ lines, styles, changes }) {
4151
return (
4252
<pre
@@ -64,5 +74,6 @@ function Slide({ lines, styles, changes }) {
6474
export default function SlideWrapper({ time, version }) {
6575
const { lines, changes } = version;
6676
const styles = animation((time + 1) / 2, lines);
67-
return <Slide lines={lines} styles={styles} changes={changes} />;
77+
const stylesWithMark = getStyleWithMark(styles);
78+
return <Slide lines={lines} styles={stylesWithMark} changes={changes} />;
6879
}

0 commit comments

Comments
 (0)