Setting the top toolbar background image

“picsum.photos/200/300.jpg” is the URL that shows the image randomly.

I set up the css like this

.card {
    background-image: url("picsum.photos/200/300.jpg");
}

And in the Front Template, I added this

<script>
var img = document.createElement('img');
img.src = 'picsum.photos/200/300?random=' + Math.random();
document.querySelector('.card').style.backgroundImage = 'url(' + img.src + ')';
</script>

I wanted a background image that changed randomly.

It works, but…

CleanShot 2023-04-07 at 20.53.33

The top toolbar is not working as I intended.

Is there any way to apply a background image except for the top toolbar?

The background is copied at the time of the card flip and doesn’t wait for any changes made via JS afterwards.

We could troubleshoot this, but I think it will be easier for you to just wait for the next big Anki update, which will not have the issue to begin with.

For now you could hide the toolbar during review (there’s a setting for that in the preferences).

1 Like

Is this the setting to hide the toolbar?

Too bad it doesn’t hide the background image.

I’ll wait for the next big update.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.