If I am a mod > 50, I should be able to setup a background image for a room :dancer:
related: #5844
I made a rough demo patch with a basic implementation of this here (raw). The patch is extremely rough as it was only made to test the feature, and currently only works with the dark theme. Here's a screenshot
My patch fills the background of the entire app with the image, rather than just the room's timeline. I personally found this more aesthetically pleasing, but if this were to be developed as a legitimate patch, there would likely need to be more discussion about where the image should actually be drawn.
My patch allows rooms to have a background set both in the rooms state as well as individual users' account room data, allowing users to override backgrounds for themselves. Again, discussion would need to be had to decide if this is necessary.
The patch defines a host.katie.room.background event which contains an image url and fill mode. fill basically just corresponds to the CSS background-size property, meaning users can set the image to either stretch to fill the screen or tile to fit it.
The JS for this patch is much simpler than I'd expected it to be, the biggest pain was the CSS; as my patch fills the entire background, it needed to make the backgrounds for many elements transparent. I doubt the CSS in the patch is up to the quality standards for this repo. There would likely be much less CSS hackiness if the background only applied to the timeline rather than the whole app.
Most helpful comment
I made a rough demo patch with a basic implementation of this here (raw). The patch is extremely rough as it was only made to test the feature, and currently only works with the dark theme. Here's a screenshot
My patch fills the background of the entire app with the image, rather than just the room's timeline. I personally found this more aesthetically pleasing, but if this were to be developed as a legitimate patch, there would likely need to be more discussion about where the image should actually be drawn.
My patch allows rooms to have a background set both in the rooms state as well as individual users' account room data, allowing users to override backgrounds for themselves. Again, discussion would need to be had to decide if this is necessary.
The patch defines a
host.katie.room.backgroundevent which contains an imageurlandfillmode.fillbasically just corresponds to the CSSbackground-sizeproperty, meaning users can set the image to either stretch to fill the screen or tile to fit it.The JS for this patch is much simpler than I'd expected it to be, the biggest pain was the CSS; as my patch fills the entire background, it needed to make the backgrounds for many elements transparent. I doubt the CSS in the patch is up to the quality standards for this repo. There would likely be much less CSS hackiness if the background only applied to the timeline rather than the whole app.