Skip to content

Commit

Permalink
move css
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Apr 17, 2023
1 parent 533db32 commit ef9d58d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
25 changes: 1 addition & 24 deletions answer_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,6 @@ def filter_answer_buttons(buttons: tuple, self: Reviewer, _: Card) -> tuple[tupl
return buttons


def get_ease_row_css() -> str:
return """
<style>
.ajt__ease_row {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: flex-start;
max-width: 450px;
min-width: 200px;
user-select: none;
margin: -3px auto 0;
}
.ajt__ease_row > * {
white-space: nowrap;
font-size: small;
font-weight: normal;
}
.ajt__ease_row > .ajt__stat_txt:only-child {
margin: 0 auto;
}
</style>
"""


def make_buttonless_ease_row(self: Reviewer, front: bool = False) -> str:
Expand Down Expand Up @@ -95,7 +72,7 @@ def stat_txt():
ease_row.extend(button_time(ease) for ease, label in self._answerButtonList())
if front is True:
ease_row.insert(len(ease_row) // 2, stat_txt())
return get_ease_row_css() + f'<div class="ajt__ease_row">{"".join(ease_row)}</div>'
return EASE_ROW_STYLE + f'<div class="ajt__ease_row">{"".join(ease_row)}</div>'


def disable_buttons(html: str) -> str:
Expand Down
22 changes: 22 additions & 0 deletions consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@
Please enable the V2 scheduler in Preferences.
</font>
"""
EASE_ROW_STYLE = """
<style>
.ajt__ease_row {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: flex-start;
max-width: 450px;
min-width: 200px;
user-select: none;
margin: -3px auto 0;
}
.ajt__ease_row > * {
white-space: nowrap;
font-size: small;
font-weight: normal;
}
.ajt__ease_row > .ajt__stat_txt:only-child {
margin: 0 auto;
}
</style>
"""
BOTTOM_TABLE_STYLE = """
<style>
#innertable tr {
Expand Down

0 comments on commit ef9d58d

Please sign in to comment.