1
0

add links section

This commit is contained in:
2026-05-11 02:06:36 -04:00
parent 1e4c35bb17
commit 576b708a32
3 changed files with 50 additions and 35 deletions

View File

@@ -1,20 +1,22 @@
<?php
function buildContact($title, $color, $username, $url) {
if (!$url) {
echo "<div class=contact style=\"background-color: $color; opacity: 0.9;\">";
} else {
echo "<div class=contact style=\"background-color: $color;\">";
}
function buildLink($type, $title, $color, $text, $url) {
$opacity = $url ? "" : "0.9";
echo "<div class=$type style=\"background-color: $color; opacity: $opacity;\">";
echo "<h3>$title</h3>";
if (strlen($username) > 15) {
echo "<p style=\"font-size: 0.8em;\">$username</p>";
} else {
echo "<p>$username</p>";
switch ($type) {
case "link":
$fontsize = "0.9em";
break;
case "contact":
$fontsize = (strlen($text) > 15) ? "0.8em" : "1em";
break;
}
echo "<p style=\"font-size: $fontsize;\">$text</p>";
if ($url) {
echo "<a title=\"$title\" href=\"$url\"></a>";
}