~repos /gromer

#golang#htmx#ssr

git clone https://pyrossh.dev/repos/gromer.git

gromer is a framework and cli to build multipage web apps in golang using htmx and alpinejs.


0c556b0d pyros2097

5 years ago
update readme
Files changed (2) hide show
  1. element.go +0 -35
  2. readme.md +4 -10
element.go CHANGED
@@ -406,41 +406,6 @@ func (e *elem) HtmlWithIndent(w io.Writer, indent int) {
406
406
  w.Write(stob(">"))
407
407
  }
408
408
 
409
- func (e *elem) ID(v string) *elem {
410
- e.setAttr("id", v)
411
- return e
412
- }
413
-
414
- func (e *elem) Style(k, v string) *elem {
415
- e.setAttr("style", k+":"+v)
416
- return e
417
- }
418
-
419
- func (e *elem) OnBlur(h EventHandler) *elem {
420
- e.setEventHandler("blur", h)
421
- return e
422
- }
423
-
424
- func (e *elem) OnChange(h EventHandler) *elem {
425
- e.setEventHandler("change", h)
426
- return e
427
- }
428
-
429
- func (e *elem) OnClick(h EventHandler) *elem {
430
- e.setEventHandler("click", h)
431
- return e
432
- }
433
-
434
- func (e *elem) OnFocus(h EventHandler) *elem {
435
- e.setEventHandler("focus", h)
436
- return e
437
- }
438
-
439
- func (e *elem) OnInput(h EventHandler) *elem {
440
- e.setEventHandler("input", h)
441
- return e
442
- }
443
-
444
409
  type text struct {
445
410
  jsvalue Value
446
411
  parentElem UI
readme.md CHANGED
@@ -110,18 +110,12 @@ func Clock(c *RenderContext, title string) UI {
110
110
  ),
111
111
  ),
112
112
  Row(
113
- Div(Css("text-6xl m-20 cursor-pointer select-none"),
113
+ Div(Css("text-6xl m-20 cursor-pointer select-none"), OnClick(startTimer),
114
114
  Text("Start"),
115
- ).
116
- OnClick(func(ctx Context, e Event) {
117
- startTimer()
118
- }),
115
+ ),
119
- Div(Css("text-6xl m-20 cursor-pointer select-none"),
116
+ Div(Css("text-6xl m-20 cursor-pointer select-none"), OnClick(stopTimer),
120
117
  Text("Stop"),
121
- ).
122
- OnClick(func(ctx Context, e Event) {
123
- stopTimer()
124
- }),
118
+ ),
125
119
  ),
126
120
  )
127
121
  }