From 98e37801c4865724873e2f0e889ef29ea30f78cd Mon Sep 17 00:00:00 2001 From: Zhi Wang Date: Sat, 15 Jan 2022 07:14:17 -0500 Subject: [PATCH] WIP --- assets/pause.svg | 1 + assets/play.svg | 1 + assets/replay.html | 77 ++++++++++++++++++++++++++++++++++++++++++++++ assets/replay.js | 46 +++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 assets/pause.svg create mode 100644 assets/play.svg create mode 100644 assets/replay.html create mode 100644 assets/replay.js diff --git a/assets/pause.svg b/assets/pause.svg new file mode 100644 index 0000000..74ac840 --- /dev/null +++ b/assets/pause.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/play.svg b/assets/play.svg new file mode 100644 index 0000000..e817cc8 --- /dev/null +++ b/assets/play.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/replay.html b/assets/replay.html new file mode 100644 index 0000000..85135ba --- /dev/null +++ b/assets/replay.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + Replay + + + +
+ +
+ + +
+
+
+
+
+ +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/assets/replay.js b/assets/replay.js new file mode 100644 index 0000000..3fd84bc --- /dev/null +++ b/assets/replay.js @@ -0,0 +1,46 @@ +function createReplayTerminal() { + // vscode-snazzy https://github.com/Tyriar/vscode-snazzy + // copied from xterm.js website + var baseTheme = { + foreground: '#eff0eb', + background: '#282a36', + selection: '#97979b33', + black: '#282a36', + brightBlack: '#686868', + red: '#ff5c57', + brightRed: '#ff5c57', + green: '#5af78e', + brightGreen: '#5af78e', + yellow: '#f3f99d', + brightYellow: '#f3f99d', + blue: '#57c7ff', + brightBlue: '#57c7ff', + magenta: '#ff6ac1', + brightMagenta: '#ff6ac1', + cyan: '#9aedfe', + brightCyan: '#9aedfe', + white: '#f1f1f0', + brightWhite: '#eff0eb' + }; + + const term = new Terminal({ + fontFamily: `'Fira Code', ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace`, + fontSize: 12, + theme: baseTheme, + convertEol: true, + cursorBlink: true, + }); + + term.open(document.getElementById('terminal_view')); + term.resize(124, 37); + + const weblinksAddon = new WebLinksAddon.WebLinksAddon(); + term.loadAddon(weblinksAddon); + + // fit the xterm viewpoint to parent element + const fitAddon = new FitAddon.FitAddon(); + term.loadAddon(fitAddon); + fitAddon.fit(); + + return term; + } \ No newline at end of file