• Re: Scale root object "page"

    From =?UTF-8?Q?Jonas_Th=C3=B6rnvall?=@21:1/5 to All on Thu Sep 23 06:06:29 2021
    torsdag 23 september 2021 kl. 14:44:45 UTC+2 skrev Jonas Thörnvall:
    Someone did post a solution to scale page some months ago.
    However i seem to lost the working code.

    Please repost?

    <style>
    :root{

    transform-origin:0 0;
    transform: scale(var --test));

    }
    </style>

    //This is to set scale depending on resolution.
    <script>

    // Get the root element
    var scaleData = document.querySelector(':root');
    alert(scaleData);

    // Create a function for getting a variable value
    function getScale() {
    // Get the styles (properties and values) for the root
    var screenScale = getComputedStyle(scaleData);
    alert(screenScale);
    // Alert the value of the --blue variable alert(scaleData.getPropertyValue('--test'));
    }

    // Create a function for setting a variable value
    function setScale() {
    r.style.setProperty('--test', '4');
    }
    getScale();
    setScale();
    </script>
    Sorry my bad found it!
    html {
    transform: scale(0.5);
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Jonas_Th=C3=B6rnvall?=@21:1/5 to All on Thu Sep 23 05:44:39 2021
    Someone did post a solution to scale page some months ago.
    However i seem to lost the working code.

    Please repost?

    <style>
    :root{

    transform-origin:0 0;
    transform: scale(var --test));

    }
    </style>

    //This is to set scale depending on resolution.
    <script>

    // Get the root element
    var scaleData = document.querySelector(':root');
    alert(scaleData);

    // Create a function for getting a variable value
    function getScale() {
    // Get the styles (properties and values) for the root
    var screenScale = getComputedStyle(scaleData);
    alert(screenScale);
    // Alert the value of the --blue variable
    alert(scaleData.getPropertyValue('--test'));
    }

    // Create a function for setting a variable value
    function setScale() {
    r.style.setProperty('--test', '4');
    }
    getScale();
    setScale();
    </script>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)