aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/anim-gen.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/anim-gen.ts')
-rw-r--r--src/routes/anim-gen.ts84
1 files changed, 40 insertions, 44 deletions
diff --git a/src/routes/anim-gen.ts b/src/routes/anim-gen.ts
index 382237e..550efb7 100644
--- a/src/routes/anim-gen.ts
+++ b/src/routes/anim-gen.ts
@@ -113,17 +113,17 @@ const biosStepHandlers: Step[] = [
biosSteps,
).fill(
(quantity: number, lastQuantity: number, index: number) =>
- (next: () => void) => {
- const s = anim.selector(
- `#bios .bar`,
- );
- s.style(`${index === 0 ? hiddenStyles : visibleStyles}
+ (next: () => void) => {
+ const s = anim.selector(
+ `#bios .bar`,
+ );
+ s.style(`${index === 0 ? hiddenStyles : visibleStyles}
width: ${lastQuantity * 100}vw;`);
- anim._internal_timeline.now += 1;
- s.style(`${visibleStyles}
+ anim._internal_timeline.now += 1;
+ s.style(`${visibleStyles}
width: ${quantity * 100}vw;`);
- anim.in(quantity === 1 ? 50 : biosStepInterval, next);
- },
+ anim.in(quantity === 1 ? 50 : biosStepInterval, next);
+ },
).map((v, i, a) => v((i + 1) / a.length, i / a.length, i)),
// Show bdsdxe
(next) => {
@@ -378,8 +378,7 @@ const ttyStepHandlers: Step[] = [
switch (step.kind) {
case 'text': {
const s = anim.selector(
- `${isBeforeFirstClear ? '#openrc' : '#tty-' + (ttyIdx - 1)} ${
- step.classes.map((v) => `.${v}`).join('')
+ `${isBeforeFirstClear ? '#openrc' : '#tty-' + (ttyIdx - 1)} ${step.classes.map((v) => `.${v}`).join('')
}`,
);
s.style(altHiddenStyles);
@@ -391,8 +390,7 @@ const ttyStepHandlers: Step[] = [
}
case 'removeNode': {
const s = anim.selector(
- `${isBeforeFirstClear ? '#openrc' : '#tty-' + (ttyIdx - 1)} ${
- step.removedItemClassList.map((v) => `.${v}`).join('')
+ `${isBeforeFirstClear ? '#openrc' : '#tty-' + (ttyIdx - 1)} ${step.removedItemClassList.map((v) => `.${v}`).join('')
}`,
);
s.style(altVisibleStyles);
@@ -460,9 +458,8 @@ const output = `/**
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
${anim.exportToCSS()}
-${
- stages.filter((_, i, a) => i !== a.length - 1).map((v) =>
- `${v.selector} {
+${stages.filter((_, i, a) => i !== a.length - 1).map((v) =>
+ `${v.selector} {
${hiddenStageStyles}
}
.ttytext-removed-after-done {
@@ -473,35 +470,34 @@ ${hiddenStageStyles}
margin-left: -100vw;
margin-right: 100vw;
}
-${
- (ttyLines.flatMap((v) =>
- v.kind === 'text'
- ? [
- ...v.value.map((v) => ({
- kind: 'text' as const,
- ...v,
- })),
- ]
- : []
- ).flatMap((v) => [
- ...(
- v.kind === 'text'
- ? [
- v.colour
- ? `.ttytext-block.text-\\[\\${v.colour}\\]{color:${v.colour};}`
- : '',
- v.bg
- ? `.ttytext-block.bg-\\[\\${v.bg}\\]{background:${v.bg};}`
- : '',
- ]
- : []
- ),
- ]).filter((v, i, a) => v.length !== 0 && a.indexOf(v) === i)).join('\n')
- }
+${(ttyLines.flatMap((v) =>
+ v.kind === 'text'
+ ? [
+ ...v.value.map((v) => ({
+ kind: 'text' as const,
+ ...v,
+ })),
+ ]
+ : []
+ ).flatMap((v) => [
+ ...(
+ v.kind === 'text'
+ ? [
+ v.colour
+ ? `.ttytext-block.text-\\[\\${v.colour}\\]{color:${v.colour};}`
+ : '',
+ v.bg
+ ? `.ttytext-block.bg-\\[\\${v.bg}\\]{background:${v.bg};}`
+ : '',
+ ]
+ : []
+ ),
+ ]).filter((v, i, a) => v.length !== 0 && a.indexOf(v) === i)).join('\n')
+ }
`
- ).join('')
-}
-${[...anim.exportToObject().values()].map(v=>`#app.skip-animation ${v.selector} {
+).join('')
+ }
+${[...anim.exportToObject().values()].map(v => `#app.skip-animation ${v.selector} {
animation-duration: 0.01ms;
}`).join('\n')}
`;