跳到內容
欄目
語言,而家係廣東話
Rastrillo 設計系統

畫面

登入畫面就係隨附嘅 signin 片段,按佢嘅各種狀態顯示。最後兩個係俾你複製嘅例子。

每個例子都真係用得,不過入面啲連結唔會帶你去邊度。

signin signin-title live-head

登入

淨係突出一個主要嘅入口,其餘擺喺下面。唔好將註冊同登入分開:一個兩樣都得嘅按鈕,要解釋嘅少,會出錯嘅都少。

問地址

一個輸入格,一個掣。冇嘢要記,亦冇嘢可以偷。rastrillo 一開箱就做到。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

用 Keymail 返嚟

瀏覽器會記住上次點樣入嚟。撳一下就會送出記住咗嘅地址,再由頭驗過。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

通行密鑰

對已經有嘅人嚟講係最快,亦冇嘢要打。但都要俾多一個方法:人會唔見咗部機,而一條用唔到嘅通行密鑰就係一道鎖死咗嘅門。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

寄咗連結之後

將個地址原樣顯示返。喺等一封永遠唔會嚟嘅電郵之前,呢個係唯一發現打錯字嘅機會。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

寄咗連結之後,喺另一個瀏覽器

如果個地址唔係呢個瀏覽器送出嘅,頁面就唔會估佢。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

提供嘅係 Keymail,寄出去嘅卻係連結

用一句話講今次寄咗連結,唔會估原因。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

去緊 Keymail

頁面會自己轉過去,萬一冇轉都有條連結。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

睇落唔啱嘅地址

個提示屬於嗰個欄位,焦點亦都由嗰度開始。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

Keymail 確認唔到嘅時候

個掣會轉做改為寄連結,咁就冇人會卡住。

預覽
{{define "title"}}{{template "signin-title" (dict "State" .Signin "Brand" .Brand)}}{{end}}
{{define "content"}}{{template "signin" (dict "State" .Signin "Brand" .Brand)}}{{end}}

Google、Apple 同其他

我哋俾按鈕你,按每間公司嘅要求畫好。登入本身我哋唔提供:嗰部分你自己接去所用嘅供應商。

預覽
<section rst-box>
  <h1>登入</h1>
  <div rst-signin-providers>
    <form method="post" action="/auth/google">
      <button rst-btn="block" type="submit">
        <svg aria-hidden="true" focusable="false" width="1.1em" height="1.1em" viewBox="0 0 48 48"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>
        用 Google 繼續
      </button>
    </form>
    <form method="post" action="/auth/apple">
      <button rst-btn="block" type="submit">
        <svg aria-hidden="true" focusable="false" width="1.1em" height="1.1em" viewBox="0 0 24 24"><path fill="currentColor" d="M12.15 6.9c-.95 0-2.42-1.08-3.96-1.04-2.04.03-3.91 1.18-4.96 3.01-2.12 3.68-.55 9.1 1.52 12.09 1.01 1.45 2.2 3.09 3.79 3.04 1.52-.07 2.09-.99 3.94-.99 1.83 0 2.35.99 3.96.95 1.64-.03 2.68-1.48 3.68-2.95 1.15-1.69 1.63-3.33 1.66-3.42-.04-.01-3.18-1.22-3.22-4.86-.03-3.04 2.48-4.49 2.6-4.56-1.43-2.09-3.63-2.32-4.39-2.38-2-.15-3.68 1.09-4.62 1.09zm3.38-3.07c.84-1.01 1.4-2.43 1.25-3.83-1.21.05-2.66.8-3.53 1.82-.78.9-1.46 2.34-1.27 3.71 1.34.1 2.71-.69 3.55-1.7z"/></svg>
        用 Apple 繼續
      </button>
    </form>
    <a href="/signin">改用電郵</a>
  </div>
</section>

電郵同密碼

如果你真係要用密碼,就照用同一個「一個主入口」嘅版面,並且將重設嘅入口擺喺個掣正下面,唔好收埋。

我哋唔建議用密碼

rastrillo 冇帶呢個畫面。人會重複用密碼,密碼會外洩,而安全保存嘅工作就落喺你身上。請用電郵連結加通行密鑰,或者淨用通行密鑰。呢度有標記,係因為有啲產品仲需要佢。

預覽
<section rst-box>
  <h1>登入</h1>
  <form rst-form method="post" action="/signin">
    <div rst-field>
      <label rst-field-label for="pw-email">電郵</label>
      <input rst-input id="pw-email" name="email" type="email" autocomplete="email" required>
    </div>
    <div rst-field>
      <label rst-field-label for="pw-pass">密碼</label>
      <input rst-input id="pw-pass" name="password" type="password" autocomplete="current-password" required>
    </div>
    <button rst-btn="primary" type="submit">繼續</button>
  </form>
</section>