Set opacity steps to 5% and emphasize hover

This commit is contained in:
litemotiv
2025-02-07 14:00:51 +01:00
parent a69e8a93bc
commit 1b3381eb99
2 changed files with 35 additions and 2 deletions

View File

@@ -239,11 +239,14 @@ if (isset($_GET['notice'])) {
$monthsOld = floor(($now - $age) / 2592000);
if ($monthsOld > 50) $monthsOld = 50;
// Minimum is 15% opacity
// Set opacity in steps of 5
$opacity = 100 - 2 * $monthsOld;
$opacity = ceil($opacity / 5) * 5;
// Minimum is 15% opacity
if ($opacity < 15) $opacity = 15;
$homepagesOutput .= '<a style="opacity:'.$opacity.'%" href="/~'.$user.'/">~'.$user.'</a>';
$homepagesOutput .= '<a data-op="'.$opacity.'" href="/~'.$user.'/">'.$user.'</a>';
}
$homepagesOutput .= '</div>';