Skip to content

Commit

Permalink
add comp-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Apr 11, 2020
1 parent 93d9fc9 commit 71cc4ce
Show file tree
Hide file tree
Showing 6 changed files with 965 additions and 7 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Previews http://repo.quamolit.org/phlox/ .
[![Clojars Project](https://img.shields.io/clojars/v/quamolit/phlox.svg)](https://clojars.org/quamolit/phlox)

```edn
[quamolit/phlox "0.2.1-a1"]
[quamolit/phlox "0.2.1-a2"]
```

`render!` to add canvas to `<body/>`:
Expand Down Expand Up @@ -181,6 +181,7 @@ Notice that Pixi.js takes colors in hex numbers. `phlox.core/hslx` is added for
(comp-button
{:text "DEMO BUTTON",
:position [100 0],
:align-right? false
:on {:click (fn [e d!] (js/console.log "clicked" e d!))}})

(comp-button
Expand Down Expand Up @@ -231,6 +232,18 @@ Notice that Pixi.js takes colors in hex numbers. `phlox.core/hslx` is added for
:on-change (fn [value d!] (d! cursor (assoc state :value value)))})
```

`phlox.comp.messages/comp-messages` for rendering messages:

```clojure
(comp-messages
{:messages (:messages state),
:position [16 (- js/window.innerWidth 16)]
:color (hslx 0 0 50)
:fill (hslx 0 0 30)
:bottom? false
:on-click (fn [message d!])})
```

### Cursor and states

`>>` for branching states:
Expand Down

0 comments on commit 71cc4ce

Please sign in to comment.