Skip to content

Commit

Permalink
Reset :new-story/template on submission
Browse files Browse the repository at this point in the history
  • Loading branch information
motform committed Mar 31, 2022
1 parent 3a89a4f commit 72f4c38
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
19 changes: 13 additions & 6 deletions resources/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@ textarea:focus {
color: var(--fg);
}

.tab-label {
font-weight: 700;
align-self: center;
margin-top: -5px;
color: var(--fg);
}

.tab-label-inactive {
color: var(--accent-25);
}

.tab:hover {
background-color: var(--blurred-2);
color: var(--fg);
Expand All @@ -333,7 +344,7 @@ textarea:focus {
padding: 11px 18px 9px 18px;
background-color: transparent;
border: 1px solid var(--blurred-1);
color: var(--accent-25);
color: var(--blurred-2);
}

.tab-secondary:hover {
Expand Down Expand Up @@ -694,17 +705,13 @@ textarea:focus {
border-radius: 9999px;
background: var(--accent-8);
cursor: pointer;
z-index: 0;
/* z-index: 0; */
align-items: center;
justify-content: center;
color: var(--bg);
transition: transform 0.5s;
}

.personality:hover > svg {
transform: rotate(180deg);
}

.personality-active {
background: var(--accent-20);
}
Expand Down
4 changes: 3 additions & 1 deletion src/org/motform/multiverse/components/header.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
:on-pointer-out #(reset! *visible? false)}
label]
(when (or @*visible? active?)
[:label.tab-label "Add literary space"])]))))
[:label.tab-label
{:class (when (and @*visible? (not active?)) "tab-label-inactive")}
"Add literary space"])]))))

(defn tab [{:story/keys [title id]} active-story-id active-page]
[:div.tab.shadow-medium.tooltip-container.blurred
Expand Down
2 changes: 1 addition & 1 deletion src/org/motform/multiverse/components/map.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
(defn node-size [root active source]
(fn [node]
(let [id (.. node -data -name)
scale (case source :source/story 4 :source/compare 3 2)]
scale (if (= source :source/story) 4 2)]
(if (or (= root id) (= active id))
(* scale 2)
scale))))
Expand Down
2 changes: 1 addition & 1 deletion src/org/motform/multiverse/components/personality.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[:div.personality-toggle.prompt-personality-toggle.h-stack.centered.gap-half.rounded.pad-quarter
{:on-pointer-down #(rf/dispatch [:personality/active personality])
:class (when (= personality active-personality) "prompt-personality-toggle-active")}
[:div.personality.shadow-medium.tooltip-container.h-stack.centered
[:div.personality.shadow-medium.h-stack.centered
{:class (str (toggle-class personality active-personality))}]
[:div.v-stack.gap-eight
[:label.personality-label personality]
Expand Down
4 changes: 3 additions & 1 deletion src/org/motform/multiverse/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@
:new-story/submit
(fn [{:keys [db]} _]
(let [prompt (get-in db [:db/state :new-story/prompt])]
{:db (assoc-in db [:db/state :new-story/prompt] "")
{:db (-> db
(assoc-in [:db/state :new-story/prompt] "")
(assoc-in [:db/state :new-story/template] :template/blank))
:dispatch [:story/new prompt]})))

(reg-event-fx
Expand Down

0 comments on commit 72f4c38

Please sign in to comment.