Want I want to learn how to do is: add background images and transparency to the page itself and to the different components on it.
I’ve found other posts that say that for doing certain things you need to use a custom page, but this implies that you know HTML and CSS, which I don’t. (one of the reasons I’m loving Anvil)
I’ve tried several modifications to the .css file of the theme, but got no results at all.
The standard-page is not an html page in which you can happily set the background-image property and see it displayed. (as you probably would do in a plain HTML page)
So, I would really appreciate advice on this. Particurlarly on how to achieve the background image and transparency stylings.
I’ve already read the tutorials on css styling and the Material Design, but I’m still unable to see any changes on the page.
Update: I also tried to reproduce exactly what is done in the Simple Web Page example, creating a role and assigning it, but the image resists to show.
Apparently I cannot add a column panel outside the one that is already given with the theme because I used the Material design. I don’t know if that might have something to do with the image not displaying.
Lost (me … not the series )
Here is the app in case you want to try to spot where the problem could be. It is just a barely improved version of one of the tutorials.
I’m using material design 3 and I don’t have any problems with it.
I’m not sure how you could add it to the page in anvil without HTML. It would be possible maybe to add it to some component as a role, but don’t do that. It would cause strange appearing of the image miliseconds after the form was loaded.
Transparency is other thing. You need to add roles on the objects that you are showing with transparency CSS:
I’m not super sure how they got this to work with pure css (but I’m bad at css and better at js). However, you can do this with a bit of jQuery in the show event:
# I always import jQuery as jq for simplicity
from anvil.js.window import jQuery as jq
jq(get_dom_node(self)).css("background-image", "url('_/theme/bird flap.jpg')")
Also, its important to note, you need to have a component on the blank page for the background to show up. That’s why I added a really tall column panel so you could see that the background image is actually there.