package templates
import (
"github.com/chasefleming/elem-go"
"github.com/chasefleming/elem-go/attrs"
"github.com/chasefleming/elem-go/styles"
)
var bodyStyle = styles.Props{
styles.Margin: "40px auto",
styles.MaxWidth: "800px",
styles.LineHeight: "1.5",
styles.FontSize: "16px",
styles.Color: "#444",
styles.Padding: "0 10px",
styles.FontFamily: "Sans-serif",
}
var headerStyle = styles.Props{
styles.LineHeight: "1.2",
}
func logo(class string) *elem.Element {
return &elem.Element{
Tag: "svg",
Attrs: attrs.Props{
attrs.Class: class,
attrs.Width: "146",
attrs.Height: "51",
"xmlns": "http://www.w3.org/2000/svg",
"xml:space": "preserve",
attrs.Style: styles.Props{
styles.Var("fill-rule"): "evenodd",
styles.Var("clip-rule"): "evenodd",
styles.Var("stroke-linejoin"): "round",
styles.Var("stroke-miterlimit"): styles.Int(2), //nolint
}.ToInline(),
"viewBox": "0 0 1280 640",
},
Children: []elem.Node{
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
},
}
}
func iconSuccess(class string) *elem.Element {
return &elem.Element{
Tag: "svg",
Attrs: attrs.Props{
attrs.Class: class,
attrs.Width: "20",
attrs.Height: "20",
"viewBox": "0 0 512 512",
"xmlns": "http://www.w3.org/2000/svg",
},
Children: []elem.Node{
elem.Raw(""),
},
}
}
func iconWarning() *elem.Element {
return &elem.Element{
Tag: "svg",
Attrs: attrs.Props{
attrs.Width: "20",
attrs.Height: "20",
"viewBox": "0 0 24 24",
"fill": "none",
"xmlns": "http://www.w3.org/2000/svg",
attrs.Style: styles.Props{
styles.MarginBottom: "1rem",
}.ToInline(),
},
Children: []elem.Node{
elem.Raw(""),
elem.Raw(""),
elem.Raw(""),
},
}
}
func iconExternalLink() *elem.Element {
return &elem.Element{
Tag: "svg",
Attrs: attrs.Props{
attrs.Width: "16",
attrs.Height: "16",
"viewBox": "0 0 16 16",
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg",
},
Children: []elem.Node{
elem.Raw(""),
},
}
}
func headerOne(text string) *elem.Element {
return elem.H1(attrs.Props{attrs.Style: headerStyle.ToInline()}, elem.Text(text))
}
func headerTwo(text string) *elem.Element {
return elem.H2(attrs.Props{attrs.Style: headerStyle.ToInline()}, elem.Text(text))
}
func headerThree(text string) *elem.Element {
return elem.H3(attrs.Props{attrs.Style: headerStyle.ToInline()}, elem.Text(text))
}
func HtmlStructure(head, body *elem.Element) *elem.Element {
return elem.Html(nil,
elem.Head(
attrs.Props{
attrs.Lang: "en",
},
elem.Meta(attrs.Props{
attrs.Charset: "UTF-8",
}),
elem.Meta(attrs.Props{
attrs.HTTPequiv: "X-UA-Compatible",
attrs.Content: "IE=edge",
}),
elem.Meta(attrs.Props{
attrs.Name: "viewport",
attrs.Content: "width=device-width, initial-scale=1.0",
}),
head,
),
body,
)
}