parallax.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VParallaxBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VParallax(children ...h.HTMLComponent) (r *VParallaxBuilder) {
  11. r = &VParallaxBuilder{
  12. tag: h.Tag("v-parallax").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VParallaxBuilder) Alt(v string) (r *VParallaxBuilder) {
  17. b.tag.Attr("alt", v)
  18. return b
  19. }
  20. func (b *VParallaxBuilder) Height(v string) (r *VParallaxBuilder) {
  21. b.tag.Attr("height", v)
  22. return b
  23. }
  24. func (b *VParallaxBuilder) Src(v string) (r *VParallaxBuilder) {
  25. b.tag.Attr("src", v)
  26. return b
  27. }
  28. func (b *VParallaxBuilder) Srcset(v string) (r *VParallaxBuilder) {
  29. b.tag.Attr("srcset", v)
  30. return b
  31. }
  32. func (b *VParallaxBuilder) SetAttr(k string, v interface{}) {
  33. b.tag.SetAttr(k, v)
  34. }
  35. func (b *VParallaxBuilder) Attr(vs ...interface{}) (r *VParallaxBuilder) {
  36. b.tag.Attr(vs...)
  37. return b
  38. }
  39. func (b *VParallaxBuilder) Children(children ...h.HTMLComponent) (r *VParallaxBuilder) {
  40. b.tag.Children(children...)
  41. return b
  42. }
  43. func (b *VParallaxBuilder) AppendChildren(children ...h.HTMLComponent) (r *VParallaxBuilder) {
  44. b.tag.AppendChildren(children...)
  45. return b
  46. }
  47. func (b *VParallaxBuilder) PrependChildren(children ...h.HTMLComponent) (r *VParallaxBuilder) {
  48. b.tag.PrependChildren(children...)
  49. return b
  50. }
  51. func (b *VParallaxBuilder) Class(names ...string) (r *VParallaxBuilder) {
  52. b.tag.Class(names...)
  53. return b
  54. }
  55. func (b *VParallaxBuilder) ClassIf(name string, add bool) (r *VParallaxBuilder) {
  56. b.tag.ClassIf(name, add)
  57. return b
  58. }
  59. func (b *VParallaxBuilder) On(name string, value string) (r *VParallaxBuilder) {
  60. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  61. return b
  62. }
  63. func (b *VParallaxBuilder) Bind(name string, value string) (r *VParallaxBuilder) {
  64. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  65. return b
  66. }
  67. func (b *VParallaxBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  68. return b.tag.MarshalHTML(ctx)
  69. }