Commit 3704089247b0a556e07a8244b11c043a48ef19be
Add transitions because why not
License: MIT Signed-off-by: Victor Bjelkholm <git@victor.earth>victorbjelkholm committed on 5/9/2020, 11:19:54 AM
Parent: 7c7b405409c95869f77c036cea58ebbd301b3803
Files changed
statechart-examples/src/statechart_examples/examples/toggle.cljs | changed |
statechart-examples/src/statechart_examples/examples/toggle.cljs | ||
---|---|---|
@@ -19,13 +19,17 @@ | ||
19 | 19 … | {:style {:height 40 |
20 | 20 … | :width 80 |
21 | 21 … | :border "2px solid grey" |
22 | 22 … | :display "flex" |
23 | - :justify-content (ifstate machine :inactive "flex-start" "flex-end") | |
24 | - :background-color (ifstate machine :inactive "lightgrey" "lightblue") | |
23 … | + :justify-content "flex-start" | |
24 … | + :background-color (ifstate machine :active "lightblue" "lightgrey") | |
25 | 25 … | :align-items "center" |
26 | 26 … | :border-radius 30}} |
27 | 27 … | [:div |
28 | - {:style {:background-color (ifstate machine :inactive "black" "blue") | |
28 … | + {:style {:background-color (ifstate machine :active "blue" "black") | |
29 … | + :transform (ifstate machine :active "translateX(100%)" "translateX(0%)") | |
30 … | + :transition "transform 350ms" | |
31 … | + :transition-timing-function "cubic-bezier(0.85, 0, 0.15, 1)" | |
32 … | + ;; :transition-timing-function "ease-in-out" | |
29 | 33 … | :height 40 |
30 | 34 … | :width 40 |
31 | 35 … | :border-radius 40}}]]]]) |
Built with git-ssb-web