AgP42 / MMM-SmartWebDisplay

The `MMM-SmartWebDisplay` module is for MagicMirror². It allow to display any web content to your MagicMirror.
57 stars 14 forks source link

Request: Add moduleOffset #2

Closed p4lsec closed 5 years ago

p4lsec commented 5 years ago

Hello,

would it be possible to integrate a moduleOffset parameter to allow for the exact placement of the module without needing to mess with custom.css, etc? MMM-RTSPStream has implemented this and it works extremely well. Thanks in advance!

AgP42 commented 5 years ago

Hello,

I checked this param into MMM-RTPStream :

moduleOffset | Only applies when using OMXPlayer. On some displays, the video does not properly line up with the box on the screen because of differences between JavaScript's reporting and the native display. Entering a pixel value will shift the video over by that amount.Default: 0 Values: Any number (no units) by itself will adjust both top/left the same amount, or you can specify left & top adjustments separately (e.g. moduleOffset: { left: 10, top: -10 }

So it is a parameter specifically needed on the context of his module.

As I understand, you would prefer to have a param to change the position of the iFrame instead of using CSS file ? On a technical point of view it is possible (as everything is possible !;-)), but it is not a good practice. CSS aim is to allow such fine tuning and I implemented it (not all modules allow specific CSS...) for this case. Also on the context of the MagicMirror, you have several position on the screen that are already predefined, so you cannot just define a position as an "offset".

On the CSS file, you can use the padding property : padding: 35px 70px 50px 90px;, this example will gives you a padding of 35 pixels for top, 70 pixels for right, 50 pixels for bottom, and to 90 pixels for left.

Good luck and I can help you for the CSS if you need,

Bye, AgP42