Skip to content

Offline bannerNew

A still 1920×1080 image for the Twitch offline screen. The quote and welcome card on black, with no pine forest, so it doesn’t repeat the profile banner.

offline

“Carve that warmth into me.”

Vinland Saga

welcome to kingcappuccinoo's stream

Crafted by Chandler King

import { BannerScene, type BannerLayout } from "@/components/stream/banner-scene";
import { STREAM_COPY } from "@/config/stream-copy";
import type { StreamLayout } from "@/config/stream-components";

const DEFAULTS = STREAM_COPY["offline-banner"];

/** The starting-soon type on black, without the pine forest. */
export const offlineBannerLayout = {
  width: 1920,
  height: 1080,
  forestTop: 0,
  showForest: false,
  statusSize: 0.0145,
  quoteSize: 0.0315,
  badgeSize: 0.0105,
  welcomeSize: 0.012,
  creditSize: 0.0105,
  avatarSize: 0.031,
  quoteGap: 0.014,
  badgeGap: 0.016,
  cardGap: 0.022,
  cardPadX: 0.012,
  cardPadY: 0.0085,
  cardGapX: 0.012,
  creditGap: 0.016,
  textPad: 0,
  status: "offline",
  welcome: "welcome to kingcappuccinoo's stream",
  credit: "Crafted by Chandler King",
  filename: "kingcappuccinoo-offline-banner.png",
} as const satisfies BannerLayout;

export function OfflineBanner({
  title = DEFAULTS.title,
  badge = DEFAULTS.badge,
}: {
  layout: StreamLayout;
  preview?: boolean;
  title?: string;
  badge?: string;
}) {
  return <BannerScene layout={offlineBannerLayout} title={title ?? ""} badge={badge ?? ""} />;
}

Props

Size

Still image, 1920 × 1080. Upload it as the Twitch offline screen. Twitch adds the offline card on top.

Installation

Offline banner is a still 1920 × 1080 PNG. Upload it as the Twitch offline screen. Twitch adds the offline card on top.

Usage

example.tsx

import { OfflineBanner } from "@/components/stream/offline-banner";

export function Overlay() {
  return (
    <OfflineBanner
      layout="desktop"
      title="Carve that warmth into me."
      badge="Vinland Saga"
    />
  );
}

Browser source

Paste this URL into OBS or TikTok Live Studio. The query params match the props below.

browser-source.tsx

// Still Twitch offline screen, 1920×1080. No pine forest. Download the PNG from the component page.
const src = "https://chandlerking.dev/live/offline-banner?layout=desktop&title=Carve+that+warmth+into+me.&badge=Vinland+Saga";

A still 1920×1080 image for the video player. Same type as the profile banner, without the pine forest.

Props

PropTypeDefaultNotes
titlestring"Carve that warmth into me."Serif quote. Query `title`.
badgestring"Vinland Saga"Attribution under the quote. Query `badge`.
layout"desktop" | "mobile"RequiredAccepted for the overlay API. The image is always 1920×1080.

Notes & Features

  • Download. Download the 1920×1080 PNG and upload it in Twitch’s offline banner slot.
  • No forest. The pine forest stays on the profile banner. This screen is the quote and welcome card on black.

Manual installation

Rather than the browser source, copy Offline banner into a project. Install its dependencies, then copy all 3 files into the matching path.

Source files

src/components/stream/offline-banner.tsx

import { BannerScene, type BannerLayout } from "@/components/stream/banner-scene";
import { STREAM_COPY } from "@/config/stream-copy";
import type { StreamLayout } from "@/config/stream-components";

const DEFAULTS = STREAM_COPY["offline-banner"];

/** The starting-soon type on black, without the pine forest. */
export const offlineBannerLayout = {
  width: 1920,
  height: 1080,
  forestTop: 0,
  showForest: false,
  statusSize: 0.0145,
  quoteSize: 0.0315,
  badgeSize: 0.0105,
  welcomeSize: 0.012,
  creditSize: 0.0105,
  avatarSize: 0.031,
  quoteGap: 0.014,
  badgeGap: 0.016,
  cardGap: 0.022,
  cardPadX: 0.012,
  cardPadY: 0.0085,
  cardGapX: 0.012,
  creditGap: 0.016,
  textPad: 0,
  status: "offline",
  welcome: "welcome to kingcappuccinoo's stream",
  credit: "Crafted by Chandler King",
  filename: "kingcappuccinoo-offline-banner.png",
} as const satisfies BannerLayout;

export function OfflineBanner({
  title = DEFAULTS.title,
  badge = DEFAULTS.badge,
}: {
  layout: StreamLayout;
  preview?: boolean;
  title?: string;
  badge?: string;
}) {
  return <BannerScene layout={offlineBannerLayout} title={title ?? ""} badge={badge ?? ""} />;
}

src/components/stream/banner-scene.tsx

import type { CSSProperties } from "react";

import { OverlayRoot } from "@/components/stream/overlay-root";
import { footerConfig, siteConfig } from "@/config/site";
import { cn } from "@/lib/utils";

export type BannerLayout = {
  width: number;
  height: number;
  forestTop: number;
  showForest: boolean;
  statusSize: number;
  quoteSize: number;
  badgeSize: number;
  welcomeSize: number;
  creditSize: number;
  avatarSize: number;
  quoteGap: number;
  badgeGap: number;
  cardGap: number;
  cardPadX: number;
  cardPadY: number;
  cardGapX: number;
  creditGap: number;
  textPad: number;
  status: string;
  welcome: string;
  credit: string;
  filename: string;
};

const night = {
  "--background": "#000000",
  "--foreground": "oklch(0.985 0 0)",
  "--muted": "oklch(0.269 0 0)",
  "--muted-foreground": "oklch(0.708 0 0)",
  "--border": "oklch(1 0 0 / 18%)",
} as CSSProperties;

export function BannerScene({
  layout,
  title,
  badge,
}: {
  layout: BannerLayout;
  title: string;
  badge: string;
}) {
  const quote = title.replace(/^["“]+|["”]+$/g, "");
  const titleLines = quote.split("|");
  const avatar = siteConfig.personal.avatar.src;

  return (
    <OverlayRoot>
      <div style={night} className="absolute inset-0 overflow-hidden bg-background text-foreground">
        <div
          className={cn(
            "absolute inset-x-0 z-10 flex flex-col items-center px-[6cqw] text-center",
            layout.showForest ? "top-0 justify-end" : "inset-0 justify-center",
          )}
          style={
            layout.showForest
              ? { bottom: `${layout.forestTop * 100}%`, paddingBottom: `${layout.textPad * 100}cqw` }
              : undefined
          }
        >
          <p
            className="font-mono leading-none tracking-[0.04em] text-muted-foreground lowercase"
            style={{ fontSize: `${layout.statusSize * 100}cqw` }}
          >
            {layout.status}
          </p>
          <h1
            className="max-w-[28ch] text-balance font-serif leading-snug font-medium text-foreground italic"
            style={{
              marginTop: `${layout.quoteGap * 100}cqw`,
              fontSize: `${layout.quoteSize * 100}cqw`,
            }}
          >
            “
            {titleLines.map((line, index) => (
              <span key={`${line}-${index}`}>
                {index > 0 ? <br /> : null}
                {line}
              </span>
            ))}
            ”
          </h1>
          <p
            className="font-mono leading-none tracking-[0.12em] text-muted-foreground"
            style={{
              marginTop: `${layout.badgeGap * 100}cqw`,
              fontSize: `${layout.badgeSize * 100}cqw`,
            }}
          >
            {badge}
          </p>
          <div
            className="flex w-max max-w-[88cqw] items-center border border-dashed bg-background/80 text-left"
            style={{
              marginTop: `${layout.cardGap * 100}cqw`,
              gap: `${layout.cardGapX * 100}cqw`,
              borderRadius: `${layout.cardPadY * 100}cqw`,
              paddingInline: `${layout.cardPadX * 100}cqw`,
              paddingBlock: `${layout.cardPadY * 100}cqw`,
            }}
          >
            <span
              className="relative shrink-0"
              style={{ width: `${layout.avatarSize * 100}cqw`, height: `${layout.avatarSize * 100}cqw` }}
            >
              {/* eslint-disable-next-line @next/next/no-img-element */}
              <img
                src={avatar}
                alt=""
                className="size-full rounded-[0.4cqw] bg-muted object-contain"
              />
              <span
                className="absolute -right-[0.15cqw] -bottom-[0.15cqw] rounded-full bg-emerald-500 ring-[0.16cqw] ring-background"
                style={{
                  width: `${layout.avatarSize * 23}cqw`,
                  height: `${layout.avatarSize * 23}cqw`,
                }}
              />
            </span>
            <span
              className="font-medium tracking-tight whitespace-nowrap"
              style={{ fontSize: `${layout.welcomeSize * 100}cqw` }}
            >
              {layout.welcome}
            </span>
          </div>
          <p
            className="font-mono leading-none tracking-[0.06em] whitespace-nowrap text-muted-foreground"
            style={{
              marginTop: `${layout.creditGap * 100}cqw`,
              fontSize: `${layout.creditSize * 100}cqw`,
            }}
          >
            {layout.credit}
          </p>
        </div>

        {layout.showForest ? (
          // eslint-disable-next-line @next/next/no-img-element
          <img
            src={footerConfig.artwork.src}
            alt=""
            width={footerConfig.artwork.width}
            height={footerConfig.artwork.height}
            draggable={false}
            style={{ top: `${layout.forestTop * 100}%` }}
            className="pointer-events-none absolute left-1/2 z-0 w-full max-w-none -translate-x-1/2 select-none"
          />
        ) : null}
      </div>
    </OverlayRoot>
  );
}

src/components/stream/overlay-root.tsx

import type { ReactNode } from "react";

import { cn } from "@/lib/utils";

export function OverlayRoot({
  children,
  className,
}: {
  children: ReactNode;
  className?: string;
}) {
  return (
    <div
      className={cn(
        "@container relative h-full w-full overflow-hidden pointer-events-none",
        className,
      )}
    >
      {children}
    </div>
  );
}

Carve that warmth into me.

Vinland Saga
Chandler King

Building AnglerIQ & The Sozo CRM

Open to software engineering roles

Crafted by Chandler King · Kansas City, MO