➕ my new tab page
ft. eisenhower grid & ddg search
#da7ea4 on #4ae7ad
👃 simple mirror
for discreet booger-checks
#f05543 on #34550f
🍅 pomodoro timer
WIP/borked mod of Mayuko Inoue's
#2701f5 on #5f1072

This page contains a couple of funsies experiments

and is absolutely overkill for housing a few links ðŸĪŠ

1. Dynamically Generated Link Colors

Link background and text colors are randomly generated hex strings:

$count = count($links); // $links is an multidimensional array
while ($count > $i) {
  $bg[$i] = substr(md5(mt_rand()), 0, 6);
  $fg[$i] = strrev($bg[$i]);
  $bg[$i] = '#'.$bg[$i];
  $fg[$i] = '#'.$fg[$i];
  $i++;
}
      

2. Dynamically Calculated Grid Size

$maxcols = 4;
if ($count > $maxcols) { $colcount = $maxcols; } else { $colcount = $count; }
$width = 100 / ($colcount);
$widthrepeat = 100 / $width;
$x=0;
while($x < $widthrepeat) {
  $widthpropertyvalue = $width.'% '.$widthpropertyvalue;
  $x++;
}
// width: 33.333333333333
// widthrepeat: 3
// widthpropertyvalue: 33.333333333333% 33.333333333333% 33.333333333333% 

and later, in the CSS:

.gridbox {
  display: grid;
  grid-template-columns: <? echo $widthpropertyvalue; ?>;
}
.gridblock:last-child {
  grid-column: 1 / <? echo $widthrepeat+1; ?>;
}