diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-28 01:13:27 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-28 01:13:27 +0200 |
commit | 3637edb816f673830b70b05354a5b74909549999 (patch) | |
tree | 356417dfc0564a2eb7b7255a1656ffbaf2a62943 /view/components.templ | |
parent | a55cfe8205d5cb2fb0948c173f23ad71d6614d13 (diff) |
Diffstat (limited to 'view/components.templ')
-rw-r--r-- | view/components.templ | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/view/components.templ b/view/components.templ new file mode 100644 index 0000000..b2383ba --- /dev/null +++ b/view/components.templ @@ -0,0 +1,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>
+}
|