Tags::HTML::Login::Button - Tags helper for login button.
use Tags::HTML::Login::Button; my $obj = Tags::HTML::Login::Button->new(%params); $obj->process; $obj->process_css;
new
my $obj = Tags::HTML::Login::Button->new(%params);
Constructor.
Returns instance of object.
css
'CSS::Struct::Output' object for process_css processing.
Default value is undef.
link
Login button link.
Default value is 'login'.
tags
'Tags::Output' object.
title
Login button title.
Default value is 'LOGIN'.
process
$obj->process($percent_value);
Process Tags structure for gradient.
Returns undef.
process_css
$obj->process_css;
Process CSS::Struct structure for output.
new(): From Class::Utils::set_params(): Unknown parameter '%s'. From Tags::HTML::new(): Parameter 'css' must be a 'CSS::Struct::Output::*' class. Parameter 'tags' must be a 'Tags::Output::*' class. process(): From Tags::HTML::process(): Parameter 'tags' isn't defined. process_css(): From Tags::HTML::process_css(): Parameter 'css' isn't defined.
use strict; use warnings; use CSS::Struct::Output::Indent; use Tags::HTML::Login::Button; use Tags::Output::Indent; # Object. my $css = CSS::Struct::Output::Indent->new; my $tags = Tags::Output::Indent->new; my $obj = Tags::HTML::Login::Button->new( 'css' => $css, 'tags' => $tags, ); # Process login button. $obj->process_css; $tags->put(['b', 'body']); $obj->process; $tags->put(['e', 'body']); # Print out. print "CSS\n"; print $css->flush."\n\n"; print "HTML\n"; print $tags->flush."\n"; # Output: # CSS # .outer { # position: fixed; # top: 50%; # left: 50%; # transform: translate(-50%, -50%); # } # .login { # text-align: center; # } # .login a { # text-decoration: none; # background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%); # background-repeat: repeat-x; # border: 1px solid #adadad; # border-radius: 4px; # color: black; # font-family: sans-serif!important; # padding: 15px 40px; # } # .login a:hover { # background-color: #e0e0e0; # background-image: none; # } # # HTML # <body class="outer"> # <div class="login"> # <a href="login"> # LOGIN # </a> # </div> # </body>
use strict; use warnings; use CSS::Struct::Output::Indent; use Plack::App::Tags::HTML; use Plack::Runner; use Tags::Output::Indent; use Unicode::UTF8 qw(decode_utf8); my $app = Plack::App::Tags::HTML->new( 'component' => 'Tags::HTML::Login::Button', 'constructor_args' => { 'title' => decode_utf8('Přihlašovací tlačítko'), }, 'css' => CSS::Struct::Output::Indent->new, 'tags' => Tags::Output::Indent->new( 'xml' => 1, 'preserved' => ['style'], ), 'title' => decode_utf8('Přihlašovací tlačítko'), )->to_app; Plack::Runner->new->run($app); # Output screenshot is in images/ directory.
Class::Utils, Error::Pure, Tags::HTML.
Tags helper for login access.
https://github.com/michal-josef-spacek/Tags-HTML-Login-Button
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2021-2023 Michal Josef Špaček
BSD 2-Clause License
0.04
To install Tags::HTML::Login::Button, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tags::HTML::Login::Button
CPAN shell
perl -MCPAN -e shell install Tags::HTML::Login::Button
For more information on module installation, please visit the detailed CPAN module installation guide.