From cc381753a82125de0d08379dc7c4d58cbdb66dad Mon Sep 17 00:00:00 2001 From: litemotiv Date: Wed, 5 Feb 2025 11:47:34 +0100 Subject: [PATCH 1/5] Colorize user home pages based on modified age --- index.php | 64 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/index.php b/index.php index a5de5d1..409ea7e 100644 --- a/index.php +++ b/index.php @@ -11,7 +11,7 @@ if (isset($_GET['notice'])) { } } ?> -

welcome to tilde.club

+

welcome to Tilde.club

Questions? See the official FAQ.

@@ -119,7 +119,7 @@ if (isset($_GET['notice'])) {

- tilde.club is not a social network it is one tiny totally + Tilde.club is not a social network it is one tiny totally standard unix computer that people respectfully use together in their shared quest to build awesome web pages

@@ -129,12 +129,12 @@ if (isset($_GET['notice'])) { RECENTLY CHANGED PAGES you can see that too

- Or Check out the tilde.club gallery created by ~tweska + Or Check out the Tilde.club gallery created by ~tweska


-

tilde.club gold star supporters

-

Tilde.Club is supported by a global community of +

Tilde.club gold star supporters

+

Tilde.club is supported by a global community of good people. We don't rank people by the amount they give, only by the fact that they gave. Here's who has donated! When you're on the @@ -165,11 +165,11 @@ if (isset($_GET['notice'])) {

-

here are the home pages of our users

-

this list does not include people who haven't changed their page yet.

-

if you're not seeing yourself listed here, change your page from the default.

-

users with recently updated pages within the last month are highlighted in a lighter color.

-

list all users

+

Here are the home pages of our users

+

This list does not include people who haven't changed their page yet.

+

If you're not seeing yourself listed here, change your page from the default.

+

Users with recently updated pages are highlighted in a lighter color.

+

List all users

'; + $homepagesOutput = '
'; + $now = time(); - foreach (glob("/home/*") as $user) { + foreach (glob("/home/*") as $user) + { // Look for index files with common extensions $indexFiles = glob("$user/public_html/index.{html,htm,php}", GLOB_BRACE); $index = count($indexFiles) > 0 ? $indexFiles[0] : null; if (!$index || in_array(sha1_file($index), $page_shas)) continue; - // Check if the index pages were updated in the last month - $recentChange = false; + // determine the most recently updated file + $age = 0; - foreach ($indexFiles as $file) { - if (filemtime($file) > $oneMonthAgo) { - $recentChange = true; - break; - } + foreach ($indexFiles as $file) + { + $access = filemtime($file); + + if ($access > $age) + $age = $access; } $user = basename($user); + + // For simplicity, we use a maximum of 50 months old + $monthsOld = floor(($now - $age) / 2592000); + if ($monthsOld > 50) $monthsOld = 50; - $homepages_list .= ''.(($recentChange) ? '~'.$user.'' : '~'.$user).''; + // Minimum is 15% opacity + $opacity = 100 - 2 * $monthsOld; + if ($opacity < 15) $opacity = 15; + + $homepagesOutput .= '~'.$user.''; } - $homepages_list .= '
'; + $homepagesOutput .= '
'; // Save cache file - $save_cache = file_put_contents($cache_file, $homepages_list); + $save_cache = file_put_contents($cache_file, $homepagesOutput); } - echo $homepages_list; + echo $homepagesOutput; ?>
From c3d8a83eed54585ffb21508abda01ea2a2f3bf52 Mon Sep 17 00:00:00 2001 From: litemotiv Date: Wed, 5 Feb 2025 11:56:31 +0100 Subject: [PATCH 2/5] fix userlist columns last row not honoring size --- style.css | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/style.css b/style.css index 590e636..7d5b588 100644 --- a/style.css +++ b/style.css @@ -141,18 +141,17 @@ code > span.fl { /* Page content */ .user-list { - display: flex; - flex-flow: row wrap; - justify-content: space-evenly; - list-style-type: none; - padding: 0; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); } + .user-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 10em; } + .user-list b { background-color: #fb5; color:#000; From a69e8a93bc5b09185939e9888b38647bdfd78568 Mon Sep 17 00:00:00 2001 From: litemotiv Date: Wed, 5 Feb 2025 12:02:26 +0100 Subject: [PATCH 3/5] Fix full user list layout --- users/index.php | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/users/index.php b/users/index.php index 8770998..d4b238f 100644 --- a/users/index.php +++ b/users/index.php @@ -1,36 +1,24 @@ - -

full user list

- +

Tilde.club user list

-
- -

here's a full list of users (including those who haven't updated their page from the default)

- -

see users who have updated their page in the last 24 hours

- -
-
    - - -
  • ~
  • - - -
+

Here is a full list of users (including those who haven't updated their page from the default)

+

Also see users who have updated their page in the last 24 hours

+
+
+ ~'.$user.''; + } + ?> +
- Date: Fri, 7 Feb 2025 14:00:51 +0100 Subject: [PATCH 4/5] Set opacity steps to 5% and emphasize hover --- index.php | 7 +++++-- style.css | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 409ea7e..ff1a42a 100644 --- a/index.php +++ b/index.php @@ -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 .= '~'.$user.''; + $homepagesOutput .= ''.$user.''; } $homepagesOutput .= ''; diff --git a/style.css b/style.css index 7d5b588..8764700 100644 --- a/style.css +++ b/style.css @@ -152,6 +152,36 @@ code > span.fl { flex: 10em; } + .user-list a:before { + content:"~"; + } + + [data-op="5"] { opacity:5%; } + [data-op="10"] { opacity:10%; } + [data-op="15"] { opacity:15%; } + [data-op="20"] { opacity:20%; } + [data-op="25"] { opacity:25%; } + [data-op="30"] { opacity:30%; } + [data-op="35"] { opacity:35%; } + [data-op="40"] { opacity:40%; } + [data-op="45"] { opacity:45%; } + [data-op="50"] { opacity:50%; } + [data-op="55"] { opacity:55%; } + [data-op="60"] { opacity:60%; } + [data-op="65"] { opacity:65%; } + [data-op="70"] { opacity:70%; } + [data-op="75"] { opacity:75%; } + [data-op="80"] { opacity:80%; } + [data-op="85"] { opacity:85%; } + [data-op="90"] { opacity:90%; } + [data-op="95"] { opacity:95%; } + [data-op="100"] { opacity:100%; } + + .user-list a:hover { + background:#f70; + color:#000; + } + .user-list b { background-color: #fb5; color:#000; From baf805493b281abecb5689ccfc10ec5991478d32 Mon Sep 17 00:00:00 2001 From: litemotiv Date: Fri, 7 Feb 2025 14:49:10 +0100 Subject: [PATCH 5/5] Change hover to underline --- style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/style.css b/style.css index 8764700..1f62d2e 100644 --- a/style.css +++ b/style.css @@ -178,8 +178,8 @@ code > span.fl { [data-op="100"] { opacity:100%; } .user-list a:hover { - background:#f70; - color:#000; + text-decoration:underline; + color:#f70; } .user-list b {