ISH-Gruppe / screenario

Screenario - The screen for every scenario
https://screenar.io
GNU General Public License v3.0
2 stars 2 forks source link

Create WorkPhase component #8

Closed s-gbz closed 2 years ago

s-gbz commented 2 years ago

Hey @liam-k there is a topic we need to discuss concerning this module: The module basicly sets the background to an img source. Is there something we need to mind whilst implementing this in react?

The way I've implemented this before, was placing an empty image element at the applications top level (AppComponent). I've then located the element via documet.getElementById() and applied the requested img.src to element's css background property.

See https://github.com/s-gbz/Screenario/commit/07ae99ffb906ed48f7b9c1f43a521ecd97227060 for reference.

liam-k commented 2 years ago

Ooof yeah, didn’t think about that. I think I’d leave the top level component (App or WindowManager) out of it if possible. WorkPhase could just create a screen-filling image element (position:absolute) which has its z-index set to [less than all other windows] via css. That way it doesn’t matter where the element is in the document tree and we don’t have to touch any top level stuff.

Then we just manage the state in WindowManager as with all other components.

s-gbz commented 2 years ago

I can't remember exactly, but there's been some specific reason why I've placed the image container so far up top. Might just've been some Angular specific thing though, really can't tell at this point - though.. thinking of the implementation I have trouble imagining how you would create such an element from within an isolated module. Another point is that the background image might be supposed to remain active even if it's mother module is (temporarily) hidden.

OR

we could simply display the image inside the module and leave it to the user to put it in fullscreen mode (speaking of, I think we should definetly consider adding a "fullscreen-button" to the BaseComponent's Toolbar).

The second option might even be better since I've noticed that the current version seems to be troubled by modules that cover the status and thus make it unreadable. What do you think? Perhaps there's another solution I haven't considered at all?