Skip to content

Commit

Permalink
feat(color): add annotate-colour
Browse files Browse the repository at this point in the history
  • Loading branch information
oflg committed Oct 15, 2023
1 parent 38649f6 commit fe8b79e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
21 changes: 12 additions & 9 deletions buttons/action/repeat.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 6,9 @@ code-body: yes
\define tv-action-refresh-policy() always

<$let
rating_n=<<rating>>
rating={{{ [<rating>!is[blank]match[Retain]then[Good]else<rating>] }}}
rating_nlow={{{ [<rating_n>lowercase[]] }}}
rating_low={{{ [<rating>lowercase[]] }}}
rating_origin=<<rating>>
rating={{{ [<rating>match[Again]then<rating>] ~[<rating>match[Hard]then<rating>] ~[<rating>match[Easy]then<rating>] ~[[Good]] }}}
color={{{ [<rating>match[Again]then[red]] ~[<rating>match[Hard]then[orange]] ~[<rating>match[Easy]then[DodgerBlue]] ~[[green]] }}}
>
<$let
currentTiddler=<<studyTiddler>>
Expand All @@ -27,8 26,8 @@ code-body: yes
/>
</$list>
<$action-setmultiplefields
$fields="[<card>jsonindexes[]]"
$values="[<card>jsonindexes[]] :map[<card>jsonget<currentTiddler>]"
$fields="[<card>jsonindexes[]] =annotate-colour"
$values="[<card>jsonindexes[]] :map[<card>jsonget<currentTiddler>] =[<color>]"
$timestamp={{$:/config/TimestampDisable}}
/>
<$action-setfield
Expand All @@ -45,10 44,14 @@ code-body: yes
/>
<div>
<div class="tmc-text-sg">
<$text text={{{ [<card>jsonget[due]format:relativedate[]] }}}/>
<$text
text={{{ [<card>jsonget[due]format:relativedate[]] }}}
/>
</div>
<div class=`tmc-btn-$(rating_low)$`>
<$text text={{{ [<rating_nlow>addprefix[$:/language/tidme/]get[text]] }}}/>
<div class=`tmc-btn-${ [<rating>lowercase[]] }$` style=`color:$(color)$;`>
<$text
text={{{ [<rating_origin>else[Good]lowercase[]addprefix[$:/language/tidme/]get[text]] }}}
/>
</div>
</div>
</$let>
Expand Down
2 changes: 1 addition & 1 deletion plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 8,5 @@
"plugin-type": "plugin",
"source": "https://github.com/oflg/Tidme",
"title": "$:/plugins/tidme/fsrs4tw",
"version": "1.4.4"
"version": "1.5.0"
}
16 changes: 0 additions & 16 deletions styles.tid
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 86,6 @@ title: $:/plugins/tidme/fsrs4tw/styles.css
align-items: flex-end;
}

.tmc-btn-again{
color: red !important;
}

.tmc-btn-hard{
color: orange !important;
}

.tmc-btn-good{
color: green !important;
}

.tmc-btn-easy{
color: blue !important;
}

.tmc-decks-button-wrapper{
display:flex;
justify-content: space-around;
Expand Down

0 comments on commit fe8b79e

Please sign in to comment.