Skip to content

Commit

Permalink
stop using checkmark for matches
Browse files Browse the repository at this point in the history
Fixes: #184
  • Loading branch information
zkat committed Jun 9, 2024
1 parent 5d6737c commit e514b51
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/mechanics/css/dlist-clock.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
content: " → ";
}
}
&.out-of {
margin-left: calc(var(--item-gap) * -1);
}
}
}
4 changes: 4 additions & 0 deletions src/mechanics/css/dlist-progress.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,9 @@
&.to-ticks:after {
content: "t";
}

&.from-ticks, &.to-ticks {
margin-left: calc(var(--item-gap) * -1);
}
}
}
17 changes: 15 additions & 2 deletions src/mechanics/css/dlist-shared.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
.iron-vault-mechanics dl {
--item-gap: 0.3em;
display: flex;
flex-flow: row wrap;
gap: var(--item-gap);
&:before {
margin-right: 0.5em;
}
&:after {
font-weight: var(--font-semibold);
padding-left: 0.5em;
}
&.match.strong-hit:after {
color: var(--text-success);
}
&.match.miss:after {
color: var(--text-error);
}
&.match:after {
content: "✅";
content: "match";
text-transform: uppercase;
font-weight: var(--font-bold);
font-size: 0.8em;
padding: 0.2em 0;
}
& dt {
display: none;
}
& dd {
margin: 0;
padding: 0;
display: inline;
font-weight: var(--font-semibold);
& * {
display: inline;
Expand Down
4 changes: 4 additions & 0 deletions src/mechanics/css/dlist-track.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@
&.to-ticks:after {
content: "t";
}

&.from-ticks, &.to-ticks {
margin-left: calc(var(--item-gap) * -1);
}
}
}
20 changes: 18 additions & 2 deletions src/mechanics/css/summary.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,37 @@
&[open] summary:has(+ *) {
border-bottom: 1px dashed var(--color-base-50);
}
& summary > :first-child {
flex-grow: 1;
display: flex;
flex-flow: row nowrap;
align-items: center;
}
&.strong-hit summary > :first-child:after {
background-image: url("img/Outcomes/outcome-strong-hit.svg");
color: var(--text-success);
}
&.weak-hit summary > :first-child:after {
background-image: url("img/Outcomes/outcome-weak-hit.svg");
}
&.miss summary > :first-child:after {
background-image: url("img/Outcomes/outcome-miss.svg");
color: var(--text-error);
}
&.match summary > :first-child:after {
content: "✅";
content: "match";
text-transform: uppercase;
font-weight: var(--font-bold);
font-size: 0.8em;
padding: 0.2em 0;
padding-right: 3.4em;
}

& summary {
display: block;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: center;
border: none;
min-height: 2em;
width: 100%;
Expand Down
9 changes: 0 additions & 9 deletions src/mechanics/mechanics-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
MarkdownRenderer,
} from "obsidian";

import { MoveModal } from "moves/move-modal";
import { ProgressTrack } from "tracks/progress";
import IronVaultPlugin from "../index";

Expand Down Expand Up @@ -245,14 +244,6 @@ export class MechanicsRenderer {
const summary = this.moveEl.createEl("summary");
if (moveName) {
await this.renderMarkdown(summary, moveName);
if (move) {
const modal = new MoveModal(this.plugin.app, this.plugin, move);
const btn = new ButtonComponent(summary);
btn
.setButtonText("?")
.setTooltip("View move text.")
.onClick(() => modal.open());
}
}
await this.renderChildren(this.moveEl, node.children, true);
}
Expand Down
12 changes: 11 additions & 1 deletion test-vault/Journals/Chapter 01.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,15 @@ a single multiline string.

```mechanics
burn from=6 to=2
```
move "[Strike](move:starforged\/moves\/combat\/strike)" {
roll "iron" action=2 adds=0 stat=3 vs1=10 vs2=10
}
move "[Endure Harm](move:starforged\/moves\/suffer\/endure_harm)" {
add 1
roll "health" action=3 adds=1 stat=5 vs1=2 vs2=2
}
```
2 changes: 1 addition & 1 deletion test-vault/Journals/Chapter 02.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ And then more stuff happened
move "Begin a Session" {
- "+1 momentum"
}
```
```

0 comments on commit e514b51

Please sign in to comment.