“picsum.photos/200/300.jpg” is the URL that shows the image randomly.
I set up the css like this
And in the Front Template, I added this
var img = document.createElement('img');
img.src = 'picsum.photos/200/300?random=' + Math.random();
document.querySelector('.card').style.backgroundImage = 'url(' + img.src + ')';
I wanted a background image that changed randomly.
It works, but…
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).
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.