From 546cb501ea259880a8420a692c603d1e6ad905ca Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 14 Jan 2026 01:34:59 +0100
Subject: feat: optimize output when no anim

---
 src/routes/IndexPage.svelte | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

(limited to 'src/routes/IndexPage.svelte')

diff --git a/src/routes/IndexPage.svelte b/src/routes/IndexPage.svelte
index f7588d3..c2d07eb 100644
--- a/src/routes/IndexPage.svelte
+++ b/src/routes/IndexPage.svelte
@@ -15,7 +15,13 @@
 <script lang="ts">
   import logo from './boot-logo.webp';
   import { architecture, hostname, tty, versions } from './distro-info';
-  import { login, ttyLines, type RenderBlock, type TTYText } from './shared';
+  import {
+    joinSimilarTTYLines,
+    login,
+    ttyLines,
+    type RenderBlock,
+    type TTYText,
+  } from './shared';
   import { onDestroy, onMount } from 'svelte';
   import { base } from '$app/paths';
 
@@ -78,8 +84,8 @@
 {#snippet ttyTextInnerRenderer(section: RenderBlock)}
   <span
     class="ttytext-block {section.colour
-      ? ` text-[${section.colour}]`
-      : ''}{section.bg ? ` bg-[${section.bg}]` : ''} {section.weight
+      ? ` t${section.colour}`
+      : ''}{section.bg ? ` b${section.bg}` : ''} {section.weight
       ? ` ${['', 'font-thin', 'font-extralight', 'font-light', 'font-normal', 'font-medium', 'font-semibold', 'font-bold', 'font-extrabold', 'font-black'][section.weight / 100]}`
       : ''}{typeof section.italic === 'undefined'
       ? ''
@@ -394,7 +400,7 @@
         <div
           class="line ttylines-openrc font-mono text-[#070505] flex flex-col"
         >
-          {#each ttyLines.filter(((maxidx) => (_, i) => i < (maxidx === -1 ? Infinity : maxidx))(ttyLines.findIndex((v) => v.kind === 'clear'))) as line}
+          {#each joinSimilarTTYLines(ttyLines.filter(((maxidx) => (_, i) => i < (maxidx === -1 ? Infinity : maxidx))(ttyLines.findIndex((v) => v.kind === 'clear')))) as line}
             {@render ttyText(line)}
           {/each}
         </div>
@@ -415,7 +421,7 @@
       >
         <div class="mb-auto"></div>
         <div class="font-mono leading-4 text-[#070505] flex flex-col p-4">
-          {#each ttyLines.filter((v, i) => i >= idx && i < (nextIdx ?? Infinity) && (!skipAnimation || !('classes' in v) || !Array.isArray(v.classes) || !v.classes.includes('ttytext-removed-after-done'))) as line}
+          {#each joinSimilarTTYLines(ttyLines.filter((v, i) => i >= idx && i < (nextIdx ?? Infinity) && (!skipAnimation || !('classes' in v) || !Array.isArray(v.classes) || !v.classes.includes('ttytext-removed-after-done')))) as line}
             {@render ttyText(line)}
           {/each}
         </div>
-- 
cgit v1.2.3

