trgkanki / cloze_hide_all

GNU Affero General Public License v3.0
11 stars 3 forks source link

Bug report + request: Toggle button #29

Closed warfarincoumadin closed 3 years ago

warfarincoumadin commented 3 years ago

On the back template, there is a spelling mistake. The lines

<button class='cloze2-toggle' onclick='toggle()'>Toogle Mask</button>
<!-- (Always) /Hide others on the back side -->

should read 'Toggle' instead of 'Toogle'. I would, however, recommend changing the phrasing to 'Reveal All' to make it more clear what the button is doing and adding a line break to space it a bit from the main text.

<br>
<button class='cloze2-toggle' onclick='toggle()'>Reveal All</button>
<!-- (Always) /Hide others on the back side -->

The appearance of the button could also be improved to fall in line with Anki styling;

.cloze2-toggle {
    -webkit-appearance: none;
    display: block;
    font-size: 1.3em;
    height: 2em;
    background-color: #ffffff;
    width: 100%;
    margin-top: 20px;
}

can be replaced with

.cloze2-toggle {
    display: block;
    appearance: button; 
    margin-left:auto;
    margin-right:auto;
}

The following lines have to be removed completely:

.cloze2-toggle:active {
    background-color: #ffffaa;
}

This will result in a button with the same styling as the rest of the Anki interface.

Finally, when revealing all clozes via pressing the button, the clozes should become distinguishable from the rest of the text. This is achieved by replacing:

cloze2.reveal-cloze2 {
    display: inline;
}

with

cloze2.reveal-cloze2 {
    display: inline;
    color: #0074D9;
}

The colour code has to be adjusted. #0074D9 is used in the [...] (three grey dots) CHA template.

phu54321 commented 3 years ago

Please split your issues.