summaryrefslogtreecommitdiff
path: root/view/components.templ
blob: b2383ba35b77093711873b68754f720f9526f264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package view

templ textLikeField(fieldType string, name string, placeholder string) {
  <input
    type={ fieldType }
    name={ name }
    placeholder={ placeholder }
    class="
      bg-slate-800 focus:bg-slate-700
      text-slate-200 placeholder-slate-500
      p-2
      rounded-md border border-slate-600 border-b-slate-500
      focus:bg-slate-700
      shadow-inner
    "
  />
}

templ TextField(name string, placeholder string) {
  @textLikeField("text", name, placeholder)
}

templ PasswordField(name string, placeholder string) {
  @textLikeField("password", name, placeholder)
}

templ Button(fieldType string, name string, attrs templ.Attributes) {
  <button
    type={ fieldType }
    class="
      text-slate-200
      bg-blue-500 hover:bg-blue-400 active:bg-blue-600
      py-2 px-6
      rounded-full border-t border-t-blue-400
    "
    { attrs... }
  >{ name }</button>
}
 
templ SecondaryButton(fieldType string, name string, attrs templ.Attributes) {
  <button
    type={ fieldType }
    class="
      text-slate-100/50
      bg-transparent hover:bg-slate-300/10 active:bg-slate-300/20
      py-2 px-6
      rounded-full border border-slate-100/50
    "
    { attrs... }
  >{ name }</button>
}