boombatower / chromecast-dashboard

A simple dashboard application for Chromecast.
https://boombatower.github.io/chromecast-dashboard/sender/
GNU General Public License v2.0
437 stars 78 forks source link

Ability to zoom casted page #9

Closed cvuorinen closed 5 years ago

cvuorinen commented 6 years ago

Hi,

Thanks for this useful utility, just found out about it and works nicely to display a dashboard page. In my case the page does not fit very nicely though and I was just wondering if it would be possible to add a zoom feature to it.

Something like using CSS -webkit-transform: scale(0.75); on the iframe element (where the scale would be assignable by the user). https://stackoverflow.com/questions/166160/how-can-i-scale-the-content-of-an-iframe

What do you think?

boombatower commented 6 years ago

Seems like a useful idea. At this point the standardized transform property should be used instead of a prefix, especially since only has to support chromecast. Alternatively, I would imagine this could be done by creating a wrapper page yourself and using that in the dashboard.

cvuorinen commented 6 years ago

Thanks for the suggestion. I actually already solved it by adding a possibility to pass in a zoom factor to the page as a URL parameter. If the dashboard was something I could not modify myself, then the wrapper would have been a good solution.

sahaskatta commented 5 years ago

@cvuorinen Do you have the modification to the code that allows passing in the zoom factor? I need the exact same feature!

cvuorinen commented 5 years ago

It was just a quick snippet of some js to get param from URL and apply it to document body:

$(function () {
    var params = ['zoom', 'margin'];

    params.map(function (param) {
        if (urlParam(param)) {
            $('body').css(param, urlParam(param));
        }
    });
});

function urlParam(name) {
    var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
    return results && decodeURIComponent(results[1]) || null;
}