# 運作方式

訪客會依序做哪些事，以及每個步驟留下什麼。

「運作方式」區塊在請訪客開始之前，先依實際操作的順序帶他們走過要做的事。它是排成網格的有序清單：每個步驟都有以文字寫出的編號、一個標題、一句話，以及一個小型[面板](https://ui.master.co/tw/components/surface#sheet)，呈現這個步驟留下的成果。這一排面板就是論點本身：橫向讀過一遍，產品就已經跑完一次。

**運作方式**

```html
<section class="container-inline px-lg py-4xl" aria-labelledby="how-title">
  <div class="flex flex-col gap-2xl max-w(1040) mx-auto">
    <header class="flex flex-col gap-sm max-w(560)">
      <p class="eyebrow">How it works</p>
      <h2 class="heading heading-2xl" id="how-title">From a repository to an address in three steps.</h2>
      <p class="lead">There is nothing to install and no pipeline to write. Atlas reads the repository and does the rest.</p>
    </header>
    <ol class="grid gap-xl row-gap-2xl m(0) p(0) grid-cols(3)@container(--4xl)">
      <li class="grid gap-md items-start grid-cols(2)@container(--xl) grid-cols(1)@container(--4xl)">
        <div class="sheet flex items-center justify-between gap-sm px-md py-sm">
          <span class="fg-text-strong truncate">atlas-labs/storefront</span>
          <span class="badge">Astro</span>
        </div>
        <div class="flex flex-col gap-xs">
          <p class="eyebrow">Step 1</p>
          <h3 class="heading heading-sm">Connect a repository</h3>
          <p class="m(0) leading-md">Sign in with your Git host and pick a repository. Atlas recognizes the framework and fills in the build command.</p>
        </div>
      </li>
      <li class="grid gap-md items-start grid-cols(2)@container(--xl) grid-cols(1)@container(--4xl)">
        <div class="sheet flex items-center justify-between gap-sm px-md py-sm">
          <code class="code truncate">git push origin main</code>
          <span class="badge badge-info badge-dot">Building</span>
        </div>
        <div class="flex flex-col gap-xs">
          <p class="eyebrow">Step 2</p>
          <h3 class="heading heading-sm">Push as you always do</h3>
          <p class="m(0) leading-md">Every push starts a build. A branch gets a preview of its own, and main goes to production.</p>
        </div>
      </li>
      <li class="grid gap-md items-start grid-cols(2)@container(--xl) grid-cols(1)@container(--4xl)">
        <div class="sheet flex items-center justify-between gap-sm px-md py-sm">
          <span class="fg-text-strong truncate">storefront.atlas.dev</span>
          <span class="badge badge-success badge-dot">Ready in 48s</span>
        </div>
        <div class="flex flex-col gap-xs">
          <p class="eyebrow">Step 3</p>
          <h3 class="heading heading-sm">Share the address</h3>
          <p class="m(0) leading-md">The deployment is live in fourteen regions with a certificate in place. Add your own domain when you are ready.</p>
        </div>
      </li>
    </ol>
    <div class="flex flex-wrap items-center gap-sm">
      <a class="btn btn-brand btn-lg" href="#">Start deploying</a>
      <a class="btn btn-lg" href="#">Read the docs</a>
    </div>
  </div>
</section>
```

區塊提供可直接複製的標記，沿用頁面的文字顏色和字級。預覽在 body 上設定 `fg-text-body text-sm`。每個區塊都是尺寸容器，無論放在寬大的頁面、側邊欄大小的空間，還是對話框裡，都會依自身寬度重新排列。

<a id="anatomy"></a>

## 組成

- **步驟是一個 `<ol>`。** 順序就是內容，所以由元素來表達：螢幕閱讀器會讀出「清單，3 個項目」以及每個步驟的位置。清單是一個網格，原本一欄，透過 `grid-cols(3)@container(--4xl)` 變成三欄。每個項目也是網格，不會繪製項目標記，所以瀏覽器自己的編號不會印在以文字寫出的編號旁邊。
- **編號是[前導標籤](https://ui.master.co/tw/components/heading#eyebrow-and-lead)，「Step 1」（步驟 1）。** 它是步驟 `<h3>` 上方的 `<p>`，就像區塊自己的前導標籤位於標題上方。畫在圓圈裡的數字是另一個需要自行設計的形狀，而寫進 `<h3>` 的數字會讓標題清單讀成「1 Connect a repository」。
- **每個步驟都呈現它留下的成果。** 一個小型 `sheet` 放一行內容：儲存庫與偵測到的框架、指令與它啟動的建置、網址與花費的時間。文字指出那裡有什麼，[徽章](https://ui.master.co/tw/components/badge.md)則說明它的狀態。排成三欄時，它們位於文字上方，就像圖片位於卡片標題上方，所以不論句子長短，三者都會對齊。寬度介於手機與三欄之間時，每個步驟改排成一列，面板在文字旁邊：橫跨整個平板寬度的一行文字長得難以閱讀，而那麼寬的面板大半是空的。
- **這些狀態是狀態訊息，所以可以使用色相。** 「Building」（建置中）是資訊色調，「Ready in 48s」（48 秒完成）是成功色調，兩者都帶有圓點，也都用文字說出色調所表達的事。框架名稱不是狀態，維持中性色。
- **一個步驟就是一個標題和一句話。** 三個步驟是在承諾事情很簡單。如果如實計算有七個步驟，就不該用這個區塊：那是文件。
- **請求放在步驟之後**，而不是之前：「Start deploying」（開始部署）是頁面上唯一的 `btn-brand`，旁邊附上進一步閱讀的入口。

<a id="accessibility"></a>

## 無障礙

- 區塊是一個 `<section>`，以其 `<h2>` 命名。各步驟是低一層的 `<h3>`。
- 請保留 `<ol>`。這裡沒有任何地方設定 `list-style: none`；在 Safari 中，這個設定會連同項目標記一起拿掉清單的角色。
- 每個面板中的那一行是步驟的圖解，會與步驟一起讀出，順序在步驟標題之前。請讓它維持文字：若改放螢幕截圖，就需要 `alt` 說明這個步驟產生了什麼。
- 徽章的色調絕不是唯一的訊號。在強制色彩模式和單色列印中，「Building」和「Ready in 48s」這些文字仍能傳達狀態。

<a id="related"></a>

## 相關內容

- [標題](https://ui.master.co/tw/components/heading.md)
- [表面](https://ui.master.co/tw/components/surface.md)
- [徽章](https://ui.master.co/tw/components/badge.md)
- [程式碼](https://ui.master.co/tw/components/code.md)
- [按鈕](https://ui.master.co/tw/components/button.md)

- [主視覺](https://ui.master.co/tw/blocks/hero.md)
- [功能特色](https://ui.master.co/tw/blocks/features.md)
- [定價](https://ui.master.co/tw/blocks/pricing.md)
- [行動呼籲](https://ui.master.co/tw/blocks/cta.md)
