Mojolicious::Plugin::Responsinator - Simulate screen sizes
0.03
This module allow you to embed a given web page inside an iframe to see how it would look on different screens.
This is probably just a module you want to use while developing, and not bundle it with the final application. Example usage:
sub startup { my $self = shift; $self->plugin("responsinator") if $ENV{ENABLE_RESPONSINATOR}; }
You need to enable the plugin in your Mojolicious application:
use Mojolicious::Lite; plugin "responsinator"; get "/" => sub { shift->render(text => "test\n") }; app->start;
Then from the browser, you can ask for an URL with the "_size" param to embed a website inside an iframe. Example:
http://localhost:3000/some/path?_size=iphone # iphone landscape http://localhost:3000/some/path?_size=iphone:portrait # iphone portrait http://localhost:3000/some/path?_size=100x400 # width: 100px; height: 400px
You can replace "iphone" in the example above with any of the predefined sizes below:
iphone
iphone-5
ipad
wildfire
nexus-4
$self->reqister($app, \%config); $app->plugin(responsinator => \%config);
Will register an "around_dispatch" hook, which will trigger on the _size query param. %config can contain:
_size
%config
param
Use this to specify another query param than the default "_size".
The images are provided by the The Responsinator Team, http://www.responsinator.com.
The code is written by Jan Henning Thorsen, http://thorsen.pm.
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Mojolicious::Plugin::Responsinator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Responsinator
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Responsinator
For more information on module installation, please visit the detailed CPAN module installation guide.