Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

First, big ++ to epoptai for this really nice CB client with tons of functionnalities. Hey! it even links to Babelfish!
Though this is a realy cool piece of code, I wanted to add a nifty progress bar (like the one in the Tk Client), so here it is (you may want to change the colors to git your favorite theme)

Line 290:

my$nxtlvl = ($xpinfo->{'level'}+1); # line 290 my@levelXP = qw(0 0 20 50 100 200 500 1000 1600 2300 3000); my $percentXP = int(( ($xpinfo->{'xp'} - $levelXP[$xpinfo->{'level'}]) + / ($xpinfo->{'xp'}-$levelXP[$xpinfo->{'level'}]+$xpinfo->{'xp2nextle +vel'})) * 100) ; my @XPcolors = qw(4A2625 71131C 9A0213 BD0606 FF0000 9E3B00 1D8700 41A +F00 12E800 00FF00); my $rest = abs(100-$percentXP);

Line 297

<table border="0" height="100%" width="100%" cellpadding="0" cellspaci +ng="0" align="center"> # Line 297 <tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%" +><tr><td bgcolor="#$XPcolors[int($percentXP/10)-1]" width="$percentXP +%">&nbsp;</td><td width="$rest%"bgcolor="#CCCCCC">&nbsp;</td></tr></t +able></td></tr>

Update: Added coloration according to the user's progress (gradient from red to green)

Cheers, OeufMayo

<kbd>--
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>

In reply to Re: framechat (XP progress bar) by OeufMayo
in thread framechat by epoptai

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others taking refuge in the Monastery: (2)
    As of 2024-09-08 20:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.