Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions preview/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
snapshot = undefined;
$('capture').textContent = 'Loading snapshot…';
term.reset();
$('terminal').classList.add('boot');
ready = false;
state('Starting preview…');
$('restart').hidden = true;
Expand Down Expand Up @@ -156,6 +157,7 @@
for (const data of pending) term.write(new Uint8Array(data));
pending.length = 0;
ready = true;
$('terminal').classList.remove('boot');
state('Ready');
if (matchMedia('(pointer:fine)').matches) term.focus();
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion preview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1>hn.</h1>
><button id="restart" hidden>Restart preview</button>
</div>
</div>
<div id="terminal"></div>
<div id="terminal" class="boot"></div>
<p class="hint">Click or tap the terminal to type. Press <kbd>?</kbd> for keys.</p>
</section>
<section id="article-panel" class="article-panel" aria-label="Article browser" hidden>
Expand Down
14 changes: 14 additions & 0 deletions preview/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ main.reading {
height: clamp(420px, calc(100svh - 300px), 820px);
margin: 14px 14px 0;
overflow: hidden;
transition:
opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
#terminal.boot {
opacity: 0;
transform: translateY(6px);
}
.hint {
margin: 12px 16px 16px;
Expand Down Expand Up @@ -387,4 +394,11 @@ button:active,
main {
animation: none;
}
#terminal {
transition: none;
}
#terminal.boot {
opacity: 1;
transform: none;
}
}
Loading