styling images

This commit is contained in:
lopar 2019-01-12 22:02:08 +02:00
parent af5baf8a6d
commit 4f99781622
2 changed files with 14 additions and 4 deletions

View File

@ -145,12 +145,10 @@ abstract class Item
abstract public function printInfo();
public function printImage($bg_color = '#AAA',$border_color = '#EEE')
public function printImage()
{
echo <<<IMG
<img src="//{$_SERVER['SERVER_NAME']}/i/sh/{$this->img}" style="width: 48px; height: 48px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.25);
padding: 7px; display: inline-block; background-repeat: no-repeat;
background-color: {$bg_color}; background-image: radial-gradient(circle, {$border_color}, {$bg_color});">
<img src="//{$_SERVER['SERVER_NAME']}/i/sh/{$this->img}" class="item-wrap-normal">
IMG;
}

View File

@ -1046,4 +1046,16 @@ img.item {
hr {
color: silver;
border-style: solid;
}
img.item-wrap-normal {
width: 48px;
height: 48px;
border-radius: 5px;
border: 1px solid rgba(0, 0, 0, 0.25);
padding: 7px;
display: inline-block;
background-repeat: no-repeat;
background-color: #AAA;
background-image: radial-gradient(circle, #EEE, #AAA);
}