| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- {{/* One template per section type. Each receives a Section. */}}
- {{define "attrs"}}{{with .ID}} id="{{.}}"{{end}}{{end}}
- {{define "tone"}}{{with .Tone}} tone-{{.}}{{end}}{{end}}
- {{define "head"}}{{if or .Eyebrow .Title .Text}}<div class="sec-head rv">
- {{with .Eyebrow}}<p class="eyebrow">{{tr .}}</p>{{end}}
- {{with .Title}}<h2 class="title">{{tr .}}</h2>{{end}}
- {{with .Text}}<p class="lead">{{tr .}}</p>{{end}}
- </div>{{end}}{{end}}
- {{define "buttons"}}{{range .}}<a class="btn {{or .Style "primary"}}" href="{{href .Href}}"{{if ext .Href}} target="_blank" rel="noopener"{{end}}>{{with .Icon}}{{icon .}}{{end}}<span>{{if .UI}}{{ui .UI}}{{else}}{{tr .Label}}{{end}}</span>{{if eq .Style "link"}}{{icon "chevron"}}{{end}}</a>{{end}}{{end}}
- {{define "app-row"}}<div class="app-row">{{range .}}{{with app .}}<img src="{{.Src}}" alt="{{.Name}}" title="{{.Name}}" width="56" height="56" loading="lazy" decoding="async">{{end}}{{end}}</div>{{end}}
- {{define "hero"}}{{$s := .}}<section class="hero{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap hero-head">
- {{with .Eyebrow}}<p class="eyebrow rv">{{tr .}}</p>{{end}}
- <h1 class="hero-title rv" style="--d:1">{{tr .Title}}</h1>
- {{with .Text}}<p class="hero-sub rv" style="--d:2">{{tr .}}</p>{{end}}
- {{with .Buttons}}<div class="btns center rv" style="--d:3">{{template "buttons" .}}</div>{{end}}
- </div>
- {{with img .Image}}<div class="hero-media" data-scale="hero"><img src="{{.Src}}"{{if .W}} width="{{.W}}" height="{{.H}}"{{end}} alt="{{trs (or $s.Alt $s.Title)}}" fetchpriority="high" decoding="async"></div>
- {{else}}{{with $s.Apps}}<div class="hero-apps" aria-hidden="true">{{range $i, $k := .}}{{with app $k}}<img class="float" style="--i:{{$i}}" src="{{.Src}}" alt="" width="96" height="96">{{end}}{{end}}</div>{{end}}{{end}}
- </section>{{end}}
- {{define "feature"}}{{$s := .}}{{$m := img .Image}}<section class="feature layout-{{or .Layout "stack"}}{{if .Flip}} flip{{end}}{{if and (not $m) (not .Code) (not .Phones)}} no-media{{end}}{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap feature-in">
- <div class="f-text rv">
- {{with .Apps}}{{template "app-row" .}}{{end}}
- {{with .Eyebrow}}<p class="eyebrow">{{tr .}}</p>{{end}}
- <h2 class="title">{{tr .Title}}</h2>
- {{with .Text}}<p class="lead">{{tr .}}</p>{{end}}
- {{with .Bullets}}<ul class="checks">{{range .}}<li>{{icon "check"}}<span>{{tr .}}</span></li>{{end}}</ul>{{end}}
- {{with .Note}}<p class="note">{{tr .}}</p>{{end}}
- {{with .Buttons}}<div class="btns">{{template "buttons" .}}</div>{{end}}
- </div>
- {{with $m}}<figure class="f-media" data-scale><img src="{{.Src}}"{{if .W}} width="{{.W}}" height="{{.H}}"{{end}} alt="{{trs (or $s.Alt $s.Title)}}" loading="lazy" decoding="async"></figure>
- {{else}}{{with $s.Code}}<figure class="f-code rv"><div class="code-bar"><span></span><span></span><span></span></div><pre><code>{{code .}}</code></pre></figure>{{end}}{{end}}
- {{if and $m $s.Code}}<figure class="f-code rv"><div class="code-bar"><span></span><span></span><span></span></div><pre><code>{{code $s.Code}}</code></pre></figure>{{end}}
- {{with .Phones}}<div class="f-phones">{{range $i, $n := .}}{{with img $n}}<figure class="phone rv" style="--d:{{$i}}"><img src="{{.Src}}"{{if .W}} width="{{.W}}" height="{{.H}}"{{end}} alt="{{trs $s.Title}}" loading="lazy" decoding="async"></figure>{{end}}{{end}}</div>{{end}}
- </div>
- </section>{{end}}
- {{define "showcase"}}<section class="showcase{{template "tone" .}}"{{template "attrs" .}} style="--n:{{len .Items}}">
- <div class="wrap">{{template "head" .}}</div>
- <div class="sc-track">
- <div class="sc-sticky">
- <div class="sc-media">{{range $i, $it := .Items}}{{with img $it.Image}}<img class="sc-img{{if eq $i 0}} on{{end}}" data-i="{{$i}}" src="{{.Src}}"{{if .W}} width="{{.W}}" height="{{.H}}"{{end}} alt="{{trs $it.Title}}" loading="lazy" decoding="async">{{end}}{{end}}</div>
- <div class="sc-caps">{{range $i, $it := .Items}}<div class="sc-cap{{if eq $i 0}} on{{end}}" data-i="{{$i}}"><h3>{{tr .Title}}</h3><p>{{tr .Text}}</p></div>{{end}}</div>
- <div class="sc-dots" aria-hidden="true">{{range $i, $it := .Items}}<span{{if eq $i 0}} class="on"{{end}}></span>{{end}}</div>
- </div>
- </div>
- {{with .Buttons}}<div class="wrap btns center sc-after">{{template "buttons" .}}</div>{{end}}
- </section>{{end}}
- {{define "lit"}}<section class="lit-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap narrow">
- {{with .Eyebrow}}<p class="eyebrow rv">{{tr .}}</p>{{end}}
- <p class="lit" data-lit>{{tr .Text}}</p>
- </div>
- </section>{{end}}
- {{define "stats"}}<section class="stats-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap">
- {{template "head" .}}
- <div class="stats">{{range $i, $it := .Items}}<div class="stat rv" style="--d:{{$i}}"><div class="stat-v" data-count>{{tr .Value}}</div><div class="stat-t">{{tr .Title}}</div>{{with .Text}}<p>{{tr .}}</p>{{end}}</div>{{end}}</div>
- </div>
- </section>{{end}}
- {{define "cards"}}<section class="cards-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap">
- {{template "head" .}}
- <div class="cards">{{range $i, $it := .Items}}<a class="card rv{{with .Size}} {{.}}{{end}} accent-{{or .Accent "index"}}" style="--d:{{mod $i 2}}" href="{{href .Link}}">
- <div class="card-text">
- {{with .Eyebrow}}<p class="eyebrow">{{tr .}}</p>{{end}}
- <h3>{{tr .Title}}</h3>
- {{with .Text}}<p>{{tr .}}</p>{{end}}
- <span class="more">{{ui "learnMore"}}{{icon "chevron"}}</span>
- </div>
- {{with img .Image}}<div class="card-media"><img src="{{.Src}}"{{if .W}} width="{{.W}}" height="{{.H}}"{{end}} alt="" loading="lazy" decoding="async"></div>
- {{else}}{{with $it.Apps}}<div class="card-apps">{{range $j, $k := .}}{{with app $k}}<img style="--i:{{$j}}" src="{{.Src}}" alt="" width="80" height="80" loading="lazy">{{end}}{{end}}</div>{{end}}{{end}}
- </a>{{end}}</div>
- </div>
- </section>{{end}}
- {{define "bento"}}<section class="bento-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap">
- {{template "head" .}}
- <div class="bento">{{range $i, $it := .Items}}<div class="tile rv{{with .Size}} {{.}}{{end}}" style="--d:{{mod $i 3}}">
- {{with .Icon}}<div class="tile-ic">{{icon .}}</div>{{end}}
- {{with .Apps}}{{template "app-row" .}}{{end}}
- {{with .Value}}<div class="tile-v">{{tr .}}</div>{{end}}
- {{with .Eyebrow}}<p class="eyebrow">{{tr .}}</p>{{end}}
- <h3>{{tr .Title}}</h3>
- {{with .Text}}<p>{{tr .}}</p>{{end}}
- {{with .Link}}<a class="more" href="{{href .}}">{{ui "learnMore"}}{{icon "chevron"}}</a>{{end}}
- {{with img .Image}}<img class="tile-img" src="{{.Src}}"{{if .W}} width="{{.W}}" height="{{.H}}"{{end}} alt="{{trs $it.Title}}" loading="lazy" decoding="async">{{end}}
- </div>{{end}}</div>
- </div>
- </section>{{end}}
- {{define "apps"}}<section class="apps-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap">
- {{template "head" .}}
- <ul class="app-grid">{{range $i, $k := .Apps}}{{with app $k}}<li class="rv" style="--d:{{mod $i 8}}"><img src="{{.Src}}" alt="" width="72" height="72" loading="lazy" decoding="async"><span>{{.Name}}</span></li>{{end}}{{end}}</ul>
- {{with .Note}}<p class="note center rv">{{tr .}}</p>{{end}}
- {{with .Buttons}}<div class="btns center rv">{{template "buttons" .}}</div>{{end}}
- </div>
- </section>{{end}}
- {{define "specs"}}<section class="specs-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap narrow">
- {{template "head" .}}
- <dl class="specs">{{range .Items}}<div class="spec rv">
- <dt>{{tr .Title}}</dt>
- <dd>{{with .Text}}<p>{{tr .}}</p>{{end}}{{with .Bullets}}<ul>{{range .}}<li>{{tr .}}</li>{{end}}</ul>{{end}}</dd>
- </div>{{end}}</dl>
- {{with .Note}}<p class="note rv">{{tr .}}</p>{{end}}
- </div>
- </section>{{end}}
- {{define "install"}}<section class="install-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap">
- {{template "head" .}}
- <div class="install">{{range $i, $it := .Items}}<article class="plat rv{{with .Size}} {{.}}{{end}}" style="--d:{{mod $i 2}}"{{with .Link}} id="{{.}}"{{end}}>
- <div class="plat-head">{{with .Icon}}<div class="tile-ic">{{icon .}}</div>{{end}}<div><h3>{{tr .Title}}</h3>{{with .Eyebrow}}<p class="plat-sub">{{tr .}}</p>{{end}}</div></div>
- {{with .Text}}<p>{{tr .}}</p>{{end}}
- {{with .Code}}<div class="cmd"><pre><code>{{.}}</code></pre><button type="button" class="copy" data-copy aria-label="{{uis "copy"}}" title="{{uis "copy"}}"><span class="c-copy">{{icon "copy"}}</span><span class="c-done">{{icon "check"}}</span></button></div>{{end}}
- {{with .Bullets}}<ol class="howto">{{range .}}<li>{{tr .}}</li>{{end}}</ol>{{end}}
- {{with .Buttons}}<div class="btns">{{template "buttons" .}}</div>{{end}}
- {{with .Note}}<p class="note">{{tr .}}</p>{{end}}
- </article>{{end}}</div>
- </div>
- </section>{{end}}
- {{define "steps"}}<section class="steps-sec{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap">
- {{template "head" .}}
- <ol class="steps">{{range $i, $it := .Items}}<li class="rv" style="--d:{{$i}}"><span class="step-n">{{add $i 1}}</span><h3>{{tr .Title}}</h3>{{with .Text}}<p>{{tr .}}</p>{{end}}</li>{{end}}</ol>
- </div>
- </section>{{end}}
- {{define "cta"}}<section class="cta{{template "tone" .}}"{{template "attrs" .}}>
- <div class="wrap narrow rv">
- <div class="cta-logo">{{icon "logo"}}</div>
- <h2 class="title">{{tr .Title}}</h2>
- {{with .Text}}<p class="lead">{{tr .}}</p>{{end}}
- {{with .Buttons}}<div class="btns center">{{template "buttons" .}}</div>{{end}}
- </div>
- </section>{{end}}
|