anki-addons icon indicating copy to clipboard operation
anki-addons copied to clipboard

Replay buttons on card and 2.1.20

Open Arthur-Milchior opened this issue 4 years ago • 9 comments

Anki 2.1.20 (currently in beta) adds a button to replay sounds. That's great. This means that this add-on become obsolete. You might want to add the information on anki, "-19", to indicate that's it can be used up to version 19.

Arthur-Milchior avatar Jan 23 '20 12:01 Arthur-Milchior

Not quite obsolete I'd say. So far the new button has a huge white circle for no apparent reason, and since it's a static img/png you can't get rid of (just) that.

I'd hope that either Anki directly switches to this addon's handling or the addon is altered to now replace that img with its cleaner svg.

twwn avatar Jan 25 '20 15:01 twwn

Let me rephrase then Current version of the add-on is obsolete; adding a second button makes no sens. Replacing one button by another one would be a nice change. You can also give your feedback about the button size on https://anki.tenderapp.com/ I won't do it because I don't care, but that's probably the kind of thing Damien Elmes would like to know

Arthur-Milchior avatar Jan 25 '20 17:01 Arthur-Milchior

Left him a post yesterday, yes. I do hope he picks up this behavior as it matches AnkiDroid's, which likewise injects a svg.

(About the second button: There's none currently as the hooks also changed. For me addon does nothing on 2.1.20.)

twwn avatar Jan 25 '20 19:01 twwn

I’v added a note at Ankiweb. I’l now think about what to do. Maybe i’l look at a way to hide the original button. But that wil probably take a while, as i don’t work too much on these add-ons any more.

ospalh avatar Jan 25 '20 19:01 ospalh

It is not obsolete. Anki 2.1.20 sound button doesn't look good (in my humble subjective opinion).

This is how Anki sound icon looks like: https://i.imgur.com/kWoNbig.png

I had this beautiful svg button https://i.imgur.com/RzzkivL.png

The advantage of svg is that users can easily change color and adjust size.

.card .replaybutton svg {
    fill:  #3399ff;
}

I was given this here: https://github.com/ospalh/anki-addons/issues/122

Damien will not implement this add-on in Anki. I already proposed it here: https://anki.tenderapp.com/discussions/beta-testing/1708-anki-2120-beta/page/1#comment_48042382 but with no response to this idea from Damien.

Edition: They can be styled a bit https://apps.ankiweb.net/docs/manual.html#audio-replay-buttons but still this is not the same effect as I showed with my styling for add-on.

omega3 avatar Feb 14 '20 19:02 omega3

I can update the add-on to ensure it hides Anki's button and use the one fo this add-on instead. If anyone want to hire me, we can discuss it. I must state that my original post was really about telling you the add-on was, as far as I see it, obsolete. I was not looking to find clients here

Arthur-Milchior avatar Feb 14 '20 21:02 Arthur-Milchior

I figured out how to achieve the effect that I had before without add-on.

In Styling section of cards

.replay-button svg path { stroke: #2f2f31; fill: #3399ff; }
.replay-button { width: 35px; }
.replay-button svg circle {
  fill: #2f2f31;
  stroke: #2f2f31;
}

.card.nightMode { background-color: #2f2f31; }

Adjust colors to your liking. Colors should match background color for the circle to disappear.

The piece of code for this is in reviewer.css. At least in tar.bz2 version for Linux.

In this case add-on seems to be unnecessary, unless it can provide some extra features.

omega3 avatar Feb 16 '20 10:02 omega3

Add-on may be simpler for users: adding a number in manager instead of changing every note type. But I admit that seems less necessary than if you didn't have this CSS

Arthur-Milchior avatar Feb 16 '20 10:02 Arthur-Milchior

Something like this can also be used to make it look exactly the same as before. To make it black, delete or replace fill='blue' with fill='black'.

.replay-button {
 content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='blue'><polygon points='11,25 25,16 11,7'></polygon></svg>");
}

kelciour avatar Feb 17 '20 04:02 kelciour