root/veekun/trunk/lib/Vee/Controller/Style.pm

Revision 370, 2.0 KB (checked in by eevee, 2 years ago)

Dimmed non-submit buttons slightly.

Line 
1package Vee::Controller::Style;
2
3use strict;
4use warnings;
5use base 'Catalyst::Controller';
6
7=head1 NAME
8
9Vee::Controller::Style - Style Controller
10
11=head1 SYNOPSIS
12
13See L<Vee>.
14
15=head1 DESCRIPTION
16
17Catalyst Controller for stylesheets.
18
19=head1 METHODS
20
21=cut
22
23=head2 default
24
25=cut
26
27# this will be fleshed/migrated out later, when I have interchangeable color schemes and such
28
29my %colors = (
30    body_fill       => '#bf9960',
31    title_text      => '#807059',
32    content_fill    => '#fff5e6',
33
34    link_normal     => '#40a040',
35    link_visited    => '#208020',
36
37    link_light      => '#cfe6b8',
38    link_medium     => '#a0c080',
39    link_dark       => '#769953',
40    link_dimmed     => '#dbe6cf',
41
42    hover_verylight => '#f2d3c9',
43    hover_light     => '#e6b8b8',
44    hover_medium    => '#c08080',
45    hover_dark      => '#995353',
46
47    header_fill     => '#e6d3b8',
48    header_text     => '#806640',
49    header_border   => '#c0a680',
50
51    input_active    => '#fffde6',
52
53    dark_separator  => '#806640',
54
55    tablerow_fill2  => '#f6e9d6',
56    tablerow_dim    => '#f6f6f6',
57    tablerow_dim2   => '#eaeaea',
58
59    code            => 'darkblue',
60
61    glass_background_disabled   => sub { shift },
62    glass_background_correct    => sub { "url(/images/bg-fade.png) $_[0] fixed left bottom no-repeat" },
63);
64
65sub style : Path : Args(1) {
66    my ($self, $c, $filename) = @_;
67
68    $c->stash( %colors );
69
70    if ($c->req->user_agent =~ /MSIE (\d+)/ and $1 < 7
71        and $c->req->user_agent !~ /Opera/)
72    {
73        $c->stash( glass_background => $colors{glass_background_disabled} );
74    } else {
75        $c->stash( glass_background => $colors{glass_background_correct} );
76    }
77
78    $c->stash->{template} = 'style/' . $filename . '.tt';
79    $c->stash->{skip_wrapper} = 1;
80    $c->res->content_type('text/css');
81}
82
83=head1 AUTHOR
84
85Maintainer: Alex "Eevee" Munroe (C<veekun@veekun.com>)
86
87See the included F<AUTHORS> file for a full list of contributers.
88
89=head1 LICENSE
90
91See the included F<LICENSE> file.
92
93=cut
94
951;
Note: See TracBrowser for help on using the browser.