From d6362582e1476b7d684bb017cccac060b7dcc0cd Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 12 Mar 2025 15:30:37 +0100
Subject: fix: skip anim classes shouldnt be needed

---
 src/routes/anim-gen.ts | 55 ++++++++++++++++++++++----------------------------
 src/routes/shared.ts   | 49 +++++++++++++++++++++++++-------------------
 2 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/src/routes/anim-gen.ts b/src/routes/anim-gen.ts
index b91e088..67b1d6f 100644
--- a/src/routes/anim-gen.ts
+++ b/src/routes/anim-gen.ts
@@ -461,43 +461,36 @@ ${hiddenStageStyles}
   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')}
+        .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(',\n')} {
-  animation-name: none;
-  animation-duration: 0.01ms;
-}
 `;
 fs.writeFileSync(
   'src/routes/anim.css',
   `${comment}
-${
-  esbuild.buildSync({
+${esbuild.buildSync({
     stdin: {
       contents: `${exported}
 ${tail}`,
@@ -506,7 +499,7 @@ ${tail}`,
     write: false,
     minify: false,
   }).outputFiles![0].text
-}`,
+  }`,
 );
 fs.writeFileSync(
   'src/routes/no-anim.css',
diff --git a/src/routes/shared.ts b/src/routes/shared.ts
index dd7f959..0d198bf 100644
--- a/src/routes/shared.ts
+++ b/src/routes/shared.ts
@@ -37,37 +37,37 @@ export type RenderBlock = {
   italic?: boolean;
   underlined?: boolean;
   url?:
-    | `newtab:${string}`
-    | `currenttab:${string}`
-    | ((textObj: TTYText & { kind: 'text' }) => void);
+  | `newtab:${string}`
+  | `currenttab:${string}`
+  | ((textObj: TTYText & { kind: 'text' }) => void);
   bg?: string;
   raw?: boolean;
   dl?: string;
 };
 export type TTYText =
   | {
-      kind: 'text';
-      renderrestriction?: 'everywhere' | 'js-only' | 'noscript';
-      value: RenderBlock[];
-      id: string;
-      classes: string[];
-    }
+    kind: 'text';
+    renderrestriction?: 'everywhere' | 'js-only' | 'noscript';
+    value: RenderBlock[];
+    id: string;
+    classes: string[];
+  }
   | {
-      kind: 'removeNode';
-      removedId: string;
-      removedItemClassList: string[];
-    }
+    kind: 'removeNode';
+    removedId: string;
+    removedItemClassList: string[];
+  }
   | {
-      kind: 'time';
-      delay: number;
-    }
+    kind: 'time';
+    delay: number;
+  }
   | {
-      kind: 'cursorVisibility';
-      visible: boolean;
-    }
+    kind: 'cursorVisibility';
+    visible: boolean;
+  }
   | {
-      kind: 'clear';
-    };
+    kind: 'clear';
+  };
 export type Only<Obj, Keys extends keyof Obj> = {
   [k in Keys]: Obj[k];
 };
@@ -580,6 +580,13 @@ export const ttyLines: TTYText[] = (() => {
       },
     ],
   ]);
+  wait(100);
+  text([
+    '\nDid you know: this is all pure css animation hell.',
+    {
+      colour: '#7a7a7a',
+    },
+  ]);
   wait(5000);
   text([
     `<button style="padding: 12px 12px;background: #fff2;margin-top: 0.4rem;border-radius: 0.7rem;opacity:0.1;margin-top:3rem;" data-el="le funny button">have a button :3</button>`,
-- 
cgit v1.2.3