tazpkg rev 731
pkgs.cgi: style tag cloud.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Dec 28 06:11:25 2014 +0200 (2014-12-28) |
parents | 891dbeab2453 |
children | 0c62d7e3cbfb |
files | tazpanel/pkgs.cgi tazpanel/pkgs.css |
line diff
1.1 --- a/tazpanel/pkgs.cgi Sun Dec 28 05:10:28 2014 +0200 1.2 +++ b/tazpanel/pkgs.cgi Sun Dec 28 06:11:25 2014 +0200 1.3 @@ -1175,7 +1175,11 @@ 1.4 else 1.5 echo "<h2>$(_ 'Tags list')</h2>" 1.6 echo "<p>" 1.7 - awk -F$'\t' '{if($6){print $6}}' $PKGS_DB/packages.info | tr ' ' $'\n' | sort -u | sed 's|.*|<a href="?tag=&">&</a> |' 1.8 + TAGS="$(awk -F$'\t' '{if($6){print $6}}' $PKGS_DB/packages.info | tr ' ' $'\n' | sort | uniq -c)" 1.9 + MAX="$(echo "$TAGS" | awk '{if ($1 > MAX) MAX = $1} END{print MAX}')" 1.10 + echo "$TAGS" | awk -vMAX=$MAX '{ 1.11 + printf "<a class=\"tag%s\" href=\"?tag=%s\" title=\"%s\">%s</a> ", int($1 * 7 / MAX + 1), $2, $1, $2 1.12 + }' 1.13 echo "</p>" 1.14 fi 1.15 ;;
2.1 --- a/tazpanel/pkgs.css Sun Dec 28 05:10:28 2014 +0200 2.2 +++ b/tazpanel/pkgs.css Sun Dec 28 06:11:25 2014 +0200 2.3 @@ -70,3 +70,21 @@ 2.4 background: #07F; 2.5 color: #eee; 2.6 } 2.7 + 2.8 +a.tag1 { font-size: 0.9em; color: #678; } 2.9 +a.tag2 { font-size: 1.0em; color: #444; } 2.10 +a.tag3 { font-size: 1.1em; color: #16A; } 2.11 +a.tag4 { font-size: 1.3em; color: #282; } 2.12 +a.tag5 { font-size: 1.5em; color: #828; } 2.13 +a.tag6 { font-size: 1.8em; color: #862; } 2.14 +a.tag7 { font-size: 2.1em; color: #FA0; } 2.15 +a.tag8 { font-size: 2.4em; color: #F00; } 2.16 +a.tag1, a.tag2, a.tag3, a.tag4, a.tag5, a.tag6, a.tag7, a.tag8 { 2.17 + display: inline-block; 2.18 + white-space: nowrap; 2.19 + vertical-align: middle; 2.20 + padding: 0.2em 0.5em; 2.21 +} 2.22 +a.tag1:hover, a.tag2:hover, a.tag3:hover, a.tag4:hover, a.tag5:hover, a.tag6:hover, a.tag7:hover, a.tag8:hover { 2.23 + outline: 1.5pt solid #FC8; } 2.24 +