modelsdev 0.11.4

A fast TUI and CLI for browsing AI models, benchmarks, and coding agents
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
---
import Tabs from "@/components/bearnie/tabs/Tabs.astro";
import TabsList from "@/components/bearnie/tabs/TabsList.astro";
import TabsTrigger from "@/components/bearnie/tabs/TabsTrigger.astro";
import TabsContent from "@/components/bearnie/tabs/TabsContent.astro";
import Button from "@/components/bearnie/button/Button.astro";
import Tooltip from "@/components/bearnie/tooltip/Tooltip.astro";
import TooltipTrigger from "@/components/bearnie/tooltip/TooltipTrigger.astro";
import TooltipContent from "@/components/bearnie/tooltip/TooltipContent.astro";
import TerminalChrome from "@/components/TerminalChrome.astro";
import { Pause, Play } from "@lucide/astro";
import {
  DISPLAY,
  PROVIDER_COUNT,
  AGENT_COUNT,
  STATUS_PROVIDER_COUNT,
} from "@/data/site";

const base = import.meta.env.BASE_URL.replace(/\/?$/, "/");

const tabTriggerClass =
  "group data-border relative block w-full cursor-pointer overflow-hidden rounded-none border-l-4 p-4 text-left transition-colors data-[state=active]:border-l-(--neon-cyan) data-[state=active]:bg-(--neon-cyan)/10 data-[state=inactive]:border-l-transparent data-[state=inactive]:bg-slate-900/30 data-[state=inactive]:hover:border-l-slate-400";
---

<section class="grid grid-cols-1 gap-4 md:grid-cols-4">
  <Tabs defaultValue="models" orientation="vertical" class="contents">
    <div class="space-y-2 md:col-span-1">
      <div class="mb-6 flex items-center justify-between">
        <h2 class="text-4xl font-black tracking-tighter text-white uppercase">
          Operations
        </h2>
        <Tooltip>
          <TooltipTrigger>
            <Button
              id="cycle-toggle"
              type="button"
              variant="outline"
              size="xs"
              iconOnly
              class="rounded-md border-slate-700 text-slate-400 hover:border-(--neon-cyan) hover:bg-transparent hover:text-(--neon-cyan) focus-visible:ring-(--neon-cyan)"
              aria-label="Pause video auto-cycle"
            >
              <Pause id="cycle-icon-pause" size={14} />
              <Play id="cycle-icon-play" size={14} class="hidden" />
            </Button>
          </TooltipTrigger>
          <TooltipContent side="bottom">
            <span id="cycle-label">Pause auto-cycle</span>
          </TooltipContent>
        </Tooltip>
      </div>
      <TabsList
        class="h-auto w-full flex-col items-stretch gap-2 rounded-none bg-transparent p-0"
      >
        <TabsTrigger value="models" class={tabTriggerClass}>
          <span
            class="mb-1 block font-bold text-slate-400 uppercase group-data-[state=active]:text-(--neon-cyan)"
            >01. MODELS</span
          >
          <p class="font-mono text-xs text-slate-400">
            Filter by capability, price, context. {PROVIDER_COUNT}+ providers.
            RTFO indicators.
          </p>
          <div
            class="tab-progress absolute bottom-0 left-0 h-0.5 w-0 bg-(--neon-cyan)"
          >
          </div>
        </TabsTrigger>
        <TabsTrigger value="agents" class={tabTriggerClass}>
          <span
            class="mb-1 block font-bold text-slate-400 uppercase group-data-[state=active]:text-(--neon-cyan)"
            >02. AGENTS</span
          >
          <p class="font-mono text-xs text-slate-400">
            Version detection, GitHub releases, changelogs, service health.
          </p>
          <div
            class="tab-progress absolute bottom-0 left-0 h-0.5 w-0 bg-(--neon-cyan)"
          >
          </div>
        </TabsTrigger>
        <TabsTrigger value="benchmarks" class={tabTriggerClass}>
          <span
            class="mb-1 block font-bold text-slate-400 uppercase group-data-[state=active]:text-(--neon-cyan)"
            >03. BENCHMARKS</span
          >
          <p class="font-mono text-xs text-slate-400">
            H2H tables, scatter plots, radar charts. ~{DISPLAY.benchmarks} entries.
          </p>
          <div
            class="tab-progress absolute bottom-0 left-0 h-0.5 w-0 bg-(--neon-cyan)"
          >
          </div>
        </TabsTrigger>
        <TabsTrigger value="status" class={tabTriggerClass}>
          <span
            class="mb-1 block font-bold text-slate-400 uppercase group-data-[state=active]:text-(--neon-cyan)"
            >04. STATUS</span
          >
          <p class="font-mono text-xs text-slate-400">
            Live health for {STATUS_PROVIDER_COUNT} providers. Incidents, maintenance,
            gauges.
          </p>
          <div
            class="tab-progress absolute bottom-0 left-0 h-0.5 w-0 bg-(--neon-cyan)"
          >
          </div>
        </TabsTrigger>
      </TabsList>
    </div>

    <TabsContent value="models" class="mt-0 h-full md:col-span-3">
      <TerminalChrome label="MODE: TUI // TAB: MODELS" class="relative h-full">
        <video
          class="w-full"
          muted
          playsinline
          preload="metadata"
          aria-label="Models tab showing provider list, model details, and RTFO capability indicators"
        >
          <source src={`${base}assets/wiki/models.mp4`} type="video/mp4" />
        </video>
        <div
          class="absolute inset-0 bg-linear-to-t from-black/90 via-black/30 to-transparent"
        >
        </div>
        <div class="absolute bottom-0 left-0 p-4 md:p-8">
          <p
            class="mb-4 max-w-lg text-base leading-tight font-light text-white md:text-xl"
          >
            Real-time ingestion of {DISPLAY.models} model definitions across
            {PROVIDER_COUNT}+ providers from models.dev.
          </p>
          <ul class="space-y-1 font-mono text-xs text-(--neon-cyan) uppercase">
            <li>+ Filter by capability and price</li>
            <li>+ Sort by date, cost, context</li>
            <li>+ Cross-provider search</li>
          </ul>
        </div>
      </TerminalChrome>
    </TabsContent>

    <TabsContent value="agents" class="mt-0 h-full md:col-span-3">
      <TerminalChrome label="MODE: TUI // TAB: AGENTS" class="relative h-full">
        <video
          class="w-full"
          muted
          playsinline
          preload="metadata"
          aria-label="Agents tab showing version tracking, changelogs, and service health"
        >
          <source src={`${base}assets/wiki/agents.mp4`} type="video/mp4" />
        </video>
        <div
          class="absolute inset-0 bg-linear-to-t from-black/90 via-black/30 to-transparent"
        >
        </div>
        <div class="absolute bottom-0 left-0 p-4 md:p-8">
          <p
            class="mb-4 max-w-lg text-base leading-tight font-light text-white md:text-xl"
          >
            Track {AGENT_COUNT}+ AI coding assistants with version detection,
            changelogs, and live service health.
          </p>
          <ul class="space-y-1 font-mono text-xs text-(--neon-cyan) uppercase">
            <li>+ Automatic version detection</li>
            <li>+ GitHub release tracking</li>
            <li>+ Live service health status</li>
          </ul>
        </div>
      </TerminalChrome>
    </TabsContent>

    <TabsContent value="benchmarks" class="mt-0 h-full md:col-span-3">
      <TerminalChrome
        label="MODE: TUI // TAB: BENCHMARKS"
        class="relative h-full"
      >
        <video
          class="w-full"
          muted
          playsinline
          preload="metadata"
          aria-label="Benchmarks tab with head-to-head comparison table and radar chart"
        >
          <source src={`${base}assets/wiki/benchmarks.mp4`} type="video/mp4" />
        </video>
        <div
          class="absolute inset-0 bg-linear-to-t from-black/90 via-black/30 to-transparent"
        >
        </div>
        <div class="absolute bottom-0 left-0 p-4 md:p-8">
          <p
            class="mb-4 max-w-lg text-base leading-tight font-light text-white md:text-xl"
          >
            Head-to-head comparison with scatter plots, radar charts, and
            quality indexes from Artificial Analysis.
          </p>
          <ul class="space-y-1 font-mono text-xs text-(--neon-cyan) uppercase">
            <li>+ Compare models side by side</li>
            <li>+ Scatter plots and radar charts</li>
            <li>+ Filter by creator and region</li>
          </ul>
        </div>
      </TerminalChrome>
    </TabsContent>

    <TabsContent value="status" class="mt-0 h-full md:col-span-3">
      <TerminalChrome label="MODE: TUI // TAB: STATUS" class="relative h-full">
        <video
          class="w-full"
          muted
          playsinline
          preload="metadata"
          aria-label="Status tab with provider health dashboard, incidents, and maintenance cards"
        >
          <source src={`${base}assets/wiki/status.mp4`} type="video/mp4" />
        </video>
        <div
          class="absolute inset-0 bg-linear-to-t from-black/90 via-black/30 to-transparent"
        >
        </div>
        <div class="absolute bottom-0 left-0 p-4 md:p-8">
          <p
            class="mb-4 max-w-lg text-base leading-tight font-light text-white md:text-xl"
          >
            Live health monitoring for {STATUS_PROVIDER_COUNT} AI providers across
            7 status page platforms.
          </p>
          <ul class="space-y-1 font-mono text-xs text-(--neon-cyan) uppercase">
            <li>+ Overall health dashboard</li>
            <li>+ Incident and maintenance cards</li>
            <li>+ Grouped service components</li>
          </ul>
        </div>
      </TerminalChrome>
    </TabsContent>
  </Tabs>
</section>

<script>
  import { animate, waapi, stagger, onScroll } from "animejs";
  import type { JSAnimation } from "animejs";

  function initTabCycle() {
    const prefersReducedMotion = window.matchMedia(
      "(prefers-reduced-motion: reduce)",
    ).matches;

    const tabsRoot = document.querySelector("[data-tabs]");
    if (!tabsRoot || tabsRoot.hasAttribute("data-cycle-init")) return;
    tabsRoot.setAttribute("data-cycle-init", "true");

    const triggers = Array.from(
      tabsRoot.querySelectorAll("[data-tabs-trigger]"),
    ) as HTMLElement[];

    const tabOrder = triggers.map((trigger) => {
      const value = trigger.getAttribute("data-value")!;
      const content = tabsRoot.querySelector(
        `[data-tabs-content][data-value="${value}"]`,
      ) as HTMLElement;
      const video = content?.querySelector("video") as HTMLVideoElement | null;
      const progress = trigger.querySelector(
        ".tab-progress",
      ) as HTMLElement | null;
      return { value, trigger, content, video, progress };
    });

    let autoCycling = !prefersReducedMotion;
    let progressAnim: JSAnimation | null = null;

    const toggleBtn = document.getElementById("cycle-toggle");
    const pauseIcon = document.getElementById("cycle-icon-pause");
    const playIcon = document.getElementById("cycle-icon-play");
    const toggleLabel = document.getElementById("cycle-label");

    function updateToggle() {
      if (!toggleBtn || !pauseIcon || !playIcon || !toggleLabel) return;
      pauseIcon.classList.toggle("hidden", !autoCycling);
      playIcon.classList.toggle("hidden", autoCycling);
      toggleLabel.textContent = autoCycling
        ? "Pause auto-cycle"
        : "Resume auto-cycle";
      toggleBtn.setAttribute(
        "aria-label",
        autoCycling ? "Pause video auto-cycle" : "Resume video auto-cycle",
      );
    }

    function clearAllProgress() {
      if (progressAnim) {
        progressAnim.cancel();
        progressAnim = null;
      }
      tabOrder.forEach((tab) => {
        if (tab.progress) tab.progress.style.width = "0%";
      });
    }

    function startProgress(video: HTMLVideoElement, bar: HTMLElement | null) {
      if (progressAnim) {
        progressAnim.cancel();
        progressAnim = null;
      }
      if (!bar || !video.duration) return;

      const remaining =
        (1 - video.currentTime / video.duration) * video.duration * 1000;
      const startPct = `${(video.currentTime / video.duration) * 100}%`;

      progressAnim = animate(bar, {
        width: [startPct, "100%"],
        duration: remaining,
        ease: "linear",
      });
    }

    function getActiveIndex(): number {
      return tabOrder.findIndex(
        (t) => t.trigger.getAttribute("data-state") === "active",
      );
    }

    function playTab(index: number, loop: boolean) {
      tabOrder.forEach((tab) => {
        if (tab.video) {
          tab.video.pause();
          tab.video.currentTime = 0;
          tab.video.loop = false;
        }
      });

      clearAllProgress();

      tabOrder[index].trigger.setAttribute("data-auto-click", "true");
      tabOrder[index].trigger.click();
      tabOrder[index].trigger.removeAttribute("data-auto-click");

      const { video, progress, content } = tabOrder[index];

      if (video) {
        video.currentTime = 0;
        video.loop = loop;
        video.play();
        if (!loop) {
          // Wait for metadata to get duration, then start progress
          if (video.duration) {
            startProgress(video, progress);
          } else {
            video.addEventListener(
              "loadedmetadata",
              () => startProgress(video, progress),
              { once: true },
            );
          }
        }
      }
    }

    // Auto-advance when a video ends
    tabOrder.forEach((tab, index) => {
      if (!tab.video) return;
      tab.video.addEventListener("ended", () => {
        if (!autoCycling) return;
        playTab((index + 1) % tabOrder.length, false);
      });
    });

    // User clicks a tab: pause cycle, loop that tab
    triggers.forEach((trigger, i) => {
      trigger.addEventListener("click", () => {
        if (trigger.hasAttribute("data-auto-click")) return;
        autoCycling = false;
        updateToggle();
        clearAllProgress();

        tabOrder.forEach((t) => {
          if (t.video) {
            t.video.pause();
            t.video.currentTime = 0;
            t.video.loop = false;
          }
        });

        const { video } = tabOrder[i];
        if (video) {
          video.currentTime = 0;
          video.loop = true;
          video.play();
        }
      });
    });

    // Play/pause toggle
    toggleBtn?.addEventListener("click", () => {
      autoCycling = !autoCycling;
      updateToggle();

      const idx = getActiveIndex();
      if (idx < 0) return;
      const { video, progress } = tabOrder[idx];

      if (autoCycling) {
        if (video) {
          video.loop = false;
          if (video.ended) video.currentTime = 0;
          video.play();
          startProgress(video, progress);
        }
      } else {
        if (video) video.loop = true;
        clearAllProgress();
      }
    });

    updateToggle();

    const activeIdx = getActiveIndex();
    if (activeIdx >= 0) {
      const { video, progress } = tabOrder[activeIdx];
      if (video) {
        video.loop = !autoCycling;
        video.play();
        if (autoCycling) {
          if (video.duration) {
            startProgress(video, progress);
          } else {
            video.addEventListener(
              "loadedmetadata",
              () => startProgress(video, progress),
              { once: true },
            );
          }
        }
      }
    }
  }

  function initFeatures() {
    const section = document.querySelector("[data-tabs]");
    if (!section || section.hasAttribute("data-features-init")) return;
    section.setAttribute("data-features-init", "true");

    const prefersReducedMotion = window.matchMedia(
      "(prefers-reduced-motion: reduce)",
    ).matches;

    if (prefersReducedMotion) {
      initTabCycle();
      return;
    }

    // Hide tab triggers for entrance animation
    const triggers = section.querySelectorAll<HTMLElement>(
      "[data-tabs-trigger]",
    );
    triggers.forEach((t) => {
      t.style.opacity = "0";
      t.style.transform = "translateY(16px)";
    });

    let initialized = false;

    onScroll({
      target: section as HTMLElement,
      enter: "bottom top",
      onEnter: () => {
        if (!initialized) {
          initialized = true;

          // Staggered entrance for tab triggers
          waapi.animate(triggers, {
            opacity: [0, 1],
            translateY: [16, 0],
            duration: 600,
            ease: "outQuad",
            delay: stagger(80),
          });

          initTabCycle();
        } else {
          // Resume active video on re-enter
          const activeContent = section.querySelector(
            '[data-tabs-content][data-state="active"]',
          );
          const video = activeContent?.querySelector("video");
          if (video) video.play();
        }
      },
      onLeave: () => {
        // Pause all videos when scrolled away
        section.querySelectorAll("video").forEach((v) => v.pause());
      },
    });
  }

  initFeatures();
  document.addEventListener("astro:page-load", initFeatures);
</script>