Read the statement by Michael Teeuw here.
Change layout based on orientation?
-
@gonzonia yeh screen shifting is different than module shifting
you can certainly detect the orientation in css
on another app i support
:root{ --scale-factor: 1; /* set default scaling in case we have partial window, debug or in vm terminal window */ --design-width: 1920px; --design-height: 1080px; } @media screen and (orientation: landscape) { :root{ --scale-factor: var(width) / var(--design-width); }; } @media screen and (orientation: portrait) { :root{ --scale-factor: var(width) / var(--design-height); }; } /*@media screen and (width:3840px) and (orientation: landscape) { :root{ --scale-factor: width/var(--design-width); }; } @media screen and (width:1080px) { :root{ --scale-factor: width/var(--design-width); }; }*/
-
@sdetweil Yeah the challenge I’m having with the way I’ve chosen to lay things out is that I have things in the top left, top center, and top right. They are just below things in the top bar on the vertical screen. Using the CSS from the post that shifts them They are still below the top bar but I kind of want them to the right of the top bar. I’m plying with it to see what I can do, but since they are all part of the same container, I’m not sure I can.
-
@gonzonia there is a moduke that can
move dynamically
https://github.com/Toreke/MMM-Dynamic-Modulesbut it needs notifications
-
@gonzonia or start a different instance on a different port for landscape
-
@sdetweil That’s a thought. I think I can probably adapt the Dynamic Modules to allow for a config option to adjust based on orientation and that gets triggered at the ALL_MODULES_STARTED notification from the core.
Let me fork that and see if I can make that work.
-
-
@sdetweil Maybe. I find it easier to build on someone else’s code. After I have some basic stuff functioning, I’ll look for a module template to work from. I’m also not sure the dynamic module will work (it’s 7 years old) so it might need to be updated anyhow.
-
@gonzonia all you need is a
notificationReceived
“DOM_OBJECTS_CREATED”
if the width is greater than the height its landscape
then loop thru the config -
@sdetweil I’m going to make it more dynamic. There’s actually screen.orientation.type that works to get landscape vs portrait
-
@gonzonia sameo